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 basics that web developers must know?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "what are the network basic knowledge that web developers must know". In daily operation, I believe many people have doubts about the network basic knowledge that web developers must know. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "what network basic knowledge web developers must know". Next, please follow the editor to study!

One-and five-layer network model

1. Major network protocols

The protocols listed in each layer below can be used and managed in code or operating system, and these protocols need to work together when programs communicate over the network.

Application layer, including HTTP, TLS (SSL3.1), DNS, Thrift, FTP, etc.

Transport layer, TCP (Transmission Control Protocol), UDP (user message Protocol)

Network layer, IP (Internet Protocol)

Link layer, ARP (address Resolution Protocol)

Physical layer, which is more closely related to hardware and does not need to pay too much attention to

Diagram of the running process of the program

two。 The process of network communication

The process of network communication

When the HTTPS request is sent in the program, the data is processed by each layer and finally reaches the target address. The main processing parts of each layer are described, in which steps 1, 2 and 3 are carried out in the program, steps 4, 5 and 6 are carried out in the operating system kernel, and step 7 is completed by the hardware device. Each step is described in detail below:

DNS parsing converts the domain name to IPv4 or IPv6 address, which sends query request to DNS server and obtains response information based on UDP protocol.

The HTTP message is generated by the httpclient tool in the program and contains the HTTP related parameters (URL, header, body, etc.) set by the user.

The TLS protocol negotiates the public key / private key through the four-way handshake mechanism. The "session key" generated by the client is encrypted and sent to the server by the public key, which is obtained by the private key decryption. Finally, the "session key" is used to encrypt the HTTP message.

The TCP connection is established by the three-way handshake mechanism, and the HTTP message is written in the form of a byte stream. All the data sent need to go through the process of "send-confirm" to ensure that the complete delivery reaches the specified IP address.

IP packets split the byte stream by MTU size, which is usually 1500 bytes in the local area network and 512 bytes in the Internet. The sender IP and receiver IP are recorded on the header information of the IP packet.

When the MAC frame is sent, it can not be sent directly to the specified IP address. According to the information recorded in the routing table (local routing table view command route-n), the kernel needs to carry out the "and operation" through "IP address and subnet mask" to get the next hop gateway IP. Then, the link layer obtains the MAC address of the gateway IP through the ARP protocol (the local ARP cache table view command arp-a), and encapsulates the sender MAC address and the gateway MAC address into the MAC frame.

II. Key external services

The network communication process described in the previous section requires the participation of a variety of external services, including DNS services, CA services, routers, and ISP services.

1. DNS service

DNS servers are managed by DNS service providers and provide services for querying IP addresses according to domain names. Common DNS service providers are China Telecom (114.114.114.114) and Google (8.8.8.8). In the Linux system, use the cat command in the file / etc/resolv.conf and directory / etcc/sysconfig/network-scripts/ to view the configured DNS server IP address.

2. CA issuance and verification service

The CA server provides the certificate issuance service needed in the TLS protocol, and verifies the trust of the certificate provided by the server through the CA service during the four-way handshake of the TLS. The browser has built-in addresses of a variety of CA servers, and certificates can also be configured locally for verification (for example, 12306.cn requires a private certificate to be installed in the browser).

3. Router

The router is the first gateway for personal computers to send IP packets to the Internet, and the router has built-in information about the relevant ISP servers.

4. ISP server

ISP (Internet Service Provider) Internet service providers (such as China Telecom and China Unicom) play a key role in network services. ISP servers play the same role as routers, recording huge routing tables and providing them for query at the data link layer. When we want to connect our servers to the Internet, we need to pay ISP to register. The essence is to add the routing information of our servers to the ISP service (actually, it also involves the implementation of the physical layer such as optical fiber construction, which is not described here).

At this point, the study of "what are the network basics that web developers must know" is over. I hope to be able to solve everyone's 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