--- title: 2. Network Models collection: computer networks author: Akash Kadlag updated: 2026-09-17 source: https://docs.chaicode.com/networking/network-models --- # 2. Network Models ![Network Models](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/e6e4c453d06b1960f328622a685c0ab97379365d8628cb61636a21800728e8b0.png) Network Models — Chap 2 The Language of Communication ![Why We Need Models](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/7d47f6bc96711578391a44bd728806584fb7b41679dcdf78a021c0f5d5cdd570.png) Why We Need Models — You are watching this bootcamp on Youtube. You opened video your phone. That request somehow leaves your device, travels through Wi-Fi, crosses the internet, reaches a server in some data center, gets processed, and a data comes back - all in under few seconds. Your phone was made by Apple. The server runs Linux. The router in your house is from a completely different manufacturer. The ISP's equipment is different again. How do they all understand each other? The answer is models. In the early days of networking, every company built their own system - their own cables, their own rules, their own way of sending data. And none of them could talk to each other. ![A comparison diagram showing three networking models: a 7-layer model (Application, Presentation, Session, Transport, Network, Data Link, Physical), a 4-layer model (Application, Transport, Internet, Link), and a 5-layer model (Application, Transport, Network, Data Link, Physical).](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/61e56ee3b242fd65f5810aff61ac5cc8a6731714d59278589958cef8b4a260c3.png) Why We Need Models — The industry needed a common language. Not just for cables and signals - but for every aspect of how data moves from one place to another. That’s why we have Layered Models with each layer has different set of protocols. ![Who Defines Standards](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/cca40bf3d56cb06af2750c6c1c512012c48ea2fbbae4635f586a59e7e2c1eb76.png) Who Defines Standards — Most networking standards are developed by independent standard organization, not by a single vendor, with participation from engineers at many companies. The first one is IEEE (Institute of Electrical and Electronics Engineers) It develops many technologies used on the local area networks. Ethernet (802.3) Wi-Fi (802.11) Second is IETF (Internet Engineering Task Force) It is open committed and defines protocols used on the internet. ![OSI Model](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/a689ed9073625f58e16f2132c3e179ac797698f6014c50f8a650cd197400045c.png) OSI Model — OSI stands for Open Systems Interconnection. It is a conceptual framework that helps standardize and describe the functions of communication systems and networks. The model consists of seven layers, and each layer has its specific tasks and responsibilities. Innovation and Flexibility Each layer can be improved separately. Innovations in physical mediums (like faster cables) don't affect other layers. Allows easy upgrades and keeps compatibility. ![A diagram illustrating the seven layers of the OSI model, detailing the function of each layer along with top-to-down and down-to-top mnemonics.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/350446553c59b8c12d2ef9e34f6b1b9e1ff2a0cb98734b62d639ed0ba2a588a6.png) OSI Model — Application Layer Human-computer interation Layer Presentation Layer Ensures that the data is in a usable format Top to Down Mnemonic All People Seem To Need Data Processing Sesssion Layer Maintains Connections using ports and sessions Transport Layer Transmits data end to end using TCP and UDP Network Layer Decides which physical path the data will take Down to Top Mnemonic Please Do Not Tell Stupid People Anything Data Link Layer Defines the format of data on the network Physical Layer Transmits raw bit stream over the physical media ![A process diagram showing the functions of the Presentation Layer in sequence with icons and arrows: Encryption, Compression, and Translation.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/3489a115b4932a2ab7a72fd10f4b3b917200b9a14fe1ea5a5b091fd811539837.png) OSI Layers — Application Layer The softwares which interact one human to another works in application layer. Example: Browsers. Presentation Layer Encryption Compression Translation ![A flow diagram illustrating a session of communication with chat bubbles pointing via an arrow to a group of users icon.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/3e08c72f5c8c8ed73d917b57da14ab0bf557e99bb889aa253319c1c74c678f07.png) OSI Layers — Presentation Layer Shows data in the correct format Encryption / Decryption Compression / Decompression Converts the data into machine-representable binary format (ASCII to EBCDIC). This process is called Translation. Session Layer Session of communication ![OSI Layers](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/eca25f13532af52df5c06f3a781b698c7f4e2bbce82b14392bb2590424273233.png) OSI Layers — Session Layer Create and maintain the sessions Authentication & Authorization is involved here It uses Timeframes Transport Layer Making sure that the data is transferred effectively Protocols involved → TCP, UDP Transportation is done in 3 steps: a. Segmentation b. Flow Control c. Error control ![A visual flow showing a divided circle labeled "Segmentation", an arrow pointing to a truck labeled "Transport", and another arrow pointing to a whole circle labeled "Reassembly".](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/5860d7b618e5aad68141ed8a2379fb003fed16c12b8218d138a3a6821aa2d833.png) OSI Layers — Transport Layer Segmentation: Data from Session layer is divided into small packets called Segments. Each segment will have: Destination & Source PORT number Sequence Number (Helps in re-assembling segments in correct order) Flow control - Controls the amount of data that is being transferred Error control - Quality of data check. Adds a checksum to every data segment. ![OSI Layers](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/db2ad331ada5d0dea14f4f0aacef508dd41add01df6ba1afc05c5edbf04eac2e.png) OSI Layers — Network Layer It does logical addressing (IP addressing done in the network layer is known as logical addressing). Moving a packet from source to destination → called Routing Load-balancing happens over here. Data Link Layer The primary functions of the Data Link Layer include framing, physical addressing, error detection and correction, and flow control. The frame includes Source Mac Address and Destination Mac Address. MAC Address → 12-digit alpha-numeric number of the network interface of your computer. ![A flow diagram illustrating data encapsulation from RAW to BITS on the client side and decapsulation from BITS back to RAW on the server side.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/31b9c354467a67b6d2731b10be12632d51093abf543cf27a0bd311279e2224c6.png) OSI Layers — Physical Layer It represents the actual physical medium, such as Ethernet cables or wireless signals. NIC card covert frames into bits. (Encoding) Transmits Data using bits in the form of signals. Client Side RAW -------> ENCRYPTED -------> SEGMENT -------> PACKET -------> FRAME -------> BITS Server Side BITS -------> FRAME -------> PACKET -------> SEGMNET -------> DECRYPTED -------> RAW ![TCP/IP Model](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/f251d6d51630e11f1da50f3b8f2ab78b605a99e611ebcb89f11e869129171c5e.png) TCP/IP Model — TCP/IP stands for Transmission Control Protocol/Internet Protocol developed by ARPA. It is the set of communication protocols used on the Internet and similar computer networks. It provides end-to-end data communication. It contains five layers and all the functionalities are organized in these five layers. Application, Transport, Internet, Date Link, Physical. ![A diagram mapping each of the five TCP/IP layers to its role and communication mechanism.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/e30bbc6b5ad4b1c9c04c00ca3931a5952ab1257a7f1dd1936fce92d0f6f17f16.png) TCP/IP Layers — Application Layer Protocols for communication between application processes Transport Layer End-to-end communication between application processes using port numbers. Network Layer End-to-end communication between hosts across networks using IP addresses Data Link Layer Hop-to-Hop delivery within local network using MAC addresses and Switches Physical Layer Sends bits as electrical, optical or radio signal over physical medium ![A diagram illustrating the Application Layer connecting a User with Google Chrome to a Google Server hosting YouTube and Gmail.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/e1a3200289da7abb7643debfd576694c29a86a4e8499def24557a43aad3cdd20.png) TCP/IP Working — Application Layer User Google Server ![A diagram illustrating the TCP/IP working process, mapping Application Layer and Transport Layer connections from a user running Chrome to a Google Server hosting YouTube on Port 443 and Gmail on Port 25.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/09ab17584cbdcb25b2357a5eef9b2b73b844410ced2105f43d159b5d0f999ac2.png) TCP/IP Working — Application Layer Transport Layer Port 443 Port 25 User Google Server ![A network diagram illustrating how different TCP/IP layers function between a client device with IP 192.0.0.1 running a browser and cloud servers with IP 142.250.0.0 hosting services like YouTube (Port 443) and Gmail (Port 25).](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/fc1249821f2ea32cb7ab3d15303c27c088be4ee848630bad03b34d95be1971a3.png) TCP/IP Working — Application Layer Transport Layer Port 443 Port 25 Internate Layer 192.0.0.1 142.250.0.0 ![A network diagram showing the mapping of TCP/IP protocol layers—Application, Transport, Internet (labeled 'Internate'), and Data Link—across devices from a client computer with IP 192.0.0.1 through switches and routers to cloud-hosted services at IP 142.250.0.0.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/71c7385aabb1ff294e44a88c687dde8b9496717bb0f317b1f65e1534e34d2e43.png) TCP/IP Working — Application Layer Transport Layer Port 443 Port 25 Internate Layer Data Link Data Link Data Link 192.0.0.1 Switch 1 Router 1 Router 2 Switch 2 142.250.0.0 ![A network diagram illustrating the flow across TCP/IP layers (Application, Transport, Internet, Data Link, Physical) between a client laptop (IP 192.0.0.1) running Chrome, through intermediate switches and routers, to cloud servers (IP 142.250.0.0) hosting YouTube on Port 443 and Gmail on Port 25.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/7b6c6af0a1c6366ba7da8ecee931253ee245cb10de110ee4de7312bb8d0dd1b2.png) TCP/IP Working — Application Transport Internate Port 443 Port 25 Data Link Physical Switch 1 Router 1 Router 2 Switch 2 192.0.0.1 142.250.0.0 ![A diagram illustrating data encapsulation through network protocol layers, showing how headers and a trailer are progressively added from the Application Layer down to the Data Link Layer, ultimately converted into a stream of bits at the Physical Layer.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/635759261221a47e0f5cf940883a57e592563eb658b08fcb87cbd99795a41c38.png) Encapsulation — Application Layer Data Encapulate Transport Layer L4 Header Data Encapulate Network Layer L3 Header L4 Header Data Encapulate Data Link Layer L2 Header L3 Header L4 Header Data L2 Trailer Physical Layer 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 0 0 ![A diagram showing the network decapsulation process across the protocol stack, stripping headers and trailers layer by layer from the Physical Layer up to the Application Layer.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/f1ad56e9ed27539132e68a505ab364a6cb00e152fab0b92c0345e16d10ed3ea8.png) Decapsulation — Application Layer Data Decapsulate Transport Layer L4 Header Data Decapsulate Network Layer L3 Header L4 Header Data Decapsulate Data Link Layer L2 Header L3 Header L4 Header Data L2 Trailer Physical Layer 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 0 0 ![A diagram illustrating data encapsulation showing a Layer 4 PDU (L4 Header, Data), a Layer 3 PDU (L3 Header, L4 Header, Data), and a Layer 2 PDU (L2 Header, L3 Header, L4 Header, Data, L2 Trailer) with the inner headers and data indicated as Payload.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/15b2cc58c6545d67c24ddfc58d18e73ef0d4816d6a48dc5aa4dcfd779fa73784.png) Protocal Data Unit — We can use alternative names to describe the message at each stage. These alternative names are called as protocol data units. A segment or datagram is Layer 4 PDU. A packet is a Layer 3 PDU A frame is a Layer 2 PDU. The contents of each PDU are called payload. • Segment or Datagram’s payload is application data. • Packet’s payload is a segment or datagram. • A frame’s payload is a packet. ![Message Delivery](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/421e8b661db6ed2f7adf389ef811f29dd24df6990db99175f2d7da3a608813e1.png) Message Delivery — We have covered how the OSI model layers work, how TCP/IP maps to it, how a packet journeys from one end to another. But there is one question we haven't answered yet - When a device sends data who is it sending to? One device? All devices? A specific group? The nearest one? These are not the same thing - and the network handles each case differently. This is what message delivery options are about. There are four ways to deliver message i. Unicast ii. Broadcast iii. Multicast iv. Anycast ![Illustrations comparing four types of message delivery: unicast sends to one specific node, broadcast sends to all nodes, multicast sends to a select group of nodes, and anycast routes to the nearest node across a network.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/7e2e056da3c1a733adef0ba9935b60ba3005de5c01c2814c417259487a6d778b.png) Types of Message Delivery — unicast broadcast multicast anycast Unicast - one to one, your Netflix stream, your API call, your SSH session. Broadcast - one to all. Message in whatsapp group. Multicast - one to group. Live video stream going to subscribed viewers. Anycast - one to nearest. DNS Queries routed to the closest server. ![Anycast](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/2e3c9c8eb1041503bef97709d831f0d207bd80621605e3791b5b12d0007a13ea.png) Anycast — This one is the most interesting and the least understood. With anycast, multiple servers around the world share the same IP address. Example: DNS When you type a domain name and your device queries a DNS resolver that query often goes to an anycast address. Cloudflare's famous DNS resolver is 1.1.1.1. That single IP address is simultaneously hosted on hundreds of servers across the world. When you query it from Mumbai, you hit a server in Mumbai. When someone queries it from London, they hit a server in London. Same IP, different physical machines, nearest one wins. ![Network Models](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/70d4242d4e4914f3be7c19b9498d2833725236913466c8e06bca218c4057e3e0.png) Network Models — The Language of Communication Need of Models Who defines Standards..? OSI Model TCP/IP Model Encapulation Decapsulation Message Delivery In the next chapter, we'll understand network devices accross multiple layers.