RIP & EIGRP

RIP

  • Routing Information Protocol.

  • Industry standard.

  • Distance vector interior gateway protocol. So it uses ‘routing-by-rumour’ logic to learn and share routes.

  • RIP uses hop count as its metric, each router in the path to the destination counts as on ‘hop’, and the bandwidth is irrelevant.

  • 10 gigabit connection counts as one hop, and a 10 megabit connection also counts a one hop.

  • Maximum hop count is 15. Anything more than that is considered unreachable, and RIP will not insert the route into routing table.

  • So, RIP cannot be used for very large networks.

  • 3 versions :

    • for IPv4, RIP v1 and v2.

    • for IPv6, RIPng (RIP Next Generation).

  • 2 message types to learn and share routing information :

    • Request message, which asks RIP-enabled neighbor routers to send their routing table.

    • Response message, which is used to send the local router’s routing table to neighboring routers.

  • By default, RIP-enabled routers will share their routing table every 30 seconds. This can cause problems in networks with lots of routers, as these regular updates can clog up the network.

RIP v1

  • Very old protocol. If you’re going to use RIP, don’t use version 1.

  • RIPv1 only advertises classful addresses - no longer used in modern networks (Class A, Class B, Class C).

  • Because v1 only supports classful addresses, it doesn’t support things like VLSM and CIDR (used for subnetting).

  • When RIPv1 advertises a network to a neighbor, it doesn’t even include the subnet mask information in the advertisement.

  • If the advertised network is in the class A range, it is assumed to be /8, similary /16 for addresses in class B range and /24 in class C range.

    • 10.1.1.0/24 will become 10.0.0.0, a class A network.

    • 172.16.192.0/18 will become 172.16.0.0, a class B network.

    • 192.168.1.4/30 will become 192.168.1.0, a class C network.

  • Not acceptable in modern networks where IPv4 address classes are replaced with CIDR and VLSM (subnetting).

  • RIPv1's messages are broadcast to the IP address 255.255.255.255, so all routers on the local segment will receive the messages.

RIP v2

  • Supports VLSM and CIDR, and doesn’t have to be classful like v1.

  • To support this, it includes subnet mask information in its route advertisements (/30 network will be advertised as /30).

  • RIPv2 messages are multicast (not broadcast) to address 224.0.0.9 (class D range - reserved for multicast).

Broadcast messages are delivered to all devices on the local network.

Multicast messages are only received by devices that have joined that specific multicast group.

Configuration

![[rip config.png]]

Assuming all of the other routers have already been set up with RIP, let’s configure R1.

Setup

R1(config)# router rip R1(config-router)# version 2 R1(config-router)# no auto-summary

  • Always use version 2 if you’re going to use RIP.

  • Modern networks we need to be able to use things like VLSM and CIDR (classful IPv4 addressing is a thing of the past).

  • Auto-summary is ON by default, and it automatically converts the networks the router advertises to classful networks.

  • 172.16.1.0/28 network attached to R1 is a class B network, so it would be advertised as 172.16.0.0/16. Make sure it is turned OFF.

Network command

R1(config-router)# network 10.0.0.0 R1(config-router)# network 172.16.0.0

  • The command itself is classful (will automatically convert to classful networks).

  • If you enter the command 'network 10.0.12.0', it will be converted to 10.0.0.0 (because Class A range).

  • Because of this behavior, there is no need to enter a network mask.

  • The network command tells the router to look for interfaces with an IP address that is in the range specified (in the command).

  • Then it will activate RIP on the interfaces that fall in the range.

  • It will form adjacencies with other connected RIP-enabled neighbors, and advertise the network prefix of the interface (NOT the prefix in the network command).

Working

R1(config-router)# network 10.0.0.0

  • Because the 'network' command is classful, 10.0.0.0 is assumed to be 10.0.0.0/8.

  • R1 will look for any interfaces with an IP address that matches 10.0.0.0/8.

  • /8 means that only the first 8 bits need to match, so the first octet of the IP address needs to be the same.

  • 10.0.12.1 and 10.0.13.1 both match, they both have the same first octet of 10.

  • So, RIP is activated on G0/0 and G1/0.

  • R1 then forms adjacencies with its neighbors R2 and R3. R1 will send and receive route information to and from R2 and R3.

  • R1 advertises 10.0.12.0/30 and 10.0.13.0/30, the network prefixes of its G0/0 and G1/0 interfaces, to its RIP neighbors, R2 and R3.

  • Even though we used the 'network' 10.0.0.0 command, R1 doesn’t advertise the 10.0.0.0/8 network.

