The TCP/IP model or Transfer Control Protocol/Internet Protocol model is a suite of communication protocols that are used to describe how data is actually communicated between one device to another within a computer network. Unlike the OSI Model, the TCP/IP model is a functional model as it reflects how the internet functions today.
This model was developed and used by the United States Department of Defense (DoD) through DARPA in the 1960s. Then several universities around the world got involved in its further developments. This is the main reason why this protocol has been more successful than the OSI model. Since TCP/IP Model is a model that arises from actual and existing protocols, it is still being updated based on actual developments on the internet.
TCP/IP model consists of 4 layers, instead of 7. However, just like the OSI Model, each layer is a package of standard communication protocols specifically designed to perform specific functionalities. The 4-layer architecture (from the highest- to the lowest-level representation of data) consists of the application layer, the transport layer, the internet layer, and the link layer.
It has to be noted that, TCP/IP model is a protocol-oriented model and is designed to be hardware independent, hence each layer may be implemented with either hardware or virtual devices. Below describes the implementation of each layer in the TCP/IP model.
1. Application Layer L7
This layer performs the functions similar to the top three layers of the OSI model, namely the application, the presentation, and the session Layer. It is responsible for presenting and creating user data, controlling user-interface specifications, and node-to-node communication.
The application layer includes the protocols for providing user services or exchanging data over the network connections established by the lower layer. This may include some basic network support services such as routing protocols and host configuration. Examples of application layer protocols include the Hypertext Transfer Protocol (HTTP), the File Transfer Protocol (FTP), the Simple Mail Transfer Protocol (SMTP), Secure Shell (SSH), Post Office Protocol 3 (POP3), Simple Network Management Protocol (SNMP), Domain Name System (DNS), and the Dynamic Host Configuration Protocol (DHCP).
At the application layer, the TCP/IP model distinguishes between user protocols and support protocols. User protocols are used for actual user applications, e.g. FTP. Support protocols provide services to a system of network infrastructure, e.g. DNS. In addition, application layer protocols are associated with particular client–server applications, and common services having well-known port numbers. For instance, HTTP uses server port 80, and TELNET uses server port 23.
At the application layer, the protocol data unit is the actual application data.
Note: The application layer in the TCP/IP model is still commonly labeled as L7 just like in the OSI model.
2. Transport Layer L4
This layer corresponds to the transport layer of the OSI model. It is responsible for maintaining end-to-end communication across the network, flow control, and reliable/”best-effort” data transmission. It establishes basic data channels that applications use for task-specific data transfer and also shields the upper-layer applications from the complexities of data.
The two main protocols for this layer are the transmission control protocol (TCP) and the user datagram protocol (UDP). These 2 protocols are categorized based on connectivity-orientation of their data transmission. TCP is a connection-oriented stream protocol that addresses reliability issues, while UDP is a connectionless datagram protocol which is a best-effort unreliable protocol.
To provide process-specific transmission channels for applications, the transport layer establishes the concept of the (network) port. A port is a numbered logical construct allocated specifically for each of the communication channels so that it can address specific services between communicating devices. Please check this article to learn more about ports.
Data from the application layer are encapsulated in the transport layer into TCP streams or UDP datagrams (protocol data unit of the transport layer), which in turn are used by lower layer protocols to transfer data.
Note: The transport layer in the TCP/IP model is still commonly labeled as L4 just like in the OSI model.
3. Internet Layer L3
This layer parallels the functions of the network layer of the OSI model. The internet layer is responsible for connecting independent networks and for logical transmission of data over the entire network. It is also the layer that establishes internetworking – the process that defines the Internet. Internetworking is the process of sending data from the source network to the destination network, and is done through the routing.
Routing is supported by host addressing and identification using the hierarchical IP addressing system, and is implemented by routers and switches. Routers and switches do not usually examine the encapsulated traffic, rather they just provide a channel for it. This makes the IP a best-effort unreliable protocol just like UDP.
The main protocol of the internet layer is the Internet Protocol (IP). This protocol defines IP addresses that are used in routing. The role of IP in routing is to deliver packets from the source host to the destination host by looking at the IP addresses in the packet headers. IP has 2 versions: IPv4 and IPv6. IPv4 is the most commonly used website on the internet. IPv6 is introduced to supplement the limited number of IPv4 addresses.
ANother protocol in the internet layer is the Internet Control Message Protocol (ICMP). ICMP is included within IP packets and is responsible for providing hosts with information about network errors.
Protocol data unit from the transport layer is encapsulated in the internet layer into IP packets (protocol data unit of the internet layer), which in turn are used by the link layer to transfer data.
Note: The internet layer in the TCP/IP model is still labeled as L3 just like in the network layer of the OSI model.
4. Link Layer L1/2
This layer corresponds to the combination of data link layer and physical layer of the OSI model. It is responsible for hardware addressing and allows the physical transmission of data. The “link” includes all devices accessible without going beyond a router, in other words it covers nodes that are connected within a local network.
With that, the protocols of the link layer operate within the scope of local network communication to which local devices are connected. The protocols in the link layer include Ethernet for local area networks (LAN), and Address Resolution Protocol (ARP) for finding the hardware address of a host from a known MAC address. ARP has several types: Reverse ARP, Proxy ARP, Gratuitous ARP and Inverse ARP.
Since TCP/IP is designed to be hardware independent, the link layer implementation is not limited to hardware implementations. Virtual link layers such as virtual private networks (VPN) and networking tunnels are also possible.
When the link layer receives/transmits IP packets from/to the Internet layer, this process is controlled by a device driver on a network interface card (NIC), and also by a firmware on link devices. Within the link, the link layer performs functions, such as framing to encapsulate IP packets in frame and finally transmit the frames over a transmission medium. The link layer includes specifications such as media access control (MAC) addresses to send data between devices within the link.
At the link layer, the protocol data unit is the frame.
TCP/IP model or OSI model?
The TCP/IP and the OSI are the most popular communication networking models. The main difference is that the TCP/IP model is a model that is practically implemented in today’s internet architecture, while the OSI model is only a conceptual model that provides guidelines on how applications or devices can ideally communicate and transport data over a network. Some would argue that the TCP/IP model better reflects the way the Internet functions today, but the OSI model is still widely referenced for understanding how the internet works.
Pros of the TCP/IP model
- Nonproprietary and is not controlled by any single company;
- Helps establish a connection between different types of computers;
- Works independently of the OS so it can communicate with any systems;
- Uses client-server architecture that is highly scalable;
- Can be operated independently;
- Supports many routing protocols; and
- Lightweight and compatible on any computer hardware and networks.
Cons of the TCP/IP model
- Complicated to set up and manage;
- Transport layer doesn’t guarantee delivery of data packets;
- Not easy to replace protocols in TCP/IP;
- Does not clearly separate the concepts of services and protocols, so it is difficult to fit new technologies in new networks; and
- Vulnerable to a SYN attack – a type of denial-of-service (DoS) attack in which a bad actor uses TCP/IP.