CN Assignment4 Q1&2
CN Assignment4 Q1&2
1. Algorithm Details
TCP Cubic
Algorithm Details
It adjusts the congestion window size based on a cubic function of time since
the last congestion event, allowing for fast recovery while being TCP-friendly.
Suitable scenarios
Limiting scenarios
Page 2
Rajeev Goel 12241460
TCP HighSpeed
Algorithm Details
Page 3
Rajeev Goel 12241460
Suitable scenarios
Limiting scenarios
• Short, Bursty Flows : TCP HighSpeed may not achieve optimal per-
formance. Its slower response time in adjusting the congestion window
can result in lower throughput before the transfer completes.
• Unfairness in Mixed Environments : In scenarios where multiple
TCP variants operate together, TCP HighSpeed can be less friendly to
other flows due to its aggressive nature.
TCP Vegas
Algorithm Details
Page 4
Rajeev Goel 12241460
• If δ < α where α ≈ 1, the network is not congested, and TCP Vegas can
increase the window size by 1.
If δ > β where β ≈ 3 is large, it indicates congestion, and TCP Vegas
should decrease the window size by 1 to prevent further queuing.
Otherwise if β ≤ δ ≤ α we say no need to change the Cwnd .
• When the estimated RTT begins to increase or packet queuing is detected,
it exits slow start. This hapens earlier than the traaditional TCP Reno
Algorithm.
• TCP Vegas does not rely on packet loss as the primary signal for conges-
tion control but still incorporates a mechanism to handle loss if duplicate
ACKs are received.
cwnd
ssthresh =
2
cwnd = ssthresh
Suitable scenarios
• Congested Backbone Networks :TCP Vegas can be advantageous on
heavily utilized backbone links. By responding to early congestion signs
before packet loss, it helps reduce overall packet drops and smoothens
traffic flow.
• Wireless Networks with Variable Latency : TCP Vegas can be
beneficial in wireless networks with fluctuating latencies because it adapts
based on RTT rather than packet loss.
Page 5
Rajeev Goel 12241460
Limiting scenarios
TCP Veno
Algorithm Details
• TCP Veno is a hybrid of TCP Reno and TCP Vegas, aiming to dis-
tinguish between congestion-based and random packet losses to respond
more effectively.
• Congestion Window (Cwnd ) is Initialized to 1 MSS, ssthresh is set to a
large initial value. The algorithm also initializes a variable, β, to help
distinguish between congestion-induced and random packet losses.under
no congestion conditions.
• Here also, the congestion window (cwnd) increases exponentially.
Cwnd = Cwnd × 2
and the phase continues until Cwnd ≥ ssthresh
• For each RTT, TCP Vena just like TCP Vegas calculates an Expected
Throughput and a Measured Throughput.
Cwnd
Expected Throughput =
RT Tbase
Cwnd
Measured Throughput =
RT Tcurrent
And calculates its difference,
δ = Expected Throughput − Measured Throughput
Page 6
Rajeev Goel 12241460
• When packet loss is detected, TCP Veno attempts to determine the cause
(random loss vs. congestion loss) using δ.
If the loss is likely due to congestion (δ ≥ β)
cwnd
ssthresh =
2
cwnd = ssthresh
If the loss is likely due to random errors, less aggressive response by reduc-
ing the congestion window less dramatically, aiming to sustain through-
put.
Suitable scenarios
Limiting scenarios
Page 7
Rajeev Goel 12241460
• A presonal class MyApp has been base to control the packet transfer inde-
pendently of OnOffApplications of NS3. Functions shown in the image below
are used to achive this.
Page 8
Rajeev Goel 12241460
• The Following 3 functions are used to store the Congestion window size, the
RTT value and the ssthresh after each packet transfer.
• Inside the main fucntion this is main snippet responsible for using a particular
type of congestion control algorithm. Here its mentioned TcpNewReno,
changing it to TcpHighSeed will start implementing TCPHighSeed CCA.
• Inside the main fucntion this is main snippet responsible for using a particular
type of congestion control algorithm. Here its mentioned TcpNewReno,
changing it to TcpHighSeed will start implementing TCPHighSeed CCA.
• Now upon setting the nodes with a client and server using InternetStack-
Helper we set the Data-rate (Bandwidth) and delay (Latency) as follows:
Page 9
Rajeev Goel 12241460
For question no. 1, 2, 3 and 6. Outputs from below files are used:
– NewReno.cc
– Highspeed.cc
– Veno.cc
– Vegas.cc
• In question 4 and 5 we need to vary the bandwidth, latency and MTU size.
For this I made 4 separate files,
– NewReno test.cc
– Highspeed test.cc
– Veno test.cc
– Vegas test.cc
Each file consist of a function that is called on 3 different values of these
parameters.
– first the bandwidth=10Mbps rest remained same.
– second the latency=5ms rest remained same.
– third the MTU=3000 rest remained same.
By observing the throughput at these 3 scenarios and the original one, we
can easily conclude the affect of these parameters on throughput.
Page 10
Rajeev Goel 12241460
1. Plot the cwnd vs time graph, and describe what you observed, like slow start
and congestion avoidance, in detail.
Page 11
Rajeev Goel 12241460
The Congestion stars from 1MSS and increases till reach ssthresh expo-
nentially. Then increases lineraly. If the packet loss is detected, it enters
the congestion avoidance phase by reducing the Cwnd size.
• Upon zooming in the initial section of plot we can notice the exponential
growth from 1.40s to 1.45s and then linear growth.
Page 12
Rajeev Goel 12241460
Page 13
Rajeev Goel 12241460
• Upon zooming in We can notice that TCP veno is mostly paying attention
to packet losses, over congestion, are the dips are bringing the Cwnd value
to half of it.
Page 14
Rajeev Goel 12241460
2. Find the average throughput for each of the congestion control algorithms using
tshark from the pcap files generated, and state which algorithm performed the
best.
Page 15
Rajeev Goel 12241460
3. How many times did the TCP algo reduce the cwnd and why?
I considered 4 scenarios:
Page 16
Rajeev Goel 12241460
Upon executing these 4 cases for each of the CCAs, we get the results as:
Page 17
Rajeev Goel 12241460
5. Plot the rtt vs time graph and explain your inferences and observations.
• In TCP NewReno the maximum RTT reached was about 0.028s which is
quite good. and the no. of fluctuations signifies how the congestion in
the network is varying.
• in TCP Highspeed the maximum RTT reached was around 0.045s which
is very high for a 2 node point-to-point network. It is focusing majorly
on the sending packets hence adding congestion tothe network.
Page 18
Rajeev Goel 12241460
• TCP Vegas max rached value is around 0.035 initailly as sudden rise, later
on it remains at 0.007s which is remarkable, as it controls the congestion
very efficienctly.
Page 19