TCP/IP Model

In this tutorial, you will learn the concepts of the TCP/IP model which consists of 4 layers. You will also learn the definition, functionality, comparison, the function of the four TCP/IP layers, and how the layers interact with each other.

Contents:

  1. What is TCP/IP Protocol Model?
  2. Layers of TCP/IP Model
  3. Application Layer and Transport Layer
  4. Features of TCP
  5. Internet Layer
  6. Network Access Layer
  7. Network Issues that are Resolved by TCP/IP Model
  8. Difference between TCP/IP and OSI Reference Model

What is TCP/IP Protocol Model?

Generally, the Internet Protocol suite is referred to as the TCP/IP protocol model because the main protocols used in this model are TCP and IP. Whenever two devices communicate with each other over a network they use the TCP/IP protocol model. The main thing to remember here is that TCP/IP is practically implemented in a computer network.

  • TCP is used in the TCP/IP model to establish a connection between two devices using a three-way handshake. It provides an acknowledgment when the data is successfully received by the receiver.
  • The function of IP in TCP/IP is to define the path between two communication devices. The router uses the source and destination IP addresses and builds the optimal path from the available paths.
  • In a nutshell, the TCP/IP model describes how your data will be transmitted, which path your data will travel, how long it will take for the data to be transmitted, the IP of the destination and source, etc.

Layers of TCP/IP Model

The TCP/IP model has 4 main layers as follows:

  1. Application Layer
  2. Transport/Host-to-Host Layer
  3. Internet Layer
  4. Network Access Layer

TCP/IP is somehow similar to the OSI reference model. But they both have different functionalities. Let’s look at the functionality of the TCP/IP layers.

advertisement
advertisement
  • Application Layer: The application layer functionality in the TCP/IP model is similar to the OSI reference model. But here instead of three separate layers, the TCP/IP application layer also combines the functionalities of the presentation layer and session layer.
    • Application Layer interacts with the user and provides services to the user. It provides a user interface by which users can interact with services easily.
    • DNS, FTP, HTTP/HTTPS, SMTP, POP, SNMP, DHCP, SSH & TELNET, etc are the protocols used in the Application Layer.
  • Transport/Host-to-Host Layer: The transport layer establishes communication with the application layer and the lower layers. It provides host-to-host and error-free delivery.
    • TCP and UDP are the protocols used in the transport layer.
  • Internet Layer: Internet Protocol (IP) addresses are used to provide logical transmission of data over a network using best-effort delivery at the Internet layer.
    • Here, best-effort delivery means that the IP is not providing any error checking mechanism or tracking information of the data.
  • Network Access Layer: Communicates with the Internet layer and receives packets from it. It converts packets into frames and frames into bits to make them understandable to the machine.

The below figure explains the 4 layers of the TCP/IP model and compares them with the OSI Reference Model layers.

layers of the TCP/IP model

As you can see from the above diagram, there are 4 layers in the TCP/IP model and 7 layers in the OSI reference model. The above diagram also shows that there is a separate application layer, presentation layer, and session layer, whereas TCP/IP has only one application layer which combines the functionality of both the presentation layer and session layer. Similarly, the OSI reference model consists of a separate data link layer and a physical layer, whereas TCP/IP has only a network access layer.

Application Layer and Transport Layer

Let us understand the first 2 layers of the TCP/IP model which are the Application Layer and Transport Layer.

Application Layer: The application layer provides the way for the user to communicate with the system. Any service running on the host machine that provides the user interface is using the application layer.

  • Accessing web pages from a server, assigning an IP to a host, resolving domain names in IPs, or sending emails are examples of the application layer.

Transport Layer: The transport layer communicates with the application layer and receives data from it. After receiving the data from the application layer, the transport layer divides the data into segments and assigns a sequence number to each segment.

  • The transport layer uses TCP and UDP protocols for the communication of data.
  • TCP is used for connection-oriented service and UDP is used for connectionless service.
  • Instead of TCP and UDP, the transport layer also uses SCTP (Stream Control Transmission Protocol) for VoIP calls. SCTP combines the features of both TCP and UDP.

The below diagram explains the responsibilities of the Application Layer and the Transport Layer.

responsibilities of the Application Layer and the Transport Layer

The above diagram shows that the data in the application layer is in a simple format. But when the data reaches the transport layer, it is broken down into smaller segments. Then the segments are transferred from PC-1 to PC-2. The PC-2 often runs multiple processes at the same time such as web pages, email, FTP, and Internet chatting as described in the figure. So as PC-2 receives segments, it will send different segments to different processes according to port numbers.

advertisement

Features of TCP

TCP is a connection-oriented protocol. A TCP is used in a network to establish a connection between communication devices using a three-way handshake mechanism.

  • The transport layer divides the data into segments received from the application layer and transmits that segment with sequence numbers using TCP. When segments are received to the receiver, the receiver reassembles the segments using the sequence number correctly.
  • TCP guarantees the sequenced delivery of messages, so one can say that TCP is reliable.
  • If a segment loss occurs in between transmission, TCP retransmits the loss segment.
  • TCP also controls the flow of data and provides reliability to the users.
  • TCP has more fields in its header whereas UDP has fewer fields than TCP. TCP also has to store and track data information, whereas UDP does not track transmitted data. Hence, TCP is slower than UDP.
  • TCP is used in non-real-time applications such as email, and UDP is used for real-time applications such as video streaming.

