Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PA 1 : TCP Your implementation must be able to tolerate packet drops, allow other concurrent connections a fair chance, and must not be overly
PA: TCP Your implementation must be able to tolerate packet drops, allow other concurrent connections a fair chance, and must not be overly nice to other connections should not give up the entire bandwidth to other connections
Introduction
You will implement a transport protocol with properties equivalent to TCP Get the starter code using GitHub Classroom:
You have been provided with a file called senderc which declares the function
void rsendchar hostname, unsigned short int hostUDPport, char filename,
unsigned long long int bytesToTransfer
This function should transfer the first bytesToTransfer bytes of filename to the receiver at hostname:hostUDPport correctly and efficiently, even if the network drops or reorders some of your packets. You also have receiver.c which declares
void rrecvunsigned short int myUDPport, char destinationFile, unsigned long long int writeRate
This function is rsends counterpart, and should write what it receives to a file called destinationFile. writeRate specifies the number of bytes per second that the receiver can write into destinationFile. If writeRate is then the receiver can write as many bytes as possible into destinationFile and if writeRate is nonzero then the receiver should write no more than writeRate bytes per second to destinationFile.
You will also add the main functions in senderc and receiver.c to invoke the data transfer operation from the command line.
Expectations
You should implement rsend and rrecv with the following expectations EE:
You cannot use TCP in any way. Use SOCKDGRAM UDP not SOCKSTREAM.
The data written to disk by the receiver must be exactly what the sender was given.
Your protocol must, in steady state averaged over seconds utilize at least of
bandwidth when there is no competing traffic, and packets are not artificially dropped or reordered.
Any two instances of your protocol competing with each other must converge to roughly fairly sharing the link same throughputs $pm $ within RTTs The two instances might not start at the exact same time.
Your protocol must be somewhat TCP friendly: an instance of TCP competing with your implementation must receive, on average, at least half as much throughput as your flow.
An instance of your protocol competing with TCP must receive, on average, at least half
as much throughput as the TCP flow. Your protocol must not be overly nice.
All of the above should hold in the presence of any amount of dropped packets. All
flows, including the TCP flows, will see the same rate of drops. The network will not
introduce bit errors.
Your implementation should support flow control via a sliding window mechanism to
ensure that the receiver is not overwhelmed. Up to this point, one could have assumed that writeRate at the receiver is not limited ie writeRate When writeRate is limited the receiver cannot maintain an infinite buffer and should signal to the sender to reduce the data transmission rate to be consistent with writeRate. When flow control is needed then some of the bandwidth utilization expectations will change to be
Your submission should include a Makefile that allows some one to build the sender and receiver binaries at the same time. The skeleton repository contains a Makefile that you could adapt slightly if
necessary.consistent with flow control receiver.c
#include #include #include #include #include
#include #include #include
#include #include
void rrecvunsigned short int myUDPport, char desnaonFile,
unsigned long long int writeRate
int mainint argc, char argv
This is a skeleton of a main funcon
You should implement this funcon more completely so that one can invoke the file transfer from the
command line.
unsigned short int udpPort;
ifargc
fprinPstderr "usage: s UDPport filenametowrite
argv;
exit;
udpPort unsigned short int atoiargv;
senderc
#include #include #include #include #include
#include #include #include
#include #include
void rsendchar hostname,
unsigned short int hostUDPport,
char filename,
unsigned long long int bytesToTransfer
int mainint argc, char argv
This is a skeleton of a main funcon
You should implement this funcon more completely so that one can invoke the file transfer from the
command line.
int hostUDPport;
unsigned long long int bytesToTransfer;
char hostname NULL;
ifargc
fprinPstderr "usage: s receiverhostname receiverport filenametoxfer
bytestoxfer
argv;
exit;
hostUDPportunsigned short int atoiargv; hostname argv;
bytesToTransfer atollargv;
return EXITSUCCESS;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started