Computer Networks Week 10   Apr 8  Corboy Law 522


Program 2
    demos

Routing

LinkState

(reliable flooding done Week 9)

Linkstate routing is an alternative to distance-vector. In distance-vector, each node keeps a minimum of network topology. In linkstate, each node keeps a maximum: a full map of all nodes and all links.
  
4.2.3: Link-state routing and SPF

Whenever either side of a link notices it has died (or if a node notices that a new link has become available), it sends out LSP packets (Link State Protocol) that "flood" the network. This is called reliable flooding; note that in general broadcast protocols work poorly with networks that have even small amounts of topological looping (redundant paths).

Flooding algorithm: new messages are sent on over all links except the arriving interface. Each node maintains a database of all messages received. LSPs have sequence numbers, and a message is new if its sequence number is larger than any seen so far.

It is important that LSP sequence numbers not wrap around. lollipop sequence-numbering

SPF algorithm example, with path weights:
      
                            B
                        5/  |  \11
                      A    3|    D
                       10\  |  /2
                            C
The shortest path from A to D is A-B-C-D, which has cost 5+3+2=10. Note that if we use hopcounts as cost, and do a breadthfirst search for any route to D, then the first route found must be the shortest. But with other cost measures, this fails.
             
Build routes from A to D: (P&D do example from D to A). We maintain two sets of paths, Confirmed (known shortest paths) and Tentative (shortest so far).

Initialization: both sets are empty.
          
At each step,
(a) take ALL nodes reachable in one hop from the newest member of Confirmed, and see if they improve any existing routes. If so, add the new route to Tentative.
          
(b) Then take the shortest path in Tentative, & move to Confirmed
Step
Confirmed
Tentative
0
(A,0,-)

1a
(A,0,-)
(B,5,B), (C,10,C)
1b
(A,0,-), (B,5,B)
(C,10,C)
2a
(A,0,-),(B,5,B)
(C,8,B) (better), (D,16,B) (new)
2b
(A,0,-), (B,5,B), (C,8,B) (D,16,B)
3a
(A,0,-), (B,5,B), (C,8,B) (D,10,B) (better)
3b
(A,0,-), (B,5,B), (C,8,B), (D,10,B)

          
         
          
           Another example:
          
               A---3---B
               |       |
               12      2
               |       |
               D---4---C
              
Link-state allows precise or TOS-based metrics (TOS=Type of Service).
It also allows multiple paths to the same destination.
time to compute routes: O(N log N) for SPF, O(N^2) for VD
       
link-state still requires precise universal link-cost measurements!



Subnet example


Suppose the Loyola CS dept (147.126.65.0/24) and the uchicago cs dept (128.135.??? We'll say 128.135.11.0/24) install a private link.
How does this affect routing?

Each dept router would add an entry for the other subnet, routing along the private link. Traffic addressed to the other subnet would take the private link. All other traffic would go to the default router. Traffic from the uchicago department to 147.126.64.0/24 would take the long route, and Loyola traffic to 128.135.12.0/24 would take the long route.

How would nearby subnets at either endpoint decide whether to use the private link? Classical link-state or DV theory requires that they be able to compare the private-link route with the going-around-the-long-way route. But they can't!

The real issue here is that luc.edu and uchicago.edu are in different routing domains, and have no way to compare each others' routing metrics!
 

4.3.2  CIDR

table explosion
    running out of Class B addresses
    too many Class C's for tables
    running out of IP address space
     
basic strategy: consolidate multiple networks going to the same destination into a single entry.
Suppose a router has four class C's all to the same destination:
    200.0.0.0/24   -> foo
    200.0.1.0/24   -> foo
    200.0.2.0/24   -> foo
    200.0.3.0/24   -> foo
That router can replace all these with the single entry
    200.0.0.0/22   -> foo

We'll actually use a mask, FF.FF.FC.00, rather than /22; note FC = 1111 1100.
new problem: address comes in, but masks only exist in the table; packets don't carry masks with them.
How does lookup work?
 
Answer: 
Theoretical algorithm: given a dest A, and table entries 
    <D[i],M[i]>, search for i such that A & M[i] = D[i]    ("&" is the bitwise-AND operator)
Or, in terms of # of bits, where D[i] has N[i] network bits,
     
        A == D[i] to first N[i] bits
     
Problem: it is possible to have multiple matches, and responsibility for avoiding this is much too distributed to be feasible.
 
longest-match rule to the rescue!
 
policy v mechanism: cidr is an address-block-allocation mechanism
how provider-based routing might work
 
review longest-match mechanism
What policies do we want to implement with it?

NSFnet-model: NSFnet was the backbone; providers formed a tree below it. But IP addresses were still handed out by IANA directly to organizations. (IANA = Internet Assigned Numbers Association)
 
Application 1: CIDR allows IANA to allocate multiple blocks of Class C to a single customer
 
Application 2: CIDR allows huge provider blocks, with suballocation by the provider

Literally understood, the second strategy works only if all other providers route to the first provider's customer via the same path. This is mostly, but not exactly, true in practice. However, we can make it work 100% by quietly replacing our usual routing algorithm with a two-stage version: first route to the appropriate provider, and then route within that provider to the appropriate customer.
 
Providers P0(A,B,C), P1(D,E), P2(F,G) each with customers shown  in parentheses: how provider-based address allocation helps
Routing tables assuming each customer gets an address from its provider's block,
    P0: 200.0.0.0/8
    P1: 201.0.0.0/8
    P2: 202.0.0.0/8

    A: 200.0.0.0/16
    B: 200.1.0.0/12
    C: 200.1.16.0/12      (16 = 0xF0)

    D: 201.0.0.0/16
    E: 201.1.0.0/16
   
    F: 202.0.0.0/16
    G: 202.1.0.0/16
 
Routing model: route to provider, then to customer
This CHANGES things, subtly; we're no longer looking for the optimum path (at least once the NSFnet routing model broke down).

CIDR and staying out of jail

Longest-match rule and changing providers
    If A moves from P1 to P2, what changes do P3, P4, etc have to make?
   
(If we design an allocation strategy that does not allow change of provider, we may be guilty of antitrust violations.)

Longest-match allows customers to move without renumbering
hidden cost of such moves

New case:
 Providers P0(B,C), P1(A,D,E), P2(F,G) each with customers listed
 (A has moved from P0 to P1)
 but now we have addrs unrelated to provider, and so A needs to be entered in every table!

                             
Consider
P0---P1---P2
versus
  /------\
P0___P1___P2
(that is, P0 and P2 connecting indirectly through P1, versus having a direct connection)

router pseudo-hierarchy v. address-allocation true hierarchy
These don't have to agree, but there is a cost for disagreement

What if B adds a link to P1, in addition to link to A?

How CIDR allows provider-based and geography-based routing
                              
provider-based addresses
Problems:
               
                                         A
                                         |
                    P1:  r1--------r2----+---R3
                         |         |         |
                         |         |         |
                         |         |         |
                    P2:  s1--+-----s2--------s3
                             |
                             B
                        
BGP "MED" value (not discussed yet) allows server providers to carry the server's outbound traffic!
               
renumbering: threat or menace? [DHCP, NAT]
           Locators v. EID
           changing IP addrs midstream

geographical addresses

minor problems:
Real issue with geographical routing: who carries the traffic? Provider-based: business model jibes with routing model!!

New routing picture: destinations are networks, still, but some are organizations and some are major providers, with intermediate nets in between. Sometimes we might CHOOSE whether to view a large net as one unit, or to view it as separate medium-sized subunits (for the sake of visualization, assume the subunits have some geographical nature, or other attribute so that we can treat them as separate destinations.

Tradeoff:
2-step routing: when does it NOT find optimal routes?