OSI and TCP/IP Models

Layer questions are usually device questions or troubleshooting questions in disguise. Knowing which layer a device operates at tells you what it can and cannot see, which is what the question is really asking.

The seven layers

LayerNameData unitWhat lives here
7ApplicationDataHTTP, DNS, SMTP, FTP, SNMP
6PresentationDataTLS, encryption, compression, encoding
5SessionDataSession setup and teardown, NetBIOS, RPC
4TransportSegment (TCP) / Datagram (UDP)TCP, UDP, port numbers
3NetworkPacketIP, ICMP, routers, layer 3 switches
2Data linkFrameMAC addresses, switches, ARP, VLANs
1PhysicalBitCables, hubs, repeaters, connectors

Device to layer

DeviceLayerDecides on
Hub / repeater1Nothing. Repeats every bit to every port
Switch2MAC address
Bridge2MAC address, joins two segments
Wireless access point2MAC address
Router3IP address
Layer 3 switch3IP, with switching performance
Firewall (stateful)3 to 4IP, port, connection state
Next-generation firewall / WAF7Application content
Load balancer4 or 7Connection, or application content
Proxy7Application request

TCP/IP model mapping

TCP/IP layerOSI layersExamples
Application5, 6, 7HTTP, DNS, SMTP
Transport4TCP, UDP
Internet3IP, ICMP, ARP
Link / Network access1, 2Ethernet, Wi-Fi

TCP against UDP

PropertyTCPUDP
ConnectionThree-way handshakeConnectionless
DeliveryGuaranteed, retransmitsBest effort
OrderingSequencedNo ordering
Overhead20-byte header minimum8-byte header
Flow controlWindowingNone
Used byHTTP, SSH, SMTP, FTPDNS, DHCP, TFTP, SNMP, VoIP

Now test yourself

Memorizing a table is a start. Practice questions are what make it stick, and every answer carries the full explanation.