What is the process of packets from entering the router to outgoing?

Let me talk about my understanding first, if there is a mistake, please correct it! First, a data packet comes over, the router's network interface will determine a frame through the special marks of the frame header and the frame end and do a CRC check on the frame. If the check is unsuccessful, the frame is discarded. If the check is successful, the frame is stripped. The header and the end of the frame are put into the buffer queue of the network layer. The network layer will decrement the TTL of the IP datagram by one, recalculate the header checksum and other operations, and query the forwarding table to find the network interface to which the packet should go. Then put it into the output buffer of the interface, and the data link layer will add a new destination (next hop) MAC address, source (local router) MAC address, and IP type (such as IPv4) for this IP datagram. Calculate a wave, add an FCS at the end of the frame, and then send the frame through the physical layer.


No problem, the logic is smooth. In order to let more readers understand this problem, it is best to compare the data package to a courier package. An IP express package enters the logistics automatic sorting system. The sorting system is a pipeline. This pipeline contains N processes, each process has a sequence, and each process strictly follows "only do what you do". Pipelining can be defined as a tedious process, such as ACL filtering in the pipeline, ACL filtering in the pipeline, QOS in and out, URPF in and out, Rate-limit in and out, NAT in and out, and so on. You can also define the most basic processing procedures, such as only routing and forwarding functions, this article only describes simple procedures.

• Hardware interface incoming reception check (entering the pipeline)

Destination MAC = broadcast address Reception destination MAC = subscribed multicast address Reception destination MAC = own MAC address Reception Other all discard processing. The reception also needs to complete the CRC check. Only after the check is successful can it be put into the receive buffer queue and wait for the next process. Otherwise discard it. In addition, it is necessary to check whether the length of the frame is too long or too short, and if it does not meet the length limit, it is discarded.

• Sanity Check of IP Package

Comrades who are fortunate to enter this process should not be complacent. More stringent medical examinations will begin soon.
 The IP version, IP header length, destination IP, source IP, IP packet length, TTL is ≥1, and the protocol number and checksum are intact and legal. If they are not satisfied, discard them directly. Those who can escape alive can run to the end with a high probability. . .

• Routing and forwarding (IP Forwarding)

Check the routing table, and find the best choice based on the longest matching principle between the destination IP and the IP routing table. If the optimal choice is one (exit), routing and forwarding will exchange IP packets to the queue of the exit, waiting for favor, and by the way, will be TTL-1.

If there are multiple exits, choose one of them according to the ECMP algorithm. The other steps are the same as the above operation.

If no exit is found, discard it directly.

• MAC Lookup at the exit peer

This is easy to handle, you can take measures in advance (collect the peer MAC in advance), or you can take measures afterwards (ARP Request/Reply).

• Output Queue

If there are hardly any packages in the exit queue, there is almost no delay, and the next process is directly entered. If the queue is full of packages, the IP package will experience a certain delay. The amount of delay is determined by the depth of the queue and whether there are frequent VIP queues. If you really experience extreme delays, "you can't blame the government for your suffering", just accept it!

• Hardware interface outbound sending (leave the pipeline)

This process is extremely simple. The package is packaged according to the requirements of the previous process. A check code (FCS) is printed on the outer package of the package. Various registers work together to buffer a frame of data in the BD table according to the maximum rate of the outbound interface. Catapulted out.

The above is the news sharing from the PASSHOT. I hope it can be inspired you. If you think today' s content is not too bad, you are welcome to share it with other friends. There are more latest Linux dumps, CCNA 200-301 dumpsCCNP Written dumps and CCIE Written dumps waiting for you.

Comments

Popular posts from this blog

How to choose Cisco dumps?

What is proxy communication?

What are CCNP Data Center jobs in Dubai?