prof. younghee lee 1 1 computer networks u lecture 6: routing prof. younghee lee
TRANSCRIPT
1Prof. Younghee Lee1
Computer Networks Lecture 6: Routing
Prof. Younghee Lee
2Prof. Younghee Lee2
Router Architecture Overview
Two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) switching datagrams from incoming to outgoing link
3Prof. Younghee Lee3
Input Port Functions
Decentralized switching: given datagram dest., lookup output port using r
outing table in input port memory goal: complete input port processing at ‘line spe
ed’ queuing: if datagrams arrive faster than forwardi
ng rate into switch fabric
Physical layer:bit-level reception
Data link layer:e.g., Ethernetsee chapter 5
4Prof. Younghee Lee4
Input Port Queuing Fabric slower that input ports combined -> queueing ma
y occur at input queues Head-of-the-Line (HOL) blocking: queued datagram at f
ront of queue prevents others in queue from moving forward
queueing delay and loss due to input buffer overflow!
5Prof. Younghee Lee5
Three types of switching fabrics
6Prof. Younghee Lee6
Switching Via MemoryFirst generation routers: packet copied by system’s (single) CPU speed limited by memory bandwidth (2 bus crossings per datagram)
InputPort
OutputPort
Memory
System Bus
Modern routers: input port processor performs lookup, copy into memory Cisco Catalyst 8500
7Prof. Younghee Lee7
Switching Via Bus
datagram from input port memory
to output port memory via a shared bus
bus contention: switching speed limited by bus bandwidth
1 Gbps bus, Cisco 1900: sufficient speed for access and enterprise routers (not regional or backbone)
8Prof. Younghee Lee8
Switching Via An Interconnection Network
overcome bus bandwidth limitations Banyan networks, other interconnection nets initially dev
eloped to connect processors in multiprocessor Advanced design: fragmenting datagram into fixed lengt
h cells, switch cells through the fabric. Cisco 12000: switches Gbps through the interconnection
network
9Prof. Younghee Lee9
Output Ports
Buffering required when datagrams arrive from fabric faster than the transmission rate
Scheduling discipline chooses among queued datagrams for transmission
10Prof. Younghee Lee10
Output port queueing
buffering when arrival rate via switch exceeds output line speed queueing (delay) and loss due to output port buffer overflow!
11Prof. Younghee Lee11
Network Processor
Runs routing protocol and downloads forwarding table to line cards– Some line cards maintain two forwarding tables to
allow easy switchover
Performs “slow” path processing– Handles ICMP error messages– Handles IP option processing
12Prof. Younghee Lee12
Elementary concept of graph theory Vertices: nodes Edges: links |V|: the number of vertices, the order of G |E|: the number of edges, the size of G Adjacency matrix
* Adjacency list: compact way to represent sparse graphs Parallel edges, loop, simple graph, simple path, distance
jiji
EjiaaAVV ijij
and verticesith theincident w );,(
otherwise 0
),( if 1 )(matrix adjacency ||||
13Prof. Younghee Lee13
Diagraphs and Weight Graphs Digraph: directed graph Weighted graph
– the length of a path: sum of the weights of the edges in the path
otherwise 0
),( if )(matrix adjacency
Ejiw
aaAij
ijij
14Prof. Younghee Lee14
Shortest Path Length Determination Dijkstra’s Algorithm: weighted shortest path
– find the shortest paths from a given source vertex to all other vertices by developing the paths in order of increasing path length» 1. Initialization:
» 2. Get next vertex
» 3. Update least-cost paths
vertex to frompath cost -least theofcost ; for ),()(
cost link ),( vertex,source : }{
nssnjiwnL
jiwssT
Tx
jLxLTx Tj
to Add
)()(such that Find min
allfor )],()(),(min[)( MnnxwxLnLnL
15Prof. Younghee Lee15
Shortest Path Length Determination Dijkstra’s Algorithm
16Prof. Younghee Lee16
Shortest Path Length Determination Bellman-Ford Algorithm
– Find the shortest paths from a given source vertex subject to the constraint that the paths contain at most one link, then find the shortest paths with a constraint of paths of at most two links, and so on.
» 1. Initialization
» 2. Update
links than more no of constraint under the
vertex vertex to frompath cost -least theofcost ;)( allfor ,)(0
h
nsnLsnnL h
)],()([)(
compute ,each For
;0 successiveeach For
min1 njwjLnL
sn
h
hjh
17Prof. Younghee Lee17
Shortest Path Length Determination Bellman-Ford Algorithm
18Prof. Younghee Lee18
Shortest Path Length Determination Comparison
– Information to be gathered:» Dijkstra’s Algorithm: complete topological information about the network» Bellman-Ford Algorithm: knowledge of the link cost to all neighboring vertices to vertex n…
19Prof. Younghee Lee19
Routing Requirements Scales to large numbers of nodes.
– asymptotic properties matter
Robust in the presence of failures.– Centralized algorithms unacceptable because they form a
single point of failure– small errors should not result in disasters
Adapts to changes in the network.– link or node errors– load sensitive routing
Selects high quality paths.– Small number of hops, low load, ..
20Prof. Younghee Lee20
Taxonomy Static versus adaptive (load sensitive).: fixed, adaptive
– Does the route depend only on static topology information or also on the load conditions
Hop-by-hop versus source routing.– Routers determined one hop at a time or preplanned
Precomputed versus on demand.– Routes are looked up in a precomputed table or are calculated for
each packet/connection request
Centralized versus distributed.– Where are how are routing decisions made
Link state versus distance vector.– Two commonly used routing mechanisms
21Prof. Younghee Lee21
The Routing Function Adaptive Routing
– Principal condition that influence routing decisions» Failure» Congestion
– drawbacks» processing burden » performance degradation due to information exchanges» congestion-producing oscillation» pathologies: fluttering, looping
– more prevalent than fixed routing» improve performance» aid in congestion control
– adaptive routing strategies» basis of local information: (shortest queue length Q)+(bias Bi for destination I);rare
» basis on information from adjacent routers: distance-vector algorithms» basis on information from all routers: link-state algorithms
22Prof. Younghee Lee22
Autonomous Systems Group of routers exchanging information
via a common routing protocol set of routers and networks managed by
a single organization
IRP: Interior routing protocol: RIP, OSPF ERP: Exterior routing protocol: BGP,
IDRP
23Prof. Younghee Lee23
Distance Vector Routing
Each node knows its neighbors and the cost of getting to the neighbors.
Each node keeps a routing table– destination + cost + outgoing link
Each node sends the (destination + cost) vector to its neighbor.– incoming updates are used to execute one iteration of Dijkstra’s algorit
hm (Bellman-Ford algorithm) When are updates sent?
– whenever information changes: fast propagation:– periodically: provides robustness against node failure
Routing Information Protocol (RIP).– shortest-hop distance vector protocol for networks– intradomain protocol
24Prof. Younghee Lee24
Common Properties
Distributed algorithms.– reachability information continues to propagate– but can result in temporary problems (e.g. routing loops)
Redundancy.– makes the system more robust
“Soft” state.– state that is periodically updated– can survive node failures
» after a short interruption of service
25Prof. Younghee Lee25
Routing Metrics Static information.
– hop count (metric = 1)– link bandwidth
Dynamic information.– queue length, measured latency, ..– combination of latency and bandwidth– danger: oscillation!!
Multi-path routing.– keep multiple paths for each destination– distribute traffic in some way
Most networks today use very simple routing metrics.– concern about correctness and stability
26Prof. Younghee Lee26
Distance-Vector Protocol: RIP The Algorithm
– link cost vector Wx, distance vector Lx, next-hop vector Rx
yx
NxAyjxR
NxwjyLjxL
x
N
xM
jxjxR
jxjxL
NxR
xR
NxL
xL
Mx
x
xy
xyAy
xxx
router and node connectsthat
network , nodefor nodesneighbor ofset where ),(
),(),(Min),(
follows; as vectorsits ofboth updates Node
ion configurat in the networks ofnumber :
attachesdirectly node which tonetworks ofnumber :
network to node from routedelay minimumcurrent in therouter next the),(
network to node fromdelay minimum of estimatecurrent ),(
),(
)1,(
),(
)1,(
),w(
)1,w(
RLW
27Prof. Younghee Lee27
Distance-Vector Protocol: RIP
Routing Table of host X before update
Destination Network
Next Router R(X,j)
Metric L(X,j)
1 - 1
2 B 2
3 B 5
4 A 2
5 A 6
Routing Table of host X after update
Destination Network
Next Router R(X,j)
Metric L(X,j)
1 - 1
2 B 2
3 A 3
4 A 2
5 A 3
B
3
1
4
3
4
C
8
8
5
6
6
A
6
3
2
1
2
Delay vectors sent to host X from neighbor routers
* w(x, 1)=1
28Prof. Younghee Lee28
Distance-Vector Protocol: RIP Distributed Bellman-Ford Algorithm
– The equation is the same with the Bellman-Ford algorithm– suppose that each router x begins with the following assignment:
– was used as original routing algorithm in the ARPANET– Each iteration is equivalent to one iteration of step 2 of Bellman-Ford algorithm – Difficulty of synchronized update.
» RIP: Asynchronous method : every 30 seconds by its own timer, each router transmits….. => correct result One or more changes occur in link costs => converge to the correct answer within a finite time proportional to the number of router
otherwise
network toconnecteddirectly is if ),(),(
jxjxwjxL
29Prof. Younghee Lee29
Distance-Vector Protocol: RIP
RIP Details– Incremental Update:
» If the incoming distance vector includes a new destination network, this information is added to the routing table
» If the node receives a route with a smaller delay metric to a destination, it replaces the existing route.
» If the node receives an update vector from router R which is the next hop, then all of entries are updated to reflect the new information from R
when some router goes down ..
– Topology changes:» Every router send an update vector to its neighbors every 30 seconds.
» If router receives no updates from N within 180 seconds, it marks the route as invalid.
» Uses a value of 16 to equal infinity
30Prof. Younghee Lee30
Distance-Vector Protocol: RIP RIP Details(continued)
– Counting to Infinity Problem» Slow convergence to a change in topology» B: L(B, 5) = 2, R(A,5) = B, R(C,5) = B» when D fails, » B and A (or C) advertises each other » L(B, 5) = 1 + L(A, 5) = 1+ 1+ “L(B,5)” = 4» takes 8 - 16 minutes to reach 16.
– Split Horizon with Poisoned Reverse» split horizon: it is never useful to send
information about a route back in the direction
from which it came.
– Poisoned reverse» advertising reverse routes with
a metric of 16 breaks the loop immediately
31Prof. Younghee Lee31
Distance-Vector Protocol: RIP RIP Packet Format
– typically, a link cost of 1 is used, so that the metric is a simple hop count
RIP Limitation – As internet grow, destinations that require a metric of more than 1
5 become unreachable.
– The overly simplistic metric leads to suboptimal routing tables.
– RIP-enabled devices will accept RIP updates from any device. This enables a misconfigured device easily to disrupt an entire configuration
32Prof. Younghee Lee32
RIP ( Routing Information Protocol)
Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops)
– Can you guess why?
Distance vectors: exchanged every 30 sec via Response Message (also called advertisement)
Each advertisement: route to up to 25 destination nets
33Prof. Younghee Lee33
RIP Table example (continued)
Router: giroflee.eurocom.fr
Three attached class C networks (LANs) Router only knows routes to attached LANs Default router used to “go up” Route multicast address: 224.0.0.0 Loopback interface (for debugging)
Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 26492 lo0 192.168.2. 192.168.2.5 U 2 13 fa0 193.55.114. 193.55.114.6 U 3 58503 le0 192.168.3. 192.168.3.5 U 2 25 qaa0 224.0.0.0 193.55.114.6 U 3 0 le0 default 193.55.114.129 UG 0 143454
34Prof. Younghee Lee34
Link State Routing
Each node collects information about the network topology and link costs.– Nodes periodically sends information about its immediate topology
to all other nodes using flooding» information includes neighbors and link costs
– a time-to-live field is used to expire old information Nodes execute Dijkstra’s algorithm locally.
– Build local forwarding table Amount of state information limits scalability.
– The entire network topology is broadcasted over the network– Each node has to store the entire network topology
35Prof. Younghee Lee35
Link-State Protocol: OSPF Preferred IRP for TCP/IP network
36Prof. Younghee Lee36
Comparison of LS and DV algorithms
Message complexity LS: with n nodes, E links, O(n
E) msgs sent each DV: exchange between neighb
ors only– convergence time varies
Speed of Convergence LS: O(n**2) algorithm requires
O(nE) msgs– may have oscillations
DV: convergence time varies– may be routing loops– count-to-infinity problem
Robustness: what happens if router malfunctions?
LS: – node can advertise
incorrect link cost– each node computes only
its own table
DV:– DV node can advertise
incorrect path cost– each node’s table used by
others » error propagate thru network
37Prof. Younghee Lee37
Link-State Protocol: OSPF Link-state Routing
– general description» When a router is initialized, it determines the link cost on each of its network interfaces.» Then it advertises this information to all other routers in the internet topology.» The router monitors its link costs.» Whenever there is a significant change, it advertises » Each router can construct the topology of entire configuration, calculate the shortest path to each destination: Dijkstra’s algorithm is used
38Prof. Younghee Lee38
Link-State Protocol: OSPF Link-state Routing
– Flooding» send to all except for the link on which it arrived» when duplicated copies of the packet arrives, they are discarded» robust» minimum-delay» all routers receive the information needed
* (for military networks)
39Prof. Younghee Lee39
OSPF Open Shortest Path First Protocol Open protocol defined in RFC 2328. Link-state routing protocol that finds short paths using Dijkst
ra’s algorithm. Many advanced features:
– Security: all route exchanges are authenticated– Same-cost paths: traffic can be split across paths with the same cos
t for load balancing purposes– Different cost metrics for different TOS traffic– Integrated support for unicast and multicast routing– Support for hierarchy inside a single routing domain to improve scali
ng: » a domain is divided in areas that function that run an OSPF link-state protocol» area border routers handle inter-area traffic; they are organized as a backbone
40Prof. Younghee Lee40
Link-State Protocol: OSPF Link Costs
– flexible routing metric scheme based on the concept of TOS.» Normal (TOS 0): default routing metric» Minimize monetary cost (TOS 2):» Maximize reliability (TOS 4)» Maximize throughput (TOS 8)» Maximize delay (TOS 16)
– Each router may construct up to five distinct routing table
Areas– Area: A collection of contiguous networks and hosts, together with routers having interfaces to any one of the included networks– Backbone: A contiguous collection of networks not contained in any area, their attached routers, and those routers that belong to multiple areas.
41Prof. Younghee Lee41
Hierarchical OSPF
42Prof. Younghee Lee42
Hierarchical OSPF
Two-level hierarchy: local area, backbone.– Link-state advertisements only in area – each nodes has detailed area topology; only know dir
ection (shortest path) to nets in other areas. Area border routers: “summarize” distances to nets in
own area, advertise to other Area Border routers. Backbone routers: run OSPF routing limited to backbon
e. Boundary routers: connect to other ASs.
43Prof. Younghee Lee43
IGRP (Interior Gateway Routing Protocol)
CISCO proprietary; successor of RIP (mid 80s) Distance Vector, like RIP several cost metrics (delay, bandwidth, reliability, load et
c) uses TCP to exchange routing updates Loop-free routing via Distributed Updating Alg. (DUAL) b
ased on diffused computation
44Prof. Younghee Lee44
Path-Vector Protocols: BGP and IDRP Path-vector routing
– drawback of distance-vector protocol for an exterior routing protocol» If different routers attach different meanings to a given metric, it may not be possible to create stable, loop free-routes» no information about AS. A AS may have different priorities from other AS.
– drawback of link-state routing protocol for an exterior routing protocol» Different ASs may use different metrics and have different restrictions. Impossible to perform a consistent routing algorithm» flooding across multiple ASs may be unmanageable
– provide information about which networks can be reached by a given router and the ASs that must be crossed there.» Distance vector approach does not include a distance or cost estimate» Each block of routing information lists all of the ASs visited to reach the destination network by this route.
– Policy routing
45Prof. Younghee Lee45
EGP: Exterior Gateway Protocol
Overview– designed for tree-structured Internet(recent past)– concerned with reachability, not optimal routes
» goal of IDR: to find any path to the intended destination that is loop free
Protocol messages– neighbor acquisition: one router requests that another be
its peer; peers exchange reachability information– neighbor reachability: one router periodically tests to see
if the other router is still reachable; exchange HELLO/ACK messages
– routing updates: peers periodically exchange their routing tables (distance-vector)
46Prof. Younghee Lee46
BGP-4: Border Gateway Protocol Assumes the Internet is an arbitrarily interconnected set of AS's.
– local traffic: traffic that originates at or terminates on nodes within an AS– transit traffic: traffic that passes through an AS
Three types of AS’s:– Stub AS: an AS that has only a single connection to one other AS : only local traffi
c– Multihomed AS: an AS that has connections to more than one other AS, but refuse
s to carry transit traffic.– Transit AS: an AS that has connections to more than one other AS, and is designe
d to carry both transit and local traffic.
Each AS has: One or more border routers One BGP speaker that advertises:
– local networks– other reachable networks (transit AS only)– gives path information
47Prof. Younghee Lee47
BGP Example
Speaker for AS 2 advertises reachability to P and QNetwork 128.96, 192.4.153, 192.4.32, and 192.4.3, can be reached directly from AS 2.
Speaker for backbone network then advertisesNetworks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached along the path <AS 1, AS 2>.
Speaker can also cancel previously advertised paths
48Prof. Younghee Lee48
BGP message format Path attributes field
– Origin– AS_Path– Next_Hop– .
Notification Messages– Message header error– Open message error
Update message– AS_Path: the identity of AS1– Next_Hop: The IP address of R1– NLRI: list of all of the subnetworks in AS1
Update message: R5 forward the information from R1 to R9– AS_Path: the list of identifiers {AS2, AS1}– Next_Hop: The IP address of R5– NLRI: list of all of the subnetworks in AS1
49Prof. Younghee Lee49
Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto standard Path Vector protocol:
– similar to Distance Vector protocol– each Border Gateway broadcast to neighbors (peers)
entire path (I.e, sequence of ASs) to destination– E.g., Gateway X may send its path to dest. Z:
Path (X,Z) = X,Y1,Y2,Y3,…,Z
50Prof. Younghee Lee50
Internet inter-AS routing: BGP
Suppose: gateway X send its path to peer gateway W W may or may not select path offered by X
– cost, policy (don’t route via competitors AS), loop prevention reasons. If W selects path advertised by X, then:
Path (W,Z) = w, Path (X,Z) Note: X can control incoming traffic by controling it route advertisements
to peers:– e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z
» BGP does not mandate a policy for selecting paths
51Prof. Younghee Lee51
Internet inter-AS routing: BGP
BGP messages exchanged using TCP. BGP messages:
– OPEN: opens TCP connection to peer and authenticates sender
– UPDATE: advertises new path (or withdraws old)– KEEPALIVE keeps connection alive in absence of UP
DATES; also ACKs OPEN request– NOTIFICATION: reports errors in previous msg; also
used to close connection
52Prof. Younghee Lee52
Why different Intra- and Inter-AS
routing ? Policy: Inter-AS: admin wants control over how its traffic routed,
who routes through its net. Intra-AS: single admin, so no policy decisions needed
Scale: hierarchical routing saves table size, reduced update
trafficPerformance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance
Problem?
53Prof. Younghee Lee53
Internet Structure
54Prof. Younghee Lee54
Policy Routing Route is determined in part by policy issues.
– What classes of traffic should take what routes– Differentiation can be based on data type (audio, video,..),
security, source, … Is used in range of conditions.
– Customer selecting provider based on traffic contents– ISP giving preferential treatment to certain types of traffic– Distinguishing between research and regular internet traffic to
meet acceptable use policies Needs specific support in the router.
– Must be able to distinguish the traffic classes– Interface selection based not only on destination address– “Layer N” switching
55Prof. Younghee Lee55
IDRP(Inter-Domain Routing Protocol) Designed for IPv6 ISO standard, a superset of BGP’s functions Key differences
– BGP operates over TCP, whereas IDRP operates over the IP used in the configuration. IDRP include its own handshaking exchange to guarantee delivery of messages: for better performance
– BGP uses 16-bit autonomous system number. IDRP uses variable-length identifiers.
– IDRP can deal with multiple internet protocols and multiple internet address scheme.
– BGP communicates a path by specifying the complete list of ASs that a path visit. IDRP is able to aggregate this information using the concept of routing domain confederation(group of ASs appear to the outside world as single AS)
56Prof. Younghee Lee56
Policy
Goal of OSPF: figure out the best way to get from here to there Goal of IDR: figure out the best way to get from here to there
without passing through a restricted area(defines policies)
57Prof. Younghee Lee57
Implementing Policy
Policies constrain communications: 3 different ways to implement policy– Implementing policy with bandwidth– Implementing policy with packet filter– Implementing policy by restricting routing information
58Prof. Younghee Lee58
Implementing Policy
Implementing policy with bandwidth– allowing only limited bandwidth (0 to N bps)
59Prof. Younghee Lee59
Implementing Policy Implementing policy with packet filter
– constrains in the forwarding process– most commercial routers support– substantial computation burden on the router– administering packet filters is a challenge: need in-depth knowledge of message
formats and possible values for various fields within packets
60Prof. Younghee Lee60
Implementing Policy Implementing policy by restricting routing information
– policy based routing: IDRP relies on this method– places constraints on how routers distribute routing information– not require special calculations for every IP datagram
61Prof. Younghee Lee61
Influencing Routing Information IDRP is not concerned with details of routing policy. It merely
acknowledges their existence, and it allows them to influence routing information.
IDRP allows the routers exchange routing information each other; describes the topology of the network
62Prof. Younghee Lee62
Routing Confederation
Collection of AS’s – IDRP only needs to keep track of the single confederation instead of all of its
ASs – may be subsets of each other– can overlap each other: more flexibility than ASs
63Prof. Younghee Lee63
Counting to Infinity
Path vector routing:– If they themselves are part of the path, then they ignore the route, avoiding a routing
loop(Distance Vector Routing: knows only the cost to the advertised destinations => doesn’t know the
path)
64Prof. Younghee Lee64
Tracking Confederation
Represent all of the ASs that make up a confederation by a single identifier but only in advertisements outside the confederation– within the the confederation, IDRP explicitly lists all ASs in its path
65Prof. Younghee Lee65
Tracking Confederation
IDRP adds simple indicators to the paths it advertises to track the information with which that ASs must travel to reach its destination
As the path propagates from router to router, those indications define its status with respect to confederations
66Prof. Younghee Lee66
Route Aggregation
IDRP router combine multiple destinations and create a single advertisement for all of them
It reduces the number of individual destinations that other routers must remember, as well as shrinking the network overhead that route update packets
require