# TCP-Vegas

TCP Vegas **senses the congestion in the network before any packet loss occurs, and instantly it decreases the window size**. So, TCP Vegas handles the congestion without any packet loss occurring.

* Uses ***diff = expected rate - actual rate*** to regulate the sending rate.
* *Expected rate* = window size divided by baseRTT.
* *Actual rate* = window size divided by currentRTT.
* **baseRTT** = It is the **minimum RTT measured so far**.
* *The expected rate* is always larger than the *Actual rate***.**

**Rate-based** congestion control.

* diff = expected rate – actual rate.
* If diff < a, Vegas increases *cwnd* linearly.
* If diff > b, Vegas decreases *cwnd* linearly.
* If a< diff < b, Vegas keeps *cwnd* unchanged.

Modified slow-start.

* Allows *cwnd* to **grow exponentially only in every other RTT**.
* If diff > c, Vegas switches from slow-start to congestion avoidance.

New retransmission.

* **Reads and records transmission time**.
* When DUPACK arrives, check if it is expired.
* Retransmits without waiting for a third DUPACK.
