Sunday 27 July 2014

Client Server Program in C to Simulate Selective Repeat ARQ


  I wrote these programs 5 years ago. It is a simulation program trying to imitate the working of Selective Repeat ARQ. Click here to view the Wikipedia article on Selective Repeat ARQ. A client server C program is used to simulate the working of Selective Repeat ARQ. The server acts as the receiver. The client acts as the sender. Because of this reason first run the receiver program and afterwards run the sender program. 

Figure Below Shows theReceiver



Figure Below Shows the Sender
  

The line given below sets the window size for the sender and the receiver.

#define W 5 
If you want you can change the window size to some other value. Currently the window size is 5.

The following lines in the receiver side decides the probability with which a frame fails to reach the destination.

#define P1 50
#define P2 10

You can increase the probability of a frame being corrupted by increasing the value of P2 and decrease the probability by decreasing the value of P2. Currently there is a 20% probability for frame corruption.




No comments:

Post a Comment