Distance Vector Routing - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Distance Vector Routing

Description:

Also called Bellman-Ford forwarding. Used for ARPANET routing several years ago ... In addition to destination network addresses and ports, distance vector routing ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 42
Provided by: randyjf
Category:
Tags: ca | distance | ford | routing | vector

less

Transcript and Presenter's Notes

Title: Distance Vector Routing


1
Distance Vector Routing
  • Using the Hop Count as a Metric

2
Distance Vector Forwarding
  • Also called Bellman-Ford forwarding
  • Used for ARPANET routing several years ago
  • This category of routers use some concept of
    route distance to determine the best path
  • In addition to destination network addresses and
    ports, distance vector routing tables contain the
    distance (in hops) to each network
  • Routing tables in distance vector (DV) routing
    typically contain a number of routes to a given
    network address
  • If these tables are sorted based on distance
    vectors (i.e. hop count), the first entry can be
    used (shortest distance)
  • This distance can propagate from router to router
    (each incrementing or decrementing as necessary)
    when new networks join

3
Distance Vector Forwarding
N5
N4
R3
N1
3
R1
1
2
R2
N2
N3
4
Distance Vector Tables
  • DV routing tables are created dynamically
  • DV routers initialize their routing tables with
    entries for networks in which they are directly
    connected (i.e. zero distance links)
  • Distance is 0, port is the port which connects
    the router directly to that network
  • Periodically, DV routers announce their routing
    table entries
  • If a neighbouring router R2 is advertising a
    route for network N with distance D, we can route
    to N with distance (D1)
  • Our routing table will get a new entry for each
    of these remote entries
  • Distance is D1, port is the port which connects
    the router to R2

5
Distance Vector Tables
N1
N4
1
1
3
4
N2
R1
R2
2
T1
T1
T1
T1
2
3
N5
N3
6
Distance Vector Tables
N1
N4
1
1
3
4
N2
R1
R2
2
T2
T2
T2
T2
2
3
N5
N3
7
Distance Vector Tables
N1
N4
1
1
3
4
N2
R1
R2
2
2
3
N5
N3
8
Distance Vector Tables
  • Routers share their routing table information by
    sending datagrams
  • These datagrams contain a number of pairs of
    destinations (V) and distances (D)

9
DV Routing Conceptual
  • Distance Vector routing requires that each router
    publicly announce the distance to all its
    reachable destinations
  • Consider this analogy
  • Think of a router as a road intersection in the
    middle of nowhere
  • At this location, several signs are posted
    indicating the distance (in kilometres),
    direction (with an arrow on the sign), and the
    name of the destination
  • These 3 values correspond to hop count, port, and
    network address, respectively

10
DV Routers Conceptual View
Welcome to Bobton Population 1
Whoohoo! A friend!
11
DV Routing Conceptual
  • Continuing this analogy, routers establish
    information the same way you would create these
    signposts
  • Travel down each of your paths, and look for
    either
  • Other signposts Create a signpost with the same
    elements as the other signpost
  • Measure the distance to the signpost
  • Add that distance to each distance
  • Towns Measure the distance, and post it verbatim
    onto your signpost

12
DV Routing Conceptual
  • It is possible that two or more directions could
    lead to the same destination
  • In this case, the shortest path is used
  • Considering our analogy, two streets could
    potentially lead to the same town
  • However, one direction may be a less efficient
    route than the other
  • Clearly, we wish to direct traffic towards the
    more efficient route

13
DV Routing Conceptual
  • In this way, routers (and sign builders) only
    need to travel down one link in each direction to
    gather routing information
  • Until they either find another router (signpost),
    or a destination network (town)

14
RIP
  • Routing Information Protocol

15
RIP
  • Distance vector forwarding
  • Employed (but not exclusively) in the following
    networks
  • IP
  • IPX

16
How RIP Works
  • Participants on an RIP network are either passive
    or active
  • Active nodes
  • Are routers
  • They collect routing information from neighbours
    to build their own routing tables
  • They advertise their own routes (using distance
    vectors) to other nodes
  • Passive nodes
  • Usually hosts or bridges
  • They collect routing information from neighbours
    to build their own routing tables
  • They do not, however, advertise their own routes,
    because no datagrams are forwarded through
    passive nodes
  • In other words, passive nodes are the end links
    in the chain only

17
How RIP Works
  • Passive and active nodes create their routing
    tables by listening to RIP response messages
    (explained later)
  • These response messages contain lists of distance
    vectors
  • When a shorter route (lower distance) is found,
    it overwrites the previous route in the routing
    table
  • Equal distances are not overwritten
  • Saves processing time

18
RIP Packet Format Version 1
  • Version has the value of 1 (for RIPv1)
  • Reserved is not presently utilized

octets
command
1
version
1
reserved
2
address family ID
2
address
14
metric
4
May be repeated
19
RIP Packets Command
  • Denotes whether the packet is a request message
    (1) or a response message (2)
  • These are the only 2 kinds of packets in RIP
  • Requests might be transmitted by routers that
    have timed out or outdated information
  • Requests essentially ask for information (i.e.
    DVs) from specific (or all) nodes
  • Responses might be transmitted in response to a
    request
  • Thus the response messages usually contain a list
    of distance vectors

20
RIP Responses
  • Are sent
  • In response to a request
  • Usually issued by nodes with outdated information
    or new nodes
  • Periodically
  • The RIP specification defines that distance
    vectors should be publicized every 30 seconds
  • In response to a change
  • If a neighbour (or link to a neighbour) changes
    (e.g. fails), a response message is automatically
    transmitted to neighbour nodes

21
RIP Packets DV Lists
  • Can be up to 25 in each packet
  • Contain 3 parts
  • Address family ID Identifier describing that
    kind of address is specified
  • Address The address of the node to which this
    DV refers
  • Metric The distance in some metric (e.g. hop
    count)
  • The large space allocated for addresses (14
    octets) can be used in different ways in networks
    that have smaller addresses
  • E.g. In IP networks, 2 octets is left unused
    before the 4 octet address, and 8 octets is left
    unused after the address (see page 301 for a more
    complete picture)

22
DV Routing Problems Example
  • Consider the network shown below

B
A
C
1
1
1
2
23
DV Routing Problems Example
  • What happens if we have link failure between B
    C?
  • B will realize there is a problem (ignored
    messages, etc.), and tries to determine another
    route to C

B
A
C
1
1
1
2
X
24
DV Routing Problems Example
  • B will ask its neighbours (i.e. A), if they can
    reach C
  • How will A respond?
  • Look at As routing table to find the answer

B
A
C
1
1
1
2
X
25
DV Routing Problems Example
  • A thinks that it can reach C in 2 hops
  • This path is through B, but that is not known to
    A
  • B will get this information and (falsely) think
    it can access C through A
  • B believes that the path is 3 hops

B
A
C
1
1
1
2
X
26
DV Routing Problems Example
  • Now suppose B has a message for C
  • It will send the message to A
  • Just as its routing table suggests
  • A will send the message back to B
  • This will put the packet into a continuous loop

B
A
C
1
1
1
2
X
27
DV Routing Problems Example
  • This loop could eventually be resolved by network
    management protocols, but
  • It takes a while for A and B to realize there is
    a routing loop
  • A will eventually invalidate its route, and use
    Bs distance vector (314) for its new route (it
    now seems possible to get to C via B)
  • A will soon after send out its distance vector
  • This will cause B to invalidate its route, and
    use As distance vector (415), etc. (to
    infinity)
  • Once A and B determine that no route is possible
    the process may continue backward (if A had other
    neighbours)

B
A
C
1
1
1
2
X
28
Count to Infinity
  • The example shows a route towards a host
    (destination node) D

Network
R1
R2
R3
D
29
Count to Infinity
  • What happens if there is link failure between R1
    and D?
  • R1 will detect the change and look for
    alternative routes

Network
R1
R2
R3
D
X
30
Count to Infinity
  • R2 will advertise that it has a route to D (with
    distance 2)
  • R1 is unaware that this route passes through
    itself to D (and as such is invalid)
  • Because only the distance is advertised (not the
    link state), there is no way for R1 to know that
    R2 does not have a viable route

Network
R1
R2
R3
?
D
31
Count to Infinity
  • R1 will replace its routing table entry for D
    with one pointing to R2 for packets addressed to
    D
  • The distance will be 3 (21)
  • The new distance vector is sent to R2

D
3
Network

?
R1
R2
R3
D
32
Count to Infinity
  • R2 will replace its routing table entry for D
    with one pointing to R1 for packets addressed to
    D
  • The distance will be 4 (31)
  • The new distance vector is sent to R1

D
4
Network

?
R1
R2
R3
D
33
Count to Infinity
  • R1 will replace its routing table entry for D
    with one pointing to R2 for packets addressed to
    D
  • The distance will be 5 (41)
  • The new distance vector is sent to R2
  • etc (to infinity)

D
5
Network

?
R1
R2
R3
D
34
Count to Infinity
  • Once infinity is reached, R2 concludes
    (correctly) that R1 cannot deliver packets to D
  • R2 will use the distance vector from R3 to find
    an alternative path to D
  • If none exists (as in the example below), this
    process will propagate backwards to the very
    source of the message

Network
?
R1
R2
R3
D
35
Slow Convergence
  • Slow convergence describes when this situation
    occurs
  • The routers in the network spend a large amount
    of time in an inconsistent state
  • Some routers know of the failure, while others do
    not
  • During this time, messages addressed to D are
    being lost and/or looping between routers
  • The routers of the network (as a whole) slowly
    converge on the correct configuration to route
    (or determine routing impossible) to D

36
Split Horizon Updates
  • One preventative measure for counting to
    infinity
  • Distance vectors are not transmitted to the same
    port where the original distance vector came
    from, on which this distance vector is based
  • For example
  • R1 may advertise a distance vector to D (D,1)
  • R2 will receive this distance vector and create
    its own (D,2)
  • R2 will not propagate this distance vector to R1
    at any time
  • It will, however, propagate it to through all
    other links

37
Split Horizon Updates
  • Problems
  • Information about where distance vectors came
    from must be stored in the routing table
  • It is possible to create the count to infinity
    problem using three or more routers in a cycle
  • Thus, split horizon is not a complete solution to
    the count to infinity problem

38
Hold Down
  • Routers wait before distributing their
    information about a disconnected network for a
    period of time
  • For RIP, the distance vectors expire in 180
    seconds
  • Before this time, routers will continue to
    forward this data incorrectly
  • After this time, all routers will remove all
    paths containing the disconnected link from their
    routing tables
  • Distance vectors are considered out-of-date if
    the vector is not retransmitted
  • After this time, the new routing information
    (minus the failed link) is distributed and new
    routes are created
  • If a route to the new destination is not found at
    this time, the routers will not have entries
    (thus it is unreachable)

39
Hold Down
  • Problem
  • The routers are expected to wait a long time
    (180s)
  • During this time, routers are in an inconsistent
    state
  • An ideal solution would result in routers
    remaining consistent throughout the process

40
Poison Reverse
  • Routers detecting a disconnected host or network
    keep its entry, but increase its cost to infinity
  • The new distance vector(s) are immediately
    transmitted
  • This prompts all other routers to find an
    alternative route if possible
  • If no alternative routes are found, the routers
    will determine the host to be unreachable

41
RIP Count to Infinity Solutions
  • Infinity in RIP is 16
  • This way, the number of messages during count to
    infinity is limited
  • However, it also means that the width of the
    network (host to host) must be less than 16
  • If costs gt 1 are to be used, the width must be
    even less
  • This imposes a serious restriction on the network
    size
  • Most RIP implementations use split horizon
  • However, some RIP implementations use poison
    reverse
Write a Comment
User Comments (0)
About PowerShow.com