The TCP/IP model, whose origins date back to the 1970s, is also called the protocol model. It is...
The TCP/IP model, whose origins date back to the 1970s, is also called the protocol model. It is designed to define how communication in a network is managed on the basis of protocols in successive layers. This means that devices forming a network, regardless of the operating system used, for example, can communicate with each other. Their communication flow looks the same or similar.
Reading about the TCP/IP model you will come across information about the ISO/OSI model. It should be remembered that this is a theoretical model that covers each of the layers of the TCP/IP model. This means that it points the way in the design of network communications. It is important to know the nomenclature from the ISO/OSI model in order to efficiently navigate through documentation that already refers to its specific layers.
Data transmission in the TCP/IP model can be described as follows:
Each layer consists of protocols that set strict rules for communication between successive layers. However, this does not mean that one protocol per layer. For example, the application layer can use DNS and HTTP protocols simultaneously.
Although the protocols work together, they do not care what their master/slave layer does, but only know how to pass the data they are responsible for.
This is the first of the layers, allowing programs and applications to encode data into the appropriate format, which is then passed on to the next layer. Network sockets (internet sockets) are used for this.
When we talk about a network socket, we mean a unique object formed by an Internet address, a communication protocol (from a lower layer) and a port number. The socket itself should not be thought of as a connection, but as an endpoint of a specific connection that provides the ability to transmit and receive data between two different computers. In the following example connect(mysocket, address = "1.2.3.4", port = "80") send(mysocket, "Hello, world!") close(mysocket)) copied beastly from wikipedia, we can see the creation of a network socket object, followed by the transmission of a string through it and the closing of the endpoint.
Socket mysocket = getSocket(type = "TCP")
connect(mysocket, address = "1.2.3.4", port = "80")
send(mysocket, "Hello, world!")
close(mysocket)
We may be confused by the keyword "connect," which suggests that the socket itself is a connection rather than an access point. This has become the subject of discussion, which in a nutshell is due to the misuse of terminology in programming libraries. Nevertheless, we encourage you to visit and read source .
The port number that makes up the socket object depends on the application layer protocol you want to use. Among the most well-known are:
Each application, depending on the protocols used, names the data structures used in the following application layers differently. The TCP protocol (not to be confused with the TCP/IP model in question) of the transport layer describes the data within it as a segment, while the UDP protocol calls it a datagram. Such data, regardless of its name at the transport layer, gets split into smaller parts, which are sent to the Internet layer with an additional header attached.
The most important transport layer protocols include: TCP, UDP, SCTP, DCCP and RSVP. For the purposes of this article, we will only look at two of them. We'll start with the TCP protocol, which provides a connection between parties through a three-way handshake procedure. What does it look like?
TCP A TCP B
1. CLOSED LISTEN
2. SYN-SENT --> <SEQ=100><CTL=SYN> --> SYN-RECEIVED
3. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
4. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK> --> ESTABLISHED
5. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK><DATA> --> ESTABLISHED
The multitude of abbreviations can make it difficult to understand, but after a few approaches it gets easier ???? From the description above we can extract the two most important features that the TCP protocol has. These are:
The TCP header attached to the message transmitted to the next layer has from 20 to 60 bytes, and its size depends on the optional information entered. Application layer protocols that use TCP include: HTTP, HTTPS, FTP or SMTP.
UDP protocol - is responsible for data transfer without establishing a permanent connection. In addition, it does not provide reliability and ordering of datagrams (equivalent to a segment). As a result, we lose out on the certainty of whether the datagram will arrive, and the transmitted data are independent of each other. Ensuring reliability, however, can be achieved on the application side. In addition, the UDP datagram has only 8 bytes and is much faster than the TCP protocol. So we will use it wherever segment loss does not significantly affect the received information, such as in listening to audio or watching video. UDP is also used for DNS queries by the small size of the transmitted requests and the lack of load on the queried DNS servers.
The main task of the Internet layer is to route packets between successive hosts on the network. Routing (routing) means choosing the most optimal route. The Internet layer also includes routers (also called nodes), which are network devices that connect physical networks. Routers route packets using the IP addresses of the sender and receiver found in the header and routing tables built dynamically. We will already focus on routing itself in a separate article. In order to preview a route with a destination, we will use the command:
traceroute website.com
The most well-known Internet layer protocol is the IP protocol (that's actually how we should write the IPv4 and IPv6 protocols, which differ in version). It is designed to transfer data from one computer to the next. It is worth remembering that the IP protocol is not reliable. On the other hand, using the TCP protocol from the previous layer, the whole thing becomes reliable.
When using one of the IP protocols, there is the creation of smaller datagrams (packets) from those received at the Internet layer.
The network access layer has the task of delivering data packets to other devices on the directly connected network.
WAN technology protocols such as Frame relay and ATM were created to take advantage of the existing telecommunications circuits of their day. Ethernet at the time was limited and not mature enough to replace WAN technology. Today, the Ethernet protocol is used almost everywhere.
So, when using the Ethernet protocol - at the level of the network access layer, IP datagrams are encapsulated into frames, which are then transmitted across the network. In addition, the source address of the network access layer and the address of the destination network access layer (for example, the MAC address) are added to the frame.