The 'network' command doesn’t tell the router which networks to advertise. It tells the router which interfaces to activate RIP on, and then the router will advertise the network prefix of those interfaces.

R1(config-router)# network 172.16.0.0

  • Because the network command is classful, 172.16.0.0 is assumed to be 172.16.0.0/16.

  • R1 will look for any interfaces with an IP address that matches 172.16.0.0/16.

  • 172.16.1.14 matches, so R1 will activate RIP on G2/0.

  • This time there are no RIP neighbors connected to G2/0, so no new adjacencies are formed.

  • R1 advertises 172.16.1.0/28 (not 172.16.0.0/16) to its RIP neighbors.

  • Although there are no RIP neighbors connected to G2/0, R1 will continuously send RIP advertisements out of G2/0.

This is unnecessary traffic, so G2/0 should be configured as a passive interface.

Passive-interface

R1(config-router)# passive-interface g2/0

  • Done from RIP configuration mode, not directly on the interface itself.

  • This configures G2/0 as a passive interface.

  • The passive-interface command tells the router to stop sending RIP advertisements out of the specified interface.

  • However, the router will continue to advertise the network prefix of the interface, which is 172.16.1.0/28, to its RIP neighbors, R2 and R3.

EIGRP and OSPF both have the same passive interface functionality, using the same command.

Default-information originate

Used to advertise R1’s default route to its RIP neighbors.

  • Configure a default route pointing to the Internet.

  • R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2

  • Any packets that don’t match any of the other entries in R1’s routing table will be sent to the Internet.

  • In the routing table, gateway of last resort is 203.0.113.2 to network 0.0.0.0 and under it you can see the configured static route to 0.0.0.0/0.

  • Now, I want to use RIP to tell R2, R3, and R4 about this default route so that they can reach the Internet as well.

R1(config-router)# default-information originate

  • Done from RIP configuration mode.

  • Now R1 will advertise the route to R2 and R3, and they will then advertise it to R4.

  • In the routing table of R4, it says ‘Gateway of last resort is 10.0.34.1 to network 0.0.0.0’

  • But below you can see two routes, one via f2/0 to R3 and one via g0/0 to R2.

  • Only one is actually stated up top as being the gateway of last resort, but because both of these routes have the same hop-count.

  • R4 will load-balance traffic over the two routes (RIP treats all connections equally as one hop, even though the connection via R3 is a slower fastethernet connection).

OSPF also has the same command to share a default route with neighbors.

Show IP protocols

R1# show ip protocols

  • This command can be used for RIP, EIGRP, and OSPF, to check various stats.

  • First up is the protocol that is being used, RIP in this case.

  • The version being used in 2.

  • Automatic network summarization is not in effect (because we used 'no auto-summary').

  • Maximum paths is 4, this refers to ECMP load-balancing.

R1(config-router)# maximum-paths <1-32>

By default, RIP will insert up to 4 paths to the same destination into the routing table if they have the same metric. However, this can be changed (same command for EIGRP and OSPF).

  • Next section shows the networks we entered with the 'network' command (these aren’t the actual networks RIP is advertising, the network command just identifies which interfaces to activate RIP on).

  • Next you can see the passive interfaces listed, just G2/0 in this case.

  • Under ‘routing information sources’ you can see R1’s RIP neighbors, 10.0.12.2 which is R2 and 10.0.13.2 which is R3.

  • Finally, 'distance' states the AD of RIP, which is currently the default of 120 (can be changed).

R1(config-router)# distance <1-255>

If you want to make RIP routes preferred over EIGRP routes make RIP’s AD lower than EIGRP’s AD of 90 (same command for EIGRP and OSPF).

EIGRP

  • Enhanced Interior Gateway Routing Protocol.

  • Improved version of the older IGRP, Interior Gateway Routing Protocol.

  • Considered an ‘advanced’ or ‘hybrid’ distance vector routing protocol (improves on the very basic operations of RIP).

  • It’s much faster than RIP in reacting to changes in the network.

  • It doesn’t have the 15 ‘hop-count’ limit of RIP, so it supports very large networks.

  • It sends messages using the multicast address 224.0.0.10 (RIPv1 broadcasts messages, and RIPv2 multicasts them to 224.0.0.9).

