Skills101

Computer Networks · Lesson 2 of 7 · Updated ·

OSI Model vs TCP/IP Model — All Layers Explained Simply

Networking is split into layers. Each layer does one job and talks only to the layers just above and below it. This makes networks easier to build and debug ("is it a cable problem or a DNS problem?").

The 7 OSI layers (application, presentation, session, transport, network, data link, physical) next to the 4 TCP/IP layers (application, transport, internet, network access), with example protocols

1. The OSI model (7 layers)

#LayerJobProtocols / examplesUnitDevice
7Applicationservices for appsHTTP, HTTPS, DNS, SMTP, FTPdata—
6Presentationformat, encrypt, compressTLS/SSL, JPEG, UTF-8data—
5Sessionopen, manage, close sessionssockets, RPCdata—
4Transportprocess-to-process delivery, reliability, portsTCP, UDPsegment—
3Networklogical addressing, routingIP, ICMPpacketrouter
2Data linknode-to-node delivery, MAC, error detectionEthernet, Wi-Fi (802.11), ARPframeswitch
1Physicalbits as signalscables, fibre, radiobithub, repeater

Remember (top → down): All People Seem To Need Data Processing.

2. The TCP/IP model (4 layers) — what the internet really uses

TCP/IP layerMatches OSI layersProtocols
Application7, 6, 5HTTP, DNS, SMTP, TLS
Transport4TCP, UDP
Internet3IP, ICMP
Network access (link)2, 1Ethernet, Wi-Fi

OSI is a teaching/reference model; TCP/IP is the practical model the internet is built on.

3. Encapsulation: wrapping data layer by layer

Application data gets a TCP header to become a segment, then an IP header to become a packet, then an Ethernet header and trailer to become a frame

When you send a message:

  1. Application creates the data (an HTTP request).
  2. Transport adds a TCP header (source and destination ports) → segment.
  3. Network adds an IP header (source and destination IP addresses) → packet.
  4. Data link adds an Ethernet/Wi-Fi header (MAC addresses) and a trailer (error check) → frame.
  5. Physical sends the bits.

The receiver removes the headers in reverse order — decapsulation.

4. Three kinds of addresses (and which layer uses each)

AddressLayerIdentifiesExample
PortTransportan application on a device443 (HTTPS), 22 (SSH), 3306 (MySQL)
IP addressNetworka device on the internet142.250.183.14
MAC addressData linka network card on the local link3C:22:FB:1A:9E:07

IP addresses get you to the right network and device; MAC addresses get you across each local hop; ports get you to the right program.

Common mistakes

  • Putting TCP at the network layer (it's transport) or IP at the transport layer (it's network).
  • Saying "the internet uses the OSI model". It uses TCP/IP; OSI is the reference.
  • Mixing up segment (transport), packet (network) and frame (data link).

Quick recap

  • OSI 7 layers: Application, Presentation, Session, Transport, Network, Data link, Physical.
  • TCP/IP 4 layers: Application, Transport, Internet, Network access.
  • Units: data → segment → packet → frame → bits.
  • Port (app) · IP (device across networks) · MAC (card on local link).

Practice what you learned

📝 Quiz: OSI and TCP/IP5 questions · instant answers & explanations · +10 XP · counts towards your free certificateTake the quiz →