Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MAKE SURE E 1 TO E 8 ARE ALL MET!! PA 1 : TCP Your implementation must be able to tolerate packet drops, allow other

MAKE SURE E1 TO E8 ARE ALL MET!! PA1: 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 sender.c, which declares the function
void rsend(char* 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 rrecv(unsigned short int myUDPport, char* destinationFile, unsigned long long int writeRate)
This function is rsend's 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 0 then the receiver can write as many bytes as possible into destinationFile and if writeRate is non-zero then the receiver should write no more than writeRate bytes per second to destinationFile.
You will also add the main functions in sender.c and receiver.c to invoke the data transfer operation from the command line.
Expectations
You should implement rsend and rrecv with the following expectations (E1-E8):
1. You cannot use TCP in any way. Use SOCK_DGRAM (UDP), not SOCK_STREAM.
2. The data written to disk by the receiver must be exactly what the sender was given.
3. Your protocol must, in steady state (averaged over 10 seconds), utilize at least 70% of
bandwidth when there is no competing traffic, and packets are not artificially dropped or reordered.
4. Any two instances of your protocol competing with each other must converge to roughly fairly sharing the link (same throughputs $\pm 10\%$), within 100 RTTs. The two instances might not start at the exact same time.
5. 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.
6. 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.)
7. 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.
8. 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 (i.e., writeRate ==0). 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 rrecv(unsigned short int myUDPport, char* des8na8onFile,
unsigned long long int writeRate){}
int main(int argc, char** argv){
// This is a skeleton of a main func8on.
// You should implement this func8on more completely // so that one can invoke the file transfer from the
// command line.
unsigned short int udpPort;
if(argc!=3){
fprinP(stderr, "usage: %s UDP_port filename_to_write
", argv[0]);
exit(1); }
udpPort =(unsigned short int) atoi(argv[1]); }
sender.c
#include #include #include #include #include
#include #include #include
#include #include
void rsend(char* hostname,
unsigned short int hostUDPport,
char* filename,
unsigned long long int bytesToTransfer)
{
}
int main(int argc, char** argv){
// This is a skeleton of a main func8on.
// You should implement this func8on more completely // so that one can invoke the file transfer from the
// command line.
int hostUDPport;
unsigned long long int bytesToTransfer;
char* hostname = NULL;
if(argc!=5){
fprinP(stderr, "usage: %s receiver_hostname receiver_port filename_to_xfer
bytes_to_xfer
", argv[0]);
exit(1); }
hostUDPport=(unsigned short int) atoi(argv[2]); hostname = argv[1];
bytesToTransfer = atoll(argv[4]);
return (EXIT_SUCCESS); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions

Question

How many multiples of 4 are there between 10 and 250?

Answered: 1 week ago