Don’t make mistakes in small areas. Computer network questions that must be answered in interviews. If you don’t understand these 10 points, don’t go to the interview!

1. Tell me what you understand about the seven-layer network model?

Application layer:  An interface between network services and end users.

The protocols include: HTTP FTP TFTP DNS protocol, etc.;

Presentation layer:  data representation, security, and compression format;

Session layer:  establish, manage, and terminate sessions. Corresponding host process, refers to the ongoing session between the local host and the remote host

Transport layer: Defines the protocol port number for transmitting data, as well as flow control and error checking. The protocols are: TCP UDP protocol.

Network layer: Perform logical address addressing to realize path selection between different networks. The protocols are: ICMP IP (IPV4 IPV6)

Data link layer:  establishes logical connections and performs hardware address addressing functions. Assemble bits into bytes and then into frames, use MAC address to access media, errors are detected but not corrected.

Physical layer:  Establish, maintain, and disconnect physical connections.

2. Three-way handshake process of TCP protocol?

When the TCP protocol establishes a connection, it needs to go through a three-way handshake process:

The first handshake:  It is initiated by the client to the server to apply for establishing a connection. The SYN flag in this message is marked as 1, so we also call it a SYN packet;

The second handshake: The server replies to the client to confirm and accept the connection request. The SYN bit and ACK bit in this message are both marked as 1, so it is called a SYN-ACK message;

The third handshake: still sent by the client to the server to confirm the server's reply message. The ACK flag in this message is marked as 1, so we also call it an ACK packet.

This is the three-way handshake process of the TCP protocol.

3. Do you know how many times the TCP handshake is held? Why do we need to shake hands three times?

3 times.

The data packet sent by the client to request a connection may stay in the network. When it reaches the server again after the connection is subsequently disconnected, the server will send a message telling the client that the message can be sent, but the client will ignore the server and will not send it. message, the server is in a waiting state, which will cause a waste of resources.

4. The 4 waves of TCP protocol?

After the TCP protocol completes sending data, the connection will be disconnected. At this time, you need to go through the process of waving four times:

The first wave: It is initiated by the client to the server to apply for disconnection. The FIN flag in this message is marked as 1, so we also call it a FIN packet;

The second wave: the server replies to the client to confirm the client's last disconnection request, so it is an ACK message;

The third wave: still sent by the server to the client, used to inform the client that the server's data has been sent and the connection needs to be disconnected; the FIN flag in this message is marked as 1, so it is also a FIN packet.

The fourth wave: the client replies to the server, confirming the server’s previous disconnection request, so it is also an ACK message;

This is the four-wave wave process of the TCP protocol.

5. Why does it take three times to shake hands and four times to wave?

The three-way handshake is the process of establishing a connection using the TCP protocol . To establish a connection, I only need to confirm that you are there and I am there. The three-way handshake is enough;

But waving four times is because the TCP protocol is for disconnecting , so I need to make sure that I end both sending and receiving data. At first, the client ends sending and informs the server. After the server confirms, it ends receiving; these two waves After completion, the client is still receiving data, and the server is still sending; so the server needs to send a FIN packet to inform me that it has finished sending data. After the client confirms, both parties close the sending and receiving data channels, so Must be four times~

6. What is the difference between tcp and udp?

TCP protocol and UDP protocol are two protocols of the transport layer: their differences mainly include the following three aspects:

First: TCP is connection-oriented, just like making a phone call by dialing to establish a connection first, while UDP is connectionless, that is, there is no need to establish a connection before sending data.

Second: TCP can provide reliable services and ensure that data transmission is error-free, not lost, not repeated, and arrives in order; while the UDP protocol only tries its best to deliver, that is, it does not guarantee reliable delivery.

Third: Because of the above two characteristics of TCP, the corresponding transmission efficiency is relatively low, while UDP is highly efficient, so some scenarios that focus on speed but do not care about packet loss will choose to use the UDP protocol, such as IP telephony, streaming media, etc.

7. Do you know what response status codes the http protocol has?

The status codes are as follows:

1xx (Provisional Response): A status code that indicates a provisional response and requires the requestor to proceed.

2xx (success): Status code indicating that the request was successfully processed.

3xx (Redirect): Indicates that further action is required to complete the request. Typically, these status codes are used for redirects.

4xx (Request Error): These status codes indicate that something might have gone wrong with the request, preventing the server from processing it.

5xx (Server Error): These status codes indicate that an internal error occurred while the server was trying to process the request. These errors may be errors on the server itself rather than an error in the request.

8. What is the difference between HTTP and HTTPS?

1. From the perspective of security: http transmits in plain text and is vulnerable to attack. It cannot confirm the identity of both parties and cannot guarantee the integrity of the data; https uses the SSL encrypted transmission protocol, and the information is ciphertext, which can authenticate the identities of both parties and prevent information from being intercepted. Tampering, security is higher than http

2. From the port perspective: http default port 80, https default port 443

3. In terms of flexibility: http is simple, fast and flexible to use; https has a high technical threshold and is difficult to support for most personal or private websites.

4. Access speed: The http protocol is simple, and the program size of the http server is small, so the communication speed is very fast; https increases the burden on the server, requires more resources to support, and reduces the user's access speed.

5. Economic applicability: http has no additional fee requirements. Certificates issued by the https protocol CA agency require annual fees. In addition, docking with the https protocol also requires additional technical support.

9. The https protocol is more secure than http. How is it implemented?

The https protocol achieves its security through the SSL protocol shell, which is mainly reflected in three aspects:

First:  the data is encrypted. The SSL protocol completes secret key negotiation through asymmetric key distribution, and then completes data encryption through symmetric key encryption;

Second: The identity of the other party will be verified. Both the server and the client will need to apply for certificates from the CA organization, and then the SSL handshake phase will verify whether the certificates of both parties are trustworthy, thereby verifying the identities of both parties and preventing third parties from impersonating;

Third: Ensure data integrity. Each data will be added with a MAC digest and signed. If the digest information of the received data is consistent with that of the sent data, it means that the data has not been tampered with.

10. When a user enters a URL in a browser to open a web page, what does the entire process from input to loading go through?

1. First it will perform DNS domain name resolution;

2. Establish TCP connection; initiate TCP three-way handshake

3. Send an HTTP request;

4. The server processes related requests and returns the processed results;

5. Close the TCP connection;

6. The browser receives the HTML code given by the server and starts parsing;

7. The browser requests the parsed resources (such as js, CSS, pictures, etc.) and renders the page to the user.

Finally: The complete software testing video tutorial below has been compiled and uploaded. Friends who need it can get it by themselves [guaranteed 100% free]

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/132623400