Figure 11.1: some routers connected to some networks.
Suppose that we have a group of routers connected to a group of networks as seen in figure (11.1), the routing protocol is used to inform every router the path to every network.
By default, every router knows about its direct connected networks – because those networks are stored in its routing table –, but it does not know about other networks.
As an example, the router ‘R1’ knows by default about networks (10.0.0.0, 184.108.40.206, 220.127.116.11). However, it does not know about other networks.
To make ‘R1’ knows about all other networks, we use the routing protocols.
In the static routing protocol, the administrator of the network manually configures every router.
Therefore, this method has high administrative effort on the administrator.
In the dynamic routing protocol, the routers automatically communicate with each other, and exchange data about the networks it knows about. Therefore, every router knows the path to every network.
This method consumes from the router’s CPU and the network’s bandwidth.
Table 11.2: a comparison between static and dynamic routing.
In the static routing, the administrator manually configures every router.
To make that, the administrator logs in to the router and enters to the ‘global configuration mode’.
In the ‘global configuration mode’, the administrator writes the following command,
Router(config)# ip route network IP subnet mask next hop IP
Router(config)# ip route network IP subnet mask exit interface
‘Network IP’ is the network IP of the destination network.
‘Subnet mask’ is the subnet mask of the destination network.
‘Next hop IP’ is the IP of the next hop router interface.
‘Exit interface’ is the router’s interface that the router should send the packet through it.
Suppose we have the network in figure (11.2),
The administrator needs to configure ‘R1’ to be able to reach the network ‘18.104.22.168/24’.
Then, the parameter will be as following,
Network IP = 22.214.171.124
Subnet mask = 255.255.255.0
Next hop IP = 126.96.36.199
Exit interface = ser 0/0
In the dynamic routing, the routers communicate with each other in order to exchange the network’s information.
Every router should determine the shortest path (least cost path) to every network in order to store this path in its routing table to use it.
In figure (11.3), ‘R2’ is able to reach ‘Net3’ through two paths – through ‘R4’ and through ‘R3’. ‘R2’ should determine the shortest path to ‘Net3’ and store it in its routing table in order to use it.
The dynamic routing protocols are divided into two groups,
In this type,
• Updates are sent periodically (every specific time).
• Updates contain information about the entire routing table.
• Updates are sent only to neighboring routers.
In this type,
• Updates are sent when a change occurs in the routes.
• Updates contains information about only the affected routes.
• Updates are sent to the entire network.
In the distance vector routing, every router sends its entire routing table to only neighboring routers, and this is done every periodic time.
So, every router knows only about its neighboring routers.
The cost of the path – path metric – in the distance vector routing is determined by the ‘hop count’, which is the number of hops – routers – between the source and the destination.
Figure 11.4: the distance vector routing
By default, every router knows its direct connected networks as seen in figure (11.4).
R1 sends its routing table to R2.
R2 sends its routing table to R1 and R3.
R3 sends its routing table to R2.
After the routing table exchange between all routers, the routing table of R1, R2, and R3 respectively will be as following,
Figure 11.5: the routing tables after the route exchange
As you can see in figure (11.5), now every router is able to reach every network.
The routing loop is a problem that causes the packets to enter in a loop between the routers.
This problem happens because of the exchange of incorrect route information between the routers.
The routing loop may happen in a network that is using a distance vector routing protocol.
To solve the routing loop problem, we have many solutions,
Every packet contains a field in its IP header, which is called the ‘TTL’ (Time To Live). The TTL value is reduced every time it passes by a router.
Therefore, if a routing loop happened, the packet will be discarded after a while when the TTL value become zero.
It is a simple rule that says, ‘never send routing updates out of the interface this update is received from’.
When a path to a network becomes unavailable, inform all the routers that, this network has infinite metric, so that all routers will update its routing table with this information.
This rule states that, when a route is marked as ‘unreachable’, stay in hold down state for a time that equals to the hold down time.
The ‘hold down state’ means, do not accept updates about this route.