Network protocols are sets of rules or standards used by devices to communicate with each other over a network.
Some examples of network protocols are:
- HTTP, used for web browsing
- SMTP, used for email
- FTP, used for file transfers
Network protocols can be broadly categorized into "layers". Each layer relies on the layer below it and provides services to the layer above it.
One model that categorizes network protocols into layers is the TCP/IP model. It has 4 layers:
We'll go over each layer individually and look at some examples.
The TCP/IP model has 4 layers.
Link Layer
Let's start by looking at the Link Layer, the bottom-most layer.
It is responsible for sending data over a physical medium, such as a cable or a wireless connection.
Some examples of Link Layer protocols are:
- Ethernet
- Wi-Fi
- Bluetooth
Ethernet is a Link Layer protocol. HTTP, FTP & SMTP are Application Layer protocols.
Internet Layer
The Internet Layer is the next layer. It is responsible for routing data across different networks to get it to the right destination.
The Internet Layer relies on services provided by the Link Layer.
The fundamental protocol in this layer is the Internet Protocol (IP). But there are others too:
- ICMP, used by programs like
ping
to test connectivity - ARP, used to map IP addresses to MAC addresses
Okay! We've looked at the first two layers of the TCP/IP model. Two to go.
Transport Layer
This layer's job is to provide reliable data transfer between two devices.
The Transport Layer relies on services provided by the Internet Layer.
The most commonly used Transport Layer protocols are:
- TCP, for reliable delivery of data
- UDP, for fast but less reliable delivery
There are a few other not so popular ones too (like RUDP, DCCP etc.), but TCP & UDP are the most common ones.
UDP is a good choice for real-time video streaming because it is a fast but not-so-reliable protocol. It doesn't try to retransmit lost packets like TCP, which could cause delays.
Okay, onto our final layer!
Application Layer
This is the top-most layer, where most of the actual applications that we use live.
The Application Layer relies on protocols like TCP/UDP in the Transport Layer.
HTTP, SMTP, FTP etc. are all Application Layer protocols.
Summary
You've now learnt about the TCP/IP model, which categorizes network protocols into 4 layers. This model is also referred to as the "Internet Protocol Suite".
Here's a quick overview of the layers and examples of protocols in each layer them:
Links for further reading:
- Internet Protocol Suite (Wikipedia page)
- The layers in the TCP/IP model (chapter from the book "Networking & Servers")