Read “How the Network is connected” feeling. There are plenty of places where the original design, equipment and technology came into being. This knowledge is not as detailed as many systems, but it is enough to increase the courage of technical blog posts. At least we can understand some of the terms of the article, logic. Only understand these things from fundamental pattern, ability holds law better.

In the few seconds between the browser entering a url and getting a response, a lot happens and a lot of knowledge is involved. Here are some excerpts and self-summaries. It’s a lot of stuff, chapter by chapter.

I. Exploration map

Second, excerpt & summary

  1. The overall process of network request: input URL– Web browser resolves URL– browser generates HTTP request message — queries IP address according to domain name — entrusts protocol stack inside operating system to send message to Web server.

  1. WWW is just a name for a Web server. World Wide Web is not the name of a protocol, but the name of the browser and HTML editor originally developed by the creators of the Web.
  2. The URL format varies with the protocol type. Protocol: HTTP\FTP\FILE\MAILTO and so on
  3. HTTP: operations (GET, POST, HEAD, OPTIONS, PUT, etc.) + URI+ other headers. The WEB server parses the contents and stores the results in a response message. The response message is sent back to the client. After the client receives it, the browser reads the required data from the message and displays it on the screen.
  4. The part whose subnet mask is 1 indicates the network ID, and the part whose subnet mask is 0 indicates the host ID.
  5. Host ID of an IP address. All 0s indicate the entire subnet, and all 1s indicate that packets are broadcast to all devices on the subnet.
  6. The reason for using domain names and IP addresses: TCP/IP networks use IP addresses to identify communication objects.
  7. Searching for an IP address through DNS is called domain name resolution, so the person responsible for performing and resolving this operation is called a parser. Parsers are segments that are included in the operating system’s socket library. The socket library provides the function of querying IP addresses. A Socket library is a collection of program components used to invoke network functions.
  8. When querying an IP address based on a domain name, the browser uses a parser in the Socket library.
  9. Sending messages is not performed by the parser itself, but is delegated to the protocol stack within the operating system.
  10. Parsers and DNS servers: If the WEB server to be accessed is registered with the DNS server, the record can be found and its IP address written to the response message and returned to the client. The message then travels over the network to the client and through the protocol stack to the parser, which then reads the message to fetch the IP address and passes it to the application.

Description: This diagram parses the basic workings of a DNS server.

Class: DNS applications on networks other than the Internet were considered when DNS was first designed, and Class is used to identify network information. But now there is no other network except the Internet, so the value of Class is always IN for the Internet

Record type: Indicates the record type of the domain name. A- The domain name corresponds to the IP address. MX– the domain name corresponds to the mail server. MX: Mail eXchange. PTR– Search domain name by IP address; CNAME– Query the related alias of the domain name. NS– Queries the IP address of the DNS server. SOA– Queries domain name attributes

  1. The DNS server searches for the corresponding record in the mapping table between the domain name and IP address and returns the IP address.
  2. There are only 13 IP addresses assigned to the root domain DNS server in the world. The information about the root DNS server is already included in the configuration file of the DNS server program, so it is automatically configured once the DNS server program is installed.
  3. The HTTP message to be sent to the WEB server is a digital data message, so you can delegate the protocol stack to send the digital information. The operation of sending and receiving digital information is not limited to browsers, but is common to all applications that use the web. Therefore, this process applies not only to the WEB, but to any WEB application.
  4. Create a socket, connect the pipe to the socket on the server side, send and receive data, disconnect the pipe, and delete the socket.
  5. Call the socekt library component to create a socket — the stack returns the descriptor — the application places the descriptor in memory — delegates the stack to connect the socket created by the client to the socket on the server side. The application does this by calling a program component called Connect in the Socket library. The message is sent to the socket through the socket library delegate stack (using the write component). The message is received through the Socket library delegate stack (using the Read component) and placed in the receive buffer. Since the receive buffer is a piece of memory located inside the application, when a message is placed in the receive buffer, it is transferred to the application – the close component that calls the socket library enters the disconnect phase. (The HTTP protocol used by the WEB states that when the WEB server sends a response message, The disconnect operation should be stopped, so the WEB server first calls CLOSE to disconnect. After the disconnect operation is delivered to the client, the client socket also enters the disconnect phase. Next, when the browser calls read to accept data, read tells the browser that the sending and receiving operation has ended and that the connection has been disconnected. The browser will also call close to enter the disconnect phase.
  6. When you specify both an IP address and a port number, you can clearly identify a specific socket on a specific computer.