Computer network interview questions

Computer network interview questions

1. seven networks and TCP / IP four-layer structure
Here Insert Picture Description
1.1 Physical Layer: Transparent transmitted bit stream, ignoring differences between different devices
1.2 data link layer: the physical layer data encapsulated in a frame
1.3 Network layer: routing operations, IP protocol layer where
1.4 transport layer: TCP and UDP layer where
1.5 session layer: establishing a connection between devices, https SSL in the layer where
1.6 represents layer: the above data indicates the computer can understand, including data compression and decompression, and the like etc.
1.7 application layer: communication between processes

Data structure 2. IP datagram
Here Insert Picture Description
3. TCP and UDP data structures
Here Insert Picture Description
3.1 original port: 16bit, be noted that the sender port number in the range 0-65535
3.2 destination port: 16bit, noted, recipient port number, in the range of 0-65535
3.3 data number: seq is the sequence number of the current transmission data is the first data byte sequence number, the number is assumed that X
3.4 acknowledgment number: ack acknowledgment is sent to the sender of the data number, if the data number is x, then the next time when the confirmation sent to the sender of the last acknowledgment sequence number X + 1 = ACK
3.5 of deviation:
3.6 reserved: not used
3.7 U: URG, emergency field value of 1 indicates an emergency packet transmitted in the network should give priority to
3.8 A: ACK, acknowledgment number, a value of 1, the current data packet payload
3.9 P: PSH
3.10 R & lt: the RST, 1 indicates a TCP connection error, should reconnect
3.11 SYN: value 1 represents a three-way handshake initiated three-way handshake acknowledgment or, (when only the first two-way handshake = 1 the SYN)
3.12 the FIN: a value of 1 indicates that the packet is closing the connection request packet
3.13 window field: transmitting other traffic control window
3.14 school bag and inspection:
3.15 Urgent Pointer:
3.16 selectable options:
3.17 filling:
3.18 User data: user data
Here Insert Picture Description

4. Network packet encapsulation Analysis
Here Insert Picture Description

The three-way handshake
Here Insert Picture Description
5.1 client set SYN = 1, and the current data number is X
5.2 server receives the returned data packet, is set SYN = 1, and the current data number is y, and checking the client data, and generating an acknowledgment number No. ack = x + 1, and ACK = 1 indicates that the current packet payload
5.3 client receives the packet again, this time SYN = 0 (no longer important), the server checks the data ID number and generating an acknowledgment ack = y + 1, and the current data sequence number x + 1, ACK = 1


5.4 Why not two-way handshake: If it is two-way handshake to establish a connection. Assume that the client sends the first request, but due to network problems, the request stranded in the network, and the client server delays acknowledgment packets sent by the client believes that this package is not passed to the server, it is also resend request. But then server receives the first request packet, and give the client confirmed. But the client's second request packet has arrived at the server, then the server believes a new connection request, and this has led to more problems. In fact, I feel like a three-way handshake in repair TCP bug / IP protocol data structure, if the TCP / IP data structure and then some of the details, you may not need a three-way handshake.

6. Four Wave
Here Insert Picture Description
6.1 client close request, transmits a packet FIN = 1, and u is the current data number
received this packet services 6.2 termination, but may give the data passed by the client end of the service has not been completed, There now follows a client retransmission data, the ACK =. 1, SEQ = V, ACK = U +. 1
6.3 server has to the client is transmitted over all of the data, and now sends an acknowledgment Shutdown packet, FIN = 1, seq = w , ACK = 1 , ack = u + 1 (constant)
6.4 client receives the acknowledgment packet server is closed, the ACK =. 1, SEQ. 1 = U +, W +. 1 ACK =
6.5 then the client enters TIME-wAIT, wait for two packets Wen time, because at the time of sending the last ACK = 1 package, at least and at most two packets after time, all of the four-way handshake package will completely disappear in the network

7. Enter a URL in the browser when what happened

First, enter the URL 7.1
7.2 because input is a URL instead of IP, so the browser will first look for the cache, there is no corresponding IP URL
7.2.1 lookup cache are: browser caching DNS; system cache (host) file inside mapping; router cache; ISP cache, recursive search etc.
7.3 browser sends an http request (GET) to the web server
7.4 server gives a correct redirect address, specified the correct URL to access the
7.5 browser sends another a proper request (GET)
7.6 server processes the request
7.7 returns the response HTML
7.8 browser displays the HTML content
7.9 browser to scan inline HTML objects, such as CSS, images, etc., when confronted with such a subject, we must re-send a GET request obtaining
7.10 browser sends an asynchronous request

8. sliding window

8.1 the sliding window contains transmission and receive windows
Here Insert Picture Description
8.2 bit window protocol: degradation it to stop and wait protocol, when a bit transmission fails, it does not receive an acknowledgment frame, the current process is stopped, retransmits the

8.3 n back protocol, the transmission window transmitting a stop, but continues to send, and set a timer for each frame, and a plurality of successive transmission frames, if a frame is not received after a timeout frame, then back to the invalid frame, which re-transmits several frames. The efficiency of this approach is not necessarily higher than stop and wait protocol, because if the send window size is k, the receive window size is 1, then the send window will result in waste of resources. (When the difference between the network transmission quality)
Here Insert Picture Description
8.4 ARQ protocol, a frame errors, regardless temporarily, continue to send frames later, but the receiver must be provided a buffer memory of the frame sent back when the frame is successfully transmitted failure over, then the frame buffer out, which requires the receiver to have a certain buffer space.
Here Insert Picture Description

Published 20 original articles · won praise 1 · views 1469

Guess you like

Origin blog.csdn.net/weixin_44587666/article/details/89075614