Presentation is loading. Please wait.

Presentation is loading. Please wait.

Routing Algorithms. Network Layer4-2 Dynamic Routing r The routing table is updated using the routing protocols. When there is a change in the Internet.

Similar presentations


Presentation on theme: "Routing Algorithms. Network Layer4-2 Dynamic Routing r The routing table is updated using the routing protocols. When there is a change in the Internet."— Presentation transcript:

1 Routing Algorithms

2 Network Layer4-2 Dynamic Routing r The routing table is updated using the routing protocols. When there is a change in the Internet such as router breakdown or link failure, the routing protocols update all the information in the routing tables. r For the dynamic routing, routers should exchange routing information using routing protocols. m routing information information about network topology, delay, etc. m routing protocol It specifies the routing messages and procedures to exchange the routing information to determine routes.

3 Network Layer4-3 Internet Routing Architecture r Internet architecture from routing’s views m It is unrealistic to apply a single routing protocol to the worldwide Internet because of its size. m So, the worldwide Internet is divided into many groups, which are administered independently. m These independent groups of networks are called the autonomous systems(AS) which are assigned 16 bits long AS number. m AS “a group of networks and routers controlled by a single administrative authority” m Each AS needs to inform its routing information of other ASs. For this purpose each AS has more than one border routers.

4 Network Layer4-4 Subnet 1.2 Subnet 1.4 Subnet 2.3 Subnet 2.2 Subnet 2.4 Subnet 2.1 Subnet 1.3 R1 R2R3 R4 R5 R6 R7 R8 Autonomous System 1 Autonomous System 2 LEGEND: Interior Gateway Protocol Exterior Gateway Protocol Subnet 1.1

5 Network Layer4-5 Internet Routing Protocols r Interior Gateway Protocol (IGP) m IGP is operated within each AS. m Each AS can operate its own IGP. m Most well-known IGPs RIP(Routing Information Protocol) OSPF(Open Shortest Path Find) r Exterior Gateway Protocol (EGP) m To exchange packets between AS, the AS border routers should exchange the routing information. m EGP is the routing protocol between ASs. BGP(Border Gateway Protocol)

6 Network Layer4-6 IGPs Routing protocol Shortest path algorithm Routing algorithm RIP IGRP Bellman-Ford algorithm Distance Vector algorithm OSPF IS-IS Dijstra algorithmLink State algorithm

7 Network Layer4-7 Distance Vector Algorithm (assume that the metric is delay) Step 1: Each router exchange ECHO packet to measure the time to reach each neighboring routers. Step 2: Each router send this information to its neighboring routers periodically. The information contains the times to reach all other routers. Step 3: Each router determines the mim. time to reach all other routers using step 1 and 2. And update its own routing table.

8 Network Layer4-8 Example J A C Echo 패킷 m sec T i sec E B D (T AB, T AC, T AD, T AE ) T B = m + T AB T C = m + T A C T D = m + T A D T E = m + T A E

9 Network Layer4-9 Example: sample network A E I B C D F G H J K L

10 Network Layer4-10 new information from A, I, H, K

11 Network Layer4-11 New information on the neighboring nodes r Suppose that the delay from J to A, I,H, and K 8,10,12,6 secs respectively. r Then what is the next hop router and the delay to reach G from J? J ---> A -------> G 8 + 18 = 26 J ----> I -------> G 10 + 31 = 41 J ----> H ------> G 12 + 6 = 18 (best route for JG) J ----> K ------> G 6 + 31 = 37

12 Network Layer4-12 Updated routing table of J

13 Network Layer4-13 Link state Routing r Overview m Each node collects the topology information of the whole network, and then computes the shortest paths to reach each node using the Dijkstra algorithm. m The routing protocols such as ISO’s IS-IS and IETF’s OSPF belong to this algorithm, and they will replace the DVA routing protocol. r Examples m OSPF for TCP/IP m ISO’s IS-IS for CLNS and IP m DEC’s DNA Phase V m Novell’s NLSP(Netware Link services protocol)

14 Network Layer4-14 Link state Routing Algorithm r Discover the neighboring node. (send Hello message periodically) r Measure the link costs to the neighboring nodes. r Make the Link State packet. r Broadcast the Link State packet to all nodes. r After receiving the Link State packets from all other nodes, make the link state database. r Compute the shortest paths to reach all other nodes based on the link state database.

