Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

TCP/IP reference model and standard protocols

We all know there is an OSI reference model, but because it came out at a time when vendors were already using TCP/IP models to build devices, the OSI reference model was generally used for learning, while the TCP/IP reference model was mainly used for actual production. In this article, we introduce the TCP/IP reference model and its standard protocols.

TCP/IP Common protocol

List from top to bottom:

At the application layer: Telnet, FTP, TFTP, SNMP, HTTP, SMTP, DNS, DHCP…

At the transport layer: TCP and UDP;

At the network layer are ICMP, IGMP, and IP;

The standard protocols on the data link layer include Ethernet, PPP and PPPOE.

The application layer

FTP: a protocol used to send files from one machine to another. It uses a Client/Server structure.

Telnet protocol: The Telnet protocol gives us the ability to have original control devices. Of course, there are also Telnet clients and Telnet servers.

HTTP protocol: Enter an address on the HTTP client, and a request is sent to the HTTP server, which then returns an HTML file for that page.

The transport layer

If data from the application layer reaches the transport layer, a transport layer header is wrapped around the data. There are two main protocols at the transport layer, TCP and UDP.

UDP\TCP packet format

In order to ensure complete data transmission, TCP adds more header data, while UDP is light and has little header data for faster data transmission.

TCP then makes a three-way handshake to connect.

After the connection is established, the TCP sequence number and confirmation sequence number are used to ensure reliable and orderly data transmission. This ensures that the data will not be lost, and even if it is lost, it will be discovered and retransmitted.

At the end of the transmission, we have to disengage the connection by waving our hands four times.

The network layer

The transport layer is mainly used to establish connections between different processes between machines, while the network layer is mainly used to transfer data from machine to machine.

Data link layer

It is located in the middle of the physical layer and the network layer and can provide services for IP and IPV6 at the network layer.

The physical layer

The physical layer is relatively simple, because the information encapsulated in this layer has been encapsulated in the previous layers. For the physical layer, the next thing to consider is passing the data out. The physical layer processes digital signals into various signals depending on the physical medium.