CS 557 - Lecture 1 Review of Basic Protocols
IP - RFC 791, 1981 TCP - RFC 793, 1981
CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - - PowerPoint PPT Presentation
CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - RFC 793, 1981 Spring 2013 These slides are a combination of two great sources: Kurose and Ross Textbook slides Steve Deering IETF Plenary Talk IP Datagram Format
IP - RFC 791, 1981 TCP - RFC 793, 1981
ver length 32 bits
data (variable length, typically a TCP
16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment
upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit.
how much overhead with TCP?
layer overhead
(max.transfer size) - largest possible link-level frame. – different link types, different MTUs
(“fragmented”) within net – one datagram becomes several datagrams – “reassembled” only at final destination – IP header bits used to identify, order related fragments
fragmentation: in: one large datagram
reassembly
– bi-directional data flow in same connection – MSS: maximum segment size
– handshaking (exchange
sender, receiver state before data exchange
– sender will not overwhelm receiver
– one sender, one receiver
– no “message boundaries”
– TCP congestion and flow control set window size
socket door TCP send buffer TCP receive buffer socket door
segment
application writes data application reads data
source port # dest port #
32 bits
application data (variable length) sequence number acknowledgement number
Receive window Urg data pnter checksum
F S R P A U
head len not used
Options (variable length)
URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes
(not segments!) Internet checksum (as in UDP)
TCP client lifecycle TCP server lifecycle
= RcvWindow = RcvBuffer-[LastByteRcvd - LastByteRead]
Host A
Seq=100, 20 bytes data
time premature timeout
Host B
Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=92 timeout
Host A
Seq=92, 8 bytes data ACK=100
loss
timeout
lost ACK scenario
Host B
Seq=92, 8 bytes data A C K = 1
time
Seq=92 timeout
SendBase = 100 SendBase = 120 SendBase = 120 Sendbase = 100
– large variation in EstimatedRTT -> larger safety margin
TimeoutInterval = EstimatedRTT + 4*DevRTT DevRTT = (1-β)*DevRTT + β*|SampleRTT-EstimatedRTT| (typically, β = 0.25)
Then set timeout interval:
RTT: RTT: gaia.c gaia.cs.u s.umass.edu mass.edu to to fantasia.e fantasia.eure urecom.fr com.fr
100 150 200 250 300 350 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 ti time me (s (sec econ
ds) RTT RTT (millis (millisec econ
ds) SampleRTT Estimated RTT
8 Kbytes 16 Kbytes 24 Kbytes time congestion window
Long-lived TCP connection
Event State TCP Sender Action Commentary ACK receipt for previously unacked data Slow Start (SS) CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” Resulting in a doubling of CongWin every RTT ACK receipt for previously unacked data Congestion Avoidance (CA) CongWin = CongWin+MSS * (MSS/CongWin) Additive increase, resulting in increase of CongWin by 1 MSS every RTT Loss event detected by triple duplicate ACK SS or CA Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Timeout SS or CA Threshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Enter slow start Duplicate ACK SS or CA Increment duplicate ACK count for segment being acked CongWin and Threshold not changed