Understanding TCP/IP
As mentioned previously, the US DoD developed a neutral networking model known as TCP/IP. This has been adopted by many computer and networking vendors. At the time of writing, TCP/IP is the dominating networking protocol suite and ensures devices can send and receive data over networks. Whether it’s a private network within your home, office, or the internet, TCP/IP is implemented within all devices connected to a network.
While TCP/IP seems to specify only two networking protocols – TCP from the Transport layer and IP from the Network layer of the OSI model – they are the most commonly used on networks. The TCP/IP protocol suite is a group of networking protocols that all work together to ensure messages can be exchanged over any type of network between sender and receiver devices.
The original version of the TCP/IP protocol is made is up of four layers compared to the seven-layered OSI model. Modern versions of the TCP/IP protocol suite have five layers, splitting the bottom layer into Physical and Data Link layers.
The following diagram shows a comparison of the original TCP/IP protocol suite and the OSI model:
Figure 1.21 – TCP/IP protocol suite
As shown in the preceding diagram, the following are the four layers of the TCP/IP protocol suite:
- Application
- Transport
- Internet
- Network Access
The Application layer of TCP/IP absorbs all the functionality and responsibilities of the Application, Presentation, and Sessions layers of the OSI model. The Transport layer of both the OSI model and TCP/IP has the same functionalities and responsibilities. The Internet layer of TCP/IP is equivalent to the Network layer of the OSI model. Lastly, the Network Access layer of TCP/IP is equivalent to both the Data Link and Physical layers of the OSI model.
Important note
The Network Access layer of TCP/IP is sometimes referred to as the Link layer or the Network Interface layer.
The following diagram provides a high-level overview of a computer sending a message that contains data to a server using the TCP/IP protocol suite:
Figure 1.22 – TCP/IP protocol suite
As shown in the preceding diagram, the sender creates a message at the Application layer known as Data that is passed down to the lower layers and encapsulates a new header before it is placed on the physical network media. On the sender’s device, the Transport layer encapsulates a header that contains the source and destination service port numbers and the Transport layer protocol such as TCP or UDP. The Internet layer encapsulates an IP header that contains the source and destination IP address and the IP version (IPv4 or IPv6). The Network Access layer encapsulates a header that contains the source and destination MAC addresses (physical addresses) and performs encodes, signals, and places the message onto the physical network media for transmission to the receiver.
On the receiver’s end, the bits are accepted on the Network Access layer, which checks the integrity of the incoming message by checking the FCS within the frame’s trailer. The Network Access layer also checks the destination MAC address found within the frame header to verify whether the message is intended for the actual receiver. Once everything is fine with the frame, the Network Access layer de-encapsulates the frame by removing the frame’s header and trailer before sending it up to the Internet layer of the TCP/IP. At the Internet layer, the destination IP address found within the IP header of the packet is verified to determine whether it matches the IP address of the receiver. Once everything is fine with the packet, the Internet layer de-encapsulates the packet’s header details and passes the message up to the Transport layer. At the Transport layer, the destination service port number is observed within the segment’s header. The destination service port number is used by the Transport layer to determine which application layer protocol to deliver the message to. Once the Transport layer has identified the service port number to the corresponding application layer protocol, it de-encapsulates the Transport layer header and sends the raw datagram to the appropriate application layer protocol at the Application layer of TCP/IP on the receiver’s device.
Important note
As data moves down a networking model, such as the OSI model or TCP protocol suite, each layer encapsulates a header containing addressing information. When a device receives a message over a network, the process is reversed as each layer de-encapsulates the headers and the message moves up to the Application layer.
With that, you have learned about the roles and functions of each layer of the TCP/IP protocol suite and the data encapsulation and de-encapsulation process. In the next section, we will dive deeper into data encapsulation concepts.