Presentation is loading. Please wait.

Presentation is loading. Please wait.

Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.

Similar presentations


Presentation on theme: "Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE."— Presentation transcript:

1 Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 11: Routing

2 Univ. of TehranIntroduction to Computer Network2 Outline Routing process Routing Algorithms Scalability

3 Univ. of TehranIntroduction to Computer Network3 Routing Process Question? How to populate the lookup table? Forwarding vs Routing forwarding: to select an output port based on destination address from the lookup table. Minimize the lookup time. routing: process by which the routing table is built. Optimize the calculating paths in case of changing topology. Primery solutions: Build the lookup table Manually? Is it practical? The answer is no. Flooding- Broadcast to all node except the one we have received the packet. Waste the bandwidth Not scale well- Broadcast storm.

4 Univ. of TehranIntroduction to Computer Network4 Overview Network as a Graph Problem: Find lowest cost, or shortest path between two nodes The process is distributed and this makes it complicated, I.e, it may create loop. Factors static: topology dynamic: load

5 Univ. of TehranIntroduction to Computer Network5 Distance Vector Each node maintains a set of triples (Destination, Cost, NextHop) Exchange updates directly connected neighbors periodically ( on the order of several seconds) whenever its table changes (called triggered update) Each update is a list of pairs: ( Destination, Cost) Update local table if receive a “better” route smaller cost came from next-hop Refresh existing routes; delete if they time out

6 Univ. of TehranIntroduction to Computer Network6 The Bellman-Ford Algorithm Bellman-Ford algorithm solve the distance Vector problem in general case. 1. Set: X o = (,,,…, ). 2. Send updates of components of X n to neighbors 3. Calculate: X n+1 = F(X n ) 4. If X n+1  X n then go to (2) 5. Stop

7 Univ. of TehranIntroduction to Computer Network7 Distance Vector: Control Traffic By changing the routing table, a node sends its table to its neighbors A node updates its table with information received from its neighbors Host A Host B Host E Host D Host C N1 N2 N3 N4 N5 N7N6

8 Univ. of TehranIntroduction to Computer Network8 Example: Distance Vector Algorithm A C 1 2 7 B D 3 1 Dest.CostNextHop B2B C7C D∞- Node A Dest.CostNextHo p A2A C1C D3D Node B Dest. CostNextHo p A7A B1B D1D Node C Dest.CostNextHo p A∞- B3B C1C Node D 1 Initialization: 2 for all neighbors V do 3 if V adjacent to A 4 D(A, V) = c(A,V); 5 else 6 D(A, V) = ∞; …

9 Univ. of TehranIntroduction to Computer Network9 Dest.CostNextHop B2B C7C D∞- Node A Example: 1 st Iteration (C  A) A C 1 2 7 B D 3 1 Dest.Cos t NextH op A2A C1C D3D Node B DestCos t NextHo p A7A B1B D1D Node C DestCostNextHo p A∞- B3B C1C Node D (D(C,A), D(C,B), D(C,D)) … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever

