# UDP and TCP arithmetic

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/practice/tee-formulas/transport

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/practice/tee-formulas--transport/

TEE · Complete six-unit quick reference · current syllabus 702AI0C023



$$
L_{UDP}=8+L_{data}
$$



UDP length includes its own eight-byte header, not the IP header.



$$
H_{TCP}=4\times\mathrm{data\ offset}
$$



Offset counts 32-bit words; minimum 20-byte TCP header.



$$
ACK=\mathrm{first\ byte\ sequence}+L
$$



After receiving all L consecutive data bytes, acknowledge the next expected byte. SYN and FIN each add one.



$$
W_{new}=\max(0,\min(rwnd,cwnd)-F)
$$



Supporting simplified sending allowance; F bytes in flight, all quantities in the same units.

[TCP sequence-number examples](https://deep-learning-study-room.vercel.app/read/cn/tee/practice/transport--tcp-seq-1/)
