> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/notes-miect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/notes-miect/redes-e-sistemas-autonomos/qos-and-security/tcp-vegas.md).

# 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.
