Teach you how to do the basics of computer network - routing table

1. Topic

Suppose a router has established the following routing table:

destination network subnet mask Next hop
128.96.39.0 255.255.255.128 interface m0
128.96.39.128 255.255.255.128 interface m1
128.96.40.0 255.255.255.128 R2
192.4.153.0 255.255.255.192 R3
*(default) - R4

A total of 5 packets have been received, and their destination addresses are:
(1) 128.96.39.10
(2) 128.96.40.12
(3) 128.96.40.151
(4) 192.4.153.17
(5) 192.4.153.90
Try to calculate the next Jump.

2. Answer

(1) The IP address of the destination station of the packet is: 128.96.39.10. First AND the subnet mask 255.255.255.128 to get 128.96.39.0. It can be seen that the packet is forwarded through the interface m0. That is
_____128. 96. 39.0000 1010
AND 255.255.255.1000 0000
_____128. 96. 39.0000 0000 ie 128.96.39.0
(2) The destination IP address of the packet is: 128.96.40.12. And the subnet mask 255.255.255.128 is 128.96.40.0. After checking the routing table, it is known that it is not equal to 128.96.39.0 or 128.96.39.128, but matches the third item 128.96.40.0 in the routing table, so the IP datagram of this address is forwarded by R2.
(3) The destination IP address of the group is: 128.96.40.151, which is 128.96.40.128 after being combined with the subnet mask 255.255.255.128, and 128.96.40.128 is obtained after being combined with the subnet mask 255.255.255.192. After checking the routing table It is known that the IP datagram for this address does not match the first 4 entries in the routing table. Therefore, the forwarding selects the default route and forwards through R4.
(4) The destination IP address of the packet is: 192.4.153.17. Combined with the subnet mask 255.255.255.128, 192.4.153.0 is obtained. After comparing with the subnet mask 255.255.255.192, 192.4.153.0 is obtained. After checking the routing table, the IP datagram of this address matches the fourth item in the routing table, and the IP datagram is forwarded by R3.
(5) The destination IP address of the packet is: 192.4.153.90, and the subnet mask 255.255.255.128 is combined to obtain 192.4.153.0. After comparing with the subnet mask 255.255.255.192, 192.4.153.64 is obtained. After checking the routing table, the IP datagram of this address does not match the first 4 items in the routing table. The packet forwarding selects the default route and forwards through R4.

➡️欢迎小伙伴在下方评论区留言!关注我的CSDN,遇到难题不迷路!

Guess you like

Origin blog.csdn.net/m0_53291252/article/details/129244599