Did you know? All Video & Audio API plans include a $100 free usage credit each month so you can build and test risk-free. View Plans ->

WebRTC For The Brave

Decoding Network Models: OSI vs TCP/IP

Before we delve into actually transferring data on a network, we need to understand the theoretical model of how your computer deals with a network. Two models are critical for understanding this: the OSI model and the TCP/IP model. These frameworks break down communication into layers, making it easier to troubleshoot and develop network systems.

The OSI Model (Open Systems Interconnection) is often the first model you learn while studying networks in a CS Undergrad course. The model has seven layers, starting with the Physical layer (hardware like cables) and ending with the Application layer (user-facing software like browsers).

  • The Physical Layer is the "hardware" layer, handling the actual cables, wires, or wireless signals that move bits (1s and 0s) from one place to another. For example, your Wi-Fi, Ethernet cables, or fiber optics work here.
  • The Data Link Layer ensures the data is packaged properly for the Physical Layer and sent without errors, organizing the bits into frames. It acts like a traffic cop for data, ensuring no collisions happen on your Wi-Fi.
  • The Network Layer decides the best route to send data between two computers, like a GPS for data packets. It adds the sender's and receiver's addresses, just like your router does to find the best path for your message.
  • The Transport Layer ensures data is delivered completely and correctly, even if it’s broken into smaller chunks. It can also resend lost pieces, like a delivery service that tracks and confirms every package (e.g., TCP).
  • The Session Layer starts, manages, and ends communication sessions between devices, acting like a meeting organizer, such as when you log into a website and maintain your session.
  • The Presentation Layer translates data into a format the application understands (e.g., text, images) and handles encryption for security, such as converting video files into a playable format on your device.
  • Finally, the Application Layer is where you interact directly with programs like web browsers, email, or chat apps. For example, sending a WhatsApp message or browsing on Chrome happens here.

The important thing to understand with the OSI model is that it is a theoretical model used to understand networking rather than how real-world implementations often look like.

The TCP/IP model simplifies things into four layers: Network Access, Internet, Transport, and Application. It’s more practical and closely mirrors how the Internet operates today. It’s like a streamlined version of the OSI model with just four layers, each performing specific tasks to send and receive data.

  • The Network Access Layer is the foundation. It handles the physical transmission of data over hardware like cables, Wi-Fi, or other networks and ensures that devices on the same network can talk to each other. Think of it as the layer that ensures your computer can send and receive signals properly over your local network.
  • The Internet Layer is responsible for moving data between networks. It breaks the data into packets, adds IP addresses, and figures out the best path to get it from one device to another. It’s like GPS for data, ensuring the packets reach their destination, even across multiple networks.
  • The Transport Layer makes sure the data is delivered correctly. It divides the data into smaller chunks, ensures all the pieces arrive in the right order, and resends any that get lost. Protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) operate here. TCP is like a reliable delivery service that tracks every package, while UDP is faster but doesn’t check if all the pieces arrived.
  • The Application Layer is what you see and interact with. It includes the applications and protocols that allow you to use the internet, like web browsers, email clients, and messaging apps. It ensures that the data is in a format you can use, such as displaying a webpage in your browser or delivering an email to your inbox.