10 Univ. of TehranIntroduction to Computer Network10 Dest.CostNextHo p B2B C7C D8C Node A Example: 1 st Iteration (C  A) A C 1 2 7 B D 3 1 Des t. Cos t NextH op A2A C1C D3D Node B Des t. Cos t NextH op A7A B1B D1D Node C Des t. Cos t NextH op A∞- B3B C1C Node D D(A, D) = min(D(A, D), D(A, C) + D(C,D) = min(∞, 7 + 1) = 8 (D(C,A), D(C,B), D(C,D)) … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever

11 Univ. of TehranIntroduction to Computer Network11 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever Dest.CostNextHo p B2B C7C D8C Node A Example: 1 st Iteration (B  A) A C 1 2 7 B D 3 1 Des t. Cos t NextH op A2A C1C D3D Node B DestCostNextHo p A7A B1B D1D Node C Dest.CostNextHo p A∞- B3B C1C Node D

12 Univ. of TehranIntroduction to Computer Network12 Dest.CostNextHo p B2B C3B D5B Node A Example: 1 st Iteration (B  A, C  A) A C 1 2 7 B D 3 1 Des t. Cos t NextH op A2A C1C D3D Node B Dest.CostNextHo p A7A B1B D1D Node C Dest.Cos t NextH op A∞- B3B C1C Node D D(A,D) = min(D(A,D), D(A,B) + D(B,D)) = min(8, 2 + 3) = 5 D(A,C) = min(D(A,C), D(A,B) + D(B,C)) = min(7, 2 + 1) = 3 … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever

13 Univ. of TehranIntroduction to Computer Network13 Example: End of 1 st Iteration A C 1 2 7 B D 3 1 Dest.CostNextHo p B2B C3B D5B Node A Des t. Cos t NextH op A2A C1C D2C Node B Des t. Cos t NextH op A3B B1B D1D Node C Des t. Cos t NextH op A2B B3B C1C Node D … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever

14 Univ. of TehranIntroduction to Computer Network14 Example: End of 3 nd Iteration A C 1 2 7 B D 3 1 Dest.CostNextHo p B2B C3B D4B Node A Des t. Cos t NextH op A2A C1C D2C Node B Dest. Cos t NextHo p A3B B1B D1D Node C Dest.CostNextHo p A4C B2C C1C Node D Nothing changes  algorithm terminates … 7 loop: … 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) 19 send D(A, Y) to all neighbors 20 forever

15 Univ. of TehranIntroduction to Computer Network15 Link Cost Changes A C 1 4 50 B 1 “good news travels fast” DCN A4A C1B Node B DCN A5B B1B Node C DCN A1A C1B DCN A5B B1B DCN A1A C1B DCN A2B B1B DCN A1A C1B DCN A2B B1B Link cost changes here time Algorithm terminates 7 loop: 8 wait (link cost update or update message) 9 if (c(A,V) changes by d) 10 for all destinations Y through V do 11 D(A,Y) = D(A,Y) + d 12 else if (update D(V, Y) received from V) 13 for all destinations Y do 14 if (destination Y through V) 15 D(A,Y) = D(A,V) + D(V, Y); 16 else 17 D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for destination Y) 19 send D(A, Y) to all neighbors 20 forever

16 Univ. of TehranIntroduction to Computer Network16 Example Destination Cost NextHop A 1 A C 1 C D 2 C E 2 A F 2 A G 3 A Distance of other nodes from Node B. The cost between two nodes has been assumed 1. All nodes keep a routing table from themselves. D G A F E B C

17 Univ. of TehranIntroduction to Computer Network17 Routing Loops Example link from A to E fails A advertises distance of infinity to E B and C advertise a distance of 2 to E B decides it can reach E in 3 hops; advertises this to A A decides it can read E in 4 hops; advertises this to C C decides that it can reach E in 5 hops…

18 Univ. of TehranIntroduction to Computer Network18 Loop- Breaking Heuristics Set infinity to a reasonably small number. For instance, RIP sets to 16 Split horizon: Don’t announce the distance to the node the distance has been gotten from. Split horizon with poison reverse: Instead of not announcing the distance put negative numbers.

19 Univ. of TehranIntroduction to Computer Network19 Link State Strategy send to all nodes (not just neighbors) information about directly connected links (not entire routing table) Link State Packet (LSP) id of the node that created the LSP cost of the link to each directly connected neighbor sequence number (SEQNO) time-to-live (TTL) for this packet

20 Univ. of TehranIntroduction to Computer Network20 Link State (cont) Reliable flooding store most recent LSP from each node forward LSP to all nodes but one that sent it generate new LSP periodically increment SEQNO start SEQNO at 0 when reboot decrement TTL of each stored LSP discard when TTL=0

21 Univ. of TehranIntroduction to Computer Network21 Route Calculation Dijkstra’s shortest path algorithm Let N denotes set of nodes in the graph l (i, j) denotes non-negative cost (weight) for edge (i, j) s denotes this node M denotes the set of nodes incorporated so far C(n) denotes cost of the path from s to node n M = {s} for each n in N - {s} C(n) = l(s, n) while (N != M) M = M union {w} such that C(w) is the minimum for all w in (N - M) for each n in (N - M) C(n) = MIN(C(n), C (w) + l(w, n ))

