IP Routing and the Routing Table

/
/
/
152 Views

What are Routes and Route Segments??

Routers are necessary for the selection of the route on the Internet. When a router receives an IP packet, it selects an appropriate path (through a network) based on the destination address of the packet. It then forwards the packet to the next router in the path. The packet is thus transferred from one router to the next along the path. The last router delivers the packet to its destination.

In Figure A, from host A to host C, a packet should go through three networks and two routers. Thus, if a node is connected to another node in a network, a route segment exists between these two nodes. Hence, they are known as the adjacent nodes on the Internet. Based on the same principle, adjacent routers are two routers connected to the same network. The number of route segments between a router and hosts in the same network is counted as zero. In figure A, the bold arrows represent these segments. The physical links that constitute this route segment do not influence the router.

Figure A Route segments

When the size of the networks vary considerably, the length of the route segments may also vary. After the actual length of the path is measured, for different networks, the number of route segments is multiplied by a weighted coefficient.

Consider a router in a network as a node in the network, and a route segment on the Internet as a link. Then routing on the Internet is similar to the routing in a simple network. Routing through a few routing segments may not be always the ideal way. For example, routing through three LAN route segments may be much faster than routing through two WAN route segments.

How routes are selected through Routing Table

Routing Table

The routing table is the key for a router to forward the packets. Each router maintains a routing table in its memory. Each entry of this table specifies the physical interface of the router through which a packet should be sent to a subnet or a host. The packet can thus reach the next router in the path or the destination host if it is a directly connected network.

According to the sources, the routes in the routing table can be divided into the following three categories:

  • The route in the link layer protocol (also called interface route or direct route)
  • The static route manually configured by the network manager
  • The route in the dynamic route protocol

The Contents of the Routing Table

A routing table has the following key entries:

  • Destination address: it is used to identify the destination IP address or the destination network address of the IP packet.
  • Network mask: it is combined with the destination address to give the address of the network segment where the destination host or router is located. Thus, they are used to identify the network address of the destination host or the router. For example, if the destination address is 129.102.8.10 and the mask is 255.255.0.0, then the address of the network where the host or the router is located is 129.102.0.0. The mask is made up of several consecutive “1”s. These “1”s can be expressed either in the dotted decimal format or in a number of consecutive “1”s in the mask.
  • Outgoing interface: it indicates the interface through which an IP packet should be forwarded.
  • Next hop IP address: it indicates the next router that an IP packet passes through.
  • Preference added to the IP routing table for a route: there may be different next hops to the same destination. These routes may be discovered by different routing protocols, or they can just be the manually configured static routes. The route with the highest preference (the smallest value) is selected as the current optimal route.

According to different destinations, the routes can be divided into the following categories:

  • Subnet route: the destination is a subnet.
  • Host route: the destination is a host.

In addition, based on whether the destination location is directly connected to the router or not, routes fall into the following types:

  • Direct route: the router is directly connected to the network in which the destination is located.
  • Indirect route: the router is not directly connected to the network in which the destination is located.

Set a default route to prevent the routing table from having a large number of entries. All the packets that fail to match a suitable entry in the routing table are forwarded through this default route.

As shown in Figure B, Router A is connected with three networks. Thus it has three IP addresses and three physical interfaces. Figure B shows the routing table.

Figure B Routing table

Routing Protocols

This section covers the following routing protocols:

  • Static Route and Dynamic Route
  • Classification of Dynamic Routing Protocols
  • Routing Protocols and Route Preferences
  • Load Balancing and Route Backup
  • Sharing of Routing Information Between Protocols

What are Static Route and Dynamic Route

Static routes can be easily configured on a system. They have lower system requirements. They are applicable to simple, stable, and small-scale networks. Static routes cannot automatically adapt to the changes in the network topology. Thus they must be manually configured.

With their routing algorithms, dynamic routing protocols can automatically adapt to the changes of network topology. So they are applicable to the network equipped with a certain quantity of Layer 3 devices. However, dynamic routes are quite complicated and difficult to configure. They have higher system requirements. They also occupy certain network resources.

Classification of Dynamic Routing Protocols

Dynamic routing protocols can be classified on the following conditions:

According to the Range of Functions

According to the range of functions, the routing protocols can be divided into:

  • Interior Gateway Protocol (IGP): runs inside an AS, such as RIP, OSPF and IS-IS.
  • Exterior Gateway Protocol (EGP): runs between different ASs, such as BGP.

According to the Algorithm

According to the Algorithm, the routing protocols can be divided into:

  • Distance-Vector Routing Protocol: includes RIP and BGP (BGP is also called Path-Vector).
  • Link-State Routing Protocol: includes OSPF and IS-IS.

The above algorithms mainly differ in the method for route discovery and calculation.

According to the Types of Destination Addresses

According to the types of destination addresses, the routing protocols can be divided into:

  • Unicast Routing Protocol: includes RIP, OSPF, BGP, and IS-IS.
  • Multicast Routing Protocol: includes DVMRP, PIM-SM, and PIM-DM.

Static routes are managed in the router together with the dynamic routes discovered by routing protocols. All these routes can be shared between different routing protocols.

Routing Protocols and Route Preferences

