Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the network programming interview questions for the latest version of TCP,UDP,Socket,Http in 2021?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what are the network programming interview questions of the latest version of TCP,UDP,Socket,Http in 2021". In the daily operation, I believe many people have doubts about the network programming interview questions of the latest version of TCP,UDP,Socket,Http in 2021. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods, hoping to answer "the latest version of TCP,UDP,Socket in 2021." What are the questions of Http's network programming interview questions that help! Next, please follow the editor to study!

1. Let's take a look at the experience of a day's interview. What is network programming?

3. Two main problems in Network programming

4. What is the network protocol?

In order to exchange data in an orderly manner in the computer network, we must abide by some agreed rules, such as the format of the exchange data, whether or not to send a reply message. These rules are called network protocols.

5. Why layer the network protocol

Simplify the difficulty and complexity of the problem. Because each layer is independent, we can divide the big problem into the small one.

Good flexibility. When the technology of one layer changes, as long as the interface relationship between the layers remains unchanged, the other layers will not be affected.

Easy to implement and maintain.

Promote standardization work. After separation, the functions of each layer can be described relatively simply.

6. Computer network architecture

TCP/IP reference model TCP/ IP four-layer protocol (data link layer, network layer, transport layer, application layer)

The layer closest to the user in the application layer is not only to provide computer users with application interfaces, but also to provide users with a variety of network services directly. Our common application layer network service protocols are: HTTP,HTTPS,FTP,TELNET and so on.

The transport layer establishes the end-to-end link of the host, and the role of the transport layer is to provide end-to-end reliable and transparent data transmission services for the upper layer protocols, including dealing with error control and flow control. This layer shields the details of the lower layer data communication to the upper layer, so that the high-level users can only see a host-to-host reliable data path that can be controlled and set by the user between the two transmission entities. As we usually say, TCP UDP is on this floor. The port number is both the "end" here.

The network layer establishes the connection between the two nodes through IP addressing, selects the appropriate routing and switching nodes for the packets sent by the transport layer of the source side, and correctly transmits them to the transport layer of the destination side according to the address. It is commonly known as the IP layer. This layer is what we often call the IP protocol layer. IP protocol is the foundation of Internet.

The data link layer controls the transmission of these data through some protocols or protocols to ensure the correctness of the transmitted data. The hardware and software that implement these protocols or protocols are added to the physical circuit, thus forming a data link

1 TCP/ UDP1.1 what are TCP/IP and UDP

1.2 the difference between TCP and UDP:

1.3Application scenarios of TCP and UDP:

Use UDP for some situations that require high real-time performance, such as games, media communications, and real-time live broadcasting, even if transmission errors occur; in most other cases, HTTP uses TCP because the transmitted content is reliable and there is no loss.

1.4 describe TCP and UDP

1.5 Analysis of application layer protocols running on TCP or UDP.

1.5.1 what is the ARP Protocol (Address Resolution Protocol)?

1.5.2 what is NAT (Network Address Translation, Network address Translation)?

1.5.3 the process from entering the address to getting the page?

1.6A three-way handshake for TCP 1.6.1 what is a three-way handshake for TCP

In the network data transmission, the transport layer protocol TCP is a reliable transmission to establish a connection, and the process of establishing a connection in TCP is called a three-way handshake.

1.6.2 details of the three-way handshake

1.6.3 understand the details of the three-way handshake with reality

1.6.4 can I shake hands twice to establish a connection? Why?

1.6.5 can I use a four-way handshake? Why?

I'm sure this will work. Three handshakes can guarantee the success of the connection, let alone four, but it will reduce the efficiency of transmission.

1.6.6 what happens if the client's ACK does not reach the server in the third handshake?

1.6.7 what if a connection has been established but the client fails?

Every time the server receives a request from the client, it resets a timer, which is usually set to 2 hours. if no data from the client is received in two hours, the server will send a probe message segment. Send it every 75 seconds. If 10 probe messages are sent in a row and still do not respond, the server thinks that the client has failed and then closes the connection.

1.6.8 what is the initial serial number?

A party to the TCP connection randomly selects a 32-bit serial number (Sequence Number) as the initial serial number (Initial Sequence Number,ISN) of the transmitted data, such as 1000. With this serial number as the origin, the data to be transmitted is numbered: 1001, 1002. During the three-way handshake, the initial serial number is transmitted to the other party B, so that when transmitting data, B can confirm what kind of data number is legal; at the same time, A can also confirm every byte received by B during data transmission. If A receives the confirmation number (acknowledge number) of B is 2001, it means that the data numbered 1001-2000 has been successfully accepted by B.

1.7 TCP's four waves 1.7.1 what is TCP's four waves

In network data transmission, the process of disconnecting the transport layer protocol is called four waving.

1.7.2 details of four waving

1.7.3 understanding the details of the three-way handshake with reality TCP's four waves

1.7.4 Why can't the ACK and FIN sent by the server be combined into three waves (what is the meaning of the CLOSE_WAIT state)?

Because the server may not finish sending some data when it receives the request for disconnection from the client, it replies to ACK first, indicating that the request for disconnection has been received. Wait until the data is sent, and then send FIN, disconnecting the data transmission from the server to the client.

1.7.5 what happens if the server's ACK does not reach the client during the second wave?

The client does not receive an ACK acknowledgement and will resend the FIN request.

1.7.6 what is the meaning of client TIME_WAIT status?

2 Socket2.1 what is Socket

Two programs on the network exchange data through a two-way communication connection, and one end of this two-way link is called a Socket. Socket is usually used to achieve the connection between the client and the server. Socket is a very popular programming interface of the TCP/IP protocol, and a Socket is uniquely determined by an IP address and a port number.

However, the types of protocols supported by Socket are not only TCP/IP and UDP, so there is no inevitable relationship between them. In Java environment, Socket programming mainly refers to network programming based on TCP/IP protocol.

Socket connection is the so-called long connection, the client and the server need to connect to each other. Theoretically, the client and the server will not break off actively once the connection is established, but sometimes network fluctuations are possible.

Socket is biased towards the bottom. Generally speaking, Socket is rarely used to program directly, and more Socket is used at the bottom of the framework.

2.2 socket belongs to that level of the network

2.3 the process of Socket communication

2.4 TCP protocol Socket code example:

First run the server, then run the client

Server:

Package com.test.io; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream

2.5 UDP protocol Socket code example:

2.6Common classes for Socket

3. HTTP3.1 what is the Http protocol?

3.2 differences and application scenarios between Socket and http

The Socket connection is the so-called long connection. Theoretically, once the connection is established between the client and the server, it will not be broken actively.

Socket applicable scenarios: online games, continuous bank interaction, live streaming, online video, etc.

A http connection is a so-called short connection, in which the client sends a request to the server. After the server responds, the connection will be disconnected and wait for the next connection.

Http applicable scenarios: company OA services, Internet services, e-commerce, offices, websites, etc.

3.3.What is the request body of http?

3.4 what are the response messages of http?

3.5 what is the difference between http and https?

3.6 how HTTPS works

3.7 how many steps does a complete HTTP request take?

3.8What are the common HTTP status codes classified and what are the common status codes?

3.9 what are the request methods in the Http protocol

3.10 the difference between GET method and POST method

Comparison of 3.11 http versions

3.12 what is symmetric encryption and asymmetric encryption

3.13 what are cookie and session for HTTP?

At this point, the study on "what are the network programming interview questions for the latest version of TCP,UDP,Socket,Http in 2021" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report