Skip to content

Network Models

1.1 The OSI Reference Model

The Open Systems Interconnection (OSI) model defines seven layers of abstraction for network Communication:

LayerNameFunctionExamples
7ApplicationUser-facing protocolsHTTP, DNS, SMTP, FTP
6PresentationData representation, encryption, compressionTLS, SSL, JPEG, ASCII
5SessionDialog control, synchronisationNetBIOS, RPC, PPTP
4TransportEnd-to-end reliability, flow controlTCP, UDP, SCTP
3NetworkLogical addressing, routingIP, ICMP, ARP, OSPF
2Data LinkFraming, error detection, MACEthernet, Wi-Fi, PPP
1PhysicalBit transmission on the mediumCables, hubs, radio waves

Encapsulation. Each layer adds its own header (and possibly trailer) to the data from the layer Above, forming a protocol data unit (PDU):

Data+thSegment+nhPacket+fh+ftFrameencodeBits\mathrm{Data} \xrightarrow{+\mathrm{th} \mathrm{Segment} \xrightarrow{+\mathrm{nh} \mathrm{Packet} \xrightarrow{+\mathrm{fh}+ft} \mathrm{Frame} \xrightarrow{\mathrm{encode} \mathrm{Bits}}}}

1.2 The TCP/IP Model

The TCP/IP model is the practical standard used on the Internet, with four layers:

LayerOSI EquivalentProtocols
Application5, 6, 7HTTP, DNS, SMTP, TLS
Transport4TCP, UDP
Internet3IP, ICMP, ARP
Network Access1, 2Ethernet, Wi-Fi, MAC

1.3 Comparison

The OSI model is a theoretical reference used for teaching and design. The TCP/IP model reflects Actual protocol implementations. The session and presentation layers in OSI are absorbed into the Application layer in TCP/IP.

Detailed OSI vs TCP/IP comparison:

AspectOSI ModelTCP/IP Model
Layers74
NatureTheoretical reference modelPractical implementation model
Session/PresentationSeparate layers (5, 6)Merged into Application layer
Network layerConnection-oriented and connectionlessPrimarily connectionless (IP)
Transport layerTP4 (reliable) and TP0 (unreliable)TCP (reliable) and UDP (unreliable)
StandardisationISO/IECIETF (RFCs)
Adopted byAcademic, governmentThe global Internet
Protocol independenceLayer-independent protocolsProtocols tightly coupled
Service interfacePrecisely defined (SAPs)Loosely defined
Release1984Developed 1970s, formalised 1980s

1.4 Protocol Data Unit Encapsulation

Each layer encapsulates data from the layer above by prepending a header (and appending a trailer at Layer 2). The resulting data unit is named according to its layer:

LayerPDU NameHeader AddedTrailerSize (typical)
ApplicationDataApplication-specificNoneVariable
TransportSegmentTCP/UDP headerNone20—60 bytes
NetworkPacketIP headerNone20—60 bytes
Data LinkFrameMAC headerFCS14—18 + 4 B
PhysicalBitsNone (encoding)NoneN/A

Encapsulation walkthrough. Consider sending an HTTP GET request of 500 bytes through TCP/IP over Ethernet:

  1. Application layer: HTTP creates a request message (500 bytes).
  2. Transport layer: TCP adds a 20-byte header. Segment = 520 bytes.
  3. Network layer: IP adds a 20-byte header. Packet = 540 bytes.
  4. Data Link layer: Ethernet adds 14-byte header + 4-byte FCS. Frame = 558 bytes.
  5. Physical layer: Frame is encoded into bits and transmitted on the medium.

Decapsulation. At the receiver, each layer strips its corresponding header before passing data To the layer above. This process is the reverse of encapsulation.