Routing Table Facts


Routing Table Facts

The router uses the routing table to determine where to send packets. When a packet is received, it compares the destination IP address contained in the packet with all known routes in the routing table.

  • The destination address is compared to the networks in the routing table looking for a match.
  • A match is made when the destination IP address is on the same subnet as indicated by the route in the routing table.
  • The IP address might match more than one route in the routing table. If that is the case, the most specific routing table entry is used (i.e. the network with the subnet mask that has the greatest number of significant bits).
  • When a match is found, the packet is sent out the specified router interface to the next hop router address.
  • If no match is found, the packet is dropped (not forwarded).

Use the show ip route command to view the routing table. A sample output of this command is shown below.

Router1841#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
 
R    172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:08, FastEthernet0/0
R    172.17.0.0/16 [120/2] via 192.168.1.1, 00:00:08, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
S*   0.0.0.0 [1/0] via 192.168.2.1

The following table describes important information shown in the command output:

Component

Description

Gateway of last resort

The gateway of last resort identifies a route to use if the packet does not match any other route. In this example, the route of 0.0.0.0 with a mask of 0.0.0.0 matches every packet. If the destination IP address does not match any other route, the next hop address of 192.168.2.1 is used for this packet.

Note: If the output shows the line Gateway of last resort is not set, then the router can only send packets to the specific routes listed in the routing table. Packets that do not match a specific route will be dropped.

Route type

The first characters of a routing table entry identifies the source or type of the route.

  • C is for directly connected networks
  • S is for static routes
  • R is for routes learned through RIP
  • Additional codes indicate routes learned through other routing protocols

A route marked with * indicates a route that is a candidate for the default route. The router uses this route to determine whether the route can be used to set the gateway of last resort information. If it meets several conditions, the information in the route marked with * is used for the gateway of last resort information.

Network

Following the route type is the network address and subnet mask. This identifies the specific subnet address for the route.

Administrative distance and cost

The numbers in brackets following non-connected routes identify the following two items:

  • The first number is the administrative distance. The administrative distance is a description of the trustworthiness or preferability of a route learned from a specific source. Each source type (such as each routing protocol) is given a different administrative distance value. A lower number indicates a more preferred route. For example, a static route (AD = 1) is preferred over a route learned through RIP (AD = 120).
  • The second number is the cost to reach the route. The meaning of the route cost number is different depending on the source of the route, but generally it identifies how far away the destination is, either in distance or time. The cost is also referred to as the metric. The cost is only comparable when talking about routes learned from the same routing protocol. For example:
    • For two RIP routes, a cost of 1 indicates a lower-cost (shorter) route than a route with a cost of 2.
    • For a route learned through EIGRP, a cost of 312560 might identify a route that is faster than a route learned through RIP with a cost of 2.

Note: Be aware that the administrative distance is used to select a route learned between different protocols, while the cost is used to select the best route learned by the same protocol.

Next hop router

The address indicated by via identifies the router address where packets will be sent when sending to the destination network. The next hop router address is a router on the same subnet as a directly connected interface. However, this does not mean that the next hop router is connected directly to the destination network, but rather that it is the next stop in the path to the destination.

Last update

For routes learned through a routing protocol, the time value (such as 00:00:08) indicates the elapsed time since the last update about the route was received. Most protocols periodically send information about known routes. The update time helps you to know the age of the route information.

Out interface

The interface designation at the end of the route identifies the local router interface used to reach the next hop router and therefore to reach the destination network.

Be aware of the following:

  • Connected routes will only show if the interface has been assigned an IP address and is also up.
  • Static routes will only show if the interface used to reach the next hop router is up.
  • Having a route marked as a candidate default route does not necessarily mean that the router has a gateway of last resort set. To determine whether the router will route packets to unknown networks, examine the Gateway of last resort line for a next hop address.

 

 

Credit: Testout 640-802 CCNA Notes

หมายเลขบันทึก: 316627เขียนเมื่อ 27 พฤศจิกายน 2009 22:44 น. ()แก้ไขเมื่อ 12 กุมภาพันธ์ 2012 11:00 น. ()สัญญาอนุญาต: ครีเอทีฟคอมมอนส์แบบ แสดงที่มา-ไม่ใช้เพื่อการค้า-ไม่ดัดแปลงจำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท