Internet Routing Algorithm

  • Upload
    ketan35

  • View
    234

  • Download
    0

Embed Size (px)

Citation preview

  • 7/30/2019 Internet Routing Algorithm

    1/38

    Department of Computer Engineering

    1

    Internet Routing Algorithms

  • 7/30/2019 Internet Routing Algorithm

    2/38

    Department of Computer Engineering

    2

    Routing algorithms

    Shortest Path

    Path that has the least cost

    Widest Path

    Path that has the most widthFor different purpose, different approaches available

    Shortest path algorithms are applicable to IP networks

    Widest path algorithms are useful for telephone networks

    Introduction

  • 7/30/2019 Internet Routing Algorithm

    3/38

    Department of Computer Engineering

    3

    Communication network is made up of nodes and links

    In IP network , a node is called a router

    A link in IP node is called an IP trunk

    Traffic flows from start (source) to end node (destination)

    Terminologies Used

  • 7/30/2019 Internet Routing Algorithm

    4/38

    Department of Computer Engineering

    4

    Route setup configured manually is called static route

    Route decided on the fly is called dynamic route

    Shortest path may be distance

    Distance can be measured in terms of time

    In networks normally shortest path is either no. of hops or time

    Terminologies Used

  • 7/30/2019 Internet Routing Algorithm

    5/38

    Department of Computer Engineering

    5

    Sample Six Node Network

    Cost of each link given

    By eyeballing we can see that the shortest path from node-1 to

    node-6 is 1-4-3-6 with a cost of 3 units

    How to find this from an algorithmic standpoint?

  • 7/30/2019 Internet Routing Algorithm

    6/38

    Department of Computer Engineering

    6

    Bellman Ford Algorithm

    Centralized Approach

    Distance Vector Approach

    Dijkstras Algorithm

    Centralized Approach

    Distance Vector Approach

    Candidate Path Caching Algorithm

    K-path Algorithm

    Shortest Path Algorithms

  • 7/30/2019 Internet Routing Algorithm

    7/38

    Department of Computer Engineering

    7

    Source node needs to know the cost of the Shortest Path to all the nodesimmediately prior to the destination node

    We use two generic node i and j , in a network of N nodes k is an intermediate node Track two sets of information

    Bellman-Ford equation

    dij = finite value if directlyconnected

    dij= if not

    Bellman Ford Algorithm : Centralized Approach

  • 7/30/2019 Internet Routing Algorithm

    8/38

    Department of Computer Engineering

    8

    Bellman Ford Algorithm :Centralized Approach

    Centralized Approach: uses number of hops in algorithm

  • 7/30/2019 Internet Routing Algorithm

    9/38

    Department of Computer Engineering

    9

    Q. Find the shortest path between 1 to 6 for the given network.

    What to remember1. Intermediate nodes k are directly connected to destination node.

    In our case destination node is j and intermediate nodes k are3,4 and 5. Therefore values between k and destination nodes arefinite and knowndkj = d36 and d46 and d56 d36 = 1 d46=15 d56 = 1

    2. What we have to calculate is the paths from source node to allintermediate nodes ie Dik = D13 and D14 and D15

    3. According to algorithms , we have to calculate

    D16(3) = D13

    (2) + d36D16

    (2) = D14(1) + d46

    D16(3) = D15

    (2) + d56

    Let us calculate D terms

    Bellman Ford Algorithm : Manual Calculations

  • 7/30/2019 Internet Routing Algorithm

    10/38

    Department of Computer Engineering

    10

    Initially D16(1) =

    Let us calculate D13

    D13(2) = D12

    (1) + d23 = 1+2 = 3 path 1-2-3or D13

    (2) = D14(1) + d43 = 1+1 = 2 path 1-4-3 (min)

    or D13(3) = D14

    (2) + d43 = 2+1 = 3 path 1-2-4-3

    or D13(4)

    = D15(3)

    + d53 = 4+1 = 5 path 1-2-4-5-3

    Let us calculate D14

    D14(1) = 1 min Dij in terms of hops and cost.

    or D14(2) = D12

    (1) + d24 = 1+1 = 2

    Let us calculate D15

    D15(2) = D14

    (1) + d45 = 1+2 = 3min Dij in terms of hops and cost.

    Bellman Ford Algorithm :Centralized Approach

  • 7/30/2019 Internet Routing Algorithm

    11/38

    Department of Computer Engineering

    11

    Bellman Ford Algorithm :Centralized Approach

    Therefore shortest path is 1-4-3-6 = 3

    D16 =

  • 7/30/2019 Internet Routing Algorithm

    12/38

    Department of Computer Engineering

    12

    Bellman Ford Algorithm : Distance Vector Approach (Time)

    Presents a complementary viewof centralize Bellman-Ford

    In centralized approach intermediate node k was connected to

    destination nodeIn distance vector approach intermediate node k is directlyconnected to source node.

    Source node needs to know the cost of the all the nodesimmediately after the source ( complementary view)

    Source node is directly connected to all intermediate nodes ki.

  • 7/30/2019 Internet Routing Algorithm

    13/38

    Department of Computer Engineering

    13

    Bellman Ford Algorithm : Distance Vector Approach (Time)

    Algorithm uses a concept of time domain dependency.

    At time t, node ican only know what it has received from kregarding

    distance to nodej, i.e., Dikj(t)

    Uses hop based cost in terms of discrete time windows ( traffic/load)

    t is now related with hop or hop is replaced by t ( h -> t)

    f C

  • 7/30/2019 Internet Routing Algorithm

    14/38

    Department of Computer Engineering

    14

    The computation of the shortest path by each node is done based

    on link cost ( traffic / load) information received at given time t.This cost may vary time to time and there may be different paths at

    different time.

    In real scenario nodes (intermediate) are always distributing their

    cost to all directly connected nodes in order to find out SP.

    Bellman Ford Algorithm : Distance Vector Approach (Time)

    D t t f C t E i i

  • 7/30/2019 Internet Routing Algorithm

    15/38

    Department of Computer Engineering

    15

    Bellman Ford Algorithm : Distance Vector Approach (Time)

    D t t f C t E i i

  • 7/30/2019 Internet Routing Algorithm

    16/38

    Department of Computer Engineering

    16

    Dijkstras Algorithm : Centralized Approach

    Computing path from a source node view

    It works on the notion of neighbouring node set

    Need to have the link costs of all links

    Computes shortest path to all the destinations

    Does not depends upon all neighbouring intermediates k

    It always calculates optimal intermediate node and then moves next

    D t t f C t E i i

  • 7/30/2019 Internet Routing Algorithm

    17/38

    Department of Computer Engineering

    17

    Dijkstras Algorithm : Centralized Approach

    Divides the list of N nodes into two list.

    It first starts with permanent list S , which represents nodes already

    considered

    It prepares tentative list Sfor nodes which are not considered

    As algorithm progresses, list S expands with new nodes while list S

    shrinks when nodes are added in S

    List S is expanded by considering a neighbouring node with least

    cost

    Algorithm stops when list Sbecomes empty

    D t t f C t E i i

  • 7/30/2019 Internet Routing Algorithm

    18/38

    Department of Computer Engineering

    18

    Dijkstras Algorithm : Centralized Approach : Illustration

    Initially S= {1} and S = {2, 3, 4, 5, 6}

    Node 1 is directly connected to 2 and 4. Both path have same cost.There is a tie . So select anyone. Let us select node 2. Now we get

    S= {1,2} and S = {3, 4, 5, 6}

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    19/38

    Department of Computer Engineering

    19

    Node 2 is directly connected to 3 and 4. Now calculate the cost forboth from node 1 and select minimum one. Now we get

    There is no improvement in the path of 1 to 4, so select (1,4). Now

    S= {1,2,4} and S = {3, 5, 6}

    Keeps the minimum

    Dijkstras Algorithm : Centralized Approach

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    20/38

    Department of Computer Engineering

    20

    D13 = min { D13 , D14 + d43 } = min { 3,1+1} = 2

    D15 = min { D15 , D14 + d45 } = min {,1+2} = 3

    D16 = min { D16 , D14 + d46 } = min {,1+15} = 16

    S= {1,2,4,3} and S = { 5, 6}

    Keeps the minimum

    Similarly, it includes nodes 5 and finally node 6.

    We get shortest path : 1-4-3-6 = 3

    Dijkstras Algorithm : Centralized Approach

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    21/38

    Department of Computer Engineering

    21

    Dijkstras Algorithm : Centralized Approach

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    22/38

    Department of Computer Engineering

    22

    Dijkstras Algorithm : Iterative Steps

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    23/38

    Department of Computer Engineering

    23

    Very similar to centralized algorithm:

    The computation of the shortest path by each node is done

    separately based on link cost information received

    Link cost of a link received by one node could be different

    from another node time to time

    Link cost seen by node iat time tregarding link k-m:

    dikm(t)

    Dijkstras Algorithm : Distributed Approach

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    24/38

    Department of Computer Engineering

    24

    Dijkstras Algorithm : Distributed Approach

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    25/38

    Department of Computer Engineering

    25

    Shortest Path with Candidate Path caching

    In certain situations, possible or candidate paths to a

    destination are known ahead of time In this case, only the updated link cost are needed

    Then, the computation is fairly simple

    Such situations arise if a router cashes a path, or more

    commonly, in off-line traffic engineering computation

    Consider the four paths from 1 to 6:

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    26/38

    Department of Computer Engineering

    26

    Shortest Path Computation with Candidate Path caching

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    27/38

    Department of Computer Engineering

    27

    Widest path routing has been around since the early days of

    dynamic call routing in the telephone network

    The notion here is different from shortest path routing in that

    the path with the maximum width is to be chosen

    Since a path is made of links, the link with the smallest

    width dictates the width of the path Consider width (bandwidth) of link l-m as seen by node iat

    time t: bikm(t)

    Main implication: path cost is non-additive (concave)

    Widest Path Computation with Candidate Path caching

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    28/38

    Department of Computer Engineering

    28

    From 1 to 5:

    Widest path is 1-4-5

    Widest Path : Illustration

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    29/38

    Department of Computer Engineering

    29

    Widest Path Computation with Candidate Path caching

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    30/38

    Department of Computer Engineering

    30

    Widest Path : Dijkstras Based

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    31/38

    Department of Computer Engineering

    31

    S = {1}, S = {2, 3, 4, 5}

    B12 = 30, B14 = 20, B13 = B15 = 0

    MaxjSB1j= 30 is attained atj= 2

    Now, S = {1, 2}, S = {3, 4, 5}

    Next compare: B13 = max {B13, min{B12,b23}} = 10 // use 1-2-3

    B14 = max {B14, miin{B12,b24}} = 20 // stay on 1-2

    B15 = max{B15,min{B12,b25}} =max {0, min{30,0}} = 0

    MaxjSB1j= max{B13,B14,B15} = 20, attained for j=4.

    Now, S = {1, 2, 4}, S = {3, 5}

    And so on [ Bij : add node according to j in the list ]

    Widest Path : Dijkstras Based : Illustration (I)

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    32/38

    p p g g

    32

    Next compare: node 3 and node 5

    B13 = max {B13, min{B14,b43}} = 15 // use 1-4-3

    B15 = max {B15, miin{B14,b45}} = 20 // stay on 1-4-5

    Therefore widest path is 1-4-5 = 20

    Widest Path : Dijkstras Based : Illustration

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    33/38

    p p g g

    33

    Widest Path : Dijkstras Based : Illustration (II)

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    34/38

    p p g g

    34

    Bellman-Ford-based Widest path routing

    Similar to additive version:

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    35/38

    p p g g

    35

    When we need to generate the shortest path, the next shortest

    path, up to the K-th shortest path

    Naive idea:

    Run the shortest path algorithm

    Delete each link one at a time, and re-run shortest path

    algorithm on the reduced graph

    Pick the best from this set of paths

    and so on

    K Shortest Paths Algorithm

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    36/38

    36

    K Shortest Paths Algorithm

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    37/38

    37

    E-book ofNetwork Routing

    Algorithms, Protocols, and Architectures

    By

    Deepankar Medhi

    Karthikeyan Ramasamy

    And

    TCP/IP by Forozoun

    Resources

    Department of Computer Engineering

  • 7/30/2019 Internet Routing Algorithm

    38/38

    Thank You