Sub topic 11
Where the mapping blurs: ARP, ICMP, TLS, and the five-layer hybrid
This chapter assumes you know the four TCP/IP layers (link, internet, transport, application), the seven OSI layers, and how encapsulation works. The two models line up in a table, but real protocols do not always stay in their assigned row. Knowing where they cross lines helps you read captures and documentation without confusion.
Why the mapping is only approximate
The OSI model was designed as a reference before many protocols existed. The TCP/IP model was written down after the protocols were already working. So TCP/IP layers describe what the protocols do, and OSI layers describe an idealized split of duties. When you force one onto the other, some protocols fit in two places or in none.
A good rule: a layer is a useful label, not a law. Ask what a protocol does and who uses its output.
ARP: between layer 2 and layer 3
ARP (Address Resolution Protocol) maps an IPv4 address to a MAC address on the local network. It is a helper for the internet layer, because IP needs a MAC address before it can hand a packet to Ethernet.
- ARP messages travel directly inside Ethernet frames (EtherType
0x0806). They have no IP header. - That points to the link layer.
- Yet ARP works with IP addresses, which belong to the internet layer.
Many texts place ARP at OSI layer 2. Others say layer 2.5 or "between 2 and 3". Both are defensible. In practice, treat it as a link-layer protocol that serves the internet layer.
ICMP: a layer 3 protocol that carries messages
ICMP (Internet Control Message Protocol) reports errors and supports tools such as ping and traceroute. It is carried inside an IP packet (IP protocol number 1), so it looks like a payload of IP, similar to a transport protocol. But it is not a transport protocol. It has no ports and it does not carry application data.
Most references place ICMP at the internet layer (OSI layer 3), because it is part of IP's own operation. Its encapsulation, however, looks like that of a layer above IP.
TLS: a layer that is hard to name
TLS (Transport Layer Security) encrypts data between two applications. In a capture of HTTPS traffic you see this order of headers:
- Ethernet
- IP
- TCP
- TLS record
- HTTP data (encrypted inside the TLS record)
TLS sits on top of TCP and below HTTP, so some people call it OSI layer 5 (session) or layer 6 (presentation). The TCP/IP model has no such layers, so TLS is usually grouped with the application layer. Despite the name "Transport Layer Security", it is not a transport protocol in the TCP/IP sense. Applications must explicitly call a TLS library to use it.
The five-layer hybrid
Many textbooks and courses use a five-layer model. It splits the TCP/IP link layer into two parts and keeps the rest.
| Five-layer hybrid | TCP/IP model | OSI model |
|---|---|---|
| 5. Application | Application | 7, 6, 5 |
| 4. Transport | Transport | 4 |
| 3. Network | Internet | 3 |
| 2. Data link | Link | 2 |
| 1. Physical | Link | 1 |
The hybrid keeps the physical layer separate because cables, radio, and signaling are a different problem from framing and MAC addresses. It also keeps the numbering that engineers use in conversation ("a layer 2 switch", "a layer 3 router").
Seeing the blur in a capture
You can check these claims yourself. Capture ARP and ICMP while you ping a local host:
sudo tcpdump -nn -e -c 6 'arp or icmp'ARP lines show only Ethernet addresses and the question "who-has ... tell ...". ICMP lines show an Ethernet header, then an IP header, then an ICMP echo. The missing IP header on ARP is the evidence that it lives at the link layer.
Common errors
- Insisting that every protocol has exactly one correct layer. Name the layer and note the exception.
- Calling TLS a transport protocol because of its name. It runs over TCP.
- Treating ICMP as a transport protocol because it is carried in IP.
- Forgetting that ARP is IPv4-only. IPv6 uses Neighbor Discovery, which is built on ICMPv6.
Exercise
A capture shows a frame with an Ethernet header followed directly by a message asking "who has 192.168.1.1?", with no IP header. Which protocol is this, and why is it usually placed at the link layer rather than the internet layer?
Show answer
It is ARP. ARP messages are carried straight in Ethernet frames (EtherType 0x0806) without an IP header, so they operate at the link layer, even though they resolve IP addresses for the internet layer.
Exercise
In an HTTPS capture, which header comes directly after TCP, and which TCP/IP layer is it usually grouped with?
Show answer
The TLS record comes directly after TCP. It is usually grouped with the application layer, because the TCP/IP model has no session or presentation layers.