How Devices Communicate: Network Protocols & Layers Explained
Do you know how one device sends data to another device?
Don't worry if you don't know! In this blog, you'll find a detailed explanation of how it happens. By the end, you'll have a clear understanding of the process.
1. Introduction
In today’s interconnected world, devices communicate seamlessly using network protocols and a layered architecture that structures data transmission. These protocols act as a set of rules, ensuring reliable and efficient communication across networks. The OSI and TCP/IP models provide a framework for understanding how data moves through different layers, from the physical connection to application-level interactions. In this blog, we’ll break down these models and explore the key protocols that power modern networking.
What will you learn in this blog?
🔸 Networking Fundamentals — The core concepts behind computer networks.
⚡ Network Layers & Protocols – Understanding OSI & TCP/IP models.
Before diving into the technical details, let’s first understand why networks follow a structured approach and what protocols, layers, and architectures are all about.
2.Basics of Networking
2.1 Network:
A network is a collection of interconnected devices, such as computers, servers, switches, modems, ISPs, and routers, that share resources and communicate with each other. These devices work together to transmit, receive, and process data efficiently. Networks can be classified into different types, including Local Area Networks (LANs), Wide Area Networks (WANs), etc.
Network Examples:
Home Wi-Fi Network (LAN)
Corporate Intranet (WAN)
2.2 Protocol:
A protocol is a set of rules that govern how data is transmitted, received, and processed in a network. It ensures seamless communication between devices by defining data formats, addressing methods, error handling, and security measures. Protocols help standardize interactions, allowing different devices and systems to work together efficiently. Examples include HTTP for web browsing, TCP/IP for reliable data transfer, and DNS for domain name resolution.
Protocol Examples:
HTTP & HTTPS (Web Browsing)
TCP/IP (Internet Communication)
2.3 Layer:
In the OSI model, a layer is a logical division of network functions that helps organize and manage data communication. Each layer has a specific role and interacts with the layers above and below it. This layered approach ensures modularity, easier troubleshooting, and standardization, making networking more efficient and scalable.
Layer Examples:
Physical Layer → Ethernet, Wi-Fi
Network Layer → IP, ICMP
Application Layer → HTTP, DNS
2.4 Network Architecture:
A network architecture is a structured framework that defines how different components and layers of a network interact to enable seamless communication. It establishes the rules, protocols, and standards that govern data transmission, ensuring efficiency, security, and scalability. This architecture includes both hardware components, such as routers, switches, and servers, and software protocols that manage data flow. By organizing these elements systematically, network architecture ensures reliable connectivity, optimized performance, and smooth data exchange across various devices and systems.
Network Architecture Examples:
Client-Server Architecture (e.g., Web Application)
Cloud-Based Architecture (e.g., Google Drive, AWS)
3. Different Layers of Networking and Protocols
Networking follows a layered architecture, which organizes communication into multiple levels, with each layer handling a specific function. This structured approach allows seamless data transmission, efficient error handling, and standardized communication between devices.
There are two primary networking models used to define these layers:
OSI Model (7 Layers)
TCP/IP Model (4 Layers)
Both models help explain how data moves between devices by breaking the communication process into smaller, easy-to-manage steps. This makes sure data is sent efficiently, safely, and without errors. It also allows different devices and systems to connect and communicate, no matter what hardware or software they use.
3.1 OSI Model
Now, we are going to explore the OSI (Open Systems Interconnection) model, which is a fundamental framework in networking. The OSI model divides network communication into seven layers, each performing a specific role in ensuring seamless data transmission between devices.
By breaking down networking into layers, the OSI model helps in troubleshooting, designing, and standardizing network communication. It enables different hardware and software systems to communicate efficiently, regardless of their underlying technology.
The layers that are available in the OSI model are:
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
3.1.1 📡Physical Layer: The Foundation of Network Communication
The Physical Layer is the first layer from the bottom and the seventh layer from the top in the OSI model. It is responsible for transmitting raw bits over a communication channel and defines the hardware specifications such as cables, connectors, signal types, and data encoding. This layer ensures the physical connection between devices and manages the modulation, transmission, and reception of signals.
Physical Layer Functions:
Encoding and Decoding – Converts digital data into signals (electrical, optical, or radio) and vice versa.
Bit-by-bit Transmission – Transmits raw data as a stream of bits over the communication medium.
Signal Transmission – Defines signal types (analog or digital) and ensures proper transmission over cables or wireless media.
Modulation: Converts digital data into analog signals (or modifies existing signals) to match the transmission medium, such as radio waves or fiber optics.
Demodulation: The receiver extracts the original digital data from the transmitted signal.
Transmission Modes – Supports Simplex (one-way), Half-duplex (two-way but one at a time), and Full-duplex (two-way simultaneously) communication.
Data Control – Manages bit synchronization, flow control, and error detection at the physical level.
Physical Layer Protocols:
The protocols that are available in the Physical Layer are:
Ethernet (IEEE 802.3)
Wi-Fi (IEEE 802.11)
Bluetooth (IEEE 802.15.1)
Zigbee (IEEE 802.15.4)
NFC (Near Field Communication)
USB (Universal Serial Bus)
DSL (Digital Subscriber Line)
ISDN (Integrated Services Digital Network)
SONET/SDH (Synchronous Optical Networking / Synchronous Digital Hierarchy)
Fiber Channel
RS-232
RS-485
Infrared (IrDA)
GSM (Global System for Mobile Communications)
LTE (Long-Term Evolution)
5G NR (New Radio)
Physical Layer Workflow:
3.1.2 🔗 Data Link Layer: Reliable Node-to-Node Data Transfer
The Data Link Layer is the second layer from the bottom and the sixth layer from the top in the OSI model. It is responsible for ensuring error-free data transfer between directly connected devices. This layer organizes raw data into frames, manages error detection, correction, and flow control, and facilitates reliable communication between network nodes. It also includes MAC addressing, which helps in identifying devices within a local network.
Data Link Layer Sub-Layers:
The data link layer is further divided into two sub-layers, which are as follows:
Logical Link Control (LLC):
The Logical Link Control (LLC) sublayer is responsible for error detection, flow control, and addressing to ensure reliable communication. It helps in framing data and allows multiple network layer protocols like IPv4 and IPv6 to work over the same network. LLC also differentiates between protocols and ensures data integrity by managing acknowledgments and retransmissions.
Media Access Control (MAC):
The Media Access Control (MAC) sublayer controls how devices access the physical transmission medium and ensures data is sent without collisions. Each device is assigned a unique MAC address by its manufacturer for identification and communication. The MAC sublayer also manages network access using protocols like CSMA/CD for Ethernet and CSMA/CA for Wi-Fi, preventing interference and improving efficiency.
Why Do We Need a Header?
At the Data Link Layer, headers are added to ensure reliable transmission over the physical medium. It includes MAC addresses to identify sender and receiver devices.
🛠️ Helps in error detection and correction (using CRC).
🔗 Adds MAC addresses to identify devices within the same network.
📏 Ensures framing and synchronization for smooth transmission.
Data-link Layer Functions:
Framing – Divides the raw data into small, structured units called frames for easy transmission. It adds necessary headers and trailers to mark the start and end of a frame.
Error Detection – Identifies errors that may occur during data transmission using techniques like Cyclic Redundancy Check (CRC) and Parity Check.
Error Correction – Corrects detected errors using methods like Automatic Repeat Request (ARQ) and Forward Error Correction (FEC) to ensure accurate data delivery.
Flow Control – Regulates the rate of data transmission between sender and receiver to prevent data loss or overload, using protocols like Stop-and-Wait and Sliding Window Protocol.
Addressing – Uses MAC addresses to uniquely identify devices in a network, ensuring that frames reach the correct destination.
Data Link Layer Protocols:
The Data Link Layer is powered by a diverse set of protocols that ensure seamless and reliable communication between directly connected devices. Here are some of the key protocols operating at the Data Link Layer:
Synchronous Data Link Control (SDLC)
High-Level Data Link Control (HDLC)
Serial Line Internet Protocol (SLIP)
Point-to-Point Protocol (PPP)
Link Access Procedure (LAP)
Link Control Protocol (LCP)
Network Control Protocol (NCP)
Ethernet (IEEE 802.3)
Wi-Fi (IEEE 802.11)
Token Ring (IEEE 802.5)
Frame Relay
Asynchronous Transfer Mode (ATM)
Data Link Layer Workflow:
3.1.3 🌐 Network Layer: Routing Data Across Networks
The Network Layer is the third layer from the bottom and the fifth layer from the top in the OSI model. It is responsible for routing, addressing, and delivering data across different networks. It ensures host-to-host communication by assigning logical addresses (IP addresses) and determining the best path for data transmission. This layer breaks data into packets and forwards them efficiently, even across multiple networks.
Network Layer Functions:
Assigning Logical Address – Provides unique IP addresses to devices for identification.
Packetizing – Converts data into packets for transmission.
Host-to-Host Delivery – Ensures data reaches the correct destination host.
Forwarding – Directs packets towards their destination via routers.
Fragmentation & Reassembly – Splits large packets for transmission and reassembles them at the receiver.
Logical Subnetting – Divides networks into subnets for efficient traffic management.
Network Address Translation (NAT) – Maps private IPs to public IPs for internet access.
Routing – Determines the optimal path for data using routing algorithms
Why Do We Need a Header?
The Network Layer adds an IP header that contains the source and destination IP addresses, enabling data to be routed across multiple networks.
📍 Enables logical addressing (IP addresses) for device identification.
🔀 Supports packet switching and routing between different networks.
🧩 Helps in fragmentation and reassembly of large packets.
Network Layer Protocols:
Internet Protocol (IP)
Address Resolution Protocol (ARP)
Reverse Address Resolution Protocol (RARP)
Internet Control Message Protocol (ICMP)
Internet Group Management Protocol (IGMP)
IP Security (IPSec)
Network Address Translation (NAT)
Internet Protocol(IP):
Two devices can communicate using IP, which ensures that data sent from one device reaches the correct destination by assigning a unique numerical address (IP address) to each device.
The Internet Protocol is a fundamental component of the Internet and computer networks, responsible for delivering packets of data from the source host to the destination host based on their IP addresses. It ensures that packets of data get to the right destination from the source device.
Network Layer Workflow:
3.1.4 Transport Layer: Managing Connections & Data Flow
The Transport Layer is the fourth layer of the OSI model, responsible for communication between processes. It ensures reliable data transfer, manages flow control, and supports multiplexing and demultiplexing of data streams. This layer is essential for establishing and maintaining seamless communication across networks.
Transport Layer Functions:
End-to-End Communication– Ensures complete data transfer between sender and receiver.
Flow Control– Regulates data flow to prevent congestion and loss.
Multiplexing & Demultiplexing– Allows multiple applications to share a single network connection.
Connection Establishment– Sets up a communication session using protocols like TCP.
Connection Termination– Gracefully closes connections after data transmission.
Reliable Data Delivery– Ensures accurate and error-free data transfer using acknowledgments and retransmissions.
Quality of Service (QoS) – Manages network performance for efficient data transmission.
Why Do We Need a Header?
The Transport Layer ensures reliable data transfer between processes using TCP or UDP headers.
Why is it needed?
🎯 Port numbers allow multiple applications to communicate simultaneously.
⚠️ Ensures error detection and retransmission (TCP).
🌊 Supports flow control and congestion control for smooth transmission.
Transport Layer Protocols:
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
Stream Control Transmission Protocol (SCTP)
Transmission Control Protocol (TCP):
Transmission Control Protocol (TCP) is a connection-oriented protocol for communications that helps in the exchange of messages between different devices over a network. It is one of the main protocols of the TCP/IP suite. In OSI model, it operates at the transport layer (Layer 4).
TCP ensures reliable communication using a three-way handshake (SYN, SYN-ACK, ACK).
It closes connections with a four-step handshake (FIN, ACK, FIN, ACK).
Ensures error-free, ordered delivery of data packets.
Uses acknowledgments (ACKs) to confirm data receipt.
User Datagram Protocol (UDP):
User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, 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 over the network. The UDP enables process-to-process communication.
Transport Layer Workflow:
3.1.5 🔄 Session Layer: Managing Connections Between Applications
The Session Layer is the fifth layer from the bottom and the third layer from the top in the OSI model. It is responsible for establishing, managing, and terminating sessions between applications. This layer ensures that communication between devices is synchronized and properly organized, providing mechanisms for efficient data exchange.
Session Layer Functions:
Session Establishment – Initiates, maintains, and terminates communication sessions.
Communication Synchronization – Ensures data is exchanged in a coordinated manner.
Activity Management – Keeps track of ongoing communication between devices.
Dialog Management – Controls communication modes (half-duplex or full-duplex).
Data Transfer – Handles data transmission during an active session.
Resynchronization – Recovers lost data during session disruptions.
Session Layer Protocols:
The Session Layer is supported by the following protocols:
Remote Procedure Call (RPC)
Session Control Protocol (SCP)
AppleTalk Session Protocol (ASP)
NetBIOS
Point-to-Point Tunneling Protocol (PPTP)
Simplex Protocol
X.225 / ISO 8327 (Session Protocol)
Named Pipes
Sockets
Session Layer Workflow:
3.1.6 🖥️ Presentation Layer: Data Formatting & Encryption
The Presentation Layer is the sixth layer from the bottom and the second layer from the top in the OSI model. It is responsible for translating, encrypting, decrypting, and compressing data to ensure proper communication between applications. This layer acts as a translation layer, converting data into a format that the application layer can understand while also handling security through encryption and decryption.
Presentation Layer Functions:
Data Translation – Converts data into a common format, ensuring compatibility between different devices and applications for seamless communication.
Data Compression – Reduces the size of data before transmission to optimize bandwidth usage, improve speed, and enhance network efficiency.
Data Encryption & Decryption – Protects sensitive data by encoding it before transmission and decoding it upon reception, ensuring secure communication.
Syntax and Semantics Management – Maintains the structure, format, and meaning of data to ensure accurate interpretation and effective communication between systems.
Presentation Layer Protocols:
The Presentation Layer is supported by the following protocols:
Hypertext Transfer Protocol Secure (HTTPS)
Secure Sockets Layer (SSL)
Transport Layer Security (TLS)
Apple Filing Protocol (AFP)
Lightweight Presentation Protocol (LPP)
Abstract Syntax Notation One (ASN.1)
Presentation Layer Workflow:
3.1.7 🌍 Application Layer: Enabling User & Network Interaction
The Application Layer is the first layer from the top and the last layer from the bottom in the OSI model. It is responsible for network communication between users and applications, acting as an interface between the user and the network. This layer enables data exchange through services like file transfer, email, web browsing, and remote access, ensuring efficient data transmission.
Application Layer Functions:
Data Representation – Ensures proper encoding, encryption, and formatting of data so that it is understood by both sender and receiver.
Network Service Access – Provides users with access to network resources and services such as web browsing, email, and file transfers.
Application Protocols – Supports various protocols like HTTP, FTP, SMTP, and DNS that enable communication between applications.
Session Management – Establishes, maintains, and terminates communication sessions between applications on different devices.
Why Do We Need a Header?
The Application Layer provides user interface protocols like HTTP, FTP, and SMTP, adding relevant headers to define request and response details.
✅ Includes protocol-specific information (e.g., HTTP request headers).
🔐 Helps in authentication and authorization for secure access.
📄 Defines data structure and formatting (e.g., MIME types in emails).
Application Layer Protocols:
Hypertext Transfer Protocol (HTTP)
File Transfer Protocol (FTP)
Simple Mail Transfer Protocol (SMTP)
Post Office Protocol (POP3)
Internet Message Access Protocol (IMAP)
Domain Name System (DNS)
Dynamic Host Configuration Protocol (DHCP)
Telnet
Simple Network Management Protocol (SNMP)
Hypertext Transfer Protocol Secure (HTTPS)
HTTP(Hyper Text Transfer Protocol):
HTTP stands for Hyper Text Transfer Protocol. HTTP works on the client server model. This protocol is used for transmitting hypermedia documents like HTML. This protocol was designed particularly for the communications between the web browsers and web servers. HTTP uses port number 80.
Domain Name System(DNS) Protocol:
The Domain Name System (DNS) translates human-readable domain names (e.g., www.google.com) into machine-readable IP addresses (e.g., 142.250.190.14), enabling internet communication.
Types of Domain:
Generic Domains
.com(commercial), .edu (educational).
Country Domain
.in (India),.us(United States)
Inverse Domain
**→Forward Lookup**: Domain Name → IP Address
**→Reverse Lookup (Inverse Domain)**: IP Address → Domain Name
File Transfer Protocol (FTP):
FTP is used for transferring files between a client and a server over a network. It supports authentication and can operate in active or passive mode. FTP enables users to upload, download, and manage files remotely.
Simple Mail Transfer Protocol (SMTP):
SMTP is a protocol used for sending emails between mail servers. It ensures email delivery across the internet and works with other protocols like IMAP or POP3 for receiving emails.
Post Office Protocol (POP3):
POP3 is used to retrieve emails from a mail server to a local device. It downloads emails and removes them from the server, making them accessible offline.
Internet Message Access Protocol (IMAP):
IMAP allows users to access and manage emails stored on a mail server. Unlike POP3, IMAP keeps emails on the server, enabling access from multiple devices.
Dynamic Host Configuration Protocol (DHCP):
DHCP automatically assigns IP addresses and network configuration details to devices, reducing manual setup and ensuring efficient network management.
Telnet:
Telnet provides a command-line interface for remote access to network devices. It allows users to control servers and network equipment but lacks encryption, making it less secure.
Simple Network Management Protocol (SNMP):
SNMP is used for monitoring and managing network devices like routers, switches, and servers. It helps administrators track performance and detect issues.
Hypertext Transfer Protocol Secure (HTTPS):
HTTPS is a secure version of HTTP that encrypts communication between a web browser and a server using SSL/TLS. It protects sensitive data such as login credentials and financial transactions.
Application Layer Workflow:
Real-World Example of the OSI Model:
Application Layer (Layer 7): The user enters "www.example.com" in a web browser, triggering an HTTP/HTTPS request.
Presentation Layer (Layer 6): With HTTP, data travels as plain text, vulnerable to interception. With HTTPS, TLS/SSL encryption protects data privacy and security.
Session Layer (Layer 5): A connection forms between the browser and web server to manage communication.
Transport Layer (Layer 4): The request splits into segments using TCP, ensuring reliable delivery through a three-way handshake.
Network Layer (Layer 3): The data receives IP addresses and routes through networks to reach the correct web server.
Data Link Layer (Layer 2): The request gets framed and receives MAC addresses for local network delivery.
Physical Layer (Layer 1): The data transforms into electrical signals, radio waves, or optical signals and travels via Wi-Fi, Ethernet, or fiber optics.
3.2 TCP/IP Model
The TCP/IP model is a core framework for network communication. It defines how data is transmitted across networks, ensuring seamless connectivity between devices. The model consists of four layers: the Link Layer, which handles physical data transmission; the Internet Layer, responsible for addressing and routing; the Transport Layer, ensuring reliable data delivery; and the Application Layer, which provides services for end users. This structured approach makes the TCP/IP model essential for modern networking and the Internet.
Layers of TCP/IP Model:
Application Layer
Transport Layer(TCP/UDP)
Network/Internet Layer(IP)
Network Access Layer
Real-World Example of the TCP/IP Model:
Application Layer: The user enters "www.example.com" in a web browser, triggering an HTTP/HTTPS request.
Transport Layer: The request splits into segments using TCP, ensuring reliable delivery through a three-way handshake. If using UDP (e.g., for video streaming), data is sent without guaranteed delivery.
Internet Layer: The data receives an IP address and routes through different networks to reach the correct web server. ICMP may assist in error reporting if needed.
Network Access Layer: The request is framed and assigned a MAC address for local network delivery. It is then converted into electrical signals, radio waves, or optical signals, traveling via Wi-Fi, Ethernet, or fiber optics.
SUMMARY:
Wrapping Up:
🌐 In the world of networking, both the OSI model and the TCP/IP model play a significant role in understanding how data flows across networks. While the OSI model provides a theoretical framework for networking with its seven-layer architecture, the TCP/IP model is the practical, widely adopted model that powers the internet and modern communication systems. 🚀
✅ For real-world networking, the TCP/IP model is the widely adopted standard as it aligns with modern networking protocols and simplifies communication. It is efficient, adaptable, and powers the internet and enterprise networks. However, the OSI model is still valuable for learning and troubleshooting, providing a structured approach to understanding networking concepts. 🔍
📖 By exploring both models in this blog, we have built a strong foundation in networking basics, understanding how data moves, how protocols interact, and how different layers work together for seamless communication. Whether you're a beginner or an experienced IT professional, mastering these fundamental concepts is crucial for excelling in modern networking, cybersecurity, and system architecture. 💡💻
REFRENCES:
Official Documentation & Standards:
OSI MODEL:
https://www.geeksforgeeks.org/open-systems-interconnection-model-osi/
TCP/IP MODEL:
https://www.geeksforgeeks.org/tcp-ip-model/
Networking Guides & Tutorials:
OSI Model Explained:
TCP/IP Model Explained:
Books on Networking:
Computer Networking: A Top-Down Approach – James F. Kurose & Keith W. Ross-
https://archive.org/details/computernetworki0000jame_y6m8
Data Communications and Networking – Behrouz A. Forouzan - https://archive.org/details/datacommunicatio0000foro_i8a0_5ed
TCP/IP Illustrated (Volumes 1-3) – W. Richard Stevens - https://archive.org/details/TCPIPIllustratedVol.1TheProtocols1stEdition
Wikipedia (For Quick Reference):
OSI Model:
https://en.wikipedia.org/wiki/OSI_model