《自顶向下计算机网络》其三Transport Layer
文章目录
UDP
why use UDP
①often used for streaming multimedia apps because
(1) loss tolerant
(2)rate senstive
②other UDP uses
(1)DNS
(2)SNMPu
(1)application-specific error recovery
UDP 封包格式
source port/ dest port/ length/ checksum
UDP 是以封包为单位的
TCP
TCP overview
①point-to-point
②reliable in-order byte stream
③pipelined
④send&receive buffers
⑤full duplex data
⑥connection-oriented
⑦flow controlled
标志位
U:URG urgent data
A:ACK ACK# valid
P:PSH push data now
R:RST reset 连线立即断开
S:SYN
F:FIN
Three-way handshake
step1:client host sends TCP SYN segment to server
(1)specifies initial seq #
(2)no data
step2:server host receives SYN replies with SYN ACK segment
(1)server allocates buffers
(2)specifies server initial seq#
step3:client receives SYN ACK replies with ACK segment,which may contain data
SYN→ACK/SYN→ACK
Four-way waveshake
step1:client(假设) end system send TCP FIN control segment to server
step2: server receives FIN replies with ACK closes connection send FIN
step3:client receives FIN replies with ACK,enters “timed wait”
step4:server receives ACK connection closed
FIN→ACK→FIN→ACK
TCP congestion control
additive increase,multiplicative decrease
additive:increase congestion window by 1MSS every RTT until loss detected
multiplicative decrease: cut congestion window in half after loss
TCP congestion control three mechanisms
①AIMD
(1)congestion window is cut in half
(2)window then grows linearly
②slow start
(1)连线开始时,congwin = 1MSS
(2)每过1RTT congestion window 加一倍
③conservation after timeout event
after timeout event
(1) congestion window instead set to 1 MSS
(2)window then grows exponentially
(3)to a threshold then grows linearly
名词解释:
stion window instead set to 1 MSS
(2)window then grows exponentially
(3)to a threshold then grows linearly
名词解释:
RTT:Round Trip Time