๐Ÿ“˜ [Computer Network] TCP RTT Estimation & Timeout

๊ณ ๋ฏผ์ •ยท2023๋…„ 11์›” 8์ผ
0

Computer Network

๋ชฉ๋ก ๋ณด๊ธฐ
11/12
post-thumbnail
post-custom-banner

03_2


๐Ÿ’ก Estimate RTT

Sample RTT
์ง€๊ธˆ ํ˜„์žฌ์˜ , ๊ฐ€์žฅ ์ตœ๊ทผ์˜ RTT ๊ฐ’
Mesured time from segment transmission until ACK receipt
Estimated RTT
RTT๊ฐ’์€ ์ง€์†์ ์œผ๋กœ ๋ณ€ํ•˜๋Š”๋ฐ
์ด๋ ‡๊ฒŒ ์ง€์†์ ์œผ๋กœ ๋ณ€ํ•˜๋Š” RTT๊ฐ’์„ ๊ณ„์† ๊ณ„์‚ฐํ•ด์„œ ํ‰๊ท ๋‚ธ ๊ฐ’

EstimatedRTT(n)=(1โˆ’a)โˆ—EstimatedRTT(nโˆ’1)+aโˆ—SampleRTT(n)EstimatedRTT(n) = (1-a)*EstimatedRTT(n-1) +a*SampleRTT(n)

(1โˆ’a)โˆ—EstimatedRTT(nโˆ’1)(1-a)*EstimatedRTT(n-1) ๊ฐ€ last averagedRTT ์ด๊ณ  ,
aโˆ—SampleRTT(n)a*SampleRTT(n) ๊ฐ€ ๋ฐฉ๊ธˆ ์ธก์ •ํ•œ ๊ฐ’์ด๋‹ค.

์œ„ ์‹์€ ์ตœ๊ทผ๊ฐ’์„ ๋” ๋งŽ์ด ๋ฐ˜์˜ํ•˜๊ณ  ๊ณผ๊ฑฐ๊ฐ’์„ ๋” ์ ๊ฒŒ ๋ฐ˜์˜ํ•œ๋‹ค. (EWMA)


๐Ÿ’ก RTT deviation

DevRTT
sample RTT์˜ ๋ณ€ํ™”๋Ÿ‰
RTT variation (or deviation)

estimate Sample RTT deviation from EstimateRTT.
Sample RTT - ํ‰๊ท  (Estimate RTT)

DevRTT=(1โˆ’ฮฒ)โˆ—DevRTT+ฮฒโˆ—โˆฃSampleRTTโˆ’EstimatedRTTโˆฃDevRTT=(1-\beta)*DevRTT+\beta*|SampleRTT-EstimatedRTT|


๐Ÿ’ก TCP Time out

timeout interval
EstimateRTT (ํ‰๊ท ) + safety margin
large variation in EstimateRTT โ†’ larger safety margim

TimeoutInterval=EstimateRTT+4โˆ—DevRTTTimeoutInterval = EstimateRTT + 4*DevRTT

4โˆ—DevRTT4*DevRTT is 'safety margin'

๐Ÿ“Œ Isn't timeout too long for waiting?
์˜ค๋ž˜ ๊ธฐ๋‹ค๋ฆฌ๋”๋ผ๋„ premature (์กฐ๊ธ‰ํ•จ)๊ฐ€ ์—†๊ฒŒ margin์„ ๋‘”๋‹ค.


๐Ÿ’ก TCP: retransmission scenarios

seq=92 ์—์„œ loss๊ฐ€ ๋‚ฌ๊ธฐ ๋•Œ๋ฌธ์— hostB๋Š” ACK์„ ๋ชจ๋‘ 92๋กœ ๋ณด๋‚ธ๋‹ค.
ACK์€ cumulative ํ•˜๊ธฐ๋•Œ๋ฌธ์— seq=100๊ณผ seq=120 ์„ ๋ฐ›์•˜๋‹ค๊ณ 
ACK=120 ๊ณผ ACK=140์„ ๋ณด๋‚ด๋ฉด ์•ˆ๋œ๋‹ค.
์ด๋ ‡๊ฒŒ๋˜๋ฉด 139๋ฒˆ๊นŒ์ง€ ๋ฐ์ดํ„ฐ๋ฅผ ์ž˜ ๋ฐ›์•˜๋‹ค๋Š” ์˜๋ฏธ๊ฐ€ ๋˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

์ด์ฒ˜๋Ÿผ ACK=92๋ฅผ 3๋ฒˆ ๋ณด๋‚ด๊ฒŒ๋˜๋ฉด hostA๋Š” ์ค‘๋ณต๋œ ACK (Duplicate ACK) ์„ ๋ฐ›๊ฒŒ๋œ๋‹ค.

์ด๋Š” loss๊ฐ€ ๋‚ฌ๋‹ค๋Š” ์˜๋ฏธ๊ธฐ๋•Œ๋ฌธ์— ์‚ฌ์‹ค์ƒ NACK๊ณผ ๊ฐ™์€ ์˜๋ฏธ๋ฅผ ์ง€๋‹Œ๋‹ค.


๐Ÿ’ก TCP fast retransmit

Fast retransmission
duplicate ACK์ด ์˜ค๋ฉด timeout์„ ๊ธฐ๋‹ค๋ฆฌ์ง€๋ง๊ณ  ๋ฐ”๋กœ retransmit ํ•ด์ค˜๋ผ

Fast retransmission ์˜ ์กฐ๊ฑด์€ 3 duplicate ACK ์ด์–ด์•ผ ํ•œ๋‹ค.

๐Ÿ“Œ Why ?

์œ„ ์‚ฌ์ง„์€ ๊ฐ™์€ ACK ์€ 4๊ฐœ์ด๋‚˜ Duplicate ACK์€ 3๊ฐœ์ด๋‹ค.
์ฆ‰ timeout ๋ณด๋‹ค ๋นจ๋ฆฌ retransmit ํ•ด์ค€๋‹ค.

fast transmit์€ ๋ฐ์ดํ„ฐ 5๊ฐœ๋ฅผ ๋ณด๋ƒˆ๋Š”๋ฐ ACK์€ 4๊ฐœ๊ฐ€ ์™”๋‹ค.
ACK number์™€ ๊ฐœ์ˆ˜๋ฅผ ํ†ตํ•˜์—ฌ ์ค‘๊ฐ„์— ์–ด๋””์„œ data loss๊ฐ€ ๋‚ฌ๋Š”์ง€์™€ loss ์—ฌ๋ถ€๋ฅผ ์•Œ ์ˆ˜ ์žˆ๋‹ค.


๐Ÿ’ก Duplicate vs Timeout

์–ด๋Š์ชฝ์ด ๋” ์•ˆ ์ข‹์„๊นŒ?

Timeout์ด ๋” ์ข‹์ง€ ์•Š๋‹ค.

Duplicate ACK์€ ์ค‘๊ฐ„์— ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์–ด์กŒ์„์ง€์–ธ์ • ๋’ค์— ์˜จ ๋ฐ์ดํ„ฐ๋Š” ๋‹ค ๋„์ฐฉํ–ˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค. (ACK์ด ์™”๊ธฐ๋•Œ๋ฌธ์—)

ํ•˜์ง€๋งŒ timeout์€ ACK ์ž์ฒด๊ฐ€ ๋„์ฐฉํ•˜์ง€ ์•Š์€ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— duplicate ๋ณด๋‹ค ์ข‹์ง€ ์•Š๋‹ค.

post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€