Internet Layer

Internet Protocol (IP) address is used to provide logical transmission of data over a network using best-effort delivery at the Internet layer.

  • Here, best-effort delivery means that the IP is not providing any error detecting mechanism or tracking information of the data.
  • The TCP/IP model communicates with devices using IP addresses. It doesn’t care how many paths there are between communication devices.
  • IP transmits data in the form of packets through multiple paths, when the receiver receives packets it does not give any guarantee whether the packets are received in sequence or not.
  • The Internet layer describes protocols for communication which are ARP (Address Resolution Protocol), RARP (Reverse Address Resolution Protocol), ICMP (Internet Control Message Protocol), and IGMP (Internet Group Message Protocol).
    • ARP: An ARP request is made over the communication link to find the physical address (MAC) of other devices when the IP is known.
    • RARP: The RARP request is used to find the IP address of the device when only the MAC address of the device is known.
    • ICMP: ICMP is used for error reporting and whether the host is reachable or not.
    • IGMP: This allows the device to transmit data to hosts that request services.

Network Access Layer

The network access layer is a combination of the data link layer and the physical layer. It provides the functionality of both the data link layer and the physical layer. The network access layer works based on the MAC address. It creates the frame and converts it into a stream of bits for machine-understandable language.

advertisement
  • The network access layer communicates with the Internet layer and receives packets from the Internet layer and converts the packets into frames. After that, the frame is also converted into bits, so that the machine can understand the data and send it through the media.
  • The Network Access Layer describes in what format your data will be transmitted through media over a network.

Network Issues that are Resolved by TCP/IP Model

No matter how well you design a computer network, there will still be some issues that can cause problems with the network. Below are some network problems that are resolved by the TCP/IP model.

  • Routing: Which path should be chosen from the available paths for communication is decided by the routing method.
  • DNS Resolution: Suppose the client wants to access the “example.com” website from the server, this request will be sent to the DNS server using port 80 or 443. Once the DNS server finds the URL of the website, it will convert the URL to an IP address, and send the access of the website to the client as a response.
  • Addressing: If the IP address of the device is known then the MAC address can be found. Similarly, if the MAC address of the device is known then the IP address can be found.
  • Flow control: If the sender sends data at a speed of 100 MB/s and the receiver is only able to receive data at 10 MB/s, the network automatically reduces the data flow to 10 MB/s and starts sending the data to the receiver at the speed of 10MB/s.
  • Error control: Detects and corrects errors between communication devices on the network.
  • Interoperability: This means that different types of devices can communicate with each other over a network. For example, mobile and computer can communicate with each other over a network without any problem.

Difference between TCP/IP and OSI Reference Model

The table below compares the functionalities of the TCP/IP model and the OSI reference model.

Key TCP/IP Model OSI Model
Full-Form Transmission control protocol/Internet Protocol Model. Open System Interconnection Model.
Implementation Practically implemented on a network. Used as a reference model and practically not implemented on a network.
Layers There are 4 main layers in the TCP/IP model as follow:

  1. Application Layer
  2. Transport/Host-to-Host Layer
  3. Internet Layer
  4. Network Access Layer
The OSI Model seven layers are as follows:

  1. Application Layer
  2. Presentation Layer
  3. Session Layer
  4. Transport Layer
  5. Network Layer
  6. Data Link Layer
  7. Physical Layer
Developed by United States Department of Defense. ISO (International Standards Organization)
Variety The presentation layer and the session layer have been combined into the application layer. There is a separate application layer, presentation layer, and session layer.
Transport Layer In the TCP/IP model, the transport layer did not provide any guarantee of packet delivery. In the OSI reference model, the transport layer guarantees packet delivery.
Approach Horizontal approach Vertical approach

Key Points to Remember

Here is the list of key points we need to remember about the “TCP/IP Model”.

  • TCP/IP was developed by the US DoD (Department of Defense) to provide interoperability between devices.
  • The TCP/IP model is practically implemented over the network, so whenever a client or device makes a request over the network the TCP/IP protocol model is used.
  • The TCP/IP model has 4 layers as follows:
    1. Application Layer
    2. Transport/Host-to-Host Layer
    3. Internet Layer
    4. Network Access Layer
  • In the TCP/IP model, the function of TCP is to establish a connection between two devices using a three-way handshake. And the function of IP is to define the path for communication.
  • Internet Protocol (IP) address is used to provide logical transmission of data over a network using best-effort delivery at the Internet layer.
  • The network access layer is a combination of the data link layer and the physical layer. The network access layer performs the functions of both the data link layer and the physical layer.
  • TCP/IP resolves network issues such as routing, addressing, DNS resolution, flow and error control, and interoperability.

Related Article:

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.