C SC 481.20 Lecture 11 : Routing Algorithms and IP Routing
major resource: Computer Networking (4th Edition),
Kurose and Ross, Addison Wesley, 2008
[ previous
| schedule
| next ]
Routing Algorithms
Overview
- Use graph theory to present algorithms
- nodes : routers (are assigned IDs)
- edges : links between routers (can be directed or undirected)
- weights on edges: any cost measure of using that link (distance, congestion, capacity)
- shortest path : minimum number of links (hops)
- least cost path : minimum total cost, regardless of # hops
- Static vs. Dynamic routing algorithms
- static means routes change very slowly (e.g. manual changes to tables)
- dynamic means routes evolve as network loads and topologies change
- Global vs. Local routing algorithms
- global means all nodes have complete knowledge of topology and costs (e.g. link state)
- local means nodes receive knowledge only from neighbors (e.g. distance vector)
- both are distributed in the sense that each node does its own calculations
- truly centralized algorithm is impractical -- why?
Link State Algorithms, illustrated by Dijkstra's
- Before algorithm is run, all nodes must have complete cost and topology information.
- Knowledge achieved by each node broadcasting costs to get from itself to its neighbors.
- Algorithm works for either directed or undirected graphs.
- Undirected means assume link cost is same in both directions (not always true).
- Algorithm calculates shortest path from a given source to all destinations.
- Each node runs algorithm with itself as source.
- Results of this iterative algorithm go into routing table.
Distance Vector Algorithms
- Each node communicates only with its neighbors
- Each node calculates only its own table
- Distance vector table layout:
- Each row is a Distance Vector received from neighbor Y
- Each column is a destination router X
- Distance Vector from neighbor Y contains cost from Y to every other node (forms a vector)
- Each entry represents cost to destination X via neighbor Y.
- Least cost path for each destination is copied into forwarding table.( dest., neighbor, maybe cost)
- Table is dynamically updated. When? When node receives message from neighbor node.
- When does node send message? When its own update causes change(s) to least cost path.
- What does message contain? Destination ID and cost (note: neighbor ID is not in message).
- “good news travels fast” – when a link cost decreases, full reduction propagates rapidly (one hop per update)
- “bad news travels slow” – when a link cost increases (or link goes down) the increase may propagate at only one cost unit per update (the “count to infinity” problem). There are countermeasures.
Hierarchical routing
- How large would routing tables be if every router needed an entry for every other router and host?
- Define autonomous systems (AS) as logical grouping of routers.
- Inter-AS routing is routing from one AS to another.
- Intra-AS routing is routing within an AS.
- They can use different routing methods.
- ANALOGY: Post office as AS. use 5-digit ZIP code to deliver to destination post office (“inter-AS”), street address to deliver to host from there (“intra-AS”)
- Routers at the AS “edge” are called gateway.
- Gateways communicate with other gateways to implement inter-AS.
- Gateways must be able to run routing methods for both inter- and intra-AS.
Routing IP datagrams
RIP – an intra-AS protocol
- Routing Information Protocol
- A distance vector protocol
- Distributed with early TCP/IP as part of BSD unix
- Cost is hop count (e.g. each link has cost 1).
- 15 hop limit.
- Distance vectors exchanged every 30 seconds
- Exchange protocol uses UDP and port 520. Yes, transport layer protocol used to implement network layer function!
OSPF – an intra-AS protocol
- Open Shortest Path First
- A link state protocol
- Uses Dijkstra’s algorithm
- Has security features (exchanges authenticated)
- Allows use of multiple same-cost paths
- Can use different cost metric for different TOS, e.g. different graph for each TOS
- Supports hierarchical structure w/i the AS.
- AS partitioned into areas, each area has border router, one area has backbone.
- Backbone routes among area border routers
- Area border routers route within area
BGP – an inter-AS protocol
- Border Gateway Protocol, RFC 1772
- De facto standard for Internet
- For routing between AS’s. E.g. between organizations.
- Policy and political considerations now come into play (e.g. routers on AT&T networks will not route through routers on MCI networks).
- Path may not be “optimal cost”
- “Path vector” algorithm, a variation of distance vector
- Routers maintain path to each destination AS. In BGP, these paths are periodically communicated to neighbor (called “peer”).
- Note that exchanged paths do not contain cost information.
- Example:
- network with routers A through H.
- A is a peer of B
- B has this route for datagrams destined for H: BCEH.
- B sends this path info to A.
- A then may set its path to H as: ABCEH, but doesn’t have to.
- Decision not to, may be technical (already has shorter path) or political (A will not route anything through E because E is owned by competitor).
- Routers exchange BGP messages via TCP, port 179.
- There are 4 types of BGP messages:
- open – to establish contact with peer
- update – to send (“advertise”) path vector to peer
- keepalive – let peer know your connection is still OK
- notification – let peer know that error has occurred
- BGP can also be used for intra-AS routing (IBGP, Internal BGP)
End of material for Exam 2
[ C
SC 481 | Peter
Sanderson | Math Sciences server
| Math Sciences home page
| Otterbein ]
Last updated:
Peter Sanderson (PSanderson@otterbein.edu)