ECE 4450:427/527 - Computer Networks Spring 2014
-
Upload
uriah-cruz -
Category
Documents
-
view
15 -
download
0
description
Transcript of ECE 4450:427/527 - Computer Networks Spring 2014
ECE 4450:427/527 - Computer NetworksSpring 2015
Dr. Nghi TranDepartment of Electrical & Computer Engineering
Lecture 6.3: Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 1
Internetworking: Discussions
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 2
• For Internetworking, we shall look at few sub-problems:• Interconnect links of the same type: Switches• We consider an important of class switch: Bridges to
interconnect Ethernet segments.• We also look a way to interconnect disparate networks
and links: Gateways, or now mostly known as routers. We shall focus on the IP
• Once we are able to interconnect a whole lot of links and networks with switches and routers, we will look at a way to find a suitable path, or route through a network:• Paths that are efficient, loop free, etc.: Routing
Recall: IP Routing Table
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 3
What is Routing?
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 4
Construct directions from starting point to destination
Forwarding vs Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 55
• Forwarding: data plane– Directing a data packet to an outgoing link– Individual router using a forwarding/routing table
• Routing: control plane– Computing paths the packets will follow– Routers talking amongst themselves– Individual router creating a forwarding tableRouting can be simply understood as a process by which routing
table is built
Why Does Routing Matter?
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 6
• End-to-end performance– Quality of the path affects user performance– Propagation delay, throughput, and packet loss
• Use of network resources– Balance of the traffic over the routers and links– Avoiding congestion by directing traffic to lightly-loaded links
• Transient disruptions during changes– Failures, maintenance, and load balancing– Limiting packet loss and delay during changes
Different Types of Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 7
• Routing in a GPS device
• Routing in computer networks– Shortest path– Smallest delay– Highest reliability– Avoid congested nodes
Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 8
• Network as a Graph
• The basic problem of routing is to find the lowest-cost path between any two nodes• The cost of a path equals the sum of the costs of all the
edges that make up the path• Cost: delay, financial cost, probability of failure, etc.
Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 9
• For a simple network, we can calculate all shortest paths and load them into some nonvolatile storage on each node.
• Such a static approach has several shortcomings• It does not deal with node or link failures• It does not consider the addition of new nodes or links• It implies that edge costs cannot change
• What is the solution?• Need a distributed and dynamic protocol• Two main classes of protocols
• Distance Vector• Link State
Distance Vector: Algorithm
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 10
• Construct a one-dimensional array (vector) of distances to all other nodes, with assumption that each node knows the cost of the link to each of its directly connected neighbors
• Exchange info with immediate neighbors• Update distances based on received information• Stop sending updates as soon as no change occurs
Distance Vector
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 11
Initial distances stored at each node (global view) (assume unit cost for each link)
Distance Vector
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 12
Dest Cost Next Hop
B 1 B
C 1 C
D –
E 1 E
F 1 F
G –
Initial routing table at node A, assume unit cost for each link
Now, how about node B?
Distance Vector: Local View (initial)
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 13
Dest Cost Next Hop
B 1 B
C 1 C
D –
E 1 E
F 1 F
G –
Dest Cost Next Hop
A 1 A
C 1 C
D –
E –
F –
G –
Dest Cost Next Hop
A 1 A
B 1 B
D 1 D
E –
F –
G –
Dest Cost Next Hop
A –
B –
C 1 C
E –
F –
G 1 G
Dest Cost Next Hop
A 1 A
B –
C –
D –
F –
G –
Dest Cost Next Hop
A 1 A
B –
C –
D –
E –
G 1 G
Dest Cost Next Hop
A –
B –
C –
D 1 D
E –
F 1 F
Distance Vector – 1st Update for A
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 14
Dest Cost Next Hop
B 1 B
C 1 C
D –
E 1 E
F 1 F
G –
Dest Cost Next Hop
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 2 F
1st Update for A
1st Update: Every node sends to its directly connected neighbors its personal list of distances
Distance Vector – 1st Update for B?
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 15
1st Update
Dest Cost Next Hop
A 1 A
C 1 C
D –
E –
F –
G –
Dest Cost Next Hop
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G –
Distance Vector – 1st Update
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 16
Dest Cost Next Hop
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 2 F
Dest Cost Next Hop
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G –
Dest Cost Next Hop
A 1 A
B 1 B
D 1 D
E 2 A
F 2 A
G 2 G
Dest Cost Next Hop
A 2 C
B 2 C
C 1 C
E –
F 2 G
G 1 G
Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D –
F 2 A
G –
Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D 2 G
E 2 E
G 1 G
Dest Cost Next Hop
A 2 F
B –
C 2 D
D 1 D
E –
F 1 F
Distance Vector – 2nd Update
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 17
Dest Cost Next Hop
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 2 F
Dest Cost Next Hop
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G 3 C
Dest Cost Next Hop
A 1 A
B 1 B
D 1 D
E 2 A
F 2 A
G 2 G
Dest Cost Next Hop
A 2 C
B 2 C
C 1 C
E 3 C
F 2 G
G 1 G
Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D 3 A
F 2 A
G 3 A
Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D 2 G
E 2 E
G 1 G
Dest Cost Next Hop
A 2 F
B 3 D
C 2 D
D 1 D
E 3 F
F 1 F
Distance Vector: Global View
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 18
Final distances stored at each node (global view)
Distance Vector
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 19
• The other common name for this class of algorithm is Bellman-Ford, after its inventors.
• As we can see, it usually takes a number of exchanges/updates between neighbors before each node has complete routing table.• The process of getting consistent routing information to
all nodes is called convergence: vary
• We have two different circumstances under which a node decides to send a routing update• Periodic update• Triggered update
Failure of Link F-G
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 20
• When a node detects a link failure• F detects that link to G has failed (how?)• F sets distance to G to infinity and sends update to A• A sets distance to G to infinity since it uses F to reach G• A receives periodic update from C with 2-hop path to G• A sets distance to G to 3 and sends update to F• F decides it can reach G in 4 hops via A
Failure of Link F-G: Updated Tables
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 21
A/Dest Cost Next Hop
B 1 B
C 1 C
D 2 C
E 1 E
F 1 F
G 3 C
B/Dest Cost Next Hop
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G 3 C
C/Dest Cost Next Hop
A 1 A
B 1 B
D 1 D
E 2 A
F 2 A
G 2 G
D/Dest Cost Next Hop
A 2 C
B 2 C
C 1 C
E 3 C
F 3 C
G 1 G
E/Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D 3 A
F 2 A
G 4 A
F/Dest Cost Next Hop
A 1 A
B 2 A
C 2 A
D 4 C
E 2 E
G 4 A
G/Dest Cost Next Hop
A 3 D
B 3 D
C 2 D
D 1 D
E 3 F
F 4 D
Drawback
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 22
– Suppose the link from A to E goes down– In the next round of updates, A advertises a distance of infinity to E,
but C advertise a distance of 2 to E– Depending on the exact timing of events, the following might happen
• Node B, upon hearing that E can be reached in 2 hops from C, concludes that it can reach E in 3 hops and advertises this to A
• Node A concludes it can reach E in 4 hops and advertises this to C• Node C concludes that it can reach E in 5 hops; and so on.• This cycle stops only when the distances reach some number that
is large enough to be considered infiniteCount-to-infinity problem
Solutions
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 23
• One technique to improve the time to stabilize routing is called split horizon– When a node sends a routing update to its neighbors, it does not send those
routes it learned from each neighbor back to that neighbor– For example, if B has the route (E, 2, A) in its table, then it knows it must have
learned this route from A, and so whenever B sends a routing update to A, it does not include the route (E, 2) in that update
• In a stronger version of split horizon, called split horizon with poison reverse– B actually sends that back route to A, but it puts negative information in the
route to ensure that A will not eventually use B to get to E– For example, B sends the route (E, ∞) to A
Routing Information Protocol (RIP)
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 24
• Early routing protocol for IP networks• Distance-vector algorithm where vertices are
networks and not hosts
• Valid hop count (distances) 1-15, with 16 representing infinity
• Limited to fairly small networks
Metric/Cost in Real World
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 25
• Can we just assign a cost of 1 to all links?• Certainly, there are so many ways to define cost:• Number of packets queued waiting to be transmitted• Consider both bandwidth and latency
• In the current real world• Common approach: a constant/link bandwidth• It means metric changes rarely if at all and only under
the control of network administrator• Why? • i) Dynamically changing metrics are too unstable; • ii) Many networks today lack the great disparity of
speeds and latencies
Distance Vector vs. Link-State
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 26
• Distance vector: • each node talks only to its directly
connected neighbors …• but it tell them everything it has learned,
i.e., distance to all nodes
• Link-state: • each node talks to all other nodes…• but it tells them only what it knows for sure,
i.e., state of its directly connected links
Link-State Routing
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 27
Strategy: Send to all nodes (not just neighbors) information about directly connected links (not entire routing table) and associated cost.
• Rely on two key mechanisms:– Reliable flooding: Make sure all nodes get the
above information of other nodes– Route calculation: Once a node has a copy of the
information from every other node, it is able to compute a complete map of the network, and then can decide the best route to each destination
Reliable Flooding
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 28
• Objective: Make sure all nodes get the link-state information of other nodes: Knowledge of directly connected neighbors and associated cost for each node
• Each node creates an update packet called link-state packet (LSP) with the following information:• ID of the node that created LSP• Cost of link to each directly connected neighbor• Sequence number (SEQNO)• Time-to-live for this packet
Reliable flooding: Make sure all nodes get LSP from the other nodes.
Reliable Flooding
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 29
• Transmission of LSPs between adjacent routers using ACK and transmission. But how to send an LSP to all nodes?
• We need some more steps to reliably flood an LSP to all nodes: controlled flooding• A node x receives a copy of LSP originated from y. • x then needs to check if it has already had a copy. If
not, store it. If it has, compare sequence number, keep a newer one.• If the received LSP is new, x sends a copy of LSP to
all neighbors, except the one from which LSP was received (why?).
• Neighbors then turn around and do the same thing: most recent copy of LSP reaches all nodes.
Reliable Flooding
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 30
Reliable Flooding
Flooding of link-state packets. (a) LSP arrives at node X; (b) X floods LSP to A and C; (c) A and C flood LSP to B (but not X); (d) flooding is complete
Route Calculation
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 31
• Now, assume a given node has copies of LSPs from every other node:• it is able to compute a complete map for the topology
of the network• and from this map it is able to decide the best routes to
each destination
• But how to decide/calculate the best route to each destination?
• The solution is based on a well-known algorithm from graph theory – Dijkstra’s shortest-path algorithm
Shortest-Path Problem: Statement
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 32
• Given: network topology with link costs– c(x,y): link cost from node x to node y– Infinity if x and y are not direct neighbors
• Compute: least-cost paths to all nodes– From a given source u to all other nodes– For each node a: u stores a’s predecessor node along
path from u to a, & cost. 3
2
2
1
14
1
4
5
3
u a
Dijkstra’s Algorithm: Overview
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 33
• Iterative algorithm for a given source node u:– After k iterations, know least-cost path to k nodes
• S: set of nodes whose least-cost path known– Initially, S = {u} where u is the source node– Add one node to S in each iteration
• D(a): current cost of path from source to node a– Initially, D(a) = c(u, a) for all nodes a adjacent to u– … and D(a) = ∞ for all other nodes a– Continuously update D(a) as shorter paths are learned
Dijkstra’s Algorithm: Implementation
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 34
1 Initialization: 2 S = {u} 3 for all nodes {a} 4 If a adjacent to u {5 D(a) = c(u,a) 6 else D(v) = ∞ 7 8 Loop 9 Find b not in S with the smallest D(b)10 Add b to S, store D(b) and P(b) (predecessor node) 11 update D(a) for all {a} adjacent to b and not in S: 12 D(a) = min{D(a), D(b) + c(b,a)} 13 until all nodes in S
Example
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 35
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
Example (Cont.)
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 36
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
32
2
1
14
1
4
5
3
Dijkstra’s Table
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 37
Step S v w x y z s t
D(v) P(v) D(w) P(w) D(x) P(x) D(y) P(y) D(z) P(z) D(s) P(s) D(t) P(t)
.
.
.
.
.
.
7 u,w,v,x,y,z,s,t
3 u 2 u 3 w 5 v 6 y 6 w 8 x
Shortest-Path Tree
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 38
• Shortest-path tree from u
32
2
1
14
1
4
5
3
u
v
w
x
y
z
s
t
• Routing table at u
v (u,v)w (u,w)x (u,w)y (u,v)z (u,v)
link
s (u,w)t (u,w)
Open Shortest First Path (OSPF)
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 39
• It is the most widely used link-state routing protocols in practice• Open: Publicly available• SPF: Alternative name for link-state
• OSPF adds a number of features to the basic link-state• Authentication: Make sure all nodes can be trusted• Additional hierarchy: Network domain divided further
in to areas: a router might just need to get to a right area
• Load balancing: Allow multiple routes to the same place to be assigned the same cost: traffic distributed evenly to those routers
Distance Vector vs. Link-State
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 40
• Distance vector: each node talks only to its directly connected neighbors, but it tell them everything it has learned, i.e., distance to all nodes
• Link-state: each node talks to all other nodes, but it tells them only what it knows for sure, i.e., state of its directly connected links
Distance Vector vs. Link-State
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 41
• Who is the winner?
Message complexity• LS: with n nodes, E links, O(nE)
msgs sent . A lot of information needs to be stored.
• DV: exchange between neighbors only
Speed of Convergence• LS: O(n2) algorithm requires O(nE)
msgs• DV: convergence time varies
– may be routing loops– count-to-infinity problem
Robustness: what happens if router malfunctions, misbehaves?
LS: – node can advertise incorrect
link cost– each node computes only its
own table, providing a degree of robustness
DV:– DV node can advertise
incorrect path cost– each node’s table used by
others , error propagate thru network
Routing in the Internet
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 42
• Routing protocols we have learned so far: idealization, all routers identical, flat network
• Internet: Network of hundreds of thousands of networks: Not possible to directly using those protocols: they do not scale to those kinds of numbers!!!
• We need something else!!!
Routing in the Internet
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 43
• Internet is organized as autonomous systems (AS) each of which is under the control of a single administrative entity
• Autonomous System (AS)– corresponds to an administrative domain– examples: University, company, backbone network, as may
the network of a single ISP– AS chooses its own routing protocol, e.g., distance-vector
or link-state• Divide routing problem in two parts:• Intra-domain: We have already learned• Inter-domain: Border Gateway Protocol (BGP) (BGP-v4)
BGP
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 44
• Few books dedicated to BGP • Key points:
• Assumes the Internet is an arbitrarily interconnected set of AS‘s
• Impossible to define optimal path• Advertise only reachability: complete paths as an
enumerated lists of ASs to reach a particular network• Does not belong to either distance-vector or link-state
• For further discussions (high points), see Chapter 4.1.2