Process and DNS procedures for network packet routing

Source: Internet
Author: User
Tags socket
The process of network packet transmission

Throughout the datagram transmission process,

Send:
The sender process calls the system call first, then sends the data to the socket, then the socket checks the data type, calls the system to call the Send function, the Send function checks the state of the socket, the protocol type, and passes it to the transport layer, The transport layer corresponds to the protocol (UDP or TCP creates a data structure for these), then joins the corresponding Transport layer protocol header, which is then delivered to the internetwork layer, IP layer, IP layer plus its head, such as IP address and inspection and. Then decide whether to Shard and then deliver down to the data link layer, the Data link layer for encapsulation purposes mac and source Mac, and CRC checksum. The NIC then calls the interrupt driver and sends it to the network.

Accept:
The datagram arrives from the network NIC, then the network card receives the data frame, puts in the network card cache, sends the interrupt request to the system, executes the interrupt handler, reads from the network card cache the data into the memory, then passes the data to the data link layer, the Data link layer carries on the packet, IP layer in the error test of this packet, at this time if it is to accept the transfer to the upper layer, if not, then discard or forward, to the transport layer, the corresponding protocol delivery solution, and then up to the application layer, delivered to the corresponding protocol, into the socket acceptance queue, The received process then makes system calls, obtains the data, and copies it to the process buffer. Then return to the user state. DNS Request Process We go from a host to access www.baidu.com, we need to know the IP address first, so we need to resolve through the domain name, PC1 first issued a DNS request to find www.baidu.com corresponding IP. (The domain name and the unique IP address corresponds to this) if the discovery is not the same network, it needs to be forwarded through the routing device, this time first through the ARP request, the router's IP, and then the DNS request encapsulated into an Ethernet frame sent to the router. The router receives the Ethernet frame and forwards it to the DNS server, in which the router may need to send an ARP request to get the MAC address of the DNS server. When DNS receives a DNS request, the IP address of the www.baidu.com is then sent to the router, and then the router is forwarded to PC1 PC1 eventually receives the destination IP address.

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.