Solutions to Assignment 2

  1. original bits: 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0
    decoded  bits: 1 1 0 1 0 1 1 1 1 1   1 0 1 1 1 1 1   1 0 1 1 1 1 1 1 1 0
                                                                         ^
    
    The receiver expects the marked bit is 0 because it does not see the required bit stuffing in the preceding six 1s. Thus, it can detect the error.

  2. It is desirable to have error detection fields to be of fixed length so not to tie the size of this field to the size of the data and risk exceeding the MTU of the datalink layer. Exceeding the MTU at the datalink layer my require that we fragment frames and deal with reassembly at each hop along the path.

  3. 
    1 1 0 1 0 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 0
    
    1.        11000001
           ---------------
      1001 | 11011001000
             1001
           --------------
              1001
              1001
           --------------
                    1000
                    1001
           --------------
                       1  (remainder)
      
      So, the message is 11011001001.
    2.        1010011
           ---------------
      1001 | 01011001001
              1001
           --------------
                1000
                1001
           --------------
                   1100
                   1001
           --------------
                    1011
                    1001
           --------------
                      10 (remainder)
      
      Thus, the receiver detects that an error has occurred because the remainder is not a zero.
    1. Propagation delay= length /speed =20*10^3 /2*10^8 =10^-4 sec

    2. The minimum time needed to send the frame and get an acknowledgment back is at least double the propagation delay (ignoring the transmission time). A suitable timeout value should give some time for transmission and the processing of frame at the receiver. Allowing 2*propagation for these we could set the timeout to be around 4 *10^-4 sec.
    3. The receiver may not be able to respond immediately, thereby introducing unpredictable processing delays. Further, if the receiver was on a shared medium (which is not the case here) the load on the link due to other simultaneous transmissions may introduce delays.

  4. An optimal window size should keep the sender busy all the time. Data that can be transmitted in one RTT or (2*propagation delay) = 1*10^6*2.5 = 2500000 bits = 2500000/(1024*8) = 305.2 frames.
    Assuming that both sender and receiver use windows of same sizes, we need sequence numbers for 2*305.2 = 610.4 frames. Therefore, 10 bits are sufficient.

  5. This situation arises in case of the hidden node problem.

  6. When A sends to C, all bridges learn where A is. However, when C sends to A, B2 does not forward the packet along its interface to B4 because it already knows where A is. This prevents B4 from learning about C. Similary, when D sends to C, B2 does not forward the packet along its interface to B1 because it already knows where C is. This prevents B1 from learning about D. The resulting tables for B1, B2, B3, and B4 are as follows.

    Forwarding table for B1:

    DestinationOutgoing Port
    A A
    C B2
    D  

    Forwarding table for B2:

    DestinationOutgoing Port
    A B1
    C B3
    D B4

    Forwarding table for B3:

    DestinationOutgoing Port
    A B2
    C C
    D B2

    Forwarding table for B4:

    DestinationOutgoing Port
    A B2
    C  
    D D

     

  7. B1 is selected as the root because it is the lowest numbered. B2 has two paths of equal length to the root. It will turn off its port to either the top or bottom network depending on which it first received information about B1 on. The situation for B3 is identical to that of B2. However, B2 and B3 continue to have open ports and forward to the right-most and left-most networks, respectively.