Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Q2.2 UDPEchoV2 - Error detection and recovery. (20 points) Questions 2.2 and 2.3 will have you add to UDPEchoV2 a subset of TCP functionality. Q2.2

image text in transcribedimage text in transcribed

Q2.2 UDPEchoV2 - Error detection and recovery. (20 points) Questions 2.2 and 2.3 will have you add to UDPEchoV2 a subset of TCP functionality. Q2.2 adds TCP's streaming' (sort of). With a TCP socket, you can send a large amount of data in a single send(), TCP will copy that data into the socket Tx buffer. TCP then pulls data from the buffer a segment size at a time (1472 bytes is a typical default setting). But we are using UDP which does not support streaming - UDP uses a datagram model. Each sendto causes all the data to be placed in a UDP message which includes a UDP header and the data. This then goes to IP at which point the UDP message is inserted in an IP datagram. Our code example UDPEchoV2 is more of a performance tool, like ping, rather than a transport protocol that an application can use to transfer data. You are to modify UDPEcho V2 so it is similar to a simple file transfer protocol. The client sends the data and the server receives the data. We define 'chunksize' to be next portion of the message sent in a UDP sendto. Assume a chunksize of 1472 bytes (this avoids fragmentation). The client performs 1 iteration and then terminates. The iteration is defined to mean 'send all data in the message and that it is correctly received by the receiver. It does require internally a number of iterations to send all message data chunk by chunk. Each chunk should contain a sequence number. The server should ACK each chunk with an ACK number that represents the next sequence number it expects. Assume the sequence number and ack numbers are in units of packets. Outline in detail all changes needed in client.c and server.c so that the client allocates an arbitrarily large buffer specified by the parameter messageSize and transfers all data, chunk by chunk beginning at the top of the buffer and ending with the final chunk (the last 1472 bytes of the message). The last sendto might not contain a full chunk if the message size is evenly divisible by chunksize.. The current UDPEcho client code has an inherent message size limitation it must be just under 64Kbytes as this leads to the maximum allowed size of an IP datagram of 64Kbytes. You now must assume the message size can range (0-1GByte]. The current UDPEchoV2 code does not retransmit data. If the timer pops, it simply sends a message using the next sequence number. In fact, the client sends the same chunk' ever time. This is a significant change as the problem requires your code to s The client will naturally terminate after it sends all of the message data AND receives all ACKS or it terminates in error if >5 retransmissions fail. You can assume the server requires a CNT-C to terminate. Please use a C-like pseudo code to identify all code changes required in client.c and Please use a C-like pseudo code to identify all code changes required in client.c and server.c. Your answer can be a detailed description of the code necessary to meet the Last update : 10/29/2021 requirements. You can also choose to edit the source code files. In your writeup, cut and paste the code you added or modified and add any necessary explanation. You can assume that the client and server parameters are unchanged. Since the client is to perform 1 iteration, effectively the two parameters, iteration delay and number of iterations are no longer used. When completed, save this version, fork a copy into a new directory for Q 2.3. Q2.2 UDPEchoV2 - Error detection and recovery. (20 points) Questions 2.2 and 2.3 will have you add to UDPEchoV2 a subset of TCP functionality. Q2.2 adds TCP's streaming' (sort of). With a TCP socket, you can send a large amount of data in a single send(), TCP will copy that data into the socket Tx buffer. TCP then pulls data from the buffer a segment size at a time (1472 bytes is a typical default setting). But we are using UDP which does not support streaming - UDP uses a datagram model. Each sendto causes all the data to be placed in a UDP message which includes a UDP header and the data. This then goes to IP at which point the UDP message is inserted in an IP datagram. Our code example UDPEchoV2 is more of a performance tool, like ping, rather than a transport protocol that an application can use to transfer data. You are to modify UDPEcho V2 so it is similar to a simple file transfer protocol. The client sends the data and the server receives the data. We define 'chunksize' to be next portion of the message sent in a UDP sendto. Assume a chunksize of 1472 bytes (this avoids fragmentation). The client performs 1 iteration and then terminates. The iteration is defined to mean 'send all data in the message and that it is correctly received by the receiver. It does require internally a number of iterations to send all message data chunk by chunk. Each chunk should contain a sequence number. The server should ACK each chunk with an ACK number that represents the next sequence number it expects. Assume the sequence number and ack numbers are in units of packets. Outline in detail all changes needed in client.c and server.c so that the client allocates an arbitrarily large buffer specified by the parameter messageSize and transfers all data, chunk by chunk beginning at the top of the buffer and ending with the final chunk (the last 1472 bytes of the message). The last sendto might not contain a full chunk if the message size is evenly divisible by chunksize.. The current UDPEcho client code has an inherent message size limitation it must be just under 64Kbytes as this leads to the maximum allowed size of an IP datagram of 64Kbytes. You now must assume the message size can range (0-1GByte]. The current UDPEchoV2 code does not retransmit data. If the timer pops, it simply sends a message using the next sequence number. In fact, the client sends the same chunk' ever time. This is a significant change as the problem requires your code to s The client will naturally terminate after it sends all of the message data AND receives all ACKS or it terminates in error if >5 retransmissions fail. You can assume the server requires a CNT-C to terminate. Please use a C-like pseudo code to identify all code changes required in client.c and Please use a C-like pseudo code to identify all code changes required in client.c and server.c. Your answer can be a detailed description of the code necessary to meet the Last update : 10/29/2021 requirements. You can also choose to edit the source code files. In your writeup, cut and paste the code you added or modified and add any necessary explanation. You can assume that the client and server parameters are unchanged. Since the client is to perform 1 iteration, effectively the two parameters, iteration delay and number of iterations are no longer used. When completed, save this version, fork a copy into a new directory for Q 2.3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Probability And Statistics For Engineering And The Sciences

Authors: Jay L. Devore

9th Edition

1305251806, 978-1305251809