1.HTTP request, which has several ways?
In the HTTP request, the first row must be a request line (request line), used to illustrate the type of request to access the resource, and the HTTP version.
Followed by a header (header) section, for explaining the additional information server to be used. After the header is a blank line, then this can then add any other data [called body (body)]
Eight kinds:
(. 1) is to get the data acquired from the server, the server transmits data to a post.
(2) For the form submission, the server can only be used to acquire data Get Request.QueryString submission to the data submitted by the Post manner can only be used to obtain Request.Form.
(3) In general, try to avoid using Get submit forms, because there may lead to security problems. Get example, the user inputs a user name and password in the address bar will be exposed in using the login form. But in the pager, the way you use Get better than with Post.
◆ 200 (the OK): find the resources and everything is normal.
◆ 304 (NOT MODIFIED): The resource is not any changes since the last request. This is typically used for caching browsers.
◆ 401 (UNAUTHORIZED): The client does not have access to the resources. This usually makes the browser requires the user to enter a user name and password to log in to the server.
◆ 403 (FORBIDDEN): The client failed to obtain authorization. This is usually after 401 entered an incorrect user name or password.
◆ 404 (NOT FOUND): Resources requested does not exist at the specified location.
2.TCP and UDP What are the differences?
1, TCP connection-oriented (e.g., dial-up connection is established first call); the UDP is connectionless, i.e. without establishing a connection before sending data
2, TCP provides reliable service. In other words, the data transfer connection of TCP, error-free, not lost, not repeat, and arrive out of order; UDP best effort, that does not guarantee reliable delivery
Tcp by verifying and, retransmission control, serial number identification, sliding window, reliable transmission of the acknowledgment. The retransmission control packet loss, also a mess on the order of sub-sequence control.
3, UDP has better real-time performance, higher efficiency than TCP, suitable for high-speed transmission and higher real-time communication or broadcast communication.
4. Each TCP connection is only a point; the UDP support one to one, one to many, and many-to-many interactive communication
5, TCP more demanding on system resources, UDP less demanding on system resources.
3.TCP to achieve reliable data transmission by what measures?
4. Describe in detail three-way handshake to establish a TCP connection, two handshakes okay?
- Client - sending packets with the SYN flag - a handshake - server
- Server - transmitting packets with the SYN / ACK flag - secondary handshake - Client
- Client - three-way handshake - - sent by the server with packets with the ACK flag
Two-way handshake can not, because the two sides in order to confirm their three-way handshake with each other sending and receiving is normal
The first handshake: the client can not confirm anything; the server confirmed the other party to send normal
The second handshake: The client confirmed: they send, receive normal, the other party to send, receive normal; the server confirmed: they normally receive, send each other normal
Third handshake: the client confirmed: they send, receive normal, the other party to send, receive normal; the server confirmed: they send, receive normal, the other normal transmission and reception
So three-way handshake will be able to confirm the double transceiver functions are normal, indispensable.
5. A detailed description of the process shut down four times and waved a TCP connection, why should four wave?
Disconnect a TCP connection is required "four wave":
- When the client finishes the data transfer, the control bit is set to 1 FIN, the TCP connection stop request made
- After receiving the server response thereto FIN, the TCP connection acknowledgment will be closed in that direction, 1 is set to ACK
- Server then made in the opposite direction close request, sets FIN 1
- The client requests the server to be confirmed, is set to ACK, both to the closed end.
Any party can notice of connection release after the data transfer, the wait for confirmation that enters the half-closed state. When there is no other time and then send the data, the connection release notification is issued, the person confirmed after the TCP connection is fully closed.
For example: A and B call, the call will be ended, A said, "I want to say nothing of the" B replied "I know", but B may also have to say, A can not ask follow B at their own pace to end the call, then B may well barabara that a pass, the last B said, "I'm done", a replied "I know", considered the end of this call.