Semester 3Data Communication and Networking
Layered Architecture
Communication between a mobile phone which using Wifi in LK with another PC connected to Fiber network in USA is incredibly complex. But it needs to have a connection to transfer data between them.
Layered Architecture is an abstract concept Network engineers use to make it into a more simplified model.
It does it by distributing responsibility into smaller layers. Each layer only need to worry about its incoming and outgoing communications. Other parts are irrelevant.
Core Concept
layered architecture break down communication into distinct sequential steps.
- Explicit Boundaries: Each layer has a specific, dedicated job.
- Service Provider Relationship: Layer provides a service to Layer (the layer above it) and uses the services of Layer (the layer below it).
- Protocols and Interfaces: Layers talk to their same level of other devices using protocols, while talking to the layers of their own above/below via interfaces.
Main Philosophy of the design
- Data can transfer both ways between adjacent layers.
- Data travels from Top Layer () to Bottom Layer () of sending device and from Bottom Layer to Top Layer of receiving device.
- But Layers are only dependent one way.
- layer depend of for getting the service.
- never gets a service from . It only depend on layers below it.
Reasons for Dependency only one way
- Information Hiding (Abstraction): The upper layer doesn't need to know how the lower layer does its job.
- Independence: Because services only flow upward, you can completely replace or upgrade a lower layer without affecting the layers above it.
Main Models
two main models.
- OSI Model (theoretical and comprehensive)
- TCP/IP Model (the practical foundation of the actual internet)
1. The OSI Model (7 Layers)
OSI - Open Systems Interconnection model
| Layer | Name | What happens | Data Unit |
|---|---|---|---|
| 7 | Application Layer | This is where the users interact with network. (HTTP, FTP, SMTP etc)This layer provide service directly to user. | Data |
| 6 | Presentation Layer | Translates, encrypts, and compresses data so the application layer can understand it (e.g., converting ASCII to JPEG or handling SSL/TLS encryption).Give standard data to the application | Data |
| 5 | Session Layer | Make/terminate connections (sessions) b/w local & remote applicationsIt provides structured dialog management (keeping track of whose turn it is to talk) and session synchronization. | Data |
| 4 | Transport Layer | It ensures data parts arrive in the correct order and aren't sent faster than the receiver can handle | Segment (for TCP) or Datagram (for UDP) |
| 3 | Network Layer | Handles routing, forwarding, and logical addressing (IP addresses). It figures out the best path for data to travel across multiple interconnected networks (the internet). | Packet (or Datagram) |
| 2 | Data Link Layer | Structured bits into frames and ensures error-free transmission over a local physical link. It handles physical addressing (MAC addresses) and detects errors on the local wire. | Frame |
| 1 | Physical Layer | Transmits raw, unstructured bitstreams over a physical medium (copper wires, fiber-optic cables, or radio waves). It deals with electrical voltages, cable specs, and pin layouts. | Bits |
| ![[OSI-model.png]] |
2. The TCP/IP Model (4 Layers)
This is the streamlined version that the internet actually runs on. It condenses the OSI model into four practical layers:
| TCP/IP Layer | Corresponding OSI Layers | Focus / Common Protocols |
|---|---|---|
| Application | Application, Presentation, Session | HTTP, FTP, DNS, SMTP |
| Transport | Transport | TCP, UDP |
| Internet | Network | IP, ICMP |
| Network Access | Data Link, Physical | Ethernet, Wi-Fi, MAC addresses |