History

The TCP/IP protocol stack (Transmission Control Protocol/Internet Protocol) is a network model that describes the process of transmitting digital data. It is named after the two main protocols, and the global Internet is built according to this model. The network model was developed with the assistance of the US Department of Defense, so the TCP/IP model is sometimes called the DoD (Department of Defense) model.

Model structure

  1. Link Layer
  2. Internet Layer
  3. Transport Layer
  4. Application Layer

TCP/IP structure


Application Layer

In the TCP/IP model, the Application Layer combines three layers of the OSI network model: Session, Presentation, and Application. At the application layer, communication sessions between hosts are maintained, transmitted data is transformed, and interaction with the end user and the network takes place. Data formatting and presentation functions are delegated to libraries and application programming interfaces (APIs): a kind of base containing information about how applications interact with each other. When services or applications call a library or API, they receive in response the set of actions needed to perform a task and complete instructions on how those actions should be performed.

Application-layer protocols operate for most applications. They provide services to the user or exchange data with lower layers over already established connections. Most applications have their own protocols here.

  • Protocols: HTTP, SMTP, FTP, DHCP.

Transport Layer

The Transport Layer takes responsibility for controlling packet delivery. TCP and UDP operate at this layer. The first establishes a connection between two hosts and guarantees complete delivery of information. If part of the information is lost during transmission, the protocol requests it again, so the recipient has the complete data package assembled in the correct order. The process is described in more detail in the note logical TCP connections.

UDP does not establish a connection between hosts; it transmits standalone datagrams. Some of them may be lost during transmission, and information integrity is not checked. UDP is used when it is necessary to reduce network load and when losing some portion of information is not critical for the recipient, for example during streaming video playback.

Internet Layer

The Internet Layer is responsible for connecting local networks into a global one. It is also responsible for host addressing, packet encapsulation, and routing functions. The main protocols of the network layer are IP, Address Resolution Protocol (ARP), Internet Control Message Protocol (ICMP), and Internet Group Management Protocol (IGMP).

IP is a routable protocol responsible for IP addressing, routing, fragmentation, and packet reassembly. ARP is responsible for discovering a network access layer address, such as the hardware address associated with a given Internet-layer access. ICMP is responsible for providing diagnostic functions and error reports for failed IP packet delivery. IGMP is responsible for managing IP multicast groups. At this layer, IP adds a header to packets known as the IP address. IP can be represented in two formats: IPv4 and IPv6, which are not compatible with each other.

  • IPv4 has a format of four blocks of numbers from 0 to 255 separated by dots.

  • IPv6 uses 128-bit addresses consisting of eight blocks separated by colons; address notation allows abbreviations according to specific rules.

The IP protocol determines the location of devices by their IP addresses, builds the shortest paths to them, and divides data into packets. To determine where the recipient is located and how to build a path to it, IP queries the DNS system. Once the address is obtained, the transmitted file is split into small parts: packets. They contain data fragments and service information, such as the IP addresses of the sender and recipient.

This routing is based on IP access using a subnet mask. If data must be transmitted within one local network, packets are sent directly by IP, and in that case using a mask is not required. The purpose of the subnet mask is to help the router determine which host should receive the data and how to transmit it. A data packet may travel through several routers until it reaches the recipient.

The IP protocol is intended to identify the addressee, but it does not guarantee data integrity. IP encapsulates other protocols such as ICMP and IGMP. The first is used to transmit error messages during communication attempts between different hosts. The second groups network devices for transmitting information only to the computers that requested it.

  • Protocols: IP, ICMP, IGMP, ARP

In the TCP/IP model, the Link Layer combines two layers of the OSI network model: Data Link and Physical.

The Link Layer describes how data packets are transmitted through the physical layer and determines how information will be transmitted from one device to another.

The Link Layer is sometimes divided into two sublayers: LLC and MAC:

  • The MAC layer is responsible for controlling how devices on a network gain access to media and permission to transmit data.

  • The LLC layer is responsible for identifying and encapsulating network-layer protocols, as well as controlling error checking and frame synchronization.

The Link Layer establishes a physical connection between devices on a local network using radio waves and/or wires. Information is encoded here, divided into packets (frames), and transmitted between devices. Each frame contains part of the transmitted information and service data. To understand where to send frames, link-layer addressing is used: MAC addresses. These are unique physical device addresses, and link-layer protocols use them to identify senders and recipients.

  • Protocols: Ethernet, Wi-Fi, Bluetooth.

Comparison of encapsulation and models

Below are diagrams comparing the OSI and TCP/IP models, as well as the data encapsulation processes:

OSI and TCP/IP comparison

Encapsulation process

Layers and data