Literally, one might think that TCP/IP refers to both TCP and IP protocols. In many cases, it is simply a general name for the protocol group that must be used to communicate using IP. Specifically, IP or ICMP, TCP or UDP, TELNET or FITP, and HTTP are all TCP/IP protocols. They are closely related to TCP or IP and are an essential part of the Internet. The term TCP/IP refers broadly to these protocols, and as a result, TCP/IP is sometimes called the Internet protocol family.

TCP/IP based

TCP/IP layered model

TCP/IP differs slightly from OSI in layered modules. The OSI reference model focuses on “what are the necessary functions of the communication protocol”, while TCP/IP puts more emphasis on “what programs should be developed to implement the protocol on the computer”.

Protocol layering is like modular development in computer software. Layering allows each layer to be used independently, so that changes in some layers of the system do not affect the entire system.

  • Advantages: it can construct a system with strong scalability and flexibility. Layering enables communication functions to be subdivided, making it easier to implement each layering protocol separately
  • Disadvantages: over-modularity, heavy processing, and the fact that each module has to implement similar processing logic.

The physical layer

At the bottom of TCP/IP is the hardware responsible for data transfer. This hardware is equivalent to physical layer devices such as Ethernet or telephone lines.

Data link layer

The main work of the link layer is to group the electrical signals and form data frames with specific meanings, and then send them to the receiver through the physical medium in the form of broadcast.

The network layer

The main work of the network layer is to define network addresses, distinguish network segments, address MAC addresses within subnets, and route packets from different subnets.

  • IP protocol: a protocol that sends packets across a network so that the entire Internet can receive the data. The IP protocol enables data to be sent to the other side of the globe, during which time it identifies the host using the IP address. IP also implies the functions of the data link layer. Through IP, hosts that communicate with each other can communicate regardless of the underlying data link. Although IP is also a protocol for packet switching, it does not have a retransmission mechanism. The packet is not retransmitted even if it fails to reach the peer host. Therefore, it is a non-reliable transport protocol.
  • ICMP: If an IP packet fails to reach the destination ADDRESS of the peer end due to an exception during transmission, an exception notification is sent to the sender end. ICMP was designed for this function. It is also sometimes used to diagnose the health of a network.
  • ARP: a protocol for resolving physical addresses (MAC addresses) from the IP addresses of packet packets.

The transport layer

The main work of the transport layer is to define ports, identify application program identity, and implement port-to-port communication. TCP ensures the reliability of data transmission.

  • TCP is a connection-oriented transport layer protocol. It can ensure the communication between hosts on both ends is reachable. TCP correctly handles packet loss and transmission sequence disorder during transmission. In addition, TCP can effectively use bandwidth and alleviate network congestion. However, in order to establish and disconnect, it sometimes requires at least 7 times of sending and receiving packets, resulting in wasted network traffic. In addition, to improve network utilization, TCP defines a variety of complex specifications, which is not conducive to video conferencing (audio and video data amount is set).
  • UDP protocol: Different from TCP, UDP is a connectionless transport layer protocol. UDP does not care whether the peer end actually receives the transmitted data. If you need to check whether the peer end has received packet or whether the peer end is connected to the network, you need to implement this in the application. UDP is commonly used in multimedia fields such as multicast, broadcast communication, and video communication with less packet data.

The application layer

A protocol designed and created to implement an application. Such as email protocol SMTP protocol, HTTP protocol used by Web browsers and file transfer FTP protocol and so on.

Example of TCP/IP communication

In each layer, the data to be sent is appended with a header that contains information necessary for the layer, such as the destination address to be sent and protocol-related information. Typically, the information supplied to the protocol is the packet header, and the content to be sent is data.

Send packet

Suppose a sends an email to B saying, “Good morning”. In terms of TCP/IP communication, E-mail is sent from one computer A to another computer B.

① Application processing: The application establishes a TCP connection at the moment it sends an email, and then uses this TCP connection to send data. It first sends the application data to TCP at the next layer, and then does the actual forwarding process.

(2) TCP module processing: TCP is responsible for establishing connections, sending data and disconnecting connections. The TCP header includes the source port number and the target port number (used to identify the application on the sending host and receiving host), and so on. The packet with the TCP header attached is then sent to the IP.

③IP module processing: IP packet in the IP head followed by TCP head, and then the application of the data head and data itself. The IP header contains the IP address of the receiver and the IP address of the sender. Following the IP header is information to determine whether the data following it is TCP or UDP. After an IP packet is generated, the route or host that accepts the IP packet is determined by referring to the routing control table. IP packets are then sent to drivers that connect to these routers or host network interfaces to actually send the data. If you do not know the MAC address of the receiving end, you can use ARP to search for the MAC address. If you know the MAC address of the peer end, you can send the MAC address and IP address to the Ethernet driver for data transmission.

④ Network interface processing: IP packets transmitted from IP, to the data attached to the Ethernet head and send processing. The Ethernet header contains the MAC address of the receiving end, the MAC address of the sending end, and the protocol that identifies the Ethernet data of the Ethernet type. The Ethernet packets generated based on the above information are transmitted to the receiving end through the physical layer.

When packets flow, the Ethernet packet head, IP packet head, TCP packet head (or UDP packet head) and the application’s own packet head and data are appended from front to back. Each packet header contains at least two bits of information: the addresses of the sender and receiver, and the protocol type of the upper layer.

As each protocol layer passes, there must be information that identifies the sender and receiver of the packet. Ethernet uses MAC addresses, IP uses IP addresses, and TCP/UDP uses port numbers to identify hosts at both ends.

Receiving packet

The packet receiving process is the reverse of the packet sending process.

⑤ Network interface processing: After receiving an Ethernet packet, the host first finds the MAC address from the Ethernet packet header to determine whether the packet is destined for itself. Discard data if it is not sent to its own packet. If you receive a packet that happens to be addressed to you, you look for the type field in the Ethernet packet header to determine what type of data the Ethernet protocol is sending. In this case the data type is obviously an IP packet, so the data is then passed to the subroutine that handles IP, or if it is not IP but some other protocol such as ARP, the data is passed to ARP. If the type field in the Ethernet packet header contains an unrecognized protocol type, the data is discarded.

⑥ IP module processing: after the IP module receives the IP packet header and the data part behind, it takes out the IP address in the header and matches its OWN IP address. If the IP address is consistent, it will receive the data and find the protocol of the next layer. If the upper layer is TCP, the part after the IP packet head is transmitted to TCP for processing. If it is UDP, the IP packet header is forwarded to UDP for processing. In the case of a router, the address of the receiving end is usually not its own address. In this case, you need to use the routing control table to investigate the host or router that should be sent before forwarding the data.

⑦ TCP module processing: in the TCP module, the first check sum will be calculated to determine whether the data is damaged. Then check to see if you are receiving data in sequence. Finally, check the port number to determine the specific application. After the data is received, the receiver sends an acknowledgement receipt to the sender. If the receipt message does not reach the sender, the sender thinks that the receiver did not receive the data and keeps sending it repeatedly. Once the data has been received in its entirety, it is passed to the application identified by the port number.

⑧ application processing: the receiver application will directly receive the data sent by the sender. By parsing the data, you can know that the recipient address of the mail is USER B’s address. User B can use the mail client on host B to receive and read the “good morning” E-mail sent by user A on host A.

The data link

The protocol of the data link layer defines the specification of the transmission between devices interconnected by the communication medium. Communication media include twisted pair cable, coaxial cable, optical fiber, radio and infrared media. In addition, data is sometimes transferred between devices via switches, Bridges, Repeaters, and so on. In fact, the data link layer and the physical layer are essential for data transmission between devices. Computer to binary 0, 1 to represent information, but the actual communication media between the level of voltage, light flicker and wave strength and other signals. It is the responsibility of the physical layer to convert these signals to binary zeros and ones.

The MAC address

MAC addresses are used to identify interconnected nodes in a data link. The MAC address is 48 bits long. 3 to 24 bits of the MAC address indicate the manufacturer’s identifier. Each NIC manufacturer has a unique identifier. The 25 to 48 bits are used by the manufacturer to identify each nic. In the case of a network card (NIC), the MAC address is typically burned into ROM. The MAC address of any network card is unique in the world.

Ethernet

The most famous and widely used data link is Ethernet. Its specification is simple, easy to NIC (network card) and driver implementation. Now, Ethernet has become the most compatible and future development of a data link.

Ethernet communication is generally realized by using an exclusive cable between a terminal and a switch

The front end of the Ethernet frame body is the Ethernet header, which is 14 bytes in total. The value contains six bytes of destination MAC address, six characters of source MAC address, and two bytes of upper-layer protocol type.

