- IP routing is the process of transmitting packets from a network to another network. The main concern of routers is networks instead of hosts. A router can only forward packets to routes (or subnets) in its routing table. Routers are also known as gateways. A host would send packets destined to another network to its default gateway of the local network.
- Routing protocols are used by routers to figure out the network topology, find paths to all the networks in an internetwork, determine the best path to a network, and fill the routing tables with the routing information. Ex: RIP, IGRP, OSPF, and EIGRP.
Routed protocols are used to define and assign logical addressing on physical interfaces, encapsulate data into packets, and liaise with the data link layer to deliver packets through an internetwork. These protocols allow packets to be forwarded by routing protocols. Ex: IP, IPX, and AppleTalk. Note: IBM SNA, NetBIOS, and NetBEUI are non-routable protocols.
- A router always has the routes to directly connected networks. For non-directly connected networks, the router must learn and know how to get to there. The information can be manually configured (static routing), or learn from other routers using routing protocols (dynamic routing).
- Below list the 2 types of routing protocols:
Interior Gateway Protocols Used for exchanging routing information between routers within an autonomous system (AS) (Intra-AS or intradomain).
Ex: RIP, IGRP, OSPF, and EIGRP.
Exterior Gateway Protocols Used for communication between autonomous systems (Inter-AS or interdomain). Out of the scope of CCNA.
Ex: BGP.
- Autonomous system (AS) is a collection of networks that is within the administration control of a company or organization that shares a common routing strategy.
- Static routing is the most basic way to tell a router where to forward packets to non-directly connected networks. Static routes are manually added to and removed from a router’s routing table; hence it is very tedious and impractical to implement static routing in large networks.
- Below list the 3 classes of dynamic routing protocols:
Distance-Vector Simple routing algorithm. Less effective and efficient compared to other classes of routing protocols. Targeted for small networks. Ex: RIP, IGRP.
Link-State Complex routing algorithm. Frequently used in large and complex networks. Ex: OSPF.
Balanced Hybrid Consists of both DV and LS concepts and features. Ex: EIGRP.
- Every routing protocol has its pros and cons. Good understanding of them is required to choose and implement the best solution for specific situation and requirement.
- With Distance-Vector routing protocols, every router in a network advertises all its known routes (complete routing table) to its neighboring routers. Finally, each router would have a complete routing table to all the subnets in the network by combining the received routing updates with its own routing table entries. A router running a Distance-Vector routing protocol does not know the topology of the entire network.
- Below describes the operation of Distance-Vector or Bellman-Ford algorithm:
i) RT1 advertises all its directly connected networks out all its interfaces.
ii) RT2 which received RT1 routing updates would advertise all its directly connected networks and the routes learned from RT1 out all its interfaces (RT1 would receive it too).
iii) Routers send and receive periodic routing updates to and from their neighboring routers.
iv) When a router fails to receive the routing updates from a neighbor, all the routes learned from the neighbor will be removed from its routing table.
- Below shows the operation of Distance-Vector routing protocols. The routing table of each router includes the network number, outgoing interface, and metric (hop count) to all networks.
Figure 11-1: The Operation of Distance-Vector Routing Protocols - Below are the main disadvantages of Distance-Vector routing protocols:
i) High network load, as complete routing tables (routing updates) are sent as broadcasts.
ii) Inconsistent routing tables and tends to have routing loops due to slow convergence.
Note: Convergence is referred to as the process of finding the new path upon a network failure.
- Distance-Vector routing protocols are also said to be “routing by rumor” or “gossip protocols”, as each router depends on its neighbors for routing information.
- Routing loops can occur when all routers are not updated at the same time. Figure 11-2 shows a routing loop scenario. Below describes how a routing loop could occur (refer to Figure 11-2):
All routers have route to Network 4. At one time, link to Network 4 fails. RT4 would inform RT3 about the bad news and RT3 would stop routing to Network 4 through RT4.
RT2 would notice this a while later when RT3 send out its latest routing update.
RT1 which was not received the routing update would send out its regular routing update.
RT2 received that and was told that Network 4 can be reach through RT1!
Routing loop occurred at this point where packets destined to Network 4 would send to
S0 Before convergence, each router has only the routes to its directly connected networks.
After convergence, every router has all the routes to all networks.
Figure 11-2: Sample Routing Loop Network
- It is very high probability that routers send routing updates to each other at about the same time.
Figure 11-3 shows another routing loop scenario – counting to infinity. Imagine that RT2 sends out an update to RT1 when the link to 172.16.3.0 is failed (metric 16 represents an unreachable network in RIP). Unfortunately RT1 send out an update to RT2 at about the same time and hence
RT2 learns that 172.16.3.0 can be reach through RT1. As a result, 2 versions of updates (infinite metric (16) and metric x) are sent out continuously until both numbers reach infinity (16).
Although eventually the routing loop is being resolved, it still slow down the convergence time.
Figure 11-3: Counting to Infinity
- Below lists the solutions for preventing routing loops (Distance-Vector loop-avoidance features):
Split Horizon Prevent a router from re-advertising the routing update information back to the same interface which the route(s) was learned, which also prohibits a router from advertising a route through an interface that the router itself is using to reach the destination.
It is able to prevent counting to infinity problem over a single link.
Route Poisoning A router will advertise a route to an unreachable network with an infinite metric to ensure all routers do not believe any rumor about the availability of the unreachable network. Poisoned routes are placed into holddown instead of waiting for the invalid timer to expire.
It is used to prevent routing loops due to inconsistent routing updates through alternative or redundant paths.
Poison Reverse When the network is stable, routers use split horizon. When a link has failed and a router received an infinite metric route, the route will be advertised out to all interfaces (route poisoning), including those prevented by split horizon. This ensures that all routers on the segment receive the poisoned route and will not use the invalid route.
It is able to prevent counting to infinity problem.
It is also known as split horizon with poison reverse.
RT1 RT2 RT3 RT4
Network 1 Network 2 Network 3 Network 4
RT1 RT2
172.16.1.0
172.16.2.0
172.16.3.0
172.16.3.0 1 172.16.3.0 16
172.16.3.0 16 172.16.3.0 2
1
2
172.16.3.0 3 172.16.3.0 16
3
Maximum Hop Count Hop count metric increases each time a route passes through a router.
It is able to solve counting to infinity problem by defining a maximum hop count. This is not a good solution since packets will still loop in the network until all routers removed or flushed the bad route from their routing tables.
Holddown When a router (RT1) did not receive the periodic routing update for a particular subnet from another router (RT2) after the invalid timer is expired (due to the passive interface configuration or RT2 is down), the route will be placed into holddown state (x is possibly down).
During this period, the router will ignore or suppress any incoming updates about alternative routes to that subnet (from routers other than RT2) until either a route with better metric is received (from
RT2) or the holddown timer expires.
It is able to prevent counting to infinity problem that split horizon does not solve, eg: networks with redundant links (Figure 11-4).
Triggered Updates Without waiting for the regular scheduled routing update timer to expire, a router will immediately send out an update as soon as a directly connected subnet has changed state (up or down), which intends to speed up convergence time. Also known as flash updates.
- Note: Some loop-avoidance features, eg: holddown, slow down convergence. Loop-avoidance features on distance-vector routing protocols are enabled and activated by default.
Figure 11-4: Counting to Infinity on Redundant Network
- Figure 11-4 shows another routing loop scenario – counting to infinity on redundant network (network with redundant links).
- Imagine that RT3 send out an update to RT1 and RT2 right after the link to 172.16.3.0 has failed.
However, RT1’s update timer expires at the same time and it sends out an update contains route to 172.16.3.0 to RT2 (RT1 does not send the update to RT3 due to split horizon). RT2 chooses the metric 2 route through RT1 between the RT3 infinite metric route and RT1 metric 1 route.
Note: Routers normally (and should) advertise the metric to a destination network based on the metric in the routing table. However, RIP advertises metric + 1 in the routing updates.
- On RT2’s next update, it does not advertise the infinite metric route to 172.16.3.0 to RT3 (due to split horizon), but it does advertise the route with metric 2 to RT3. After a while, RT3 also
RT1
RT2 RT3
172.16.3.0 172.16.3.0 2 172.16.3.0 16
RT1
172.16.3.0 16 172.16.3.0 1
1 2
1 1