Upload
iris-hubbard
View
214
Download
1
Tags:
Embed Size (px)
Citation preview
Routing Concepts
Warren ToomeyGCIT
Introduction
Switches need to know the link address and location of every station. Doesn't scale well, e.g. to several hundred million stations on the Internet.
Routers operate at OSI Layer 3. In particular, IP routers use link-independent addresses.
Routers don't route packets to individual stations, but to networks.
Introduction
Routers must do path determination: on which output interface is it best to send a packet?
How to measure best? Simple hop count? Do we care about bandwidth, $$$ cost, link load etc.
Routing Tables
Routers have a routing table. Each entry has identity of destination network/mask, cost to reach it, details of next hop to send the packet
How is a router's routing table constructed? Network admin could set up several static routes,
but when links fail these static routes will prevent packet forwarding across other links
We want the routers to learn the network connectivity: dynamic routes
Static & Default Routes
Static routes are fine where there is only one possible way to send traffic
A default gateway is an example of a static route where a router or station can see exactly one router which is Internet-connected: send all non-local traffic to this default gateway
Example Routing Table
If routes overlap, use the one with the biggest mask Default route has mask /0. If specified, catches all
packets which are not matched by the other routes No default route in the above table, so if packet
destined for 8.8.8.8 arrives, it is dropped
Network Mask Cost Via
145.67.8.128 /25 11 18.5.5.6
145.67.0.0 /16 8 96.7.1.2
220.40.1.224 /28 12 Serial 0/0/0
17.0.0.0 /8 3 18.5.5.6
Equal Cost Routes
R1 has two routes to bottom network, same metric R1 can send packets to R2 and R4 Packet load is shared across two links: equal cost
load balancing
Dynamic Routes Dynamic routes are ones which change due to
information learned from other routers. A routing protocol is used to exchange information about routes between routers.
Dynamic routes and enough alternate paths allow routers to work around breaks or problems in the network.
Goals of a Routing Protocol1. To dynamically learn and fill the routing table with a route to all
networks in the overall internet.
2. If more than one route to a network is available, to put the best route in the routing table. The other routes may also be added as fallback entries.
3. To determine when routes in the table are no longer valid, and to remove them from the routing table.
4. To find and use an alternate route if an existing route is removed from the table.
5. To do steps 1, 2, 3 and 4 as quickly as possible. The time it takes to obtain the best set of routes when something changes is known as the convergence time.
6. To prevent routing loops, i.e. to prevent routers having inconsistent views of the network.
Routing Metrics
Each static or dynamic route has a cost, or metric, associated with it. The lower the cost/metric, the better the route.
Dynamic metrics are often calculated from one or more factors e.g hop count, delay, bandwidth, link load, link reliability, link cost etc.
Routing Metrics
Different routing protocols use different metrics RIP: hop count EIGRP: bandwidth, delay, load and reliability OSPF: bandwidth
Routing Protocol Types
Distance Vector: Routers periodically tell their neighbours about the routes they know
Router learn by “word of mouth” about each network and the cumulative cost to reach it
No router has a complete map of the network Link State: Routers flood the network with details
of their immediate link connectivity Each router build a complete network map with link
costs Each router uses their map to find the best routes
Routing Protocol Types
Aim of any routing protocol is convergence: Every router has a consistent routing table Packets take their optimal route, with no loops
But, links change (new ones, failed ones) Time to reach consistency is time to convergence Link State protocols converge faster than Distance
Vector protocols RIP and EIGRP: Distance Vector protocols OSPF: Link State protocol
Distance Vector Routing
Routing table entry: network, mask, cost, next router e.g. 176.5.0.0/16, cost 12, via 11.5.6.7
DV routers advertise their routing table to neighbour routers: remove the next router, add on the cost to cross the link
Distance Vector Routing
Routers can keep multiple entries for a route, but they always use the one with the lowest metric
Routing table exchange is done periodically, so details of a link change takes time to propagate from the closest router to the furthest router
RIP sends updates every 30 seconds EIGRP sends updates every 90 seconds
Routing Loops
Routing loops occur when time to convergence is slow, and some routers are using outdated data.
For example:
Router C advertises a route to Network 1 to B and D
Count to Infinity Say C advertises “N1 cost 7” to B
B sends “N1 cost 8” to D
C stops hearing advertisements from B & D
C throws out the route it has to network N1 D advertises “N1 cost 9” to C. C adds this new route to its routing table
C advertises “N1 cost 10” to B
This repeats forever. To stop it, treat a certain metric value and over as infinity (impossible)
RIP uses 16 as its infinity metric
The discarding of a route when it reaches infinity is known as "counting to infinity"
Counting to infinity will eventually break the routing loop, but it takes a long time to do so
Split Horizon
Link to N1 breaks, but R1 has routing entry to N1 R1 sends “N1 cost 2” to R2, who adds it to table Any packet going to N1 bounces between R1 & R2 Solution is Split Horizon: information learned from
one router is never sent back to that same router, just in case it is now incorrect
However, can pass on information learned from another router
Split Horizon with Poison Reverse
A variation on Split Horizon is called Split Horizon with Poison Reverse
Here, information learned from one router is always sent back to that same router, but it is adverstised with an infinite cost
The effect is the same in both cases: a routing loop between two routers will be broken
Hold Down Timers
Split Horizon break loops between 2 routers, not a circle of >2 routers. Still have count to infinity: slow
To improve convergence, use timers Hold-down timer: if do not receive advertisement after the
hold-down time, treat it as suspicious. Use route, but do no re-advertise it. Ignore advertisements with higher metrics
Flush time: if still no advertisement after flush time, remove route from routing table
RIP: advertisements every 30s, hold down 180s, flush 240s
Hold Down Timers
B has “N1 cost 2 via A” in its table. N1 link breaks E stops advertising route to A: route held down A stops advertising to B: route held down C sends “N1 cost 4” to B. Ignored as higher metric
and the route is marked as suspicious
Route Poisoning
Note: different to Poison Reverse Timers OK, but take time to expire when a route is
not advertised Instead, when route is lost, advertise it to neigbours
with the infinity value. In previous diagram, E sends “N1 cost infinity” to A
A updates its table immediately, passes the infinity advertisement on to its neighbours
Much faster than waiting for the timers to expire
Flash Updates
Distance Vector advertises periodically: RIP is 30s Why wait? Send advertisement as soon a a new
route appears or an old one changes Improves convergence time However, causes more network traffic, as new route
floods out from router to router Is a problem with links that “flap”: come up, go
down, come up
Drawbacks of Distance Vector
Convergence of Distance Vector is slow for several reasons:
delays in advertisements inability to tell if information is true or false
Workaround like count to infinity, split-horizon Techniques like flash updates help to reduce advertisement
delays Techniques like poison reverse, route poisoning help to
distinguish false information from correct information Still, no router has full map of the network
Link State Routing Protocols
Link State routing protocols find the best (lowest metric) path by building a full topology map of the internetwork in each router
Link-state routing uses: link-state packets (LSPs), a topological database, Dijkstra's algorithm (SPF) to find the best paths to
all networks, a routing table of paths and interfaces to each
network.
Link State Packets
R1 sends out this to all of its neighbours
Connected Link/Network Link Cost and State
Link to R2 23, up
Link to R3 18, up
Link to R4 9, up
Link to 207.8.8.0/25 1, up
Link State Packets
As each router receives this LSP, it passes it on to other neighbour routers
LSP floods out to all
routers Each router updates their
topological database
with the information
Dijkstra's (SPF) Algorithm
When each router's topological database changes, it runs Dijkstra's algorithm to find the best routes to every network
Which is the best path from 1 to 6? From 3 to 1?
Link State Problems
LSP are flooded whenever a link changes. Can cause a lot of extra network traffic. Will cause a lot of CPU work on every router
Routers need more RAM to hold the topological database
Solutions: break the internetwork up into areas, LSPs are only flooded within an area
Elect certain routers to be the only routers to send out LSPs
Link State Areas
Link State Designated Routers
In multiaccess links, one Link State router is elected to send out LSPs: the designated router
– A second router is elected the backup designated router
Helps to minimise LSP traffic