Sunday, June 28, 2009

Reliable Protocol on Unreliable Channel

When you work with Unreliable communication channel (like UDP), you need to implement your own "Reliable Mechanism" to be sure that packet that you've send was received correctly. Here there's my attempt.

Reliable Transmitter:

The schema below shows the operations that reliable transmitter has to do. "Red" are "error or unexpected operations", Green are "expected operations", Blue are TX Operations.

Transmitter send a packet and waits for the ACK packet (sended by receiver). If ACK doesn't arrive before the Tx Timeout packet is resended. When ACK arrive Tx send the CACK (Confirm ACK) packet and waits for a timeout, if another ACK Arrive TX resend the CACK, this because receiver doesn't have the confirm of transmitter. When TX timeout all is done, and the packet is sended correctly.


Reliable Receiver:

The schema below shows the operations that reliable receiver has to do. "Red" are "error or unexpected operations", Green are "expected operations", Blue are Rx Operations.

When RX receive a Packet sends an ACK, and waits for the CACK, if CACK doesn't arrive before timeout RX resend the ACK. When CACK arrive all is done. We've received the packet and the transmitter knows that we've received it.

No comments:

Post a Comment