Immediately following the frame header is the data. The maximum range of data that can be contained in a data frame is 46 to 1500 bytes. The end of the Frame is a 4-byte Sequence called FCS (Frame Check Sequence).

The physical address of the destination workstation is stored in the destination MAC address. The source MAC address stores the physical address of the sending workstation that constructed the Ethernet frame.

The Frame Check Sequence (FCS) appears at the end of the Frame. Use it to check for frame damage. In the process of communication transmission, if the interference of electronic noise appears, it may affect the data sent and lead to the appearance of garbled code bits. Therefore, error frames that are disturbed by noise can be discarded by checking the value of this FCS field.

Wireless communication

Wireless communication usually uses electromagnetic wave, infrared, laser and other ways to transmit data. Generally in the office of the LOCAL area network within the formation of a relatively high – speed connection called wireless LAN. Wireless communication does not require network cables or other visible cables.

TCP/IP protocol

Internet Protocol (IP). As the most important protocol in TCP/IP, IP is mainly responsible for sending packets to the final target computer. Thus, IP enables communication between any two computers in the world.

The IP address

In computer communication, in order to identify the communication peer, it is necessary to have an identification code similar to an address. A MAC address is an identifier used to identify different computers on the same link.

When communicating over TCP/IP, identify the host and router by IP address. To ensure normal communication, you must configure a correct IP address for each device. In Internet communication, the world must have the correct IP address. Thus, IP addresses are like a cornerstone of TCP/IP communication.

An IP address (IPv4 address) is a 32-bit positive integer. To be processed in binary mode inside the computer. Since human society is not used to binary notation, a special notation is needed. That is, the 32-bit IP address is divided into four groups of eight bits, and each group starts with “. And convert each group of numbers to a decimal number.

Calculate the numbers represented as IP addresses as a whole:

From this calculation, up to 4.3 billion computers could be allowed to connect to the network. In fact, the IP address is not configured according to the number of hosts, but each network card (NIC) on each host has an IP address. Generally, only one IP address can be configured for a NIC. In fact, a NIC can be configured with multiple IP addresses.

Routing control

The address used to send data packets is an IP address at the network layer. However, an IP address alone is not enough to send packets to the peer destination address. Routing refers to the ability to send packet data to the final destination address. All hosts maintain a Routing Table for Routing packets to the target host. This table records which router IP data should be sent to in the next step. IP packets are transmitted over the various data links based on this routing table.

The network address part of an IP address is used for route control.

The routing control table records the network address and the next address that should be sent to the router (Win10 uses the route print command). When sending an IP packet, you must first determine the destination address in the IP packet header, then find the record with the same network address in the routing control table, and forward the IP packet to the corresponding next router according to the record.

IP Fragment processing

The biggest difference between different data links is that they have different MTU (Maximum Transmission Unit). The MTU value on Ethernet is 1500 bytes. An upper layer of IP may require more bytes of data to be transmitted than these Mtus, so mtus smaller than the packet length must be transmitted over the line.

IP Fragmentation divides a large IP packet into multiple smaller packets. The fragmented packets are then combined and passed to the upper layer after reaching the peer destination address.

IP datagrams that have been sharded can only be reassembled by the target host. Routers do sharding but they don’t reassemble.

Path MTU Discovery

Sharding also has its drawbacks. The processing load of the router increases. Second, in sharding processing, once a fragment is lost, the entire IP datagram will be invalidated.

In order to solve the above problems, a new technology “path MTU discovery” has been developed. It refers to the maximum MTU when no fragment is required between the sending host and the receiving host. It is the minimum MTU of all data links in the path. The path MTU discovers that the sending host fragments datagrams according to the path MTU size and sends them. By discovering path MTU, you can avoid fragment processing on intermediate routers and send larger packets over TCP. Today, many operating systems have implemented path MTU discovery.

The path MTU discovery works as follows:

First, the fragment prohibition flag bit at the head of the sending host is set to 1 when the sending host sends IP packets. According to this flag bit, routers on the way will not fragment large packets that need to be sharded to process, but will discard the packets.

The VALUE of the MTU on the data link is then sent to the sending host via an ICMP unreachable message.

The sending host fragments datagrams according to this MTU.

IPv6

