Objective: Implement a reliable, full-duplex file transfer protocol using the UDP transport layer, incorporating a Selective Repeat (SR) ARQ mechanism and a dynamic flow control strategy. The system should be capable of handling various file types and resuming interrupted transfers efficiently.
Specifications
(a) Flow Control with Dynamic Window and Shared Buffers
Implement a naïve flow control mechanism using the Selective Repeat protocol.
The system should allow dynamic adjustment of the send window size and shared buffer capacity based on simulated network conditions.
The user should be able to modify the network condition periodically through a command prompt or pop-up input. Example dynamic configurations:
Network Busy: Window Size = 10 packets, Buffer Size = 800 Bytes
Network Medium: Window Size = 50 packets, Buffer Size = 1024 Bytes
Network Excellent: Window Size = 100 packets, Buffer Size = 1500 Bytes
(b) Custom File Header Design
Design a custom file header structure to encapsulate essential metadata for each packet and file transfer.
The header should include fields such as:
File name and size
Sequence number and acknowledgment number
Packet type or flag (DATA, ACK, FIN, etc.)
Timestamp or checksum (optional for verification)
This header will support reliable transmission and reconstruction of files at both sender and receiver ends.
(c) Multi-File and Heterogeneous Data Transfer
Implement functionality to transfer an entire folder containing multiple heterogeneous files, such as:
Text files
Image files
Audio files
Video files
Ensure the protocol correctly identifies file types and handles them concurrently or sequentially as needed.
(d) Connection Interruption and Resume Capability
The protocol must support checkpoint-based resumption of file transfer in case of unexpected connection termination.
Upon restart, the system should resume transmission from the last acknowledged checkpoint, rather than restarting the entire transfer.
Maintain a log file on both client and server sides to record:
List of incomplete or missing files
Percentage of data already transmitted
Timestamp and session ID of each transfer
Connection interruption events
The log will be used for synchronization and recovery after reconnection.
(e) Full-Duplex File Transfer using Threads
Implement full-duplex communication over UDP using POSIX threads (pthreads).
The protocol should allow simultaneous bidirectional file transfer (client ↔ server) within a single session.
Use separate threads for sending and receiving to enable concurrent operations.
Synchronize shared buffers and acknowledgment windows appropriately to avoid race conditions.
(f) Performance Analysis and Plotting
After successful implementation of the UDP-based reliable full-duplex file transfer using the Selective Repeat protocol, students must analyze the performance of their system by varying parameters such as buffer size, window size, and network condition.
Latency vs Buffer Size
Objective: To observe how increasing the buffer size affects end-to-end latency.
X-axis: Buffer Size (Bytes)
Y-axis: Average Latency (milliseconds)
Expected Trend:
o For very small buffers, latency is high due to frequent waiting and synchronization overhead.
o As buffer size increases, latency decreases until saturation (no significant improvement beyond a certain size).
Latency vs Window Size
Objective: To analyze the impact of the transmission window size on latency performance.
X-axis: Window Size (number of packets)
Y-axis: Average Latency (milliseconds)