22 Univ. of TehranIntroduction to Computer Network22 Link state (Example) A B C D 5 3 2 10 11 Two list confirmed and tentative Always, select the one with minimum distance from the tentative list. StepConfirmedTentative 1(D,0,-) 2 (B,11,B), (C,2,C) 3(D,0,-), (C,2,C)(B,5,C), (A, 12,C)

23 Univ. of TehranIntroduction to Computer Network23 Interior Gateway Protocols RIP: Route Information Protocol developed for XNS distributed with Unix distance-vector algorithm based on hop-count OSPF: Open Shortest Path First recent Internet standard uses link-state algorithm supports load balancing supports authentication

24 Univ. of TehranIntroduction to Computer Network24 Metrics Original ARPANET metric measures number of packets enqueued on each link took neither latency or bandwidth into consideration New ARPANET metric stamp each incoming packet with its arrival time ( AT ) record departure time ( DT ) when link-level ACK arrives, compute Delay = (DT - AT) + Transmit + Latency if timeout, reset DT to departure time for retransmission link cost = average delay over some time period Fine Tuning compressed dynamic range replaced dynamic with link utilization

25 Univ. of TehranIntroduction to Computer Network25 How to Make Routing Scale Flat versus Hierarchical Addresses Inefficient use of Hierarchical Address Space class C with 2 hosts (2/255 = 0.78% efficient) class B with 256 hosts (256/65535 = 0.39% efficient) Still Too Many Networks routing tables do not scale route propagation protocols do not scale

26 Univ. of TehranIntroduction to Computer Network26 Route Propagation Know a smarter router hosts know local router local routers know site routers site routers know core router core routers know everything Autonomous System (AS) corresponds to an administrative domain examples: University, company, backbone network assign each AS a 16-bit number Two-level route propagation hierarchy interior gateway protocol (each AS selects its own) exterior gateway protocol (Internet-wide standard)

27 Univ. of TehranIntroduction to Computer Network27 EGP: Exterior Gateway Protocol Overview Designed for tree-structured Internet Concerned with reachability, not optimal routes Protocol messages neighbor acquisition: one router requests that another be its peer; peers exchange reachability information neighbor reachability: one router periodically tests if the another is still reachable; exchange HELLO/ACK messages; routing updates: peers periodically exchange their routing tables (distance-vector)

28 Univ. of TehranIntroduction to Computer Network28 BGP-4: Border Gateway Protocol AS Types stub AS: has a single connection to one other AS carries local traffic only multihomed AS: has connections to more than one AS refuses to carry transit traffic transit AS: has connections to more than one AS carries 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

29 Univ. of TehranIntroduction to Computer Network29 BGP Example Speaker for AS2 advertises reachability to P and Q network 128.96, 192.4.153, 192.4.32, and 192.4.3, can be reached directly from AS2 Speaker for backbone advertises networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached along the path (AS1, AS2). Speaker can cancel previously advertised paths Backbone network ( AS 1) Regional provider A (AS 2) Regional provider B (AS 3) Customer P (AS 4) Customer Q ( AS 5) Customer R ( AS 6) Customer S (AS 7) 128.96 192.4.153 192.4.32 192.4.3 192.12.69 192.4.54 192.4.23

30 Univ. of TehranIntroduction to Computer Network30 Internet Structure Recent Past NSFNET backbone Stanford BARRNET regional Berkeley P ARC NCAR UA UNM Westnet regiona l UNL KU ISU MidNet regional …

31 Univ. of TehranIntroduction to Computer Network31 Internet Structure Today Backbone service provider Peering point Peering point Large corporation Small corporation “ Consumer ” ISP “Consumer ” ISP “ Consumer ” ISP


Download ppt "Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE."

Similar presentations


Ads by Google