What are the functions of each layer in TCP/IP?

Photo by Connor Williams on Unsplash

We know that the OSI model gives us the idealized network communications protocol family. TCP/IP does not correspond to this model directly, as it either combines several OSI layers into a single layer or does not use certain layers at all.

We see in the table below the OSI model layers, their TCP/IP Model equivalents, and examples of the protocols available at each level of the TCP/IP protocol stack. Each host that is involved in any communication transaction runs its own implementation of this protocol stack.

To see the different layers of TCP/IP in action, let's take an example of an email file that is sent from a computer connected to Wi-Fi to a computer connected to Ethernet.

Starting at the Application Layer (Layer 5 of TCP/IP): For example, I want to send PDF files of books to my friend by mail. Here, you can think of a book as an application data file.

At Layer 4 (Transport Layer), the books will be divided into boxes, and the boxes will be numbered for mailing, like 1, 2, 3, 4, or 5 out of 5. You can think of these boxes as TCP payload segments and box-numbering as TCP Sequence Numbers (2/5 for the second box out of the five boxes).

After they are received at the destination, the box numbers will be used to find any missing boxes and for reordering the books in proper sequence, that’s what TCP does exactly.

At Layer 3 (Internet Protocol Layer), sender and receiver addresses will be added to each box. You can think of the sender IP address as the source IP address and the receiver IP address as the destination IP address. IP Addresses are used to deliver (route) the packets to the receiver (destination) IP address.

At Layer 2 (Data Link Layer or Network Access Layer), we select the mail type, for example, Air mail, Surface mail, priority mail, etc. That means in actual networking, we would be selecting between Satellite communication, Mobile communication (4G LTE, 5G), Optical Fiber communication, Ethernet, Wi-Fi, Bluetooth, etc.

And finally, at Layer 1 (Physical Layer), we select the mode of transport, for example, ship, airplane, truck, bicycle, walking, etc based on air mail, land mail or sea mail, or any extra option that we selected at Layer 2. Therefore, here, we have Wired Electrical Signals and Cables, Wireless RF Signal and Antenna and Optical Laser Signal and Optical Fibers as components.

So, we saw the different layers of TCP/IP Network Operations in action, using the above example in a short yet precise format.

I hope you liked the content. Thanks, Have a great week!




Software Engineer in making!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Significance of 0 in Technology

How to Copy Files in Python

Advice for Ruby Programming Foundations Written Assessment(Part 4)

[LeetCode]#2032. Two Out of Three

Investigating Machine Learning Techniques to Improve Spec Tests — IV

How To Manage Multi JAVA Versions On Mac

Upgrading Smart Contracts with OpenZeppelin Upgrades Plugins in Typescript & Hardhat

Performance Testing — lessons learned

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohammad Humayun Khan

Mohammad Humayun Khan

Software Engineer in making!

More from Medium

GitHub Versioning

Turns Out, Operational Discipline Is the Key

Performance Evaluation of TickTock (A new Time Series DB) on RaspberryPI

7 Steps To Fix Flaky Tests