The transport layer of TCP protocol and UDP protocol 1.TCP/ IP system includes two Protocols: TCP protocol and UDP protocol. Www.2cto.com (1) TCP protocol (Transmission Control Protocol) provides reliable end-to-end communication, which ensures that the data received by the receiver is exactly the same as the data sent by the sender and ensures that the data is not lost or error-free, at the same time, there are also traffic control and congestion control functions, so the TCP protocol is complicated and can provide services for application-layer protocols that require reliability, such as file transmission, email sending and receiving, Web browsing, remote login, etc. (2) the UDP protocol cannot ensure that data is not lost or error-free, it cannot be ensured that the recipient receives data in the same order as the sender sends data. UDP protocol is relatively simple, but highly efficient. It can provide services for applications with low reliability requirements and high real-time requirements, such as transmitting audio and video. Www.2cto.com UDP (User datasync protocol) User Datagram protocol. It only provides application process addressing and simple error detection, and does not provide other functions. UDP protocol features: (1) connectionless. (2) UDP is a best-effort service that does not provide reliable data transmission services (such as data loss, duplication, and disorder ). (3) UDP is an efficient transmission protocol. (4) UDP has no congestion control or traffic control. TCP features: (1) connection-oriented (2) Reliable Data Transmission Service (3) Traffic Control. TCP can control the rate of data sent by the process to ensure that the other end is not overwhelmed by a large amount of data and overflow occurs. (4) Provide congestion control. When the network is congested, TCP can reduce the rate and quantity of data injected into the network and relieve the congestion. (5) provides full duplex communication. TCP provides two-way data transmission services. TCP allows the application processes of both parties to send data at any time. Both ends of the TCP connection have a sending cache and a receiving cache, which is used to temporarily store two-way communication data. (6) TCP is for byte streams. The "stream" in TCP refers to the byte sequence that flows into or out of the process. 2. What is the principle of program locality? The principle of program locality is that programs tend to use recently used data and commands, that is, the distribution of memory addresses accessed during program execution is not random, but relative cluster set; this cluster consists of commands and data.
Program locality includes the time locality of the program and the space locality of the program.
1. Program time locality: the information that the program will use may be the information currently in use.
2. spatial locality of a program: the information that the program will use may be adjacent to or near the information currently in use.
The principle of program locality is one of the foundations of computer architecture design. 3. List storage layers on a computer by access speed