CS450 Introduc0on to Networking Lecture 14 TCP Phu Phung Feb 13, 2015
Next lecture (Feb 16) Assignment 3 (No iclicker ques0ons) Wireshark links Guest lecture on Monday Feb 23 rd DNS Security Midterm exam in class 1 PM Friday, March 6 th
TCP: Overview RFCs: 793,1122,1323, 2018, 2581 point-to-point: one sender, one receiver reliable, in-order byte steam: no message boundaries pipelined: TCP congestion and flow control set window size full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) inits sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver
TCP segment structure URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) head len 32 bits source port # dest port # sequence number acknowledgement number not used U A P R S F checksum receive window application data (variable length) Urg data pointer options (variable length) counting by bytes of data (not segments!) # bytes rcvr willing to accept
TCP seq. numbers, ACKs sequence numbers: byte stream number of first byte in segment s data acknowledgements: seq # of next byte expected from other side cumulative ACK Q: how receiver handles outof-order segments A: TCP spec doesn t say, - up to implementor outgoing segment from sender source port # dest port # sequence number acknowledgement number rwnd checksum sent ACKed urg pointer window size N sender sequence number space sent, notyet usable not ACKed but not usable ( inflight ) yet sent incoming segment to sender source port # dest port # sequence number acknowledgement number A rwnd checksum urg pointer
TCP seq. numbers, ACKs Host A Host B User types C host ACKs receipt of echoed C Seq=42, ACK=79, data = C Seq=79, ACK=43, data = C Seq=43, ACK=80 host ACKs receipt of C, echoes back C simple telnet scenario
Sender sends seq#=101, with data length = 20 bytes, and receives ack = 91. What is true? A. The receiver has successfully received up to seq# 90 B. The packet with seq#=101 was lost C. The packet with seq#=91 was lost D. A and B E. A and C
TCP round trip time, timeout Q: how to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout, unnecessary retransmissions too long: slow reaction to segment loss Q: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT smoother average several recent measurements, not just current SampleRTT
TCP round trip time, timeout EstimatedRTT = (1- α)*estimatedrtt + α*samplertt v exponential weighted moving average v influence of past sample decreases exponentially fast v typical value: α = RTT: 0.125 gaia.cs.umass.edu to fantasia.eurecom.fr 350 RTT: gaia.cs.umass.edu to fantasia.eurecom.fr RTT (milliseconds) RTT (milliseconds) 300 250 200 150 samplertt EstimatedRTT 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) time (seconds) SampleRTT Estimated RTT
TCP round trip time, timeout timeout interval: EstimatedRTT plus safety margin large variation in EstimatedRTT -> larger safety margin estimate SampleRTT deviation from EstimatedRTT: DevRTT = (1-β)*DevRTT + β* SampleRTT-EstimatedRTT (typically, β = 0.25) TimeoutInterval = EstimatedRTT + 4*DevRTT estimated RTT safety margin
What is DevRTT? A. Rela0ve difference between SampleRTT and Es0matedRTT B. Is used as a parameter for safe margin of 0meout interval C. Is used to re- calculate SampleRTT D. A and B E. A and C
Next lecture TCP Readings 3.5 Guest lecture on Monday Feb 23 rd DNS Security Midterm exam in class In class: 1 PM Friday, March 6 th
Copy right notice: These slides are adapted from J.F Kurose and K.W. Ross s ones All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012