cs 557 lecture 1 review of basic protocols
play

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


  1. CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - RFC 793, 1981 Spring 2013

  2. • These slides are a combination of two great sources: – Kurose and Ross Textbook slides – Steve Deering IETF Plenary Talk

  3. IP Datagram Format IP protocol version 32 bits total datagram number length (bytes) header length head. type of ver length (bytes) len service for fragment “ type ” of data fragmentation/ 16-bit identifier flgs offset reassembly max number time to upper Internet remaining hops live layer checksum (decremented at 32 bit source IP address each router) 32 bit destination IP address upper layer protocol to deliver payload to E.g. timestamp, Options (if any) record route data how much overhead taken, specify (variable length, list of routers with TCP? to visit. typically a TCP • 20 bytes of TCP or UDP segment) • 20 bytes of IP • = 40 bytes + app layer overhead

  4. IP Fragmentation • network links have MTU (max.transfer size) - largest possible link-level frame. – different link types, fragmentation: different MTUs in: one large datagram out: 3 smaller datagrams • large IP datagram divided ( “ fragmented ” ) within net – one datagram becomes several datagrams reassembly – “ reassembled ” only at final destination – IP header bits used to identify, order related fragments

  5. TCP RFCs: 793, 1122, 1323, 2018, 2581 • point-to-point: • full duplex data: – one sender, one receiver – bi-directional data flow in same connection • reliable, in-order byte – MSS: maximum segment steam: size – no “ message boundaries ” • connection-oriented: • pipelined: – handshaking (exchange – TCP congestion and flow of control msgs) init ’ s control set window size sender, receiver state • send & receive buffers before data exchange • flow controlled: application application – sender will not overwhelm writes data reads data socket socket door door receiver TCP TCP send buffer receive buffer segment

  6. TCP segment structure 32 bits URG: urgent data counting source port # dest port # (generally not used) by bytes sequence number of data ACK: ACK # (not segments!) acknowledgement number valid head not U A P R S F Receive window PSH: push data now len used # bytes (generally not used) checksum Urg data pnter rcvr willing to accept RST, SYN, FIN: Options (variable length) connection estab (setup, teardown commands) application data Internet (variable length) checksum (as in UDP)

  7. TCP Connection Management Three-Way Handshake TCP server lifecycle TCP client lifecycle

  8. TCP Flow control • Rcvr advertises spare room by including value of RcvWindow in segments • Sender limits (Suppose TCP receiver discards out-of-order unACKed data to segments) RcvWindow • spare room in buffer – guarantees receive = RcvWindow buffer doesn ’ t = RcvBuffer-[LastByteRcvd - overflow LastByteRead]

  9. TCP Congestion Control Review • When CongWin is below Threshold , sender in slow- start phase, window grows exponentially. • When CongWin is above Threshold , sender is in congestion-avoidance phase, window grows linearly. • When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold . • When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.

  10. TCP: retransmission scenarios Host A Host A Host B Host B Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=92 timeout Seq=100, 20 bytes data timeout ACK=100 X loss Seq=92, 8 bytes data Seq=92, 8 bytes data Sendbase = 100 Seq=92 timeout SendBase = 120 0 0 1 = K C A SendBase SendBase = 100 = 120 premature timeout time time lost ACK scenario

  11. TCP Timeouts Setting the timeout • EstimtedRTT plus “ safety margin ” – large variation in EstimatedRTT -> larger safety margin • first estimate of how much SampleRTT deviates from EstimatedRTT: DevRTT = (1- β )*DevRTT + β *|SampleRTT-EstimatedRTT| (typically, β = 0.25) Then set timeout interval: TimeoutInterval = EstimatedRTT + 4*DevRTT

  12. Example RTT estimation: RTT: RTT: gaia.c gaia.cs.u s.umass.edu mass.edu to to fantasia.e fantasia.eure urecom.fr com.fr 350 300 ds) onds econ (millisec 250 (millis RTT RTT 200 150 100 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 ti time me (sec (s econ onnds ds) SampleRTT Estimated RTT

  13. TCP Window Size Over Time congestion window 24 Kbytes 16 Kbytes 8 Kbytes time Long-lived TCP connection

  14. Event State TCP Sender Action Commentary ACK receipt Slow Start CongWin = CongWin + Resulting in a doubling of for (SS) MSS, CongWin every RTT previously If (CongWin > Threshold) unacked set state to “ Congestion data Avoidance ” ACK receipt Congestion CongWin = CongWin+MSS * Additive increase, for Avoidance (MSS/CongWin) resulting in increase of previously (CA) CongWin by 1 MSS unacked every RTT data Loss event SS or CA Threshold = CongWin/2, Fast recovery, detected by CongWin = Threshold, implementing triple Set state to “ Congestion multiplicative decrease. duplicate Avoidance ” CongWin will not drop ACK below 1 MSS. Timeout SS or CA Threshold = CongWin/2, Enter slow start CongWin = 1 MSS, Set state to “ Slow Start ” Duplicate SS or CA Increment duplicate ACK CongWin and Threshold ACK count for segment being not changed acked

  15. Summary

  16. IPv6 • Initial motivation: 32-bit address space soon to be completely allocated. • Additional motivation: – header format helps speed processing/ forwarding – header changes to facilitate QoS IPv6 datagram format: – fixed-length 40 byte header – no fragmentation allowed

  17. IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “ flow. ” (concept of “ flow ” not well defined). Next header: identify upper layer protocol for data

  18. Other Changes from IPv4 • Checksum : removed entirely to reduce processing time at each hop • Options: allowed, but outside of header, indicated by “ Next Header ” field • ICMPv6: new version of ICMP – additional message types, e.g. “ Packet Too Big ” – multicast group management functions

Recommend


More recommend