TCP/IP Model
TCP/IP is currently the most widely used communication protocol suite in the Internet. It uses a simpler architecture than the OSI reference model for data transmission between devices connected in a network.
Initially developed by the Defense Advanced Research Projects Agency (DARPA) of the United States Department of Defense, TCP/IP has a conceptual model that consists of four layers.
Each layer of the TCP/IP architecture corresponds to one or several layers of the OSI model:
- Layer 4, the application layer. It corresponds to layers 5 (session), 6 (presentation) and 7 (application) in the OSI model. This layer manages presentation, encryption and information control.
- Layer 3, the transport layer. It is similar to layer 4 (transport) of the OSI model. Basically, it provides a logical connection between the sender and the receiver, divides data into segments and reassembles it and controls the transmission status.
- Layer 2, the Internet layer. It is similar to layer 3 (network) of the OSI model. It is responsible for routing packets across networks and forwarding datagrams to their next destination.
- Layer 1, the network interface layer. It corresponds to layers 2 (data link) and 1 (physical) in the OSI model. This layer accepts data packets and transmits them over the network.
On its way from the source to the destination, data travels through all these layers. Each one adds new information to the packet, known as a header. At the receiving end, the packet goes through the same layers in reverse order and the headers are removed one by one until only the original message remains.
As a packet travels through the TCP/IP stack, each layer adds a header to it, changing its format. Different packet formats have different names:
The data packet created at the application layer is called a message.
- This message is then encapsulated in a segment at the transport layer.
- Once the segment is encapsulated at the Internet layer, it becomes a datagram.
- Finally, the packet at the network interface layer is known as a frame.
TCP/IP Layers and Protocols
TCP/IP is a simplified version of the OSI model where each layer provides services only for the layers above it, making the entire process transparent.
Application Layer
It enables applications to access the services of other layers and defines the protocols they use to communicate. The most widely known application layer protocols are:
- HTTP (Hypertext Transfer Protocol) is used to transfer files that make up web pages on the World Wide Web.
- FTP (File Transfer Protocol) is used to transfer files between computers.
- SMTP (Simple Mail Transfer Protocol) is used to send emails and attachments.
- Telnet is a terminal emulation protocol used to remotely access computers over a network.
- DNS (Domain Name System) is used to map a domain name to an IP address.
- RIP (Routing Information Protocol) is a routing protocol used by routers to communicate on an IP network.
Examples of TCP/IP application layer interfaces include WinSock (Windows Sockets) and NetBIOS (Network Basic Input/Output System). The former is a dynamic library of functions for Windows providing an API (application programming interface), while the latter is a network access service used to connect an operating system with specific hardware.
Transport Layer
The transport layer establishes a logical connection between the devices. The transport layer protocols divide the data into segments for transmission to the lower layers. Once they reach their destination, they are reassembled into the original message, thus providing end-to-end communication. Another function of this layer is assigning port numbers to the application processes.
Its main protocols are:
- TCP (Transmission Control Protocol) is a reliable connection oriented protocol that provides end-to-end communication. This protocol establishes a TCP connection, assigns sequence and acknowledgment numbers to the packets sent and recovers lost packets. It is one of the most important and widely used TCP/IP protocols.
- UDP (User Datagram Protocol) provides an unreliable connection. As it is fast and puts little load on the network, UDP is often used for real-time applications, such as video or voice communication, where it doesn’t make much sense to recover lost packets. The only way to correct errors is to resend the entire message.
Internet Layer
The Internet layer is responsible for addressing, packaging and routing. Its task is to find the shortest path over the network to minimize the number of routers the data packets must pass through. The basic Internet layer protocols are:
- IP (Internet Protocol) is responsible for IP addressing, routing, fragmentation, and reassembly of data packets between networked devices. It is one of the most important and widely used TCP/IP protocols along with the TCP of the transport layer.
- ARP (Address Resolution Protocol) is used to map the Internet layer address to the network interface layer address (hardware address).
- ICMP (Internet Control Message Protocol) provides diagnostic functions and reports an error if the delivery of IP packets fails.
Network Interface Layer
The network interface layer, also known as the link layer, is responsible for placing packets on and receiving them from the network. It creates an interface between the host and the network hardware, providing a transmission medium over which data can travel. This layer guarantees connectivity between different types of LANs (for example, Ethernet and Token Ring) or WANs (for example, X.25 and Frame Relay). It also ensures compatibility with such technologies as Wi-Fi and ATM (Asynchronous Transfer Mode).
OSI vs. TCP/IP
The protocols of the TCP/IP suite can be described in terms of the OSI model. Both models describe how data is transmitted between devices over a network. However, there are some differences between them, each one has certain advantages and disadvantages.
Similarities:
- They are both layered models used to describe communication between devices over a network.
- Both models have application layers, albeit with different functions.
- Both models have very similar transport and network (Internet) layers.
- They are widely known and sometimes used interchangeably to describe how network communications occur.
Differences:
- OSI was developed as a theoretical model, while TCP/IP is a practical model around which the Internet was created.
- The OSI model consists of seven layers, while TCP/IP has only four.
- There are separate session, presentation and application layers in OSI, while in TCP/IP they are combined into a single application layer.
- OSI has separate data link and physical layers, while in TCP/IP they are combined into one network interface layer.
- The OSI model is considered a generic network architecture, while the TCP/IP protocol suite is a real practical solution.
- Unlike OSI, which is mainly used to describe, discuss and understand individual network functions, TCP/IP is designed to resolve specific problems rather than provide a general description of the network communication processes.Although most protocols and systems conform to it, OSI is a generic, protocol independent standard; whereas, TCP/IP is based on standard protocols which lead to the development of the Internet.
In general, both models are used interchangeably to describe communications between networked devices. Therefore, it is important to understand them to ensure network infrastructure security.