Load balancing

  • EIGRP is the only IGP that can perform [[#Unequal-cost load balancing]].

  • By default it performs ECMP load-balancing over 4 paths like RIP, but you can configure it to load-balance over multiple paths that don’t have equal cost.

  • EIGRP will even load-balance them in proportion to their bandwidth.

  • So, more traffic will be sent over paths with a lower-metric (faster paths), and less traffic will be sent over paths with a higher metric (slower paths).

Configuration

![[eigrp config.png]]

R1(config)# router eigrp 1 R1(config-router)# no auto-summary R1(config-router)# passive-interface g2/0

  • Enter EIGRP configuration mode with 'router eigrp' command followed by an AS, autonomous system, number.

  • The AS number must match between routers or they will not form an adjacency and share route information.

  • Then disable auto-summary. It functions the same as in RIP, it will advertise classful networks instead of the actual network prefix configured on its interfaces.

  • Then configure g2/0 as a passive-interface.

R1(config-router)# network 10.0.0.0 R1(config-router)# network 172.16.1.0 0.0.0.15

  • Used the 'network' 10.0.0.0 command to activate EIGRP on the g0/0 and g1/0 interfaces.

  • You can use a mask with EIGRP’s 'network' command, however it will assume a classful address if you don’t specify the mask.

  • So, 'network 10.0.0.0' is assumed to be 10.0.0.0/8.

'Network' command does not tell the router to advertise the 10.0.0.0/8 network. It tells to activate EIGRP on interfaces with an IP address that falls in the 10.0.0.0/8 range, so any IP address that begins with 10.

  • So EIGRP will be activated on g0/0, g1/0 interfaces.

  • The command 'network 172.16.1.0 0.0.0.15' activates EIGRP on the g2/0 interface.

Wildcard masks

  • EIGRP uses a ‘wildcard mask’ instead of a regular subnet mask.

  • A wildcard mask is basically an ‘inverted’ subnet mask.

  • All 1s in the subnet mask are 0 in the wildcard mask, and all 0s in the subnet mask are 1 in the wildcard mask.

  • Convert the 1's into 0's and 0's into 1's from the subnet mask to find the wildcard mask or subtract each octet in subnet mask from 255.

Prefix lengthSubnet maskWildcard mask

/24

255.255.255.0

0.0.0.255

/16

255.255.0.0

0.0.255.255

/8

255.0.0.0

0.255.255.255

/28

255.255.255.240

0.0.0.15

/25

255.255.255.128

0.0.0.127

/14

255.252.0.0

0.3.255.255

/19

255.255.224.0

0.0.31.255

/21

255.255.248.0

0.0.7.255

  • '0' in wildcard = bits must match between interface’s IP address and the EIGRP network command.

  • '1' in wildcard mask = bits need not match.

  • To find if they match, convert both to binary and check with wildcard mask.

  • In the above example, a /28 wildcard mask is used (the same prefix length of the network g2/0 is connected to).

  • Though you can use a variety of wildcard masks as shown below, just keep it simple and use the same prefix length as the interface itself.

  • Or use a /32 wildcard mask and specify the exact IP address on the interface (wildcard: 0.0.0.0 as subnet is 255.255.255.255).

Examples

IP address : 172.16.1.14 -> 10101100.00010000.00000001.00001110 Network command : 172.16.1.0 -> 10101100.00010000.00000001.00000000 Wildcard mask : 0.0.0.15 -> 00000000.00000000.00000000.00001111

  • This means that the first 28 bits must match.

  • They do match and EIGRP will be activated on the interface.

IP address : 172.16.1.14 -> 10101100.00010000.00000001.00001110 Network command : 172.16.1.0 -> 10101100.00010000.00000001.00000000 Wildcard mask : 0.0.0.7 -> 00000000.00000000.00000000.00000111

  • This means the first 29 bits must match.

  • But they don't, because the 29th bit doesn’t match between R1’s g2/0 interface and the network command.

  • So EIGRP will not be activated on the interface.

IP address : 172.16.1.14 -> 10101100.00010000.00000001.00001110 Network command : 172.16.1.8 -> 10101100.00010000.00000001.00001000 Wildcard mask : 0.0.0.7 -> 00000000.00000000.00000000.00000111

  • The first 29 bits matches and EIGRP will be activated on the interface.

IP address : 172.16.1.14 -> 10101100.00010000.00000001.00001110 Network command : 168.0.0.0 -> 10101000.00000000.00000000.00000000 Wildcard mask : 7.255.255.255 -> 00000111.11111111.11111111.11111111

  • This means that only the first 5 bits must match.

  • They match and EIGRP is activated on the interface.

Show IP protocols

R1# show ip protocols

  • It shows ‘Routing protocol is EIGRP 1’ (1 -> AS number).

  • EIGRP’s metric uses interface bandwidth and delay by default. Those are the ‘K1’ and ‘K3’ values that are set to 1 here.

  • The bandwidth of the SLOWEST link in the path, plus the sum of the delay values of all the links in the path, are used to calculate the metric.

  • The other k-values, K2, K4, and K5 are set to 0 by default and are not used to calculate metric (can be changed with configuration).

  • Next is the router-ID. In EIGRP and OSPF, the router has a unique router ID which identifies it within the AS.

  • Router ID order of priority :

    • Manual configuration.

    • Highest IP address on a loopback interface.

    • Highest IP address on a physical interface.

  • So, g2/0’s 172.16.1.14 became the router ID.

  • Router ID isn’t actually an IP address, it’s just a 32-bit number formatted like a dotted-decimal IP address, and you can change it to any 32 bit number.

R1(config-router)# eigrp router-id ID in IP format R1(config-router)# eigrp router-id 1.1.1.1

  • Router ID changes to 1.1.1.1, since manual configuration takes highest priority.

  • Automatic summarization is disabled.

  • EIGRP also performs ECMP load-balancing over a maximum of 4 paths by default, like RIP.

  • Then it displays 'Routing for networks 10.0.0.0 and 172.16.1.0/28'. These are the two 'network' commands entered earlier.

  • Then it shows g2/0 is configured as a passive interface.

  • There are two neighbors, R2 and R3.

  • EIGRP has two separate AD values

    • 90 -> internal routes

    • 170 -> external routes

R1# show ip route

  • EIGRP routes are indicated with the letter D.

  • The metric costs in the routes are larger values than OSPF and RIP.

  • Downside of EIGRP -> metrics are harder to understand.

Metric

  • EIGRP uses bandwidth and delay to calculate the metric of a route.

  • ( { K1 * bandwidth + (K2 * bandwidth) / (256-load) + K3 * delay } * { K5 / (reliability + K4) } ) * 256

  • The default K values are K1 = 1, K2 = 0, K3 = 1, K4 = 0, and K5 = 0.

  • K1 is multiplied by bandwidth and K3 is multiplied by delay.

  • Simplified version : metric = bandwidth of slowest link in the path to the destination + delay of all links in the path to the destination.

![[eigrp metric.png]]

  • Say R1 wants to send traffic to R4’s LAN. The route via R2 is the best.

  • So, the bandwidth of the slowest link (red box) is added to the delay of all links (blue boxes) to get the total metric value of the route.

  • Routers don’t actually send ping messages to measure the delay of each link.

  • ‘Delay’ value is actually a default value based on the interface bandwidth.

EIGRP metric = Bandwidth of slowest link + Delay of all links

Terminologies

Feasible distance

  • Local router’s metric value to the route’s destination.

  • From R1’s perspective, trying to reach 192.168.4.0/24 , that means the metric of the whole route, from R1 to R2, then R2 to R4, then for R4 to send the traffic out of its own inteface.

Reported distance (advertised distance)

  • Neighbor’s metric value to reach the destination.

  • For this route the neighbor is R2, the reported distance is R2’s metric to the destination.

![[eigrp terminology.png]]

In the output of the 'show ip eigrp topology' command, for the route to the 192.168.4.0/24 network,

via 10.0.12.2,

  • The number on the left is R1’s metric, the Feasible Distance.

  • The number on the right is R1’s neighbor, R2’s metric, the Reported Distance.

via 10.0.13.2,

  • On the left is R1’s total metric to reach the destination.

  • To the right is reported distance, R1’s neighbor R3’s metric to reach the destination.

**Successor **

  • Term for the route with the lowest metric to the destination (best route).

  • In this case, route via R2 is the successor to 192.168.4.0/24 because it has the lower metric, so it’s the best route.

Feasible Successor

  • An alternate route to the destination, it’s not the best route, but it must meet the ‘feasibility condition’.

  • Feasibility condition : A route is considered a feasible successor if it’s reported distance is lower than the successor route’s feasible distance.

![[eigrp terminology 1.png]]

  • R3’s reported distance is 28,416.

  • The successor route via R2’s feasible distance is 28,672.

  • 28,416 is less than 28,672, so the route via R3 is a feasible successor.

If a route meets the feasibility requirement, it is guaranteed not to be a looped route. This is a loop-prevention mechanism.

Unequal-cost load balancing

  • Unique feature of EIGRP, because other routing protocols only perform load-balancing if each route’s metric is equal.

  • In the output of 'show ip protocols' command, it says EIGRP maximum metric variance 1 (default value).

  • Variance of 1 = ECMP load-balancing will be performed.

  • This means a route’s feasible distance must be equal to the successor route to be chosen for load-balancing.

  • If another route’s FD is equal to the successor route’s FD, that route is a successor too. There can be multiple successors.

  • So, with the default settings EIGRP doesn’t do unequal-cost load-balancing.

Here in R1’s routes to 192.168.4.0/24,

  • Successor route’s FD is 28672. Feasible successor’s FD is 30976.

  • It’s higher, so it can’t be used to load-balance.

R1(config-router)# variance 2

  • 'variance 2' means that feasible successor routes with an FD up to two times the successor route’s FD can be used to load-balance.

  • Here, feasible successor’s FD of 30,976 is less than 2 times the successor’s FD of 28,672.

  • So the route via R3 can now be used for load-balancing and the route will be entered in the routing table.

  • However, R1 will send slightly more traffic via R2 than R3, because R2’s path has a lower metric, it’s a faster path.

EIGRP will only perform unequal-cost load-balancing over feasible successor routes. If a route does’t meet the feasibility requirement, it will NEVER be selected for load-balancing, regardless of the variance.

  • This is because the feasibility requirement is an important loop-prevention mechanism.

  • Router will never ignore it and put a non-feasible route in the routing table.

Definitions

  • The best metric along a path - feasible distance.

  • The best path to a destination network - successor.

  • A backup path that is guaranteed to be loop free - feasible successor.

  • The metric that the next hop router has calculated - advertised distance.

The ones with 'distance' in the name, refer to a kind of metric. And the ones with 'successor' in the name refer to a kind of route in EIGRP.

Quiz

![[wildcard mask quiz.png]]

  • Only the first digit has to be the same.

  • Since the digits are same, EIGRP will be activated on both the interfaces.

Q : When does a router use AD values to determine route selection?

A : When multiple routes to the same destination network are received and each of these routes is received from a different routing protocol.

  • If multiple routes to different destination networks are received, router doesn't have to choose between them, it will simply put in all of the routes in the routing table, because they are to different destinations.

  • When multiple routes to the same destination network are received and these routes are received from the same routing protocol, the router will have to choose which one to put in the routing table but the router uses the lower metric value, not AD, because the protocol is same (same AD for same protocol).

  • When the destination is same but the routing protocol is different, the router cannot compare the metrics, because each routing protocol uses a totally different metric.

Lab

Configuring loopback

R1(config)# interface loopback 0 R1(config-if)# ip address 1.1.1.1 255.255.255.255

  • It is common to use a /32 mask for loopback addresses.

  • A loopback interface is always up unless you manually disable it with the 'shutdown' command.

Configuring EIRGP

R1(config)# router eigrp 100 R1(config-router)# network 0.0.0.0 255.255.255.255

  • Since 'network' command uses a wildcard mask, so this is like a subnet mask of 0.0.0.0, meaning a /0 prefix length.

  • All IP address are in the 0.0.0.0/0 range, therefore EIGRP is activated on all interfaces.

(not recommended in real networks, but a simple trick for labs)

R1(config-router)# network 10.0.12.0 0.0.0.3 R1(config-router)# network 10.0.13.0 0.0.0.3 R1(config-router)# network 1.1.1.1 0.0.0.0

  • Use the exact prefix on each interface to enable EIGRP.

  • /30 subnet so the wildcard mask is 0.0.0.3

  • Don’t forget the loopback interface, we want to advertise R1’s loopback address to the other routers.

R1(config-router)# no auto-summary R1(config-router)# passive-interface l0

  • We should make interfaces like g0/0 (in R4), not connected to any EIGRP neighbors, a passive interface.

  • Good idea to do it on loopback interfaces also, because router will treat the loopback interface like any other interface and try to send EIGRP messages out of it, even though the loopback interface isn’t connected to any device.

R1# show ip neighbors

  • To view the EIGRP neighbors (OSPF has the same command).

  • You can see R1’s two neighbors, which interface they are connected to.

R1# show ip route R1# show ip route eigrp

(can also do for connected, local, static etc.)

  • Filter the command to view only EIGRP routes in the routing table by adding EIGRP on the end.

  • R1 has routes to the loopback interfaces of R2, R3, and R4.

  • Also contains the routes to subnet between R2 and R4, subnet between R3 and R4, and R4’s internal network.

R1# show ip eigrp topology

  • More detailed information about the EIGRP routes R1 has received, not just the ones in the routing table.

  • For example, here are two routes to 192.168.4.0/24, although only one is entered in the routing table (route via R2 - lower metric).

Last updated