15 Network Layer4-15 Example of Link state routing Step1: Collect the link state information from the neighboring nodes and make the link state packets. A B D C E F 5 2 3 1 2 1 1 3 3 2 A seq# age B 2 C 5 D 2 D seq# age A 2 B 2 C 3 E 1 C seq# age A 5 B 3 D 3 E 1 F 1 B seq# age A 2 C 3 D 2 E seq# age C 1 D 1 F 1 F seq# age C 1 E 1 Link state packets

16 Network Layer4-16 Example of Link state routing Step 2: Propagate the link state information to all other nodes. m Make the link state packet. m Use the flooding. Step 3: Compute the shortest path. m Based on the link state information, the node makes the link state database that represents the whole network topology. m Compute the shortest path using the Dijkstra algorithm.

17 Network Layer4-17 Link State Database A B D C E F 5 2 3 1 2 1 1 3 3 2 Link #CostLink #Cost A-B A-C A-D B-A B-C B-D C-A 25223252522325 D-E E-C E-D E-F E-C E-E 111111111111 C-B C-D C-E C-F D-A D-B D-C 33112233311223 Link #Cost

18 Network Layer4-18 Internet Routing Protocols

19 Network Layer4-19 Intra-AS Routing r Also known as Interior Gateway Protocols (IGP) r Most common Intra-AS routing protocols: m RIP: Routing Information Protocol m OSPF: Open Shortest Path First m IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

20 Network Layer4-20 RIP r IETF standard routing protocol r Based on the Distant Vector algorithm r The hop count is used as the metric. m The hop count is 1 for an adjacent network. m The hop count 16 means infinity.(network is not connected.) r Each router exchange routing information every 30 secs. m The routing information contains the whole routing table entries. r Each advertisement: list of up to 25 destination nets within AS r It uses the UDP port number 520. r It was first implemented in the UNIX 4.2 BSD.

21 Network Layer4-21 Procedure Receive a response RIP message 1. Add one hop to the hop count for each advertised destination 2. Repeat the following steps for each advertised destination: If (destination not in the routing table) Add the advertised information to the table else if (next-hop field is the same) replace entry in the table with the advertised one else if (advertised hop count smaller than one in the table add it to the routing table else do nothing 3. Return

22 Network Layer4-22 RIP: Example(1)

23 Network Layer4-23 RIP: Example(2)

24 Network Layer4-24 RIP: Example(2)

25 Network Layer4-25 RIP message Command version family reserved All 0s Network address All 0s distance Command : request (1) or response (2) The unsolicited response is transmitted periodically every 30 secs. Family: TCP/IP (2) distance : hop count 반복

26 Network Layer4-26 Problems of DVA(RIP) r Problems m scalability m Slow convergence In particular, when the shortest paths are changing rapidly, the inconsistency between routing tables can happen, since the updated routing information propagates slowly. count-to-infinity problem m Not proper to be expanded to multicast routing protocol.

27 Network Layer4-27 Good news go travels quickly! r good news go fast! m When the connection with the network 1 is added, the routing table can reach the stability after 2 message exchanges. up R1R3R2 Net 1 Net D R 1 1 R1 Net D R 1  - Net D R 1  - Net D R 1 1 R1 Net D R 1 2 R1 Net D R 1  - Net D R 1 1 R1 Net D R 1 2 R1 Net D R 1 3 R2 (N1,1) (N1,2) Initial state time Note: (x, y) = (destination network, Distance) distance next router destination

28 Network Layer4-28 Count-to-infinity Problem(1) crash R1R3R2 Net 1 Net D R 1  - Net D R 1 2 1 Net D R 1 3 2 Net D R 1 3 2 Net D R 1 4 3 Net D R 1 3 2 Net D R 1 5 2 Net D R 1 4 3 Net D R 1 5 2 Net D R 1 5 2 Net D R 1 6 1 Net D R 1 5 2 Net D R 1  - Net D R 1  - Net D R 1  - (N1,2) (N1,  ) (N1,4) (N1,3) (N1,4) (N1,5) (N1,3) (N1,2) (N1,3) (N1,4) (N1,5) (N1,4).................. Initial state time

29 Network Layer4-29 Count-to-infinity Problem(2) r Bad news goes slowly!! m In the previous picture, when the connection between R1 and network 1 is broken, the cost (distance) to network 1 grows to infinity gradually. m When the cost reaches to 16, the router knows that the connection is broken. m When the bad news occur, it takes a long time to be aware of that.(slow convergence) r Solutions m Split Horizon m Hold down m Poison reverse

30 Network Layer4-30 Solutions to the Count-to- infinity Problem r Split horizon update (with Poison Reverse) m The router interface that receives the information about a certain network should send information about that network to other routers as infinity (distance=16) m It cannot be applied to all kinds of topologies. r Route poisoning m If a router receives the information that the hop count to a certain network increases, it sets the hop count=16, and send it to other routers, suspecting a loop might occur.

31 Network Layer4-31 Split Horizon r A router should never send the routing update information to the interface through which it received the corresponding routing information. Net1 Net2 Net3 Net2 1 Net3 2 Net3 1 A B Net1 1 Net1 2 Net2 1 routing message

32 Network Layer4-32 Poison reverse r When a router sends the routing update message to all routers, it says to the interface from which it received the information about the network that the cost to the network is infinity (cost=16). Net1 Net2 Net3 Net1 16 Net2 1 Net3 2 A B routing message Net1 1 Net2 16 Net3 16 Net1 16 Net2 16 Net3 1 routing message Net1 2 Net2 1 Net3 16

33 Network Layer4-33 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead m routes via neighbor invalidated m new advertisements sent to neighbors m neighbors in turn send out new advertisements (if tables changed) m link failure info quickly propagates to entire net m poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

34 Network Layer4-34 RIP Table processing r RIP routing tables managed by application-level process called route-d (daemon) r advertisements sent in UDP packets, periodically repeated physical link network forwarding (IP) table Transprt (UDP) routed physical link network (IP) Transprt (UDP) routed forwarding table

35 Network Layer4-35 OSPF (Open Shortest Path First) r “open”: publicly available r Uses Link State algorithm m LS packet dissemination m Topology map at each node m Route computation using Dijkstra’s algorithm r OSPF advertisement carries one entry per neighbor router r Advertisements disseminated to entire AS (via flooding) m Carried in OSPF messages directly over IP (rather than TCP or UDP

36 Network Layer4-36 OSPF “advanced” features (not in RIP) r Security: all OSPF messages authenticated (to prevent malicious intrusion) r Multiple same-cost paths allowed (only one path in RIP) r For each link, multiple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real time) r Integrated uni- and multicast support: m Multicast OSPF (MOSPF) uses same topology data base as OSPF r Hierarchical OSPF in large domains.

37 Network Layer4-37 Hierarchical OSPF

38 Network Layer4-38 Hierarchical OSPF r Two-level hierarchy: local area, backbone. m Link-state advertisements only in area m each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. r Area border routers: “summarize” distances to nets in own area, advertise to other Area Border routers. r Backbone routers: run OSPF routing limited to backbone. r Boundary routers: connect to other AS’s.

39 Network Layer4-39 Internet inter-AS routing: BGP r BGP (Border Gateway Protocol): the de facto standard r BGP provides each AS a means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate the reachability information to all routers internal to the AS. 3. Determine “good” routes to subnets based on reachability information and policy. r Allows a subnet to advertise its existence to rest of the Internet: “I am here”

40 Network Layer4-40 Anonymous System(AS) Subnet 1.2 Subnet 1.4 Subnet 2.3 Subnet 2.2 Subnet 2.4 Subnet 2.1 Subnet 1.3 R1 R2R3 R4 R5 R6 R7 R8 Autonomous System 1 Autonomous System 2 LEGEND: Interior gateway protocol Exterior gateway protocol Subnet 1.1

41 Network Layer4-41 Autonomous System (AS) r AS m “ a set of routers under a single technical administration, using an Interior Gateway Protocol and common metrics to route packets within the AS and using an Exterior Gateway Protocol to route packets to other ASs” (RFC 1771) r Today AS may use more than one IGP, with potentially several sets of metrics. r The autonomous system designator is a 16-bit number, with a range of 1 to 65535. A range of AS numbers, 64512 through 65530, is reserved for private use, much like the private IP addresses.

42 Network Layer4-42 Path attributes & BGP routes r When advertising a prefix, advert includes BGP attributes. m prefix + attributes = “route” r Two important attributes: m AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17 m NEXT-HOP: Indicates the specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.) r When gateway router receives route advert, uses import policy to accept/decline.

