OSI Model - Open Systems Interconnection
The OSI Model (Open Systems Interconnection) is a conceptual reference framework that describes how data is transmitted across a network, dividing the process into 7 distinct layers.
What is the OSI Model?
The OSI Model is an international standard developed by ISO (International Organization for Standardization) that defines a conceptual framework for network communication. Each layer has specific responsibilities and communicates with adjacent layers.
The 7 Layers of the OSI Model
Layer 7: Application (Application Layer)
Function: Interface between user and network
Characteristics:
- Services: Network services for applications
- Protocols: HTTP, FTP, SMTP, DNS, Telnet
- Functions: Authentication, compression, encryption
- Examples: Web browsers, email clients
Data: APDU (Application Protocol Data Unit)
Layer 6: Presentation (Presentation Layer)
Function: Data format and conversion
Characteristics:
- Encoding: ASCII, Unicode, EBCDIC
- Compression: Data size reduction
- Encryption: Data security
- Conversion: Data format between systems
Data: PPDU (Presentation Protocol Data Unit)
Layer 5: Session (Session Layer)
Function: Session control between applications
Characteristics:
- Establishment: Session creation
- Maintenance: Active session management
- Termination: Session closure
- Synchronization: Checkpoints
Data: SPDU (Session Protocol Data Unit)
Layer 4: Transport (Transport Layer)
Function: Reliable data transfer
Characteristics:
- Segmentation: Data division into segments
- Flow control: Traffic management
- Error control: Detection and correction
- Multiplexing: Multiple connections
Protocols: TCP, UDP, SCTP Data: Segments (TCP) / Datagrams (UDP)
Layer 3: Network (Network Layer)
Function: Routing and logical addressing
Characteristics:
- Routing: Route determination
- Addressing: IP addresses
- Fragmentation: Packet division
- Congestion control: Traffic management
Protocols: IP, ICMP, OSPF, BGP Data: Packets
Layer 2: Data Link (Data Link Layer)
Function: Reliable transfer between adjacent nodes
Characteristics:
- Physical addressing: MAC addresses
- Error detection: CRC, checksums
- Access control: CSMA/CD, Token Ring
- Synchronization: Data frames
Protocols: Ethernet, PPP, HDLC Data: Frames
Layer 1: Physical (Physical Layer)
Function: Bit transmission through medium
Characteristics:
- Electrical signals: Voltages, currents
- Physical media: Cables, fiber optic, wireless
- Encoding: Bit representation
- Synchronization: Transmission clocks
Protocols: Ethernet, WiFi, Bluetooth Data: Bits
OSI vs TCP/IP Comparison
OSI Model (7 layers)
Application ←→ Application
Presentation ←→ Application
Session ←→ Application
Transport ←→ Transport
Network ←→ Internet
Link ←→ Link
Physical ←→ LinkTCP/IP Model (4 layers)
Application ←→ HTTP, FTP, SMTP, DNS
Transport ←→ TCP, UDP
Internet ←→ IP, ICMP
Link ←→ Ethernet, WiFiData Flow in OSI
Encapsulation (Sending)
User Data
↓ (Layer 7) + Application Header
APDU
↓ (Layer 6) + Presentation Header
PPDU
↓ (Layer 5) + Session Header
SPDU
↓ (Layer 4) + Transport Header
Segment
↓ (Layer 3) + Network Header
Packet
↓ (Layer 2) + Link Header + Trailer
Frame
↓ (Layer 1) + Physical Signals
BitsDecapsulation (Receiving)
Bits
↓ (Layer 1) - Physical Signals
Frame
↓ (Layer 2) - Link Header - Trailer
Packet
↓ (Layer 3) - Network Header
Segment
↓ (Layer 4) - Transport Header
SPDU
↓ (Layer 5) - Session Header
PPDU
↓ (Layer 6) - Presentation Header
APDU
↓ (Layer 7) - Application Header
User DataProtocols by Layer
Application Layer
- HTTP/HTTPS: Web browsing
- FTP: File transfer
- SMTP: Email
- DNS: Name resolution
- Telnet: Remote terminal
- SSH: Secure terminal
Presentation Layer
- SSL/TLS: Encryption and authentication
- JPEG, PNG: Image compression
- MPEG: Video compression
- ASCII, Unicode: Text encoding
Session Layer
- NetBIOS: Network sessions
- RPC: Remote procedure calls
- SQL: Database sessions
- PPTP: VPN tunnels
Transport Layer
- TCP: Reliable transfer
- UDP: Fast transfer
- SCTP: Multiple stream transfer
- DCCP: Congested data transfer
Network Layer
- IP: Internet Protocol
- ICMP: Control messages
- OSPF: Internal routing
- BGP: External routing
- RIP: Routing information protocol
Link Layer
- Ethernet: Local networks
- PPP: Point-to-point connections
- HDLC: Data link control
- Frame Relay: WAN networks
- ATM: Asynchronous transfer mode
Physical Layer
- Ethernet: Copper cabling
- WiFi: Wireless networks
- Bluetooth: Short-range connections
- Fiber optic: Optical transmission
- DSL: Telephone lines
OSI Model Advantages
✅ Modularity: Each layer has specific responsibilities
✅ Standardization: Facilitates interoperability
✅ Troubleshooting: Facilitates problem diagnosis
✅ Development: Allows independent development by layers
✅ Scalability: Easy to add new technologies
OSI Model Disadvantages
❌ Complexity: More complex than TCP/IP
❌ Implementation: Not fully implemented
❌ Overhead: More overhead than TCP/IP
❌ Flexibility: Less flexible than TCP/IP
Practical Use Cases
1. Network Problem Diagnosis
Problem: Cannot access a website
Diagnosis by layers:
- Layer 7: Does the browser work?
- Layer 6: Are there encryption problems?
- Layer 5: Is the session established?
- Layer 4: Does TCP/UDP work?
- Layer 3: Is IP configured?
- Layer 2: Does Ethernet work?
- Layer 1: Is the cable connected?2. Network Design
Architecture by layers:
- Layer 7: Application servers
- Layer 6: Presentation servers
- Layer 5: Session servers
- Layer 4: Load balancers
- Layer 3: Routers
- Layer 2: Switches
- Layer 1: Cables and physical media3. Security by Layers
Security at each layer:
- Layer 7: User authentication
- Layer 6: Data encryption
- Layer 5: Session control
- Layer 4: Application firewalls
- Layer 3: Network firewalls
- Layer 2: VLANs, port security
- Layer 1: Physical access controlAnalysis Tools by Layer
Application Layer
- Wireshark: Protocol analysis
- tcpdump: Packet capture
- netstat: Network connections
- ss: Socket information
Network Layer
- ping: Connectivity test
- traceroute: Packet route
- ip: Network configuration
- route: Routing tables
Link Layer
- arp: ARP table
- ifconfig: Network interfaces
- ethtool: Ethernet information
- iwconfig: Wireless interfaces
Related Concepts
- Network Protocols - Protocols by layer
- Networking - General network concepts
- Topology - Network design by layers
- IP Addresses - Layer 3 addressing
- DNS - Application layer service
- TLS/SSL - Presentation layer security
- Firewall - Security by layers
References
- ISO/IEC 7498-1 - OSI Model
- RFC 1122 - Internet Requirements
- Cisco Networking Academy
- CompTIA Network+
Glossary
- Encapsulation: Process of adding headers to data
- Decapsulation: Process of removing headers from data
- PDU: Protocol Data Unit
- SDU: Service Data Unit
- SAP: Service Access Point
- Primitive: Operation between adjacent layers