#Introduction to TCP/IP Networking Model
Gaurav Sharma
Business Transformation | Legal Operations | Process Optimization | PMO | Automation Strategy | IP
What is TCP/IP?
TCP/IP is a collection of protocols that are designed for connecting devices over a network and for making them communicate with each other
- TCP/IP protocol is a combination of Transmission Control Protocol and Internet Prtocol (and few more protocols, not discussed in this article for simplicity purpose)
- TCP/IP is responsible for routing individual packets from least congested and from fastest routes available, irrespective of routes takes by other similar or sequential packets.
- Just like 7 logical layers of the OSI reference model, TCP/IP also have layers, but only 4 logical layers. Few may argue that TCP/IP has 5 layers not 4. However, for simplicity purpose i explained the broad functionalities of the TCP/IP using only 4 layers. Functionalities of the Network layer (of the TCP/IP) can be split into two separate layers, namely data link layer and physical layer.
How many layers are there in TCP/IP model?
Following are the four basic logical layers of TCP/IP with their brief functionalities
- Application Layer (Top Layer) : This is the layer to which the web browsers directly interacts with. This layer uses its own set of protocols such as HTTP (for web), FTP (for file transfers), and SMTP (for emails) to name a few. This layer gets data from users and transfer it to the transport layer via various dedicated ports (e.g., Port 80 for HTTP) for further processing. Notably, this layer performs functions somewhat similar to top three layers of the OSI reference model (i.e., application, presentation, and session layer)
- Transport Layer: This is the layer where TCP protocol works. Another protocol that works in this layer is UDP. This layer receives data from the application layer via ports (each port dedicated to a different protocol like HTTP, FTP, SMTP, etc) and divides the received data into multiple packets for transferring them to the Internet layer. Every packet has a header portion and a body portion. The body portion contains the actual data and the header portion is used for packet indexing, error corrections, etc. Header portion is basically used to identify the sequence in which the actual data was divided for re-assembling purposes. Notably, this layer performs functions somewhat similar to transport layer of the OSI reference model.
- Internet Layer: This is the layer where IP protocol works (e.g., IPV4, IPV6, ICMP, ARP, etc). This layer initially adds origin and destination IP addresses to the header portions of the multiple packets before routing them. Moreover, this layer is important as this actually is the layer which is responsible of physically transferring packets (generally transferred by a router) from a first computer (data origin or data sending node) to a second computer (destination node or receiving node) on the network. Notably, this layer performs functions somewhat similar to the network layer of the OSI reference model.
- Network Access Layer (lowest layer): This is the final logical layer that receives (generally received by a router on their IP addresses) the packets from the Internet layer or the network. This layer is typically responsible for transferring (using Ethernet or WIFI) the received packets to physical addresses (MAC address) or better say to physical machines (as multiple physical machines can be connected to one router such as mobile, laptop, tablet, etc.). In addition, this layer is responsible for converting data from the received packets into electrical data signals (electrical impulses), which is the only communication language the physical machines understand. Notably, this layer performs functions somewhat similar to the last two layers of OSI model (i.e., data link and physical layer).
So what exactly is the role of IP in TCP/IP?
Internet Protocol is basically and broadly used for letting a first computer discover a second target computer on a network for establishing communication
- IP is a routing protocol used for routing information over network
- IP facilitates how computers discover each other on a network
- IP controls routing of information to different network nodes or sub-networks
- IP works on Network layer, i.e., Layer 3 of OSI model
- IP deals with IP addresses, subnet masks, default gateways, and DNS
- IP protocol is responsible for helping one computer to find another computer on a network to start communication
How is TCP related then?
Once the first computer discovered the target computer on the network, role of TCP begins to establish communication between them
- TCP ensures how two computers communicate with each other on a network. For example, what language they are going to use, how fast will be the communication speed will be, etc.
- TCP breaks a transmission message into multiple small packets, which are sent over the network (instead of the original message as a whole). A packet may only have few bytes of information at max.
- TCP works on Transport layer, i.e., Layer 4 of OSI model.
How TCP/IP facilitates communication over Internet?
Below is an exemplary process describing how TCP facilitates communication between two computers:
- For communication, router of first computer (using TCP) sends one packet (i.e., Packet 1) to IP address of the second computer and waits for acknowledgment from the second computer. If the second computer replies that Packet 1 is received, process proceeds to next step. Otherwise, the first computer retries.
- When second computer confirms reception of Packet 1, the first computer sends double the amount of packets sent earlier (i.e., packet 2 and packet 3, ) to the second computer and waits for confirmation. The second computer acknowledges only the last packet, if received. So, if second computer acknowledges reception of 3rd packet then the process proceeds to step 3. Otherwise, if the second computer acknowledges reception of 2nd packet, then the first computer understands that there has been some communication issue, and the first computer begins again by sending just one packet (not double the number of packets) i.e., packet 3 (as packet 2 was already received by the second computer) and the process goes on in the same flow.
- When second computer confirms reception of Packet 3, the first computer sends double the amount of packets sent earlier (i.e., packet 4,5,6, and packet 7) to the second computer and waits for confirmation. The second computer acknowledges only the last packet, if received. So, if second computer acknowledges reception of 7th packet then the process proceeds to step 4. Otherwise, if the second computer acknowledges reception of any packet other that packet 7, then the first computer understands that there has been some communication issue, and the first computer begins again by sending just one packet (not double the number of packets) and the process goes on in flow.
- The first computer sends double the amount of packets sent earlier (i.e., packet 8,9,10,11,12,13,14 and packet 15) to the second computer and waits for confirmation for packet 15. The process keeps on going as described above. This is the only reason we used to notice that file transfer process is slow initially, progress successively up to a saturation level (which is dependent on bandwidth, latency, etc.),suddenly slows down in between (if a packet loss occurred), and then regains its momentum. This was prominently noticeable with 56k or slower modems and not much noticeable with a broadband or higher speed connections.
Thank you for reading, Please hit like/share if you found the article of some use. This will motivate me to get some more time out to publish some more knowledgeable articles.