Interview common problem of computer network

1 TCP and UDP contrast?

  • Connection-oriented TCP, UDP not required for non-connection that is established before sending the data link;
  • Byte stream oriented TCP, UDP datagram-oriented;
  • TCP provides reliable services (data transmission), UDP use a best effort delivery, does not guarantee reliable delivery;
  • TCP provides reliable transport services. Error-free data transmission, are not lost, will not be repeated, arrive in order;
  • TCP flow control, congestion control, and so on;
  • TCP-one support, UDP support one-to-many-many interactive communication;

2, TCP three-way handshake and four waving process

 

3, POST and GET contrast?

  • get is to obtain data from the server, post the data is transmitted to the server
  • GET URL is added to the parameter data queue to submit the form referred to in the ACTION attribute, and the value of the respective fields correspond form, it can be seen in the URL. post through HTTP post mechanism to various fields with its contents is placed in a form HTML HEADER URL address transmitted with the ACTION attribute refers. Users do not see this process. 
  • For get way, the server side with Request.QueryString variable value acquisition for post embodiment, the server acquires data submitted by Request.Form
  • Get the amount of data transfer is small, not greater than 2KB. Post large amount of data to be transmitted
  • get security is very low, post high security

 

4, the tour input a URL to receive an intermediate response protocol involved?

1 check cache
2 DNS resolve
3 ip access
4 establish tcp connection
5 rounds http data
6 to accept the data and parse http
7 close
 
 

5, HTTP status code

  • 100-199 is used to specify the corresponding client should certain actions. 
  • 200-299 is used to indicate the request was successful. 
  • 300-399 for the file has been moved and the new address often contains the specified header information in the positioning information. 
  • 400-499 is used to indicate a client error. 
  • 500-599 used to support server error. 

 

6, HTTP and HTTPS difference? 

Http protocol runs on top of TCP, clear text transmission, the client and the server can not verify the identity of the other; Https is wearing SSL (Secure Socket Layer) Http shell, run on SSL, SSL runs on top of TCP, is add HTTP encryption and authentication mechanisms. Following differences exist between the two:

Different ports: the use of different Http and Http connection, a port are not the same, the former is 80, which is 443;

Resource consumption: comparison and HTTP communications, Https communication due to adhesion subtraction process consumes more CPU and memory resources;

Cost: Https communication needs certificates which the certification body to the general need for later; 
  
encryption Https is an encryption mechanism and mixing with a shared key encryption and public key encryption.

1 check cache
2 DNS resolve
3 ip access
4 establish tcp connection
5 rounds http data
6 to accept the data and parse http
7 close
 
 

5, HTTP status code

  • 100-199 is used to specify the corresponding client should certain actions. 
  • 200-299 is used to indicate the request was successful. 
  • 300-399 for the file has been moved and the new address often contains the specified header information in the positioning information. 
  • 400-499 is used to indicate a client error. 
  • 500-599 used to support server error. 

 

6, HTTP and HTTPS difference? 

Http protocol runs on top of TCP, clear text transmission, the client and the server can not verify the identity of the other; Https is wearing SSL (Secure Socket Layer) Http shell, run on SSL, SSL runs on top of TCP, is add HTTP encryption and authentication mechanisms. Following differences exist between the two:

Different ports: the use of different Http and Http connection, a port are not the same, the former is 80, which is 443;

Resource consumption: comparison and HTTP communications, Https communication due to adhesion subtraction process consumes more CPU and memory resources;

Cost: Https communication needs certificates which the certification body to the general need for later; 
  
encryption Https is an encryption mechanism and mixing with a shared key encryption and public key encryption.

Http protocol runs on top of TCP, clear text transmission, the client and the server can not verify the identity of the other; Https is wearing SSL (Secure Socket Layer) Http shell, run on SSL, SSL runs on top of TCP, is add HTTP encryption and authentication mechanisms. Following differences exist between the two:

Different ports: the use of different Http and Http connection, a port are not the same, the former is 80, which is 443;

Resource consumption: comparison and HTTP communications, Https communication due to adhesion subtraction process consumes more CPU and memory resources;

Cost: Https communication needs certificates which the certification body to the general need for later; 
  
encryption Https is an encryption mechanism and mixing with a shared key encryption and public key encryption.

Guess you like

Origin www.cnblogs.com/wylwyl/p/10988273.html