What is TCP/IP: key features

TCP/IP (Transmission Control Protocol/Internet Protocol) is a set of rules and standards that define how devices exchange information on a network.
Unlike the theoretical OSI (Open Systems Interconnection) model, which divides communication into 7 levels, TCP/IP uses 4:

link layer,
Inter-network/network layer (IP),
transport layer (TCP/UDP),
application layer (application layer).

Although both models describe the interaction between devices on the network, they arose independently of each other and have a unique structure and purpose.

The OSI model, like the TCP/IP model, covers all aspects of communication, but due to its complexity and academic nature, it has not been widely applied in practice.

And thanks to its flexibility and efficiency, the TCP/IP stack has become the backbone of the modern Internet. However, some instructions and documentation quite often prefer to describe systems from the point of view of OSI, since it remains the main one in the study of theory, carrying an educational function.

What are their connections and differences?

  • OSI is an attempt to create a universal standard with strict differentiation of functions. TCP/IP is the result of practical adaptation based on engineering solutions developed in real conditions.
  • OSI was developed in parallel with the growth of the Internet, where the TCP/IP stack was already implemented and therefore dominated. Attempts to replace it with the OSI model failed because new protocols (for example, CLNP instead of IP) were not supported.
  • OSI assumed centralized standardization, while TCP/IP was based on decentralized, “trial” solutions (for example, separation of tasks between IP and TCP).
  • TCP/IP turned out to be easier to implement and scale, and its protocols, like HTTP and FTP, took over the functions that individual layers performed in OSI, for example, representative or session.

The main differences

Number of layers7 (there are such levels as session, representative, etc.)4 (expanded layers that include functions of several OSI layers)
AppointmentA theoretical model for learningThe working stack of network protocols
Protocols (examples) CLNP,
  ES-IS, TP0/TP4
 IP,
  TCP, UDP, HTTP, DNS
AddressingComplex Addresses (NSAP)Simple IP Addresses
Error handlingAt each levelBased on the transport layer (TCP)

How TCP/IP works

The TCP/IP architecture is described in the RFC 1122 standard, which is one of the many IETF technical documents that regulate the operation of the Internet.

In this standard, the TCP/IP model consists of four levels. Although, for example, Andrew Tanenbaum in the book “Computer Networks” divides the lower level into two — channel and physical.

The main tasks of the TCP/IP stack

  • Information fragmentation: Data is split into packets for easy transmission.
  • Routing: Choosing the optimal route between sender and receiver.
  • Integrity check: Correcting errors and retransmitting lost data.
  • Connection management: installation, maintenance and termination of communication between nodes.

TCP/IP Model Levels

As noted above, the TCP/IP model consists of four main levels, each of which performs specific functions.:

Channel level

It is responsible for data transmission within a single physical network or a separate segment of it. It regulates how devices interact with a transmission channel, such as Ethernet or Wi-Fi. Detects and corrects errors that occur during transmission at the physical layer. The main tasks of the channel layer:

–

  • Frame creation: Information is grouped into structured units — frames (LLC, HDLC, PPP, Ethernet protocols, etc.) — for sending through a physical medium. An addressing system is used, where MAC addresses serve as device identifiers.
  • Access to the environment: Mechanisms are installed that determine the order in which devices are able to transfer data, which helps to avoid conflicts during simultaneous transmission. The channel layer is also responsible for the correct delivery of frames to the recipient. Among the protocols at this level: ARP — maps IP addresses to MAC addresses.
  • Data integrity control: Verification methods are used, such as checksum calculation, to detect corrupted data during transmission.

The inter-network layer

The layer, which is also called the network layer, is responsible for moving packets between different networks. It is based on the IP protocol, which provides routing and unique addressing of devices. Key functions of the inter-network layer:

  • Device identification: Each device on the network is assigned a unique IP address to uniquely identify its position in the overall network structure.
  • Routing: Determines the optimal route for packets to travel from the sender to the recipient, taking into account possible transitions through different networks.
  • Fragmentation and recovery: If necessary, large packets are split into smaller parts for transmission and recreated in their original form on the receiver side.

In other words, local area networks are being combined into a large—scale global infrastructure, through which information is transmitted between devices through backbone and edge routers. It is at this stage that IP addresses and subnet masks become important.

  • The subnet mask helps determine if the device belongs to the same network as the sender. If the recipient is located within the same subnet, the packet is delivered directly. Otherwise, the data is transmitted through a chain of routers until it reaches the desired destination.
  • IP Protocol (Internet Protocol) It plays a key role in determining by the router which subnet the target device belongs to. Each device connected to the network has its own unique IP address, and on the Internet, having two devices with the same IP address is unacceptable. There are several versions of the IP protocol, the first of which was the widely used IPv4.

Due to the growing number of IPv4 connections, there are not enough addresses: they have to be released from unused devices or bought on specialized exchanges.
To solve the problem, the IPv6 standard was developed in 1998, in which the address is increased to 128 bits. This allows you to create 212,000 different addresses, a number so large that it will be enough even with the largest network growth. But now it is still impossible to say that the Internet is ready for the full use of IPv6.