IPv6 (IP Version 6) is a standardized Internet protocol to solve the problem of IPv4 address exhaustion. An IPv4 address contains four 8-bit bytes, that is, 32 bits. IPv6 addresses are four times as long as 128 bits, usually written as eight 16-bit bytes. The number it can represent is an astronomical 38 digits, enough to assign addresses to all hosts and routers.

The value is a hexadecimal number :FEDC: BA98:7654:3210 :FEDC: BA98:7654:3210

IPv6 sharding is performed only on the sending host, and the router does not participate in the sharding. This is also to reduce the load on the router and improve the network speed. Therefore, path MTU discovery is essential in IPv6. However, the minimum MTU of IPv6 is 1280 bytes. Therefore, for those with certain system resource constraints (CPU processing power or memory limitations, etc.) in embedded systems. The device does not need to perform “path MTU discovery”, but sends IP packets in 1280 bytes.

IPv4 first

For IP communication, IP header information must be added to data. The IP header contains all the necessary information for IP protocol packet sending control.

  • version

The value consists of 4 bits, indicating the version number of the IP header. Value is “4”.

  • Header Length (IHL: Internet Header Length)

The value consists of 4 bits, indicating the size of the IP header, in 4 bytes (32 bits). For IP packets with no options, the header length is set to 5. That is, when there is no option, the length of the IP header is 20 bytes (4×5=20).

  • TOS: Type Of Service

It consists of 8 bits to indicate the quality of service.

  • DSCP segment and ECN segment

Differential Services Codepoint (DSCP) is a part Of TOS. Used for quality control; ECN (Explicit Congestion Notification) is used to report network Congestion. ECN consists of two bits.

  • Total Length (Total Length)

Represents the total number of bytes in the IP header combined with the data part. The field is 16 bits long. The maximum length of an IP packet is 65535 bytes.

  • ID: Identification

It consists of 16 bits and is used for sharding. The id values for the same fragment are the same, but the values for different fragments are different.

  • Flags

The value consists of 3 bits, which indicates the information about packet fragmentation.

  • Fragment Offset (FO: Fragment Offset)

It consists of 13 bits and identifies the position of each segment to be sharded relative to the original data.

  • TTL: Time To Live

It consists of 8 bits. It refers to the number of routers that can be transferred (a maximum of 256 routers) to avoid infinite transmission of IP packets on the network.

  • Protocol

The value consists of 8 bits, indicating which protocol the next IP header belongs to.

  • Header Checksum

Consisting of 16 bits (2 bytes), also known as the IP header checksum. This field validates only the header of the datagram, not the data portion.

  • Source Address

The value consists of 32 bits (4 bytes), indicating the IP address of the sender.

  • Destination Address

The value consists of 32 bits (4 bytes) and represents the IP address of the receiver.

  • Padding

If optional, the header length may not be an integer multiple of 32 bits. To do this, adjust to a multiple of 32 bits by populating the field with 0.

  • Data

Store data. The IP header of the upper-layer protocol is also processed as data.

IPv6 first

  • Version

Like IPv4, it consists of 4 bits. IPv6 has a version number of 6, so the value in this field is “6”.

  • Traffic Class

The Type Of Service (TOS) field equivalent to IPv4 also consists Of 8 bits.

  • Flow Label

It consists Of 20 bits and is intended for QoS control.

  • Payload Length

The payload is the data part of the package. The Total Length (TL) of IPv4 indicates all the lengths including the header. In IPv6, however, the Playload Length does not include the header, only the Length of the data part.

  • Next Header

Equivalent to an IPv4 protocol field. It consists of 8 bits. The upper layer protocol of IP is usually TCP or UDP.

  • Hop Limit 

It consists of 8 bits. This value is the same as TTL in IPv4. Each time the data passes through the router, it is reduced by 1, and when it reaches 0, the data is discarded.

  • Source Address

It consists of 128 bits (8 16-bit bytes). Indicates the IP address of the sender.

  • Destination Address

It consists of 128 bits (8 16-bit bytes). Indicates the IP address of the receiver.

IP protocol related technologies

DNS

In the application, when a user enters a host name (domain name), DNS automatically retrieves the database that registered the host name and IP address and quickly locates the corresponding IP address. DNS is a mapping between system management host names and IP addresses.

ARP

Address Resolution Protocol (ARP) is a Protocol used to solve Address problems. Using the target IP address as a cue, it is used to locate the MAC address corresponding to the next network device that should receive data subcontracting. If the destination hosts are not on the same link, you can use ARP to search for the MAC address of the next-hop router. However, ARP is only applicable to IPv4, not IPv6.

