Packet forwarding algorithm

1) first is extracted from the IP datagram header the IP address of the destination host D, they are drawn in a network N.

(2) If N is a network router directly connected to this, it is delivered directly, without going through another router
forwarding, direct data packets delivered to the destination host.

      否则就执行(3)

(3) If there is host-specific route in the routing table for the destination address D, and put the datagram passed to the next hop router specified in the routing table.

     否则执行(4)

(4) If there are N network route to the routing table, put the datagram passed to the next hop router specified in the routing table.

    否则执行(5)

(5) If there is a default route in the routing table, the data packets transmitted to put a default route specified default router.

     否则执行(6)

(6) Report an error packet forwarding.

Guess you like

Origin blog.csdn.net/weixin_44517301/article/details/94299189
Recommended