Question: in C or Java Additive Increase and Multiplicative Decrease (AIMD) is a very useful congestion control mechanism used in TCP to efficiently and fairly share
in C or Java
Additive Increase and Multiplicative Decrease (AIMD) is a very useful congestion control mechanism used in TCP to efficiently and fairly share the bandwidth in a network. The beauty of the mechanism is that the hosts do not consult each other. They just apply the AIMD rule independently by themselves and eventually the bandwidth is fairly shared. In this project, you will write a program to simulate the process of AIMD. You can start with 2 hosts. We assume the link they share has a bandwidth of 1 unit. Intially they take, for example, 0.2 and 0.3 of the bandwidth. Then each will work on its own to apply the AIMD rule. That is, each host will first do the AI part by incrementing its share of bandwidth by a certain amount denoted by inc, for example, inc = 0.1. Then after some time, if the total bandwidth exceeds 1, the host will receive packet loss and should do the MD part by reducing its share of bandwidth by a certain percentage denoted by dec, for example, dec = 25%. Repeat this process, after some time, you will see no matter what initial bandwidth they start from, they will reach a fair share of the bandwidth. That is, 0.5 for each. After you experiment with 2, you can try 3, 4, and 5 hosts to see how they reach a fair share. You can have inputs like this: >Enter the number of hosts: 3 >Enter inc and dec: 0.1 0.25 >Enter their initial share of bandwidth: 0.1 0.12 0.08 (Your program is running) h[0]= 1.000000e-01 h[1]= 1.200000e-01 h[2]= 8.000000e-02 (can insert a delay here before you print out the next line) h[0]= 2.000000e-01 h[1]= 2.200000e-01 h[2]= 1.800000e-01 h[0]= 3.000000e-01 h[1]= 3.200000e-01 h[2]= 2.800000e-01 h[0]= 4.000000e-01 h[1]= 4.200000e-01 h[2]= 2.850000e-01 h[0]= 3.750000e-01 h[1]= 5.200000e-01 h[2]= 2.887500e-01 h[0]= 3.562500e-01 h[1]= 4.650000e-01 h[2]= 2.915625e-01 h[0]= 3.421875e-01 h[1]= 5.650000e-01 h[2]= 2.936719e-01 h[0]= 3.316406e-01 h[1]= 4.987500e-01 h[2]= 2.952539e-01 h[0]= 3.237305e-01 h[1]= 4.490625e-01 h[2]= 3.952539e-01 ... In practice, you can see that they will not exactly reach 1/3. But after a while, they will oscillate in that neighborhood. You can insert a delay function such as sleep(1) or pause(1) function (depending on which language you use) to slow down the output. You can set different numbers to the parameters and see the results.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
