In [2]:
from IPython.display import Image

Reliable Data Transfer or

Hey, What can go wrong??

  1. Bit Errors
  2. Crashing servers
  3. Lost Data - queuing
  4. Crashing routers

Lets asssume that we can only get a bit error

  1. Need to have some kind of positive and/or negative acknowledgement

In [9]:
Image("Images/rdt_2_0.jpg", width=500)


Out[9]:

But Wait -- this won't work

  1. What if the ACK is corrupted?
  2. What if the NAK is corrupted?

Possible Solutions

  1. send a new message type "what did you say?"
  2. add enough error correction to overcome the problem
  3. Just resend the packet if you don't understand ACK or NAK
    • But now how does the receiver know whether this is a new packet or a copy of an old one you sent because of a corrupted response??

Adding a one bit sequence number


In [12]:
Image("Images/rdt_2_1_sender.jpg",width=600)


Out[12]:

In [15]:
Image("Images/rdt_2_1_rcvr.jpg",width=600)


Out[15]:

Can we simplify?

  1. Lets get rid of the NAKs
  2. Instead of a NAK we just send an ACK for the last correctly received packet
  3. The sender will know that it has received a duplicate ACK and can resend the packet followed the double ACKed pack

In [17]:
Image("Images/rdt_2_2_sender.jpg", width=600)


Out[17]:

In [18]:
Image("Images/rdt_2_2_rcvr.jpg",width=600)


Out[18]:

Great are we done yet?

No!

Did you forget about losing data?

  1. How do we detect Packet loss?
  2. What do we do about it?

Lets make the sender do it!

  1. If the sender does not get an acknowlegement then one of two things has happened:

    • The original packet was lost
    • The ack was lost
  2. How long should the sender wait?

    • Too long means a slow protocol
    • Too short means we may very well introduce duplicate packets

In [19]:
Image("Images/rdt_3_0_sender.jpg",width=600)


Out[19]: