paint-brush
TCP / IP Stack - Simplified for Web Developers 🌍🧑🏻‍💻by@jaypmedia
1,397 reads
1,397 reads

TCP / IP Stack - Simplified for Web Developers 🌍🧑🏻‍💻

by Jean-Paul RustomAugust 10th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

TCP / IP model is not a physical thing. It is a conceptual model used to understand how communications are made over the Internet, and consists of 4 layers.
featured image - TCP / IP Stack - Simplified for Web Developers 🌍🧑🏻‍💻
Jean-Paul Rustom HackerNoon profile picture

In the ever-evolving landscape of web development, many professionals tend to focus extensively on high-level programming languages and frameworks, often overlooking the crucial networking fundamentals that underlie the functioning of the internet. However, delving into the intricacies of the TCP/IP stack can empower web developers with a deeper understanding.


TCP / IP model is not a physical thing.

Instead, it is a conceptual model used to understand how communications are made over the internet, and consists of 4 layers.



Layers of TCP / IP

1. The Application Layer

The application layer is the layer that interacts directly with the end user, providing the services and applications that allow users to access and use the network resources.


They are software applications you use on your computer, such as web browsers, email clients and messaging apps.


Example: Applications that allows Internet access Example: web browser, messaging apps

These use protocols such as:

  • HTTPS
  • DNS
  • SMTP
  • FTP
  • SSH

2. The Transport Layer

The transport layer provides data transport services to and from the application layer. It offers two main options for data transportation: reliable and efficient or unreliable and fast.


This layer uses protocols like TCP to provide reliable communication between two devices and UDP to provide fast but unreliable transmission. (More on these in my other articles)


The transport layer takes the application data (for eg an HTTP POST request) from the application layer and packages it into segments, which are then sent over the internet using port numbers.


Structure of a TCP segment on a high level

3. The Network Layer

This layer is responsible for routing the data across multiple networks and it uses protocols such as the IP protocol.


ip protocol route.png

It takes the data from the transport layer and packages it into packets, which are then sent over the Internet using IP addresses.


Think of it like a postal service that can deliver letters across the globe.


It needs to know the destination and the best route to get there. The Internet layer uses IP addresses to identify different networks and determines the best path for data to travel across them.


The network layer is considered an unreliable protocol as it does not guarantee the delivery of packets or their order. The reliability of communication is achieved by higher protocols, such as TCP which use IP as their underlying transport mechanism.

4. The Link Layer

The link layer is responsible for taking the raw bits of data from the physical layer, and organizing them into frames, then moving data between devices that are physically connected.


Image description

Think of it like a postman that is delivering letters within the same neighborhood. The postman needs to know the addresses of the sender and the recipient, and also needs to make sure that the letters are properly packaged and labeled.


In the same way, the data link layer uses frames to package data and add information such as source and destination MAC addresses to ensure it gets delivered to the correct device.



Here is the animated version for those of you who prefer interactive videos: