Comp 343/443    

Fall 2011, LT 412, Tuesday 4:15-6:45
Week 7, Oct 18

Read:
    Ch 1, sections 1,2,3 and 5
    Ch 2, sections 1, 2, 3, 5, 6
    Ch 3, sections 1, 2, 3

Midterm: October 25




Routing-table algorithms (§4.2 (4th edition) or §3.3 (5th edition))

Ethernet bridges can always fall back on broadcast, so they can afford to build the routing tables "incrementally". For IP, there is no fallback delivery mechanism: router tables must be built before delivery can succeed. While manual table construction is possible, it is not practical.

4.2.2: distance vector routing (Routing Information Protocol, RIP)

Distance-Vector is used by the Routing Information Protocol, or RIP, on unix systems this is often called "routed" (pronounced route-d). It is the simplest routing-table protocol.

Routers identify their router neighbors, and add a third cost (or distance) column to their tables. The simplest case is when we assign a cost of 1 to each link (the "hopcount" metric); it is also possible to assign more complex numbers. Neighbors exchange the (destination,cost) portions of their tables. When a neighbor's (dest,cost) pair arrives, the router updates its own table in three cases:
  1. new node reported
  2. decreased distance to existing node reported . NOTE: these are the "no-bad-news" cases for which convergence happens because the distances are monotonically decreasing (or the same). If all hopcounts are 1, shortest path is the first discovered.
  3. increased distance reported by NextHop for that node
For the moment, let us ignore the third case. Then every cost is (non-monotonically) decreasing, and thus must converge. The first two cases are the "no-bad-news" cases.

Simple example:

        B              
     /    \
   /        \
  A -------- C
  |          |
  |          |
  D -------- E


First example: use the first two rules to generate basic tables for everyone (done week 6)

Second example: link weights other than 1.

A-----2-----C
|           |
8           1
|           |
B-----3-----D


Third example: have the D--E link break, and have the third rule come into play. This is the "bad-news" case: a link has broken, and is no longer available. Costs may now rise as well as fall.


 

Distance-Vector slow-convergence problem

  A and B have table entries for destination D as shown underneath.

             D-------A----------B
                 <D,dir,1>   <D,A,2>        ;; "dir": directly connected

Now the D--A link breaks:

            D---x---A----------B
                 <D,dir,>   <D,A,2>        ;; "dir": directly connected
                 
If A immediately notifies B that D is no longer reachable (distance = ∞), then all is well. However, it is possible that, just before A begins to do this, B notifies A first that it has a route to D, with cost 2. This will lead to "slow convergence to infinity" (demo).

slow-convergence fixes

The simplest is using a small value for infinity.
            RIP: infinity=16, updates every 30 sec
            Cisco IGRP: infinity <= 256; default = 100
             
Other fixes (covered week 7):
           
split horizon:

Don't report reachability to your own NextHop for a node; in the example above, B would never report D-reachability to A because A is B's NextHop to D.

poison reverse:
       claim a node to be at distance infinity, when reporting to your own NextHop for that node
       Poison reverse is a stronger form of split horizon.

triggered updates: send report immediately on any change for the worse. This is generally intuitive, except that it can lead to notification storms, and there is still the possibility that the other end will send first.

hold down: sort of a receiver-side version of triggered updates: the receiver doesn't use new alternate routes for ~60 sec following discovery of unreachability. This gives time for bad news to arrive.

route poisoning: hold down only for changes that increase hop count
 


Chapter 5: transport


 

TCP - P&D 5.2

more semantic issues: 
        connected v connectionless
        connection is between two sockets: a socketpair
        one socket on host A can be part of multiple distinct socketpairs
        reliable v unreliable
        stream v packets
         
        what TCP does; header fields
  
  TCP Header Format
 
                                    
    0                   1                   2                   3   
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          Source Port          |       Destination Port        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Sequence Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Acknowledgment Number                      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Data |           |U|A|P|R|S|F|                               |
   | Offset| Reserved  |R|C|S|S|Y|I|            Window             |
   |       |           |G|K|H|T|N|N|                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |           Checksum            |         Urgent Pointer        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Options                    |    Padding    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                             data                              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
                            TCP Header Format
 
connection establishment
        
Logical issue of what is a "connection"
connection state on top of stateless lower layer
    
Basic strategy of 3-way handshake
         
Sequence number value is the number of the first byte of the packet, or what the number would be if there were a first byte.
         
Ack is the number of the next byte we are expecting
         
SYNs count as 1 byte (so do FINs)
         

In the following diagram, we are using relative sequence numbers, assumed to begin at 0 on each side.                            
         
         
A
B
send SYN, seq=0


send SYN+ACK, seq=0, ack=1 (expecting)
send ACK, seq=1, ack=1 (ACK of syn

send "abc", seq=1, ack=1


send ACK, seq=1, ack=4
send "defg", seq=4, ack=1

send seq=1, ack=8
send "foobar", seq=8, ack=1

send seq=1, ack=14, "hello"
send seq=14,ack=6, "goodbye"
send seq=21, ack=6, FIN send seq=6, ack=21    ;; crossing

send seq=6, ack=22 ;; ACK of FIN

send seq=6, ack=22, FIN
send seq=22, ack=7
          
If side X sends ACK=n, then after that is received the other side Y will reply with SEQ=n (this assumes no data is lost in transit.) Logically, however, side Y's concept that SEQ=n took effect as soon as Y sent the data for which X sent the ACK=n.

ISN issue : we do not in fact transport relative sequence numbers. Each side chooses its Initial Sequence Number, and sends that instead. All further sequence numbers sent are the relative sequence number plus the ISN.
          
              outline
              versus one 2-way handshake
             
              Adding 1000 to ISNA: this affects SEQ on A's side, ACK on B's side
               
TCP sliding windows: mostly the same as "normal" sliding windows, done earlier

     
Introduction to TCP state diagram, as far as connection establishment

    SYN, ACK, FIN, RST packets
     
Final-ACK problem: what if the final ACK is lost? The other side will resend its final FIN, but there will be no one left to answer! This is solved with the TIMEWAIT state.

Old late duplicates problem: Suppose a connection between the same pair of ports is closed and promptly reopened. Sometime during the first connection, a packet is delayed (and retransmitted). It finally arrives during the second connection, at just the right moment that its sequence number fits into the receive window of the receiver. (Example: ISN1 = 0, delayed packet seq number = 8000, ISN2 = 5000, receiver is expecting relative sequence number of 3000 when the old packet arrives.)