TCP and UDP are both transport layer protocols, which serve the communication between processes. UDP is usually used for real-time tasks with less stringent security requirements, such as IP telephony and video conferencing. However, TCP is generally used for tasks with low transmission delay but strict security requirements, such as e-mail and file transmission.
The main differences are: UDP does not need to establish a connection before transmission, while TCP must establish a connection before transmission, and release the connection after data transmission; UDP provides unreliable transport, while TCP provides reliable connection-oriented transport services. UDP overhead is less than TCP overhead.
In order to ensure their work, the network layer provides the most basic end-to-end data transmission service to the transport layer. Specific functions include grouping and unpacking, routing, congestion control and Internet interconnection.
3. What is the basic principle and workflow of 3.FTP?
FTP uses client and server modes. FTP server process can provide basic services for file transfer for multiple client processes at the same time. It uses the reliable transmission service of TCP to establish two parallel TCP connections when the client connects with the server: control connection and data connection.
The working process is as follows:
For servers:
1), open the known port (2 1) so that the client process can connect.
2) Wait for the client process to send a connection request.
3) Start the slave process to process the request sent by the client process. After the client process stops, the slave process will be terminated.
4) Return to the waiting state and continue to wait for other client processes to send requests.
For customer processes:
1), find the connection between the numerical port (2 1) and the server process, and inform the server process that its other port number is used to establish data transmission connection.
2) The server will use its own known data transmission port (20) to establish data transmission connection with the port number provided by the client process.
4. What is the basic principle and workflow of 4.HTTP?
HTTP provides a prescribed format and standard for the request and response interaction between browser and Web server. When a user clicks a mouse to connect to a document on the World Wide Web, the HTTP protocol must first establish a TCP connection with the server, which requires three-way handshake. When the first two parts of three-way handshake are completed, the World Wide Web client sends the HTTP request message to the World Wide Web server as the data of the third message of three-way handshake. After the server receives the HTTP request message, it returns the requested document to the client as a response message.
5. What is the basic principle of routing algorithm?
The principle of RIP algorithm which only provides routing information-distance vector algorithm;
Each router contains a routing table, which contains the shortest distance from the router to all networks in the autonomous system and the next hop router. And exchange routing table information of neighboring routers at a fixed time. When exchanging, update the routing table according to the following principles:
1), and add 1 to the distance field of the message sent by X.
2) For each judgment of the message sent by X:
If there is no destination network n in the original routing table, add the item to the routing table;
Otherwise, there is a network n. If the next hop of the item in the original routing table is X, the received item will be replaced by the item in the original routing table.
Otherwise, that is, the next hop is not X, then compare the two distances, if the distance of the received item is smaller, replace it, otherwise do nothing.
3) If you don't receive the updated routing table of the neighbor router within 3 minutes, please record the neighbor router as unreachable.
4), return
RIP protocol allows all routers in the autonomous system to exchange routing information with their neighbors on a regular basis, and constantly update the routing table, so as to make the route from each router to each destination network shortest.