Professional Documents
Culture Documents
UDP Based Reliable Communication
UDP Based Reliable Communication
UDP Based Reliable Communication
Gianni Perez
gianni.perez@protonmail.com
Acknowledgements
VI. THREE-WAY HANDSHAKE
Reserved Advertised Window
Following the same guidelines as TCP, I attempted to
The method makeHeader() in the main classes implement a method called the “three-way handshake”
UDPSender.java and UDPReceiver.java is represented to allow both client and server to exchange
below: synchronization signals prior to the file transfer stage
and after all the file had been copied. The following
private void makeHeader(byte[] header) graph illustrates how the application accomplishes this:
{
header[0] = (byte)((seqNum >>> 24) & 0xFF);
header[1] = (byte)((seqNum >>> 16) & 0xFF);
header[2] = (byte)((seqNum >>> 8) & 0xFF);
header[3] = (byte)(seqNum & 0xFF);
header[4] = (byte)((ack >>> 16) & 0xFF);
header[5] = (byte)((ack >>> 16) & 0xFF);
header[6] = (byte)((ack >>> 8) & 0xFF);
header[7] = (byte)(ack & 0xFF);
header[8] = (byte)((rsvd >>> 8) & 0xFF);
header[9] = (byte)(rsvd & 0x00);
header[10]= (byte)((windowSize >>> 8) &
0xFF);
header[11]= (byte)(windowSize & 0xFF);
}
And this is the figure that shows such process: Receiver acknowledges.
VIII. OBSERVATIONS
IX. CONCLUSION