Different routing protocols (as well as the static route) may learn different routes to the same destination, but not all these routes are optimal. At a certain moment, only one routing protocol determines the current route to a specific destination. Each of these routing protocols (including the static route) is set to a preference. When there are multiple routing information sources, the route learned by the routing protocol with the highest preference becomes the current route.

Routing protocols and the default preferences (the smaller is the value, the higher is the preference) of the routes learned by them are shown in Table A.

In Table A, 0 indicates the direct route and 255 indicates any route learnt from unreliable sources. The smaller is the value, the higher is the preference.

Table 1-1 Routing protocols and their default preferences for the routes

Routing Protocol or Route TypePreference of the Corresponding Route
DIRECT0
OSPF10
IS-IS15
STATIC60
RIP100
OSPF ASE150
OSPF NSSA150
IBGP255
EBGP255
UNKNOWN255

Except for direct route, the preferences of various routing protocols can be manually configured to meet the user’s requirements. In addition, the preferences for each static route can be different.

Load Balancing and Route Backup

Load Balancing:

Th router supports the multi-route mode. That is, the router permits the configuration of multiple routes with the same destination and the same preference. If no route with higher preference reaches the destination, all routes with the same preference are adopted. Routers at the IP layer send packets to the destination through various paths. Thus the load balancing is realized.

For the same destination, a specified routing protocol may find multiple routes. If the routing protocol has the highest preference among all active routing protocols, these multiple routes are regarded as currently valid routes. Thus, load balancing of the IP traffic is ensured at the routing protocols layer.

So far, the routing protocols that support load balancing are RIP, OSPF, BGP, and IS-IS. Static route also supports load balancing.

Route Backup:

You can configure multiple routes to the same destination based on the actual situation. The route with the highest preference is called the active route. The other routes with descending preferences are called backup routes.

Generally, the main route forwards packets. When the link has some faults, the route becomes inactive, and the router chooses a backup route to forward the data. The process realizes the switch from the main route to the backup route. When the main route is recovered, the router recovers its corresponding route and chooses the route again. Because the route has the highest preference, the router chooses the main route to send the data. That is the switch from the backup route to the main route.

Sharing of Routing Information Between Protocols

The algorithms of various routing protocols are different. Thus they may discover different routes. This brings about the problem of sharing the learned routes between the routing protocols.

A router can import the information of another routing protocol. Each protocol has its own route import mechanism. For the details, refer to the description “Importing an External Route” in the configuration guide of the corresponding routing protocol.

Routing Management

The section covers the following topics:

  • Displaying of the Routing Table
  • Displaying and Debugging of the Routing Management Module

Displaying of the Routing Table

To locate the routing problems, you should first view the information in the routing table. Some commands for displaying routing information in Huawei Routers are shown in Table B.

The display command can be used in all views.

ActionCommand
View the brief information of the current active routes.display ip routing-table
View the details of routing tables.display ip routing-table verbose
View the route to a specified destination address.display ip routing-table ip-address [ mask | mask-length ] [ longer-match ] [ verbose ]
View the routes within specified range of destination addresses.display ip routing-table ip-address1 { mask1 | mask-length1 } ip-address2 { mask2 | mask-length2 } [ verbose ]
View the routes filtered by a specified basic ACL.display ip routing-table acl acl-number [ verbose ]
View the route filtered by specified IP prefix list.display ip routing-table ip-prefix ip-prefix-name [ verbose ]
View the route discovered by the specified protocol.display ip routing-table protocol protocol [ inactive | verbose ]
View the statistics in a routing table.display ip routing-table statistics
View the brief of the private network routing table.display ip routing-table vpn-instance vpn-instance-name [ filter-option ]
View the private network routing table details (in the user view).display ip routing-table vpn-instance vpn-instance-name [ filter-option ] verbose

 

Displaying and Debugging of the Routing Management Module

As shown in Table C, to use the display and the debugging commands in the routing management module is one method to settle the routing problem.

The display command can be used in all views, while the debugging command can be used only in the user view.

Table C Displaying and Debugging the routing management module

ActionCommand
Check the information about the routing management on the interface.display rm interface [ interface-type interface-number ]
Check the information about IPv6 routing management on the interface.display rm ipv6 interface [ interface-type interface-number ]
Check the information about the routing management on the private network interface.display rm interface vpn-instance vpn-instance-name
Enable the debugging of all routing management.debugging rm all
Enable the debugging of all backup routing management.debugging rm backup
Enable the IPv4 debugging of all routing management.debugging rm ipv4 { bfd | im | urt | usr | msr | rcom [ ip-prefix ip-prefix-name ] | rr }
Enable the IPv6 debugging of all routing management.debugging rm ipv6 { im | urt | usr | rcom [ ip-prefix ip-prefix-name ] | rr }
Enable the Job debugging of all routing management.debugging rm job
Enable the routing policy debugging of all routing management.debugging rm policy [ ip-prefix ip-prefix-name ]
Enable the system debugging of all routing management.debugging rm system
Enable the task debugging of all routing management.debugging rm task
Enable the timer debugging of all routing management.debugging rm timer
  • Facebook
  • Twitter
  • Google+
  • Linkedin
  • Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views : Ad Clicks :Ad Views :