Network and Data CommunicationsUnit 1111 min read
OSI Model: Layers, Functions & Real-World Impact
Unit 11 of Network and Data Communications: Explores the Open Systems Interconnection (OSI) model’s 7-layer architecture, its practical functions, hardware/software roles, and real-world applications in networking technologies like eSewa, Daraz, and NTC.
TAKEAWAYS:
- The OSI model standardizes network communication into 7 logical layers, each with distinct functions and protocols.
- Layer 7 (Application) handles user interfaces (e.g., HTTP for web browsing), while Layer 1 (Physical) manages raw bit transmission (e.g., Ethernet cables).
- Hardware/software map uniquely to layers: routers (Layer 3), switches (Layer 2), and NICs (Layer 1/2).
- Practical implications include troubleshooting (e.g., isolating issues to Layer 2 for MAC conflicts) and protocol design (e.g., TCP/UDP at Layer 4).
- Real-world examples: eSewa’s HTTPS (Layer 7) secures transactions; NTC’s fiber optics (Layer 1) enable broadband.
- Exam focus: Compare layers, explain hardware roles, and link protocols to layers (e.g., IP at Layer 3).
The OSI Model: A 7-Layer Blueprint for Networking
The OSI (Open Systems Interconnection) model is a reference framework that divides network communication into 7 hierarchical layers, each with specific responsibilities. It was developed by the International Organization for Standardization (ISO) in 1984 to standardize how devices communicate across heterogeneous networks. Below is the layered architecture with key functions:
Layer 1: Physical Layer 2: Data Link Layer 3: Network Layer 4: Transport Layer 5: Session Layer 6: Presentation Layer 7: Application
Key Idea: Each layer encapsulates data from the layer above, adds its own header (and sometimes footer), and passes it to the layer below. This is called PDU (Protocol Data Unit) encapsulation.
Layer-by-Layer Breakdown
1. Physical Layer (Layer 1)
Function: Transmits raw bits (0s and 1s) over physical media (cables, wireless signals). Hardware: Repeaters, hubs, cables (Ethernet, fiber), transceivers. Protocols: None (standards like IEEE 802.3 for Ethernet).
Worked Example: NTC’s fiber-optic cables (Layer 1) carry data as light pulses between switches. If a cable breaks, Layer 1 fails entirely—no data reaches higher layers.
Layer 1: Physical
- Media: Copper (UTP), Fiber, Wireless (RF)
- Signals: Electrical (voltage), Light (fiber), Radio waves
- Hardware: Repeaters, Hubs, NICs (physical interface)
2. Data Link Layer (Layer 2)
Function: Handles framing, MAC addressing, and error detection for reliable transmission between directly connected devices (e.g., host to switch). Sublayers:
- Logical Link Control (LLC): Manages access to the physical medium.
- Media Access Control (MAC): Uses MAC addresses (48-bit unique identifiers) to identify devices.
Hardware: Switches, NICs (Network Interface Cards), bridges.
Worked Example:
When you send a message via WhatsApp, Layer 2 ensures the packet reaches the correct phone using its MAC address (e.g., 00:1A:2B:3C:4D:5E). A switch forwards frames based on MAC tables.
Data Link Layer
- Framing: Adds header/footer (e.g., Ethernet frame)
- MAC Addressing: 48-bit hardware address (e.g., 00:1A:2B:3C:4D:5E)
- Error Detection: CRC (Cyclic Redundancy Check)
- Hardware: Switches, NICs
Mermaid Diagram: Ethernet Frame Structure
3. Network Layer (Layer 3)
Function: Manages logical addressing (IP) and routing between independent networks (e.g., your home to Daraz’s server). Key Protocols:
- IP (Internet Protocol): Assigns IP addresses (e.g.,
192.168.1.1). - ICMP: Error reporting (e.g., "ping" commands).
- Routing Protocols: OSPF, BGP (used by NTC to route traffic).
Hardware: Routers, IP addresses.
Worked Example:
When you order on Daraz, your request travels from your phone (IP: 192.168.x.x) to Daraz’s server (IP: 10.0.0.y) via routers at Layer 3. Each router checks its routing table to forward packets.
Network Layer
- IP Addressing: IPv4 (32-bit), IPv6 (128-bit)
- Routing: Path selection (e.g., OSPF, BGP)
- Hardware: Routers, IP tables
Mermaid Diagram: IP Packet Header
4. Transport Layer (Layer 4)
Function: Ensures end-to-end communication between applications (e.g., web browser to server). Key Protocols:
- TCP (Transmission Control Protocol): Connection-oriented, reliable (used by eSewa for secure transactions).
- UDP (User Datagram Protocol): Connectionless, fast (used by YouTube for streaming).
Hardware: None (software-based).
Worked Example: When you transfer money via eSewa, TCP ensures the transaction data arrives correctly and in order by:
- Establishing a connection (SYN, SYN-ACK, ACK).
- Splitting data into segments with sequence numbers.
- Detecting and retransmitting lost packets.
Transport Layer
- TCP: Reliable, connection-oriented (e.g., HTTP)
- UDP: Fast, connectionless (e.g., VoIP, streaming)
- Ports: 0–65535 (e.g., HTTP: 80, HTTPS: 443)
Mermaid Diagram: TCP 3-Way Handshake
sequenceDiagram
participant Client
participant Server
Client->>Server: SYN (Sequence No: x)
Server->>Client: SYN-ACK (Sequence No: y, ACK No: x+1)
Client->>Server: ACK (ACK No: y+1)5. Session Layer (Layer 5)
Function: Manages sessions between applications (e.g., establishing, maintaining, terminating connections). Protocols: NetBIOS, RPC, PPTP.
Worked Example: When you log in to WhatsApp, Layer 5 ensures the session stays active until you log out. If the connection drops, it can resume from where it left off.
Session Layer
- Session establishment: TCP handshake (Layer 4)
- Session management: Checkpoints, recovery
- Protocols: NetBIOS, RPC
6. Presentation Layer (Layer 6)
Function: Translates, compresses, and encrypts data for the Application Layer. Key Tasks:
- Data Translation: Converts between formats (e.g., ASCII to EBCDIC).
- Encryption: SSL/TLS (used by eSewa for secure payments).
- Compression: JPEG, MP3 (used by YouTube).
Hardware: None (software-based).
Worked Example: When you pay via eSewa, Layer 6 encrypts your credit card details using TLS (Transport Layer Security) before sending them to the bank.
Presentation Layer
- Encryption: SSL/TLS, AES
- Compression: JPEG, ZIP
- Data formatting: ASCII, Unicode
7. Application Layer (Layer 7)
Function: Provides network services directly to end-users (e.g., web browsing, email). Key Protocols:
- HTTP/HTTPS: Web browsing (e.g., Google, Daraz).
- FTP: File transfer.
- SMTP: Email (e.g., Gmail).
- DNS: Domain name resolution (e.g.,
google.com→8.8.8.8).
Hardware: None (user interfaces, servers).
Worked Example:
When you type daraz.com in your browser:
- DNS (Layer 7) resolves
daraz.comto an IP (e.g.,103.1.2.3). - HTTP (Layer 7) requests the webpage from Daraz’s server.
- TCP (Layer 4) ensures the data arrives intact.
Application Layer
- Protocols: HTTP, FTP, SMTP, DNS
- Services: Web, email, file transfer
- Hardware: User devices, servers
Hardware and Software Mapping to OSI Layers
| Layer | Hardware | Software/Protocols |
|---|---|---|
| 1 (Physical) | Repeaters, Hubs, Cables | None (standards: IEEE 802.3) |
| 2 (Data Link) | Switches, NICs | MAC addressing, Ethernet frames |
| 3 (Network) | Routers | IP, ICMP, OSPF, BGP |
| 4 (Transport) | None | TCP, UDP |
| 5 (Session) | None | NetBIOS, RPC |
| 6 (Presentation) | None | SSL, JPEG, MP3 |
| 7 (Application) | None | HTTP, FTP, DNS, SMTP |
Practical Implications of the OSI Model
Troubleshooting:
- If packets don’t reach the destination, check Layer 3 (IP) or Layer 2 (MAC).
- If data is corrupted, check Layer 1 (Physical) or Layer 2 (CRC).
Protocol Design:
- TCP (Layer 4) ensures reliability for banking (eSewa).
- UDP (Layer 4) is used for live streaming (YouTube) where speed > accuracy.
Security:
- Layer 6 (Presentation) encrypts data (TLS for HTTPS).
- Layer 7 (Application) uses firewalls to block malicious traffic.
Scalability:
- Layer 3 (Network) routers handle traffic between networks (e.g., NTC’s ISPs).
## In the Real World
eSewa’s Secure Transactions:
- Layers Used: 7 (Application: HTTPS), 6 (Presentation: TLS encryption), 4 (Transport: TCP).
- How: When you pay via eSewa, Layer 6 encrypts your data, and Layer 4 ensures it arrives at the bank’s server without errors.
Daraz’s Order Fulfillment:
- Layers Used: 3 (Network: IP routing), 2 (Data Link: MAC addressing), 1 (Physical: Ethernet/fiber).
- How: Your order travels from your phone (via Layer 3 routers) to Daraz’s warehouse, where Layer 2 switches forward frames to the correct server.
NTC’s Broadband Network:
- Layers Used: 1 (Physical: Fiber optics), 2 (Data Link: Ethernet frames), 3 (Network: IP routing).
- How: NTC’s fiber cables (Layer 1) carry data as light pulses, while routers (Layer 3) direct traffic to your home.
## Exam Tip
Compare Layers:
- Always link protocols to layers (e.g., "TCP operates at Layer 4").
- Explain hardware roles (e.g., "Switches work at Layer 2").
Troubleshooting Scenarios:
- If asked about a failed connection, describe how you’d check each layer (e.g., "Is the cable connected? (Layer 1) Is the MAC address correct? (Layer 2)").
Real-World Examples:
- Use eSewa, Daraz, or NTC as examples to explain how layers work together (e.g., "eSewa uses TCP for reliable transactions").
Diagrams:
- Draw the OSI model and label each layer with one key function (e.g., "Layer 3: IP addressing").
- Show PDU encapsulation (how data is wrapped at each layer).
Avoid Memorization:
- Instead of listing all 7 layers, explain the flow (e.g., "Data starts at Layer 7, gets encapsulated at each layer, and is transmitted at Layer 1").
Final Note: The OSI model is not how networks actually work (modern networks use TCP/IP, a 4-layer model), but it’s a teaching tool to understand networking concepts. Always relate layers to real-world examples (eSewa, Daraz, NTC) to score high!
Based on the TU BIT syllabus for Network and Data Communications (BIT254), unit 11.
Discussion
Loading…