Background-
OSI Model was developed by the International Organization for Standardization (ISO). The OSI Model consists of 7 layers and each layer has specific functions and responsibilities.
The OSI model helps break down how computer networks communicate into seven simple steps. This makes it easier to understand, troubleshoot, and fix problems in networks. It also ensures different devices and software can work together smoothly. By organizing communication into layers, it simplifies complex network tasks and helps create better systems.
Real life Analogy -
The OSI model can be compared to sending a letter through the postal system.
The Physical Layer is like the roads and trucks that physically transport the letter.
The Data Link Layer is like the envelope that protects the letter and ensures it's securely sent.
The Network Layer is the address on the envelope, guiding the letter to the right destination.
The Transport Layer ensures the letter arrives at the correct recipient and isn’t lost.
The Session Layer is like starting a conversation with the recipient, setting the context for communication.
The Presentation Layer ensures the letter is in a readable format, like typed or handwritten.
Finally, the Application Layer is the actual content of the letter, the message you're sending.
Each layer in the OSI model works together to make sure the message (or data) gets from one point to another smoothly and accurately.
What is OSI Model -
The OSI (Open Systems Interconnection) Model is a set of rules that explains how different computer systems communicate over a network.
1.Physical Layer
Function: It transmits raw data (bitstreams) over a physical medium, like cables or wireless signals.
- It helps in Physical Topology (Mesh, Star, Bus, Ring) decisions
Key Responsibilities:
Determines voltage levels
Manages data transfer rates
Defines physical connectors and cables
Protocols/Standards:
Ethernet (for cables and connectors)
USB
Bluetooth
IEEE 802.11 (Wi-Fi – physical layer)
2. Data Link Layer
- It is responsible for the node-to-node delivery of data. Its major role is to ensure error-free transmission of information.
Function: Handles error detection, correction, and frame synchronization.
Key Responsibilities:
Frames data for transmission
Manages physical addressing (MAC addresses)
Error detection and correction (e.g., CRC)
Protocols:
Ethernet (MAC and LLC sublayers)
PPP (Point-to-Point Protocol)
HDLC (High-Level Data Link Control)
Wi-Fi (IEEE 802.11 - Data Link Layer aspects)
3. Network Layer
- The main job of this layer is to maintain the quality of the data and pass and transmit it from its source to its destination.
Function: Manages logical addressing and routing of data between devices.
Key Responsibilities:
IP addressing
Routing and forwarding
Protocols:
IP (Internet Protocol) - IPv4, IPv6
ICMP (Internet Control Message Protocol)
ARP (Address Resolution Protocol)
RIP, OSPF, BGP (Routing Protocols)
4. Transport Layer
- The data packets must be taken and sent to the appropriate machine by the network layer.
Function: Provides reliable or unreliable delivery of data with error recovery and flow control.
Key Responsibilities:
Ensures complete data transfer
Error checking
Flow control
Protocols:
TCP (Transmission Control Protocol)
UDP (User Datagram Protocol)
SCTP (Stream Control Transmission Protocol)
5. Session Layer
- The Session Layer is responsible for establishing active communication sessions between two devices.
Function: Establishes, manages, and terminates sessions between applications.
Key Responsibilities:
Session establishment
Session maintenance
Synchronization
Protocols:
NetBIOS
PPTP (Point-to-Point Tunneling Protocol)
RPC (Remote Procedure Call)
6. Presentation Layer
- If two or more devices are communicating over an encrypted connection, then this presentation layer is responsible for adding encryption on the sender’s end as well as the decoding the encryption on the receiver’s end so that it can represent the application layer with unencrypted, readable data.
Function: Translates, encrypts, and compresses data for the application layer.
Key Responsibilities:
Data translation (e.g., ASCII to EBCDIC)
Data encryption (e.g., SSL/TLS)
Data compression
Protocols:
SSL/TLS (for encryption)
JPEG, PNG, GIF (data format translation)
MPEG (for video compression)
7. Application Layer
It is the top layer in this model and takes care of network communication. The application layer provides the functionality to send and receive data from users.
It acts as the interface between the user and the application. The application provides services like file transmission, mail service, and many more.
Function: Interfaces directly with end-user applications and services.
Key Responsibilities:
Network services to applications
Data presentation to users
Protocols:
HTTP/HTTPS (Hypertext Transfer Protocol)
FTP (File Transfer Protocol)
SMTP (Simple Mail Transfer Protocol)
DNS (Domain Name System)
SNMP (Simple Network Management Protocol)
Lower Layers (1-4) focus on data transport and delivery.
Upper Layers (5-7) deal with application-level communication and user interaction
TCP/IP Model
Background-
It was created in the early 1970s during a U.S. Defense Department project called ARPANET. This project aimed to build a reliable network for communication, even in emergencies.
What is TCP/IP?
TCP (Transmission Control Protocol) to ensure reliable, organized, and error-free communication over the Internet.
Real life Analogy-
Imagine you’re sending a puzzle to a friend. You pack the pieces into boxes, label them with numbers, and ship them. TCP works like this:
Setup: You call your friend to make sure they’re ready to receive the puzzle (TCP sets up a connection).
Sending Pieces: You send the boxes, each labeled, so your friend can arrange them in order (TCP breaks data into packets).
Handling Problems: If a box is lost or damaged, your friend tells you, and you resend it (TCP ensures reliable delivery).
Reordering: Even if the boxes arrive in a random order, your friend uses the labels to assemble the puzzle correctly (TCP organizes data).
Completion: Once the puzzle is complete, your friend confirms it’s done (TCP closes the connection).
1.Network Access Layer
This layer is responsible for generating the data and requesting connections. It acts on behalf of the sender and the Network Access layer on the behalf of the receiver.
Purpose
It deals with the physical transmission of data over the network.
Functions:
This layer handles the actual transmission of raw bits over the hardware. It ensures that data is properly formatted for the physical medium (such as Ethernet, Wi-Fi, etc.).
Protocols:
Ethernet
Wi-Fi
DSL, Fiber Optic, etc.
2. Internet or Network Layer
The protocols which are responsible for the logical transmission of data over the entire network.
Purpose: Responsible for logical addressing and routing of data across the network.
Functions: This layer defines the addressing and routing needed to transfer data between devices over different networks.
Protocols:
IP (Internet Protocol): Responsible for addressing and routing data packets , IPv4 and IPv6.
ICMP (Internet Control Message Protocol): Used for error reporting and diagnostics (e.g., ping).
ARP (Address Resolution Protocol): Resolves IP addresses to MAC addresses.
3.Transport Layer
It manages end-to-end communication and error handling.
The TCP/IP transport layer makes sure data is sent and received correctly. It does this by confirming each packet is delivered and resending any that are missing, so everything arrives in the right order and without errors.
Functions: This layer ensures reliable data transfer between devices. It controls data flow, error detection, and retransmission of lost data.
Protocols:
TCP (Transmission Control Protocol): Provides reliable, connection-oriented communication.
UDP (User Datagram Protocol): Provides faster, connectionless communication but without guarantees of reliability.
4. Application Layer
It is the topmost layer responsible for end-user services and applications.
It is responsible for end-to-end communication and error-free delivery of data. It shields the upper-layer applications from the complexities of data.
Functions: This layer provides protocols that allow software to interact with the network. It facilitates communication between devices through applications like web browsers, email clients, FTP, and more.
Protocols: HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS.
TCP VS UDP
TCP ?
It is a connection-oriented protocol for communications that helps in the exchange of messages between different devices over a network.
Transmission Control Protocol (TCP) ensures reliable and efficient data transmission over the internet.
Advantages of TCP
It is reliable for maintaining a connection between Sender and Receiver.
It is responsible for sending data in a particular sequence.
Its operations are not dependent on Operating System.
It allows and Support many routing protocols.
It can reduce the speed of data based on the speed of the receiver.
Disadvantages of TCP
It is slower then UDP and it takes more bandwidth.
Slower upon starting of transfer of a file.
Not suitable for LAN and PAN Networks.
It does not have a multicast or broadcast category
It does not load the whole page if a single data of the page is missing.
UDP ?
It is an unreliable and connectionless protocol. So , there is no need to establish a connection before data transfer.
The UDP helps to establish low-latency and loss-tolerating connections establish over the network. The UDP enables process-to-process communication.
Advantages of UDP
It does not require any connection for sending or receiving data.
Broadcast and Multicast are available in UDP.
UDP can operate on a large range of networks.
UDP has live and real-time data.
UDP can deliver data if all the components of the data are not complete.
Disadvantages of UDP
No Acknowledgment
- There is no way to confirm if the data was successfully delivered.
No Sequence Tracking
- UDP does not keep track of the order of data, so packets may arrive out of order.
Unreliable Data Transfer
- Being connectionless, UDP cannot guarantee reliable delivery of data.
Packet Loss in Collisions
- Routers drop UDP packets more often than TCP packets during network collisions.
Error Handling
- If errors are detected, UDP may simply drop the affected packets without retransmission.
1. Connection Type
TCP: Connection-oriented. Requires a connection to be established between the sender and receiver before data is transmitted.
UDP: Connectionless. Data is sent without establishing a connection.
2. Reliability
TCP: Reliable. Ensures data delivery in the correct order using acknowledgments, retransmissions, and error checking.
UDP: Unreliable. No guarantees for delivery, order, or error correction.
3. Speed
TCP: Slower due to overhead from connection setup, error checking, and data acknowledgment.
UDP: Faster because it avoids the overhead of connection setup and error-checking mechanisms.
Overhead is the extra work or effort a system does to ensure everything works smoothly.
4. Use Cases
TCP:
File transfers (FTP)
Web browsing (HTTP/HTTPS)
Emails (SMTP, IMAP, POP3)
Remote access (SSH, Telnet)
UDP:
Streaming (audio/video)
Online gaming
DNS lookups
VoIP (Voice over IP)
5. Data Transmission
TCP: Uses a byte stream, ensuring that the data arrives in sequence.
UDP: Sends data as packets (datagrams) independently. There’s no guarantee of order.
6. Flow Control
TCP: Has flow control to prevent the sender from sending too much data too quickly for the receiver to handle.
UDP: No flow control, so it’s simpler and faster but might overwhelm the receiver.
7. Header Size
TCP: Bigger header (20-60 bytes) because it includes extra details like sequence numbers and acknowledgments.
UDP: Smaller header (8 bytes), making it faster and better for simple transmissions.
8. Error Checking
TCP: Checks for errors, confirms delivery, and resends data if needed to ensure reliability.
UDP: Only checks for errors but doesn’t fix them or resend data.
Choose TCP when reliability is essential.
Choose UDP when speed and low latency are more critical.
Thank you for taking time to read this.