How does ARP know the MAC address?

Assume that host A sends IP packets to host B on the same link. The IP addresses of host A and host B are 172.20.1.1 and 172.20.1.2 respectively. They do not know each other’s MAC addresses.

To obtain the MAC address of host B, host A broadcasts an ARP request packet. The ARP request packet contains host B’s IP address 172.20.1.2. Since the broadcast packet can be received by all hosts or routers on the same link, the ARP request packet is resolved by all hosts and routers on the same link. If the destination IP address in the ARP request packet is the same as its own IP address, the node inserts its MAC address into the ARP response packet and returns it to host A.

As long as you know the IP address, even if you don’t do ARP, as long as you do a broadcast on the data link can be sent to host B?” So why do you need both IP and MAC addresses?

Host A must pass through router C to send IP datagrams to host B. Even if the MAC address of host B is known, router C cannot directly send the datagram from host A to host B because the two networks are separated. In this case, host A must first send the datagram to router C’s MAC address C1.

When sending IP packets over the Ethernet, the message “which router will send the datagram next” is very important. The “next route” is the corresponding MAC address. Both IP address and MAC address are indispensable. Then there’s the ARP protocol that associates the two addresses.

If instead of using an IP address, all the hosts and nodes in all the networks in the world are connected through a MAC address. It’s impossible to know where a machine is just by looking at a MAC address. And if all the devices in the world are connected by MAC addresses, you have to send packets all over the world. Cause heavy network traffic.

RARP

The Reverse Address Resolution Protocol (RARP) is a Protocol that reverses ARP to locate IP addresses from MAC addresses. This is often used when small embedded devices such as printer servers are connected to the network.

ICMP

The main functions of ICMP include checking whether an IP packet is successfully delivered to the target address, notifying the specific reason why an IP packet is discarded during delivery, and improving network Settings.

DHCP

The Dynamic Host Configuration Protocol (DHCP) is used to automatically set IP addresses and assign IP addresses in a unified manner. With DHCP, computers can communicate TCP/IP as long as they are connected to the network.

DHCP allocates IP addresses in two ways. One is that the DHCP server automatically selects a specific IP address for allocation. Another method is to assign a fixed IP address to the MAC address. And you can use both methods together.

Transport layer protocol

TCP/IP has two representative transport layer protocols, namely TCP and UDP. TCP provides reliable traffic, while UDP is often used to give broadcast and detail control to the application’s traffic.

TCP

TCP is a connection-oriented, reliable streaming protocol. A stream is an uninterrupted data structure, which you can think of as a flow of water in a drainage pipe. TCP implements sequence control or retransmission control to provide reliable transmission. In addition, it has many functions such as “flow control”, “congestion control” and improving network utilization.

TCP achieves reliable transmission through checksum, sequence number, acknowledgement, retransmission control, connection management and window control.

Acknowledge reply ACK

When data from the sender reaches the receiving host, the receiving host returns a notification that the message has been received. The message is called a Positive ACknowLEd-INTERFACE (ACK), meaning that it has been received. Reliable data transmission through positive acknowledgement acknowledgement (ACK). After sending data, the sender waits for the peer to confirm the reply. If there is an acknowledgement reply, data has been successfully delivered to the peer end. Otherwise, the possibility of data loss is high. If no acknowledgement is received within a certain period of time, the sender considers that the data is lost and resends the data.

Retransmission control

Functions such as retransmission control and repeat control can be achieved through serial numbers. The serial number is the sequential number assigned to each byte (8-bit byte) of the sent data. The receiving end queries the serial number and data length in the TCP header of the received data and sends back the serial number to be received in the next step as an acknowledgement.

Connection management

TCP provides connection-oriented communication transport. Connection-oriented refers to the preparation work between the two ends of the communication before the data communication begins.

The normal process of establishing and breaking a TCP connection requires at least seven packets to be sent back and forth (this process is also known as the “three-way handshake” or “four-way wave”).

 UDP

UDP is an unreliable datagram protocol. In the case of UDP, while you can ensure the size of a message sent, you can’t guarantee that it will arrive.

UDP does not provide complex control mechanisms and uses IP to provide connectionless communication services. And it is a mechanism for sending data from an application to the network as it is received. UDP does not retransmit packets even if they are lost during transmission. There is no function to correct even when the arrival order of packets is out of order.

