Skip to content

Developed algorithms to send and receive data, using c, implementing congestion control and flow control mechanisms that are used in TCP, but using UDP sockets.

Notifications You must be signed in to change notification settings

gaurabacharya/Reliable-Data-Transfer-Protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To achieve these expectations, we'll need to implement a reliable data transfer protocol over UDP with congestion control and flow control mechanisms. Here's an outline of how we can approach this:

  1. Packet Structure: Define a packet structure that includes sequence numbers, acknowledgment numbers, checksums, and data payload.

  2. Sender Implementation (rsend):

    • Split the file into chunks.
    • Implement a sliding window mechanism to control the number of unacknowledged packets.
    • Use selective repeat ARQ (Automatic Repeat reQuest) to handle lost packets.
    • Implement congestion control mechanisms like slow start and congestion avoidance using algorithms like TCP Tahoe or TCP Reno.
    • Calculate and verify checksums for data integrity.
    • Handle flow control based on receiver's acknowledgment window size.
    • Send packets using UDP sockets.
  3. Receiver Implementation (rrecv):

    • Receive packets using UDP sockets.
    • Implement a sliding window for receiving and buffering packets.
    • Send acknowledgments for received packets and handle duplicate acknowledgments.
    • Write received data to the destination file with consideration of the write rate limit.
    • Signal the sender to adjust transmission rate based on flow control.
    • Calculate and verify checksums for data integrity.
  4. Main Functions:

    • Implement main functions in sender.c and receiver.c to handle command-line arguments and invoke the data transfer operations.
  5. Testing and Evaluation:

    • Test the protocol under different network conditions, including dropped packets and varying bandwidth.
    • Evaluate the protocol's performance against the provided expectations (E1-E8), ensuring fairness, throughput, and adherence to flow control.

In further detail:

1. Packet Structure:

Define a packet structure that includes fields for sequence number, acknowledgment number, checksum, and data payload.

struct Packet {
    unsigned int seq_num;
    unsigned int ack_num;
    unsigned int checksum;
    char data[MAX_DATA_SIZE];
};

2. Sender Implementation (rsend):

Here's an outline of steps to implement rsend:

a. Split the file into chunks:

  • Read the file in chunks of a certain size.

b. Sliding Window Mechanism:

  • Maintain a sender window to control the number of unacknowledged packets.
  • Update the window based on acknowledgments received.

c. Selective Repeat ARQ:

  • Retransmit packets that are not acknowledged within a certain timeout period.

d. Congestion Control:

  • Implement slow start and congestion avoidance algorithms.
  • Adjust the sender window size based on congestion signals.

e. Flow Control:

  • Monitor receiver's acknowledgment window size.
  • Adjust transmission rate based on receiver's flow control signals.

f. UDP Socket Communication:

  • Send packets using UDP sockets.

3. Receiver Implementation (rrecv):

Here's an outline of steps to implement rrecv:

a. Receiving and Buffering:

  • Receive packets using UDP sockets.
  • Buffer received packets in a receive window.

b. Sending Acknowledgments:

  • Send acknowledgments for received packets.
  • Handle duplicate acknowledgments.

c. Writing to Destination File:

  • Write received data to the destination file.
  • Respect the write rate limit specified.

d. Signaling Flow Control:

  • Signal the sender to adjust transmission rate based on flow control.

e. UDP Socket Communication:

  • Receive packets and send acknowledgments using UDP sockets.

4. Main Functions:

Implement main functions in sender.c and receiver.c to handle command-line arguments and invoke the data transfer operations.

5. Testing and Evaluation:

Test the protocol under different network conditions, including dropped packets and varying bandwidth. Evaluate the protocol's performance against the provided expectations (E1-E8).

About

Developed algorithms to send and receive data, using c, implementing congestion control and flow control mechanisms that are used in TCP, but using UDP sockets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •