Interpreting the Components of a Routing Table
A routing table is a data table that is contained in a router and a network computer to show the route to a particular destination in a network. The main role of a routing table is to direct the packets to the correct path depending on the destination address in the IP layer. Here, the author will explain what each entry of a routing table means and the components of the routing table.
Components of a Routing Table
- Destination Network:
- This column shows the network on which the host resides, or the IP address.
- It defines the network or subnet where the packets are intended to go/destined for.
- Example:
192.168.1.0
,10.0.0.0
, or0.0.0.0
(default route).
2. Subnet Mask (Netmask):
- This column displays the subnet mask of the destination network, derived from the received packet headers.
- It helps identify the network portion and the host portion of an IP address.
- Example:
255.255.255.0
or/24
.
3. Next Hop:
- This indicates the IP address of the next hop router to which the packet should be forwarded.
- It could also be an interface name if the destination is directly connected.
- Example:
192.168.1.1
oreth0
.
4. Interface:
- The network interface through which the packet should be sent.
- It is the router’s outgoing interface.
- Example:
GigabitEthernet0/0
,eth0
, orwlan0
.
5. Metric:
- This is a value used to determine the preference for a route.
- Lower metrics indicate more preferred routes.
- Example:
10
,20
, etc.
6. Routing Protocol:
- The protocol through which the route was learned.
- Example:
R
(RIP),O
(OSPF),B
(BGP),S
(static),D
(EIGRP).
7. Flags:
- These are indicators that provide additional information about the route.
- Common flags include:
U
(Up): The route is up and operational.G
(Gateway) – The route uses a gateway.H
(Host): The route is to a specific host.D
(Dynamic): The route was dynamically learned.S
(Static): The route was manually configured.
Example Routing Table Entries
Here are examples of routing table entries on different systems and explanations for each component.
Example Routing Table on Linux:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.0.0.0 192.168.1.2 255.0.0.0 UG 200 0 0 eth1
- First Entry:
- Destination:
0.0.0.0
(default route) - Gateway:
192.168.1.1
(next hop) - Genmask:
0.0.0.0
(default mask) - Flags:
UG
(Up, Gateway) - Metric:
100
(cost of route) - Iface:
eth0
(interface to use) - Second Entry:
- Destination:
192.168.1.0
(network address) - Gateway:
0.0.0.0
(directly connected) - Genmask:
255.255.255.0
(subnet mask) - Flags:
U
(Up) - Metric:
0
(cost of route) - Iface:
eth0
(interface to use) - Third Entry:
- Destination:
10.0.0.0
(network address) - Gateway:
192.168.1.2
(next hop) - Genmask:
255.0.0.0
(subnet mask) - Flags:
UG
(Up, Gateway) - Metric:
200
(cost of route) - Iface:
eth1
(interface to use)
Example Routing Table on Cisco IOS:
Router# show 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, H - NHRP, l - LISP
a - application route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.1.1
192.168.1.0/24 is directly connected, GigabitEthernet0/0
10.0.0.0/8 [90/2172416] via 192.168.1.2, 00:00:10, GigabitEthernet0/1
- First Entry:
- S*: Static route (default route)
- 0.0.0.0/0: Destination network (default route)
- [1/0]: Administrative distance and metric
- via 192.168.1.1: Next hop
- Gateway of last resort: Indicates the default route
- Second Entry:
- 192.168.1.0/24: Destination network
- directly connected: Connected route
- GigabitEthernet0/0: Interface
- Third Entry:
- 10.0.0.0/8: Destination network
- [90/2172416]: Administrative distance and metric
- via 192.168.1.2: Next hop
- 00:00:10: Time since the route was learned
- GigabitEthernet0/1: Interface
Conclusion
Since a routing table contains information about the routing process, its components are rather important for network diagnostics and administration. Through the destination network, subnet mask, next hop, interface, metric, routing protocol, and flags, the network administrators have the ability to see how packets are routed in a certain network and the possibility of encountering certain problems.