440 likes | 543 Views
ECE 4450:427/527 - Computer Networks Spring 2014. Dr. Nghi Tran Department of Electrical & Computer Engineering. Lecture 6.3: Routing. Internetworking: Discussions. For Internetworking , we shall look at few sub-problems: Interconnect links of the same type : Switches
E N D
ECE 4450:427/527 - Computer NetworksSpring 2014 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 6.3: Routing ECE 4450:427/527
Internetworking: Discussions • 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 ECE 4450:427/527
Recall: IP Routing Table ECE 4450:427/527
What is Routing? Construct directions from starting point to destination ECE 4450:427/527
Forwarding vs Routing • 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 table • Routing can be simply understood as a process by which routing table is built 5 ECE 4450:427/527
Why Does Routing Matter? • 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 ECE 4450:427/527
Different Types of Routing • Routing in a GPS device • Routing in computer networks • Shortest path • Smallest delay • Highest reliability • Avoid congested nodes ECE 4450:427/527
Routing • 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. ECE 4450:427/527
Routing • 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 ECE 4450:427/527
Distance Vector: Algorithm • 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 ECE 4450:427/527
Distance Vector • Initial distances stored at each node (global view) (assume unit cost for each link) ECE 4450:427/527
Distance Vector Initial routing table at node A, assume unit cost for each link Now, how about node B? ECE 4450:427/527
Distance Vector: Local View (initial) ECE 4450:427/527
Distance Vector – 1st Update for A 1st Update: Every node sends to its directly connected neighbors its personal list of distances 1st Update for A ECE 4450:427/527
Distance Vector – 1st Update for B? 1st Update ECE 4450:427/527
Distance Vector – 1st Update ECE 4450:427/527
Distance Vector – 2nd Update ECE 4450:427/527
Distance Vector: Global View Final distances stored at each node (global view) ECE 4450:427/527
Distance Vector • 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 ECE 4450:427/527
Failure of Link F-G • 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 ECE 4450:427/527
Failure of Link F-G: Updated Tables ECE 4450:427/527
Drawback • 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 infinite • Count-to-infinity problem ECE 4450:427/527
Solutions • 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 ECE 4450:427/527
Routing Information Protocol (RIP) • 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 ECE 4450:427/527
Metric/Cost in Real World • 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 ECE 4450:427/527
Distance Vector vs. Link-State • 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 nodetalks to all other nodes… • but it tells them only what it knows for sure, i.e., state of its directly connected links ECE 4450:427/527
Link-State Routing 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 ECE 4450:427/527
Reliable Flooding • 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. ECE 4450:427/527
Reliable Flooding • 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. ECE 4450:427/527
Reliable Flooding 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 ECE 4450:427/527
Route Calculation • 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 ECE 4450:427/527
Shortest-Path Problem: Statement • 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: ustores a’s predecessor nodealong path from u to a, & cost. 2 1 3 1 4 u a 2 1 5 4 3 ECE 4450:427/527
Dijkstra’s Algorithm: Overview • 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 ECE 4450:427/527
Dijkstra’s Algorithm: Implementation 1 Initialization: 2 S = {u} 3 for all nodes {a} 4 If aadjacent to u { 5 D(a) = c(u,a) 6 else D(v) = ∞ 7 8 Loop 9 Find bnot in S with the smallest D(b) 10 Add bto S, store D(b) and P(b) (predecessor node) 11 update D(a) for all {a} adjacent to band not in S: 12 D(a) = min{D(a), D(b) + c(b,a)} 13 until all nodes in S ECE 4450:427/527
Example 2 2 1 1 3 3 1 1 4 4 2 2 1 1 5 5 4 4 3 3 2 2 1 1 3 3 1 1 4 4 2 2 1 1 5 5 4 4 3 3 ECE 4450:427/527
Example (Cont.) 2 2 1 1 3 3 1 1 4 4 2 2 1 1 5 5 4 4 3 3 2 2 1 1 3 3 1 1 4 4 2 2 1 1 5 5 4 4 3 3 ECE 4450:427/527
Dijkstra’s Table ECE 4450:427/527
Shortest-Path Tree 2 v y 1 3 1 4 x z u 2 v (u,v) 1 5 w (u,w) t w 4 3 x (u,w) s y (u,v) z (u,v) s (u,w) (u,w) t • Shortest-path tree from u • Routing table at u link ECE 4450:427/527
Open Shortest First Path (OSPF) • 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 ECE 4450:427/527
Distance Vector vs. Link-State • 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 nodetalks to all other nodes, but it tells them only what it knows for sure, i.e., state of its directly connected links ECE 4450:427/527
Distance Vector vs. Link-State • Who is the winner? 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 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 ECE 4450:427/527
Routing in the Internet • 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!!! ECE 4450:427/527
Routing in the Internet • 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) ECE 4450:427/527
BGP • 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 ECE 4450:427/527