Hello guys! We have already discussed what is OSI model and today we are going to talk about TCP/IP model.
So whats the difference between these two models?
Well both models try to explain how two computers connect to each other but OSI Model is a theoretical concept while TCP/IP is implemented in real life.
Protocols Used: HTTP, HTTPS, NTP, FTP, SMPT, SNMP, DNS, Telnet, SSH, IRC, TFTO, POP3
As you can see in graphic above, Application Layer in TCP/IP consists of Application, Presentation and Session Layer. Now lets say you logged in a website with uses HTTPS protocol. So the time when you connect to the website, your computer creates a session with the server which happens in the Session Layer of the OSI Model . HTTPS protocol uses encryption so the browser and the server has to decrypt and encrypt data which happens in Presentation Layer of OSI Model. Your browser is a part of Application Layer of OSI Model.
In TCP/IP Model all these three layers i.e. Application Layer, Presentation Layer and Session Layer are merged into a single layer called Application Layer.
Protocols Used : TCP and UDP
This layer is same in OSI and TCP/IP model. The transport layer decides how the data is going to be transmitted between two devices.
I have already written a great article about how data is transmitted, so please go and check it out before you read any more of this article.
Protocols Used: Internet Protocol (IP), Internet Message Control Protocol (ICMP) and Address Resolution Protocol (ARP)
Internet Layer is used to transfer data packets from one machine to another. IP address lies in this layer which is essential for communication. Internet Layer also uses ICMP protocol which is used to report errors and other events like when server is unreachable, timeout occurs or a connection fails to setup etc. We have ARP in internet layer which is said to lie between Internet and Network Access Layer as it maps IP addresses into physical addresses so its kind of half way between these two layers. You can read more about ARP here.
Network Access Layer
Protocols Used: Ethernet, Copper Cables, X.25, Token Ring, Fiber Optics, BNC. ISDN etc.
Protocol Data Units (PDUs) in TCP/IP Model
Each layer has a PDU associated with it. PDU is terms to describe what kind of data is associated with a layer. When data travels through different layers, each layer adds some data to it and this process is called encapsulation. The resulting information is called PDU. Confused? Keep reading you will get to know it soon.
Application Layer PDU
The PDU for Application Layer is Data. Basically the data which is meant to be sent, like when you visiting a website you are sending and receiving some data.
Transport Layer PDU
Transport Layer uses TCP and UDP protocols to transfer data. Well the PDU for TCP and UDP are different.
In case of TCP, the PDU is called a segment of TCP. On the other hand, it is called a datagram in case of UDP.
Data has to be broken down into smaller parts, called data packets, well that happens in transport layer. And as I stated earlier, each layer adds some information to the data passing through. So what kind of information do Transport Layer add? Well they add a header to the data packet which contains information like source port and destination port. To know more about TCP headers click here.
Internet Layer PDU
Internet Layer another header to the data received from Transport Layer. This header contains information which is essential for establishing a connection with remote host. The information present in IP header includes IP version (either IPv4 or IPv6), protocol in use, source and destination IP address etc.
The PDU of Internet Layer is called a Packet.
Network Access Layer PDU
Network Access Layer adds the information which is required by the data to reach the router, the resulted data packet is what we call a frame. A frame also contains what we call a trailer with error-checking information. The header is placed on the top of the data while a trailer is placed below it. Then the frame is converted into bits. Bits can be electrical signals or light signal which are used transfer the data packets from one computer to another.
I hope you understood everything I wrote above. If you are unable to understand something or have a question please comment or use Google to satisfy yourself.
Encapsulation and Decapsulation in TCP/IP Model
The process of adding data by different layers to the original is called Encapsulation. This data helps the data packet to reach its destination. When this encapsulated data is received by the target computer, this extra data is removed and the original data is served to the application. The process of removal of this extra data is called Decapsulation.
Take a look at this image
Data which is meant to be sent is packed in a box. Then this box is packed in another box i.e. TCP/UDP header which is then sent to the Internet Layer which puts it into another box (IP header). Then finally this box is put inside another box i.e. Frame which is then sent to the destination.
Then the receiver opens these boxes one by one and sends the original data to the application layer. Here’s a more practical representation of encapsulation,
Well that’s how two devices communicate with each other 🙂
Thanks for reading. I hoped enjoyed this article.
Also Read: Networks and Port Forwarding