Network Layer Models
Understand OSI and TCP/IP models and packet encapsulation
Interaction guide: Click on a layer to highlight it. Double-click or click the info button to show protocol and encapsulation details. Press "Start Animation" to visualize data traversing through the layers.
Network communication systems are organized in layers to manage complexity and ensure standardized communications. Each layer offers specific services to the layer above and utilizes services from the layer below.
Introduction to Layered Models
Two primary layered models dominate networking: the OSI (Open Systems Interconnection) model and the TCP/IP model. These models provide a framework for understanding how data moves through a network.
OSI Model
Developed by ISO in the late 1970s
7 distinct layers
More theoretical and comprehensive
TCP/IP Model
Developed for the ARPANET/Internet
4 condensed layers
More practical and widely implemented
The OSI Model: 7 Layers
The OSI model, developed by the International Organization for Standardization (ISO), divides network communication into seven distinct layers, each with specific responsibilities:
Physical Layer (Layer 1)
Transmits raw bit streams over physical medium
Bit synchronization, bit rate control, physical topologies, transmission mode
Hubs, repeaters, cables, network adapters, modems
When you connect an Ethernet cable, you're operating at the Physical layer
Data Link Layer (Layer 2)
Provides node-to-node data transfer and error detection
Framing, physical addressing (MAC), error detection and control, media access control
Switches, network interface cards, bridges
Ethernet protocol operates here, managing how data is formatted into frames
Network Layer (Layer 3)
Routes data packets between different networks
Logical addressing (IP), routing, packet forwarding, fragmentation and reassembly
Routers, Layer 3 switches
IP addressing and routing occurs at this layer
Transport Layer (Layer 4)
Provides end-to-end communication and data flow control
Segmentation, flow control, error correction, port addressing
TCP (connection-oriented) and UDP (connectionless)
TCP ensures all packets arrive in order with error recovery
Session Layer (Layer 5)
Establishes, maintains, and terminates connections
Session establishment, maintenance, and termination, synchronization, dialog control
NetBIOS, RPC (Remote Procedure Call), SQL
Presentation Layer (Layer 6)
Translates data between application and network formats
Data translation, encryption, compression, character encoding
JPEG, MPEG, SSL/TLS encryption, ASCII, EBCDIC
Application Layer (Layer 7)
Provides network services directly to end-users
Network applications, file transfers, messaging, user interfaces
HTTP, SMTP, FTP, DNS, Telnet, SSH, SNMP
The TCP/IP Model: 4 Layers
The TCP/IP model is the networking model used in the current internet architecture and is simpler than OSI:
Network Access Layer
(or Link Layer): Combines OSI Physical and Data Link layers
Physical addressing, media access, hardware addressing, physical topology
Ethernet, Wi-Fi, PPP, ARP
Internet Layer
Corresponds to OSI Network Layer
Logical addressing (IP), routing, packet handling
IP, ICMP, ARP, IGMP
Transport Layer
Similar to OSI Transport Layer
End-to-end communication, reliability, flow control
TCP, UDP, SCTP
Application Layer
Combines OSI Session, Presentation, and Application layers
User interfaces, data formatting, encryption, application services
HTTP, FTP, SMTP, DNS, Telnet, SSH, SNMP
Encapsulation and Decapsulation
Encapsulation is the process where each layer adds its own header information as data travels down the protocol stack.Decapsulation is the reverse process where each layer removes its respective header information before passing the data up.
Encapsulation Process:
- Application data is generated
- Transport layer adds TCP/UDP header (creates a segment/datagram)
- Internet layer adds IP header (creates a packet)
- Link layer adds frame header and trailer (creates a frame)
- Physical layer converts to bits for transmission
This layered approach allows each protocol to focus on its specific functions without concerning itself with the details of other layers, making network design and troubleshooting more manageable.