This article is reprinted from the WeChat public account "Cisco CCIE Club", the author is Lao Yang. Please contact the Cisco CCIE Club public account to reprint this article. Routing Table To understand the kind of information in the routing table, it is helpful to consider what happens when a packet arrives at a router interface. First, the router examines the data link identifier in the destination address field of the frame. If it contains the router interface identifier or the broadcast identifier, the router strips the packet from the frame and passes it to the network layer. At the network layer, the router examines the packet's destination address. If the destination address is the IP address of a router interface or the broadcast address for all hosts, the packet's protocol field is further examined before the encapsulated data is sent to the appropriate internal process. In addition, all other destination addresses need to be routed. The destination address here may be a host address on another network, which is either connected to the router (including the router interface connected to that network) or not directly connected to the router. The destination address may also be a directed broadcast address, which has a clear network address or subnet address and the host bit is all 1. These addresses are also routable. If the packet is routable, the router will look up the path to obtain the correct path. Each routing table entry in the database must contain at least the following two items:
The router will try to make the most accurate match possible. 2 In descending order of accuracy, the optional addresses are listed as follows:
The default address is the least specific address and is used only when all other matches fail. If the destination address of a data packet does not match any routing table entry, the data packet will be discarded and an ICMP message "Destination Network Unreachable" will be sent to the source address. As shown in Figure 3-1, this is a simple network, and the figure shows the routing table entries required for each router. The most important thing here is how these routing tables will work as a whole and can accurately and efficiently transmit data packets. The network column of the routing table lists the network addresses that the router can reach. The pointer to the target network is in the next hop column. In Figure 3-1, if router Crroll receives a data packet with source address 10.1.1.97 and destination address 10.1.735, the result of the routing table query is: the best match for the destination address is subnet 10.1.7.0, which can be sent out from interface so via next hop address 10.1.2.2 to the destination. The data packet is sent to router Dahl, and Dahl searches its own routing table and finds that the data packet should be sent out from interface SI via next hop 10.1.4.2 to the destination network 10.1.7.0. This process will continue until the data packet reaches router Baum. When Baum receives the data packet at interface so, Baum finds that the destination is a directly connected network connected to port EO by searching the router. Finally, the routing selection process ends and the data packet is passed to host 10.1.735 on the Ethernet link. The routing process described above assumes that the router can match the next-hop address with its interface. For example, router Dahl must know that Lewis's address 10.1.4.2 can be reached through interface S1. First, Dahl knows from the IP address and subnet mask assigned to interface SI that subnet 10.1.4.0 is directly connected to interface S1; then Dahl can know that 10.1.4.2 is a member of subnet 10.1.4.0 and must be connected to that subnet. There is also a special case, that is, multicast addresses, which refer to a group of devices rather than all devices. The class D address 24.00.0 is a multicast address. This address is reserved for all OSPF routers. There are two basic processes for finding the best match, which depend on whether the router behaves as classful or classless. Note that in order for packets to be exchanged correctly, each router must maintain consistent and accurate information. For example, in Figure 3-1, the entry for network 10.1.1.0 is missing from the routing table of router Dahl. The packet from 10.1.1.97 to 10.1.7.35 will be delivered, but when 10.1.7.35 replies to 10.1.1.97, the packet from Baum to 10.1.7.35 will be delivered. Lewis then passes the packet to Dahl. Dahl searches the routing table and finds that there is no routing entry for subnet 10.1.1.0, so it discards the packet. At the same time, Dahl sends an ICMP message to host 10.1.7.35 that the target network is unreachable. Example 3-1 shows the routing table for the Lewis router in Figure 3-1. The Cisco command for viewing the routing table in a Cisco router is show ip route. Examine the contents of the database and compare it with the generic routing table for Lewis router in Figure 3-1. You can see that the keywords at the top of the table explain the letters in the columns to the left of the routing table. These letters indicate how each routing table entry was learned. In Example 3-1, the routes marked with a C represent directly connected networks, and the routes marked with an S represent static routes. The statement "gateway of last resort is not set" refers to the default route. The header has a statement that the primary network address 10.0.0.0 has 7 known subnets with a mask of 24 bits. In each of the 7 routing table entries, the destination subnet is given. For entries that are not directly connected networks - the packet must be forwarded to the next-hop router - the tuple in brackets specifies the [administrative distance/metric] of the route. Metric is a means of evaluating routing by priority. The lower the metric, the shorter the path, which means the path is more ideal. Note that in Example 3-1 the metric of the static route is 0. Finally, the routing table also gives the interface address of the next-hop router or the interface that is connected to the directly connected destination network. |
>>: All IPV4 addresses are exhausted, and you still don’t know what it is?
This article takes stock of the smart city applic...
[51CTO.com original article] From "0 to 1, 1...
Last weekend, DesiVPS sent a message about the ne...
On October 24, the 1024 Kunpeng Programmer's ...
The mass adoption of the Internet can be attribut...
On September 7, the third day of the All-Connect ...
According to the latest forecast from Gartner, gl...
Digital transformation has been fully launched in...
[51CTO.com original article] Not long ago, Huawei...
ZeroNet is a revolutionary P2P network based on B...
Guo Shenghua, the godfather of Chinese hackers an...
Do you have such a need? More than 20 local area ...
Part 01 QoS Service Domestic operator networks ge...
At the beginning of the new year, Alibaba Cloud...