CSS 432
Program 3: Additive Increase/Multiplicable Decrease
Spring Quarter 2004
Professor: Munehiro Fukuda
Assigned on 4/29/04 and due on 5/13/04
EstimatedRTT = a * EstimatedRTT + ( 1 - a ) * SampleRTT Timeout = 2 * EstimatedRTTYour implementation is to initaialize EstimatedRTT with 1000usec and to set a to 0.85. Follow the RTT sampling algorithm shown in below:
int congestionThreshold = maxWindowSize; where windowSize is given by the main function indicating the maximum window size.This means that the very first packet transfers follow slow start until the current window size reaches congestionThreshold that has been initially set to the maximum window size. This increase the current window size rapidly until the first network congestion is detected.
In general, A congestion is detected if packets began to be dropped off. In our implementation, we assume that a congestion has occurred if the number of unacknowledged messages has reached the current window size and the client hasn't received any new acknowledgment within TIMEOUT that has been recently estimated with our RTT estimation.
Upon detecting a congestion, the AIMD algorithm sets congestionThreshold to half of the current window size, and then resets the window size to 1. In this way, it restarts slow start until another congestion takes place.
Message sequence | Behavior |
0 - 6666 | Keep receiving as many messages as possible |
6667 - 9999 | Sleep for 1 second every 200 messages |
10000 - 15000 | Keep receiving as many messages as possible |
15001 - 15999 | Sleep for 2 seconds every 500 messages |
16000 - 19999 | Keep receiving as many messages as possible |
This new version of serverEarlyRetrans( ) function is used in the test case 4 and 5 of the main function. It sends the client an acknowledgment formatted below:
int acknowledgment[3]; acknowledgment[0] = message[0]; // the original message sequence acknowledgment[1] = message[1]; // the original message's tv_sec timestamp acknowledgment[2] = message[2]; // the original message's tv_usec timestamp
Arguments passed to those two functions depend on your implementation. If the clientSlowAIMD( ) function has received rttOn = false, it does not call estimateRtt( ) and always uses 1000usec as its constant timeout value. Change the PORT definitio to the last five digits of your student ID, and thereafter compile them with g++ as follows:
$ g++ UdpSocket.cpp Timer.cpp udp.o aimd.cpp hw3.cpp -o hw3If a compilation results in success, you will get the hw3 executable file. Run this program both on a client and a server side. Choose a client machine among uw1-320-16 ~ uw1-320-31 connected to a 1Gbps network and a server machinie among uw1-320-00 ~ uw1-320-15 connected to a 100Mbps network. The program will display the following messages to the standard error:
Client side example: $ ./hw3 uw1-320-10 > data Choose a testcase 1: unreliable test 2: stop-and-wait test 3: sliding windows 4: sliding windows + congestion 5: slow-start-aimd test + congeestion --> 5 use RTT estimation? (y or n): y Server side example: $ ./hw3Type 2, 4, and 5 for evaluating the performance of the three different test cases respectively. In particular for test case 5, type "y" or "n" to activate or inactivate the RTT estimation algorithm. The main function in hw3.cpp will store the performance results in the data file. Use cerr to print out any debugging information or message sequence numbers. Don't use cout, otherwise your debugging and message sequence information will be mixed up with performance results in the data file. If you hope to store cerr information in the data file, you should type:
Client side example: $ ./hw3 uw1-320-10 2> data1 Server side example: $ ./hw3 2> data2In summary, you have to measure the average elapsed time and number of packet retransmissions for the following four teste cases:
Criteria | Percentage |
Documentation of your implementations in terms of (1) RTT estimation, (2) window size estimation based on AIMD, (3) slow start implementation, and (4) timeout and message resending, including including explanations and illustrations in details | 4pts(20%) |
Source code that adheres good modularization, coding style, and an appropriate amount of comments. The source code is graded in terms of (1) timestamp information in mesasge[1] and message[2], (2) original RTT estimation algorithm, (3) Karn/Partridge algorithm, (4) AIMD used in window estimation, (5) slow start, (6) timeout and duplicated message re-transfer, and (7) comments. Write as many comments as possible, otherwise the professor/the grader cannot keep track of these complicated algorithms. | 8pts(40%) |
Execution output such as a snapshot of your display/windows or partial contents of standard error redirected to a file. You don't have to print out all data. Just a 2-or-3-page evidence is enough. | 1pts(5%) |
Performance evaluation that summarizes in a table the elapsed time and the number of packet retransmissions of your implementations: (1) stop-and-wait, (2) sliding window, (3) AIMD with RTT estimation, and (4) AIMD without RTT estimation. | 4pts(20%) |
Disussions should be given for difference among (1) stop-and-wait, (2) sliding window, (3) AIMD with RTT estimation, nad (4) AIMD without RTT estimation in terms of their elapsed time and # of packet retransmissions | 4pts(20%) |
Total | 20pts(100%) |