Review the entire process of network access and describe the algorithms and protocols used

Source: Internet
Author: User
1. if no relevant data exists in the DNS cache, IE browser sends a DNS request to the DNS server: The purpose of this process is to obtain the IP address corresponding to the domain name www.sina.com; the IE browser sends a DNS request to the local DNS module, and the DNS module generates the relevant DNS packets. The DNS module transmits the generated DNS packets to the UDP Protocol Unit at the transport layer; the UDP Protocol Unit encapsulates the data into a UDP datagram and sends it to the IP Protocol Unit at the network layer. The IP Protocol Unit encapsulates the data into an IP packet, where the destination IP address is the IP address of the DNS server; the encapsulated IP data packet is sent to the Protocol Unit at the data link layer. If no data exists in the ARP cache during sending, an ARP broadcast request is sent, waiting for the ARP response. After receiving the ARP response, write the information corresponding to the IP address and the next-hop MAC address of the route to the ARP cache table. After the IP address is written to the cache, enter the destination MAC address with the next hop address of the route and forward it as a data frame; this forwarding process may be performed multiple times, depending on the location of the DNS server on the campus network; the DNS request is sent to The data link layer protocol unit. The data link layer protocol unit of the DNS server parses the received data frame and transmits the IP data packets contained in it to the IP Protocol Unit of the network layer; the IP Protocol Unit of the DNS server resolves the received IP data packets, and transmits the UDP data packets contained in the DNS server to the UDP Protocol Unit of the transport layer. The UDP Protocol Unit of the DNS server resolves the received UDP data packets, transmit the internal DNS packets to the DNS service units on the server. The DNS service units receive DNS requests and resolve the domain names to the corresponding IP addresses to generate DNS response packets; (All application layer packets must pass through the transport layer, network layer, and data link layer. Therefore, in the following description, I will simplify the description of this process in the following form, the single arrow indicates internal transmission of the local machine, and the double arrow indicates sending on the network.) DNS response packets → UDP → IP → Mac → hosts requesting domain name resolution; the host requesting domain name resolution receives a data frame. The data frame → IP → UDP → DNS → IE browser writes the domain name resolution result to the DNS Cache table in the form corresponding to the domain name and IP address.
2. IE and www.sina.com.cn establish a TCP connection: IE sends a TCP connection request packet to www.sina.com.cn. The SYN flag in the request TCP packet is set to 1, indicating the connection request; the TCP request packet → IP (DNS) → MAC (ARP) → campus gateway → www.sina.com.cn host; when the TCP request packet passes through the IP layer, the entered destination IP address is the IP address obtained during the above DNS process. When the data link layer is passed, if the MAC address is unknown, the ARP process described above will also be carried out; the data frame received by www.sina.com.cn → IP → TCP, the TCP unit will respond to the request response message. The SYN and ACK flag bits in the Request Response TCP packet are set to 1, indicating the connection request response; the TCP request response packet → IP → MAC (ARP) → campus gateway → Request Host; The Request Host receives the data frame → IP → TCP, And the TCP protocol unit responds to the request confirmation packet; the ACK flag in the Request Response TCP packet is set to 1, indicating connection requests Request confirmation; TCP request confirmation message → IP → MAC (ARP) → campus gateway → www.sina.com.cn host; data frame received by www.sina.com.cn → IP → TCP, connection established; in this process, any packet error or timeout must be re-transmitted. This process is called the three-way handshake for TCP connection establishment.
3. IE browser start HTTP access process IE browser to www.sina.com.cn issued a HTTP-GET packet; The HTTP-GET method packet → TCP/IP → Mac → campus gateway → www.sina.com.cn host; www.sina.com.cn received data frame → IP → TCP → HTTP, HTTP unit will respond to HTTP format encapsulated HTML hypertext form data; HTTP-HTML data → TCP/IP → MAC (ARP) → campus gateway → Request Host; request the data frame received by the host → IP → TCP → HTTP → IE browser. The browser displays HTML hypertext in the form of a webpage, which is what we see on the webpage.
4. disconnect the TCP connection from IE and send a TCP connection end request message to www.sina.com.cn. The FIN flag in the request TCP packet is set to 1, indicating that the request is terminated; the TCP End request packet → IP → MAC (ARP) → campus gateway → www.sina.com.cn host; the data frame received by www.sina.com.cn → IP → TCP, the TCP unit will respond to the end response packet; the fin and ACK flag bits in the TCP packet are both set to 1, indicating the end of the response; the TCP End response packet → IP → MAC (ARP) → campus gateway → Request Host; this process requires two-way execution, so the www.sina.com.cn host will perform the same operation according to the above process. The whole process is called the four handshakes of TCP disconnection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.