10 handouts

Upload: emad11518

Post on 02-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 10 Handouts

    1/5

    1

    WAN technologies and routing

    Packet switches and store and forward

    Hierarchical addresses, routing and routing

    tables

    Routing table computation

    Example WAN technologies

    Categories of network technology

    Local Area Network (LAN)

    Metropolitan Area Network (MAN)

    Wide Area network (WAN)

    Key distinguishing feature is scale:

    geographic distance AND

    number of connected computers

    Packet Switches

    In order to grow, WANs use many switches

    Basic component is the packet switch that

    can connect to local computers and to

    other packet switches

    WAN topology

    Chosen to accommodate expected traffic

    and to provide redundancy

    Store and forward

    Each switch receives packets, queues

    them in its memory and then sends them

    out when possible (i.e., when the

    destination is available)

    Many computers can send packets

    simultaneously

    Physical addressing in a WAN

    A WAN defines a frame format and assigns

    physical addresses to its computers

    Hierarchical addressing, e.g.,

    first part identifies packet switch

    second part identifies computer on this switch

    switch 1 switch 2

    A

    B

    C

    D

    [1,2]

    [1,5]

    [2,2]

    [2,6]address

  • 8/10/2019 10 Handouts

    2/5

    2

    Next hop forwarding

    A packet switch determines the destination

    for each packet from the destination address

    local computer or

    another packet switch

    Only has information about how to reach the

    next switch - next hop

    This is held in a routing table

    Example routing table

    A

    B

    C

    D

    E F

    S1

    S2

    S3

    Routing table for S2

    Destination Next Hop

    [1,2] interface 1

    [1,5] interface 1

    [3,2] interface 4

    [3,5] interface 4

    [2,1] computer E

    [2,6] computer F

    [1,2]

    [1,5]

    [2,1] [2,6]

    [3,2]

    [3,5]

    Source independence

    The next hop depends upon the destination

    address but not on the source address

    Hierarchical addresses and routing

    Routing is the process of forwarding a

    packet to its next hop

    Hierarchical addresses simplify routing

    smaller routing tables

    more efficient look up

    Routing in a WAN

    Large WANs use interior switches and exterior

    switches

    Their routing tables must guarantee that

    Universal routing - there must be a next hop for

    every possible destination

    Optimal routes- the next hop must point to the

    shortest path to the destination

    Default routes

    A routing table may be simplified by including

    (at most) one default route

    Switch 1

    Destn next hop

    1 -

    * interface 3

    Switch 2

    Destn next hop

    2 -

    4 interface 4

    * interface 3

    Switch 3

    Destn next hop

    3 -

    interface 2

    interface 3

    4 interface 4

  • 8/10/2019 10 Handouts

    3/5

    3

    Routing table computation

    Manual computation is not feasible for large

    networks

    Static routing- program computes and installs

    routes when a switch boots; these routes do

    not change.

    Dynamic routing- program builds an initial

    table when the switch boots; this alters as

    conditions change.

    WANs and graphs A Wan can be modelled as a graph Nodes are switches: 1, 2, 3, 4

    Edges are connections between switches: (1,3) (2,3) (2,4) (3,4) Weights are distance along a connection

    Computing the shortest path

    Dijkstras algorithm - find the distance from

    a source node to each other node in a

    graph

    Run this for each switch and create next-

    hop routing table as part of the process

    Distance represented by weights on

    edges

    Example of the shortest path

    Dijkstras algorithm

    S = set of nodes, labelled with current distancefrom source, but for which minimumdistanceis not yet known

    Initialise S to everything but the source

    Iterate:

    select the node, u, from S that has smallest currentdistance from source

    examine each neighbour of u and if distance tothe neighbour from source is less via u than iscurrently recorded in S then update

    Implementation

    Data structure to store information about thegraph (nodes and edges)

    Integer labels for the nodes [1..n]

    Three data structures:

    current distance to each node - array - D[1..n]

    next hop destination for each node array - R[1..n]

    set S of remaining nodes - linked list - S

    weight(i, j) function (infinity if no edge)

  • 8/10/2019 10 Handouts

    4/5

  • 8/10/2019 10 Handouts

    5/5

    5

    Repeat forever {

    wait for the next routing message to arrive over the network;

    let the sender be switch N

    for each entry in the message {

    let V be the destination in the entry and D the distance

    compute C as D plus the weight of the link over whichthe message arrived

    examine and update the local routing table {

    if ( no route exists to V ) {

    add an entry to the local table for V

    with next hop N and distance C

    } else if ( a route exists with next hop N ) {

    replace existing distance with C

    } else if (route exists with distance > C )

    change next hop to N and distance to C

    }

    }

    }

    Link state routing

    Each switch periodically broadcasts state of

    specific links to other switches

    Switches collect these messages and then

    apply Dijkstras algorithm to their version of

    the state of the network