IP routing
the point of a router is to move packets from one IP network to another and learn about nonattached networks. this can be done via static routes or dynamic routes.
Common dynamic protocols are as follows
• OSPF
• EIGRP
• BGP
• IS-IS
• RIPv2
The protocols listed above(except for BGP) they are meant for interior Gateway Protocols(IGP) BGP is an exterior Gateway Protocol(EGP)
Distance Vector Algorithms
Protocols such as RIP advertise routes as vectors and distance is a metric or cost (e.g hop count) the vector would be the next hop router IP. Interface speed is not taken into account.
Enhanced Distance Vector Algorithms
EIGRP has enhancements over distance vector protocols
• Has rapid convergence
• Sends updates only when there is a change in the network
• It uses hellos and forms neighbor relationships similar to that of link state protocols
• Uses bandwidth, delay, reliability, load, and MTU instead of hop count
• Can load balance across equal and unequal paths
Link-State Algorithms
Link-state protocols advertise the state and metrics for each of its connected links and routers(e.g. OSPF and IS-IS). link state information is flooded through the network unchanged just as the originating router advertised it. This allows router to have an identical and in-sync map of the network that each router can run Dijkstra shortest path first against.
Path Vector Algorithm
Protocols such as BGP. Instead of looking at distance they look at the best loop-free path. Path properties include autonomous System Number, multi-exit discriminator, origin, next hope, local preference. A path vector protocol can guarantee a loop-free path by keeping track of each autonomous system that the routing advertisement traverses
Path Selection
A router will use the forward information base(FIB) to evaluate the prefix length when determining what path should be used. The FIB is programmed from the routing in$
• Prefix length; E.g. 192.168.0.1/25 and 192.168.0.128/25 are to separate networks with separate paths and would be more preferred of a 192.168.0.1/24 route
• Administrative distance;
| Route Source | Default Distance Values |
|---|---|
| Connected interface | 0 |
| Static route | 1 |
| Enhanced Interior Gateway Routing Protocol (EIGRP) summary route | 5 |
| External Border Gateway Protocol (BGP) | 20 |
| Internal EIGRP | 90 |
| IGRP | 100 |
| OSPF | 110 |
| Intermediate System-to-Intermediate System (IS-IS) | 115 |
| Routing Information Protocol (RIP) | 120 |
| Exterior Gateway Protocol (EGP) | 140 |
| On Demand Routing (ODR) | 160 |
| External EIGRP | 170 |
| Internal BGP | 200 |
| Unknown* | 255 |
• Metrics; in the case of multiple paths to a destination metrics are used to determine which path is best. Metrics are also used with equal cost multipathing / unequal cost load balancing.
The 3072 value below is the metric
switch#sh ip route eigrp
D EX 10.10.0.0/16 [170/3072] via 172.16.10.2, 4w4d, Vlan172
D 10.10.2.0/24 [90/3072] via 172.16.10.2, 4w4d, Vlan172
Static Routes
Static routes provide precise control over a network but can create a burden as these are managed on a device by device basis. Static routes come in 3 types
• Directly Attached [ip route 192.168.0.0 255.255.255.0 serial1/0]
• Recursive [this is dependent on the router knowing how to find the next hop router(not directly connected)]
• Fully Specified [192.168.0.0 255.255.255.0 192.168.1.1]
Floating static route example. This sets a metric so that the higher metric route will be used only if the lower metric route is removed from the RIB.
Ip route 192.168.0.0 255.255.255.0 172.16.0.1 1
Ip route 192.168.0.0 255.255.255.0 172.16.1.1 210
Null routes can be used to reduce CPU overhead on a router
IPv6 Routes
IPv6 static routes work in the same way as IPv4 routes ipv6 routing does need to be enabled.
ipv6 unicast-routing
Virtual Routing and Forwarding
Virtual Routing and Forwarding(VRF) create wholly separate routing tables, interfaces, and forwarding tables on one physical router. Networks can overlap.
vrf definition MYVRF
address-family ipv4
!
Int gi0/0
Ip add 192.168.0.1 255.255.255.0
!
Int gi1/0
Ip add 192.168.0.1 255.255.255.0
vrf forwarding MYVRF
!