What is TCP Or IP Protocol, Working, Diagram, Layers, With Example
Hello guys, welcome back to my blog. In this article, I will discuss what is TCP or IP protocol, the working of TCP or IP, transmission control protocol or internet protocol, diagram of TCP or IP, etc.
If you have any doubts related to electrical, electronics, and computer science, then ask questions. You can also catch me on Instagram – Chetan Shidling.Â
Also, read:
- Differences Between RAM And Graphics Card, Definition, Applications.
- PWM, Definition, Working, Techniques, Advantages, Disadvantages, Uses.
- What Is AUTOSAR, Motivation, Benefits, Partnership, Drawbacks.
TCP Or IP Protocol
Communications among computers on a network are made by protocol suits. The most generally utilized and most generally available protocol suite is the TCP/IP protocol suite. A protocol suite consists of a layered architecture where each layer represents some functionality that can be taken out by a protocol. Each layer normally has more than one protocol option to carry out the duty that the layer adheres to. TCP/IP is normally considered to be a four-layer system. The 4 layers are as follows:
- Application layer
- Transport layer
- Network layer
- Data link layer
01. Application Layer
The application layer is the top layer of the TCP/IP protocol suite. This layer involves applications or processes that use transport layer protocols to transfer the data to destination computers. At each layer, there are some protocol options to carry out the task assigned to that special layer. So, the application layer also has many protocols that applications use to communicate with the second layer, the transport layer. Some of the popular application layer protocols are:
- HTTP (Hypertext transfer protocol)
- FTP (File transfer protocol)
- SMTP (Simple mail transfer protocol)
- SNMP (Simple network management protocol) etc
02. Transport Layer
This layer gives the backbone to data flow between two hosts. This layer accepts data from the application layer above it. There are many protocols that work at this layer but the two most generally used protocols at the transport layer are TCP and UDP. TCP is practiced where a reliable connection is needed while UDP is used in case of weak connections.
TCP divides the data(coming from the application layer) into accurately sized chunks and then passes these pieces onto the network. It acknowledges received packets, delays for the acknowledgments of the packets it sent and sets the timeout to send again the packets if acknowledgments are not received in time. The term ‘reliable connection’ is applied where it is not aspired to lose any message that is being transferred over the network through this connection. So, the protocol employed for this type of connection must give the mechanism to achieve this desired characteristic. For example, while downloading a file, it is not desired to lose any data(bytes) as it may lead to corruption of downloaded content.
UDP gives a comparatively simpler but unreliable service by sending packets from one host to another. UDP does not take any extra steps to ensure that the data sent is received by the target host or not. The term ‘unreliable connection’ is used where the loss of some data does not hamper the task being fulfilled through this connection. For example, while streaming a video, the loss of a few bytes of data due to some reason is acceptable as this does not hurt the user experience much.
03. Network Layer
This layer is also called the Internet layer. The main goal of this layer is to make or handle the movement of data on the network. By the movement of data, we usually mean routing of data over the network. The main protocol employed in this layer is IP. While ICMP (utilized by popular ‘ping’ command) and IGMP are also utilized at this layer.
04. Data Link Layer
This layer is also recognized as a network interface layer. This layer usually consists of device drivers in the OS and the network interface card connected to the system. Both the device drivers and the network interface card take charge of the communication details with the media being utilized to transfer the data across the network. In most circumstances, this media is in the form of cables. Any of the famous protocols that are utilized at this layer include ARP(Address resolution protocol), PPP(Point to point protocol), etc.
Working Of TCP Or IP Protocol
One point which is deserving of taking note of is that the interaction between two computers across the network through TCP/IP protocol suite takes place in the form of a client-server architecture. The client requests a service while the server treats the request for a client. Presently, since we have explained the underlying layers which support that data flow from host to target across a network. Let’s take a very easy example to make the concept more precise. Consider the data flow when a website is opened by you.
As seen in the above figure, the data flows down through each layer on the host device. At the initial layer, as the HTTP protocol is being used, an HTTP request is made and sent to the transport layer. Here the protocol TCP indicates some more data (like sequence number, source port number, destination port number, etc) to the data coming from the upper layer so that the communication continues reliable i.e, a track of sent data and received data could be maintained.
At the following lower layer, IP adds its own message over the data arriving from the transport layer. This information would help in packets traveling across the network. Finally, the data link layer makes sure that the data transfer to/from the physical media is done correctly. Here again, the communication done at the data link layer can be unreliable or reliable. This information moves on the physical media (like Ethernet) and reaches the target device or machine.
Now, at the target device(which in our case is the machine at which a website is hosted) the same series of communications occur, but in reverse sequence. The packet is originally received at the data link layer. At this layer, the data(that was stuffed by the data link layer protocol of the host machine) is held and the rest of the data is moved to the upper layer. Furthermore, at the Network layer, the information set by the Network layer protocol of the host machine is read and the rest of the data is passed on to the next upper layer. The same occurs at the transport layer and finally, the HTTP request sent by the host application(your browser) is received by the target application(Website server).
One would wonder whatever happens when data particular to each layer is read by the corresponding protocols at the target machine or why is it needed? Well, let’s understand this by an example of a TCP protocol being at the transport layer. At the host device, this protocol adds information like sequence numbers to each packet sent by this layer. At the target device, when the packet reaches this layer, the TCP at this layer does note the sequence number of the packet and sends an acknowledgment (which is received seq number + 1).
Now, if the host TCP does not receive the acknowledgment within some particularized time, it sends again means resends the same packet. Hence this way TCP makes sure that no packet becomes lost. Hence we see that protocol at every layer reads the data set by its counterpart to deliver the functionality of the layer it represents.
I hope this article may help you all a lot. Thank you for reading. If you have any doubts related to this article, then click on ask question and add your doubts – Ask Question.
Also, read:
- 100 + Electrical Engineering Projects For Students, Engineers
- 1000+ Electronics Projects For Engineers, Diploma, MTech Students
- 1000+ MATLAB Simulink Projects For MTech, Engineering Students
- 500+ Embedded System Projects For Engineer, Diploma, MTech, PhD
- 500+ Projects For Diploma Electrical, Electronics Student, Diploma Project
- 8051 Microcontroller Timers, TCON Register, TMOD Register
- Advanced Technologies In-Vehicle Infotainment Systems
- Advancements In 3D Printing Technology And It’s Future