In addition to IP, other protocols are used within the framework of the inter-network layer to provide auxiliary functions.:

  • ICMP (Internet Control Message Protocol) is designed to transmit error messages and other diagnostic information between devices on the network. It helps routers and hosts to report problems with packet delivery, such as the unavailability of the destination. User applications do not directly use ICMP, with the exception of network utilities such as ping or traceroute, which are used for diagnostics. It is important to note that ICMP does not transfer user data, unlike TCP and UDP at the transport layer. To work with IPv6, there is a separate version of the protocol — ICMPv6.
  • IGMP (Internet Group Management Protocol) is used to manage group connections in IPv4 networks. It allows devices to request data intended for a specific group, for example, in the case of streaming video or participating in multiplayer games. In IPv6 networks, the MLD (Multicast Listener Discovery) protocol embedded in ICMPv6 performs similar functions.

Transport level

At this level, reliable information delivery between network devices is ensured. The key protocols here are TCP and UDP (User Datagram Protocol).

There are unavoidable risks of loss during data transmission, but not all types of information are equally sensitive to this. Thus, the loss of several characters in a text document can significantly distort its content, while the loss of a couple of frames from the video stream is unlikely to be noticeable to the viewer. Therefore:

  • TCP is used when the integrity of the delivered packets is important and a response is expected to verify it.
  • In UDP, integrity is not important, no response packet is expected, which ensures speed.

The main tasks of the transport layer:

  • connection management: organization, maintenance and correct termination of connections between network nodes,
  • transmission rate control: regulating the data flow to prevent overloading of channels and receiving devices,
  • error detection and correction: using integrity control methods, including checksums and resending corrupted packets.

The application layer

Programs that are accessed over the network work at this level. The simplest example is a web server that displays the contents of the server as a website in the browser.

Application layer functions:

  • creating interfaces for applications: providing standard methods that allow programs to connect to network resources,
  • session management: monitoring the start, maintenance and correct completion of data exchange sessions between applications,
  • formatting and preparing data: converting information into a format suitable for transmission over the network and subsequent processing on the recipient’s side.
    In the TCP/IP architecture, applications interact with the transport layer via TCP or UDP protocols, but they do not require a deep understanding of the structure of the transmitted data — applications focus only on the IP address and port number.

IP, ports, and sockets: how apps find each other

Although unique IP addresses are assigned to devices at the internetwork level, in practice, data is exchanged not between machines, but between specific applications running on these devices.

An IP address alone is not enough to correctly identify a specific application on a device. The port number is additionally used for this purpose. Together, the IP address and port form a so-called socket, a unique “entry point” through which applications exchange data.

It is through sockets that the vast majority of network communications take place, whether it’s downloading a website, sending mail, or streaming video.

The word “socket” is often used as a synonym for “host” or “user”. In addition, a socket is called a processor connection socket, and in UNIX systems there are socket files that work according to a similar scheme, but use the file name instead of the IP address and port.

Each application at the application layer uses its own protocol for data exchange and a port number assigned to it for accessing the network. To avoid conflicts and confusion, the IANA (Internet Assigned Numbers Authority) is responsible for the allocation of ports on the global Internet. This organization sets IP address ranges and assigns ports to popular network services.

This does not oblige you to use the specified port for applications, but changing this parameter to another one will require additional settings. They are needed so that the devices on the other side can properly “access” yours by specifying the right port for the right application, since by default they will use exactly the ones that IANA has defined.
Examples:

  • Mail applications use port 25 (SMTP protocol) for sending.
  • For receiving mail, port 110 (POP3 protocol) is used.
  • Web servers display content (sites, for example) according to the HTTP protocol, port 80.
  • File transfer via FTP protocol is port 21.

The port is often indicated after the IP and separated from it by a colon, for example, it looks like this: 182.68.75.102:80.

Another important port, 53, is reserved for the domain name service, DNS. It converts alphabetic names of network domains into numeric IP addresses and vice versa, and saves us from having to memorize the numbers of IP addresses. Instead, the system independently polls the domain name’s IP address by sending a request to port 53 of the DNS server from the network settings.

Converting symbolic addresses to IP

Since we have raised the topic of DNS in the context of the TCP/IP model, which fully describes how the global network works, it is important to mention what ordinary users face. It’s easier for people to remember symbolic names (for example, google.com ) than numeric IP addresses. This is exactly what the domain name system (DNS, Domain Name System) exists for. When the user enters the URL in the browser, the following process occurs:

The browser checks the cache for the corresponding IP address.

If there is no data, the request is sent to the local DNS server.

If the local DNS does not contain the necessary information, the request is transmitted to the higher DNS server.

After receiving the IP address, the browser establishes a TCP/IP connection to the server.

DNS greatly simplifies working with the Internet, making it more convenient and accessible to users.

The TCP/IP model has become the basis for building a global Internet due to its practicality and modularity. Unlike OSI, it not only theoretically describes, but also practically implements the entire mechanism of communication between network devices, covering the entire data transmission cycle: from the physical environment to application interaction.

Knowledge of the principles of TCP/IP helps not only in understanding how the Internet works, but also in solving real-world network administration and diagnostics tasks.