Lab Report 4
Lab Report 4
Lab Report:04
[For teachers use only: Don’t write anything inside this box]
Marks: Signature:
Comments: Date:
1 TITLE OF THE LAB REPORT EXPERIMENT
TCP Congestion Control Using TCP Tahoe.
2 OBJECTIVES
• To understand the principles of TCP congestion control and its impact on reliable
data transmission.
• To explore the differences between TCP Tahoe and other variants like TCP Reno.
• To analyze the role of Slow Start, Congestion Avoidance, and Fast Recovery
phases in controlling congestion.
3 PROCEDURE
1. Understanding TCP Congestion Control:
• Slow Start: Begin with a small cwnd and double it with each acknowledg-
ment to explore available bandwidth.
• Congestion Avoidance: After reaching ssthresh, increment cwnd linearly
to prevent congestion.
• Fast Recovery: Reset cwnd to 1 MSS upon detecting congestion and re-
sume from Slow Start.
1
3. Implementation in Java:
• Write Java code for TCP Tahoe, incorporating random congestion simula-
tions.
• Implement methods for congestion detection, adjustment of cwnd, and phase
transitions.
4 IMPLEMENTATION
package tcpcongestioncontrol;
import java.util.Random;
import java.util.Scanner;
int dataSent = 0;
int round = 0;
2
handleCongestion();
} else {
// If no congestion, adjust cwnd
if (cwnd < ssthresh) {
// Slow Start: Exponential growth
cwnd *= 2;
System.out.println("Slow Start Phase: cwnd doubled to " + cwnd)
} else {
// Congestion Avoidance: Linear growth
cwnd += 1;
System.out.println("Congestion Avoidance Phase: cwnd increased
}
}
3
5 TEST RESULT / OUTPUT
4
Figure 3: Overall TCP Tahoe Sawtooth Behavior
7 SUMMARY:
TCP Tahoe is a foundational congestion control algorithm that effectively manages net-
work traffic under varying conditions. It balances efficiency and fairness through its
three phases, ensuring reliable data delivery even in congested networks.By resetting
cwnd during congestion and gradually increasing the transmission rate, TCP Tahoe
promotes stable network operation. Its simplicity and adaptability make it a critical
component of modern TCP implementations.