43 Network Layer4-43 BGP messages r BGP messages exchanged using TCP. r BGP messages: m OPEN: opens TCP connection to peer and authenticates sender m UPDATE: advertises new path (or withdraws old) m KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request m NOTIFICATION: reports errors in previous msg; also used to close connection

44 Network Layer4-44 AS 1 AS 5 AS 2 AS 3 1 1 BGP Example R1 R2 R3 R51 R52 AS 4 R4 N3 N2 N1

45 Network Layer4-45 BGP Example r R1 m Obtain the network information in AS1 by exchanging the IGP routing messages between routers in AS1. m R1 sends BGP UPDATE message to all BGP neighbors. m The UPDATE message includes: AS_Path: {AS1} Next_Hop: {R1’s IP address} NLRI: {N1, N2, N3} r R2, R3 m R2 and R3 that received the UPDATE message can know that the networks in AS1 can be reached via R1.

46 Network Layer4-46 AS 1 AS 5 AS 2 AS 3 2 2 BGP Example R1 R2 R3 R51 R52 AS 4 R4 N3 N2 N1

47 Network Layer4-47 BGP Example r R2 sends to R51 the UPDATE message that includes the following: m AS_Path: {AS1, AS2} m Next_Hop : {R2’s IP address} m NLRI: {N1, N2, N3} r R3 sends to R4 the UPDATE message that includes the following: m AS_Path: {AS1, AS3} m Next_Hop : {R3’s IP address} m NLRI: {N1, N2, N3}

48 Network Layer4-48 AS 1 AS 5 AS 2 AS 3 3 BGP Example R1 R2 R3 R51 R52 AS 4 R4 N3 N2 N1

49 Network Layer4-49 BGP Example r R4 sends to R52 the UPDATE message that includes the following: m AS_Path: {AS1, AS3, AS4} m Next_Hop : {R3’s IP address} m NLRI: {N1, N2, N3}

50 Network Layer4-50 AS 1 AS 5 AS 2 AS 3 BGP Example R1 R2 R3 R51 R52 AS 4 R4 N3 N2 N1

51 Network Layer4-51 BGP Example r R51 and R52 m R51 that received the UPDATE message from R2 can know: The networks in AS1 can be reached via R2 The path is {AS2, AS1}. m R52 that received the UPDATE message from R4 can know: The networks in AS1 can be reached via R4 The path is {AS4, AS3, AS1}. m R51 and R52 exchange BGP UPDATE messages. They will choose the better path. m Choosing the path, they refer to AS-path list in the UPDATE message to find out: Route loop(loop prevention) Path selection based on the shortest path(shortest path vector) Path selection based on AS policy(policy routing)

52 Network Layer4-52 BGP route selection r Router may learn about more than 1 route to some prefix. Router must select route. r Elimination rules: 1. Local preference value attribute: policy decision 2. Shortest AS-PATH 3. Closest NEXT-HOP router: hot potato routing 4. Additional criteria

53 Network Layer4-53 BGP routing policy r A,B,C are provider networks r X,W,Y are customer (of provider networks) r X is dual-homed: attached to two networks m X does not want to route from B via X to C m.. so X will not advertise to B a route to C

54 Network Layer4-54 BGP routing policy (2) r A advertises to B the path AW r B advertises to X the path BAW r Should B advertise to C the path BAW? m No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers m B wants to force C to route to w via A m B wants to route only to/from its customers!

55 Network Layer4-55 Why different Intra- and Inter-AS routing ? Policy: r Inter-AS: admin wants control over how its traffic routed, who routes through its net. r Intra-AS: single admin, so no policy decisions needed Scale: r hierarchical routing saves table size, reduced update traffic Performance: r Intra-AS: can focus on performance r Inter-AS: policy may dominate over performance


Download ppt "Routing Algorithms. Network Layer4-2 Dynamic Routing r The routing table is updated using the routing protocols. When there is a change in the Internet."

Similar presentations


Ads by Google