In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
The TCP/IP protocol set includes the application layer, the transport layer, the network layer and the network access layer.
The application layer includes:
Hypertext transfer Protocol (HTTP): the basic protocol of the World wide Web.
File transfer (TFTP simple File transfer Protocol):
Remote login (Telnet), which provides remote access to other hosts, allows users to log in to internet hosts and execute commands on this host.
Network management (SNMP simple Network Management Protocol), which provides methods for monitoring network devices, as well as configuration management, statistics collection, performance management and security management.
Domain name system (DNS), which is used to convert domain names and their public broadcast network nodes into IP addresses in internet.
Secondly, the network layer includes:
Internet Protocol (IP)
Internet Control Information Protocol (ICMP)
Address Resolution Protocol (ARP)
Reverse address Resolution Protocol (RARP)
Finally, the network access layer: the network access layer is also known as the host to network layer (host-to-network). The functions of the network access layer include the mapping of IP addresses and physical address hardware, and the encapsulation of IP into frames. Based on different hardware types of network interfaces, the network access layer defines the connection to the physical media.
Differences between TCP/UDP protocols
TCP (Transmission Control Protocol, Transmission Control Protocol) is a connection-oriented protocol, that is, a reliable connection must be established with the other party before sending and receiving data. A TCP connection can only be established through three "conversations". The process is very complicated. Just briefly describe the simple process of these three conversations: host A sends a connection request packet to host B: "I want to send you data, okay?" This is the first conversation; host B sends a packet to host An agreeing to connect and requesting synchronization (synchronization is two hosts, one is sending and the other is receiving, coordinating work): "Yes, when will you send it?" This is the second conversation; host A sends another packet to confirm host B's request for synchronization: "I'll send it now, you take it!" This is the third dialogue. The purpose of three "conversations" is to synchronize the sending and receiving of data packets. After three "conversations", host A formally sends data to host B.
TCP three-way handshake process
1 Host A sends host B a data segment containing the flag bits of the synchronization sequence number to host B, and requests the establishment of a connection from host B through this data segment
Host A tells host B two things: I want to communicate with you; which serial number you can use as the starting data segment to respond to me.
2 after receiving the request from host A, host B responds to host A with a data segment with acknowledgement reply (ACK) and synchronization sequence number (SYN) flag bits, and also tells host A two things:
I have received your request, you can transfer the data; which serial number are you going to use as the starting data segment to respond to me
3 after host A receives this data segment, it sends a confirmation reply confirming that it has received the data segment of host B: "I have received the reply, and I am going to start transmitting the actual data now."
In this way, 3 handshakes are completed, and host An and host B can transfer data.
Characteristics of 3-way handshake
There is no application layer data.
The SYN flag will be set to 1 only when TCP builds a production connection.
The SYN flag bit is set to 0 after the handshake.
TCP four-time disconnection process
1 when host A completes the data transmission, set the control bit FIN to 1 and make a request to stop the TCP connection
2 Host B responds to the FIN after receiving it, confirms that the TCP connection in this direction will be closed, and sets the ACK to 1.
(3) the request for shutting down in the opposite direction is made by the B side, and the FIN is set to 1.
Host A confirms the request of host B, sets the ACK to 1, and ends the shutdown in both directions.
From the three-way handshake and four disconnections of TCP, it can be seen that TCP uses connection-oriented communication mode, which greatly improves the reliability of data communication and makes the sending data side.
There is interaction between the receiver and the receiver before the formal data transmission, which lays a reliable foundation for the formal data transmission.
Noun interpretation
One of the control bits of the ACK TCP header to confirm the data. The acknowledgement is sent by the destination, which is used to tell the sender the segment before the sequence number.
All have been received. For example, if the confirmation number is X, it means that all the previous Xmure segments have been received. Only when ACK=1, the confirmation number is valid. When ACK=0, the confirmation number is invalid, and then the data will be retransmitted to ensure the integrity of the data.
SYN synchronizes the serial number, which is the location 1 when TCP establishes the connection.
The FIN sender completes the sending task bit. When the TCP completes the data transmission and needs to be disconnected, it is proposed that the disconnected party will replace this position 1.
The header structure of TCP:
Source port 16-bit
Target port 16-bit
Serial number 32 bits
Response serial number 32-bit
TCP head length 4 digits
Reserved 6-bit
6-bit control code
Window size 16 bits
Offset 16 bit
Checksum 16-bit
Option 32-bit (optional)
So we get the minimum length of the TCP header, which is 20 bytes.
UDP (User Data Protocol, user Datagram Protocol)
(1) UDP is a connectionless protocol. Before transmitting data, the source does not establish a connection with the terminal. When it wants to transmit data, it simply grabs the data from the application and throws it onto the network as soon as possible. On the sending side, the speed at which UDP transmits data is only limited by the speed at which the application generates data, the ability of the computer, and the transmission bandwidth; at the receiving end, UDP puts each message segment in the queue, and the application reads one message segment from the queue at a time.
(2) since the transmission data does not establish a connection, there is no need to maintain the connection state, including the transceiver status, so a server can transmit the same message to multiple clients at the same time.
(3) the title of the UDP packet is very short, only 8 bytes, and the extra overhead compared to the 20-byte packet of TCP is very small.
(4) the throughput is not regulated by the congestion control algorithm, but only limited by the data rate generated by the application software, the transmission bandwidth, and the performance of the source and terminal hosts.
(5) UDP uses best effort delivery, that is, reliable delivery is not guaranteed, so the host does not need to maintain a complex link state table (which has many parameters).
(6) UDP is message oriented. The message handed over by the sender's UDP to the application is delivered down to the IP layer after the header is added. Neither split nor merge, but retain the boundaries of these messages, so the application needs to choose the appropriate message size.
We often use the "ping" command to test whether the TCP/IP communication between the two hosts is normal. In fact, the principle of the "ping" command is to send UDP packets to the other host, and then the other host acknowledges the receipt of the data packet. If the message of whether the packet has arrived is fed back in time, then the network is open.
Summarize the difference between TCP and UDP:
1. Connection-based and connectionless
two。 Requirements for system resources (more TCP, less UDP)
The structure of 3.UDP program is simple.
4. Stream mode and Datagram mode
5.TCP guarantees data correctness, UDP may lose packets, TCP guarantees data order, UDP does not.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.