Because UDP is connectionless, data can be sent at any time. The processing is simple and efficient, and is often used in the following aspects:

  • Communication with a small amount of packets (DNS, SNMP, etc.)
  • Video, audio and other multimedia communication (instant messaging)
  • Restricted to application communication on a specific network such as a LAN
  • Broadcast communications (broadcast, multicast)

Format of UDP header

  • Source Port number 

Indicates the sending port number. The field length is 16 bits. This field is optional, and sometimes the source port number may not be set. The value of this field is set to 0 when there is no source port number. Can be used in communication that does not require a return.

  • Destination Port number (Destination Port) 

Indicates the receiving port. The field length is 16 bits.

  • Packet Length (Length)

This field stores the sum of the length of the UDP header and the length of the data, in bytes (8 bits).

  • Checksum 

Checksums are designed to provide reliable UDP headers and data.

TCP header format

TCP does not have a packet length or data length field. You can obtain the TCP packet length from the IP layer. You can know the data length from the TCP packet length.

  • Source Port number 

Indicates the sending port number. The field length is 16 bits.

  • Destination Port number (Destination Port)

Indicates the receiving port number. The field length is 16 bits.

  • Sequence Number

The field is 32 bits long. The serial number refers to the location where the data is sent

  • Acknowledgement Number

The confirmation number field contains 32 characters. Is the serial number of the data that should be received next time.

  • Data Offset

Indicates the part of the TCP packet from which the data transferred should be calculated. This field is 4 bits long and the unit is 4 bytes.

  • Reserved

This field is intended for later expansion and has a length of 4 bits.

  • Control Flag

The field length is 8 bits, and each bit is CWR, ECE, URG, ACK, PSH, RST, SYN, and FIN from left to right. These control flags are also called control bits.

  • Window Size

The field is 16 bits long. Used to inform the size (8 bits) of data that can be received from the position indicated by the confirmation reply number in the same TCP header. TCP does not allow you to send data larger than the size shown here. If the window is 0, window probes can be sent to see the latest window size. But this data must be 1 byte.

  • Checksum

The CHECKsum of TCP is similar to that of UDP, except that the checksum of TCP cannot be disabled.

  • Urgent Pointer

The field is 16 bits long. This parameter is valid only when the URG control bit is 1.

  • Options

The option field is used to improve TCP transport performance. The maximum length is 40 bytes because it is controlled by data offset (header length).

Application protocol

There are many applications that take advantage of the network, including Web browsers, E-mail, remote logins, file transfers, network management, and so on. It is the application protocol that enables these applications to perform specific communication processing. Low-level protocols, such as TCP and IP, are widely applicable and independent of upper-layer application types. An application protocol is a protocol designed and created to implement an application.

Remote login

TELNET

TELNET uses a TCP connection to send text commands to and execute them on the host. Local users operate locally as if they were directly connected to the Shell inside the remote host. TELNET is often used to log in to network devices such as routers or high-performance switches and set them accordingly

SSH

SSH is an encrypted remote login system. When you log in to TELNET, you do not need to enter the password to send the message, which may cause the risk of communication eavesdropping and illegal intrusion. SSH can be used to encrypt communication content. Even if the messages were intercepted, it would not be possible to figure out the passwords that were sent, the specific commands that were sent, or what the results of the commands were when they were returned.

The file transfer

FTP is the protocol used to transfer files between two connected computers. It uses two TCP connections: one for control and the other for data (file) transfer.

The controlled TCP connection is mainly used in the FTP control part. For example, verify the login user name and password, set the name of the sent file, and set the sending mode.

E-mail

The SMTP protocol

The Protocol that provides email services is called Simple Mail Transfer Protocol (SMTP). SMTP uses TCP protocol in its transport layer in order to send mails efficiently. After SMTP establishes a TCP connection, it controls and replies and sends data on this connection.

The POP protocol

The protocol is a protocol for receiving E-mail messages. The mail sent by the sender is forwarded to the POP server that is always plugged in according to SMTP. The client receives emails from the POP server based on the POP protocol.

The IMAP protocol

Internet Message Access Protocol (IMAP) is a Protocol for receiving emails, similar to POP. In POP, mail is managed by the client, while in IMAP, mail is managed by the server. With IMAP, you can read all your messages without having to download them from the server.

TCP/IP is the cornerstone of the Internet

reference

TCP/IP protocol