1 / 48

Outline RTT estimation using EWMA Stop and Wait Sliding Window Algorithms

Transport Layer: Sliding Window Reliability. Outline RTT estimation using EWMA Stop and Wait Sliding Window Algorithms. Transport layer functions. Transport protocol defines the pattern/sequence for end hosts sending packets Transport has to deal with a number of things

dianerosa
Download Presentation

Outline RTT estimation using EWMA Stop and Wait Sliding Window Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transport Layer: Sliding Window Reliability Outline RTT estimation using EWMA Stop and Wait Sliding Window Algorithms CS 640

  2. Transport layer functions • Transport protocol defines the pattern/sequence for end hosts sending packets • Transport has to deal with a number of things • Multiplexing/demultiplexing – ports and message queues • Error detection within packets - checksums • Reliable, in order delivery of packets - Today • Flow control – Today • Connection management - TBD • Congestion control – TBD • We’re moving toward understanding TCP CS 640

  3. Methods of Reliability • Packets can be lost and/or corrupted during transmission • Bit level errors due to noise • Loss due to congestion • Use checksums to detect bit level errors • Internet Checksum is optionally used to detect errors in UDP • Uses 16 bits to encode one’s complement sum of data + headers • When bit level errors are detected, packets are dropped • Build reliability into the transmission protocol • Using acknowledgements and timeouts to signal lost or corrupt frame CS 640

  4. Acknowledgements & Timeouts • An acknowledgement (ACK) is a packet sent by one host in response to a packet it has received • Making a packet an ACK is simply a matter of changing a field in the transport header • Data can be piggybacked in ACKs • A timeout is a signal that an ACK to a packet that was sent has not yet been received within a specified timeframe • A timeout triggers a retransmission of the original packet from the sender • How are timers set? CS 640

  5. Acknowledgements & Timeouts CS 640

  6. Propagation Delay • Propagation delay is defined as the delay between transmission and receipt of packets between hosts • Propagation delay can be used to estimate timeout period • How can propagation delay be measured? • What else must be considered in the measurement? CS 640

  7. Exponentially weighted moving average RTT estimation • EWMA was original algorithm for TCP • Measure SampleRTT for each packet/ACK pair • Compute weighted average of RTT • EstRTT = axEstimatedRTT + bxSampleRTT • where a+b = 1 • a between 0.8 and 0.9 • b between 0.1 and 0.2 • Set timeout based on EstRTT • TimeOut=2xEstRTT CS 640

  8. Stop-and-Wait Process Sender Receiver • Sender doesn’t send next packet until he’s sure receiver has last packet • The packet/Ack sequence enables reliability • Sequence numbers help avoid problem of duplicate packets • Problem: keeping the pipe full • Example • 1.5Mbps link x 45ms RTT = 67.5Kb (8KB) • 1KB frames imples 1/8th link utilization CS 640

  9. Sender Receiver … ime T … Solution: Pipelining via Sliding Window • Allow multiple outstanding (un-ACKed) frames • Upper bound on un-ACKed frames, called window CS 640

  10. Buffering on Sender and Receiver • Sender needs to buffer data so that if data is lost, it can be resent • Receiver needs to buffer data so that if data is received out of order, it can be held until all packets are received • Flow control • How can we prevent sender overflowing receiver’s buffer? • Receiver tells sender its buffer size during connection setup • How can we insure reliability in pipelined transmissions? • Go-Back-N • Send all N unACKed packets when a loss is signaled • Inefficient • Selective repeat • Only send specifically unACKed packets • A bit trickier to implement CS 640

  11. £ SWS … … LAR LFS Sliding Window: Sender • Assign sequence number to each frame (SeqNum) • Maintain three state variables: • send window size (SWS) • last acknowledgment received (LAR) • last frame sent (LFS) • Maintain invariant: LFS - LAR <= SWS • Advance LAR when ACK arrives • Buffer up to SWS frames CS 640

  12. £ RWS … … LFR LFA Sliding Window: Receiver • Maintain three state variables • receive window size (RWS) • largest frame acceptable (LFA) • last frame received (LFR) • Maintain invariant: LFA - LFR <= RWS • Frame SeqNum arrives: • if LFR < SeqNum < = LFA accept • if SeqNum < = LFR or SeqNum > LFA discarded • Send cumulative ACKs – send ACK for largest frame such that all frames less than this have been received CS 640

  13. Sequence Number Space • SeqNum field is finite; sequence numbers wrap around • Sequence number space must be larger then number of outstanding frames • SWS <= MaxSeqNum-1 is not sufficient • suppose 3-bit SeqNum field (0..7) • SWS=RWS=7 • sender transmit frames 0..6 • arrive successfully, but ACKs lost • sender retransmits 0..6 • receiver expecting 7, 0..5, but receives the original incarnation of 0..5 • SWS < (MaxSeqNum+1)/2 is correct rule • Intuitively, SeqNum “slides” between two halves of sequence number space CS 640

  14. Another Pipelining Possibility: Concurrent Logical Channels • Multiplex 8 logical channels over a single link • Run stop-and-wait on each logical channel • Maintain three state bits per channel • channel busy • current sequence number out • next sequence number in • Header: 3-bit channel num, 1-bit sequence num • 4-bits total • same as sliding window protocol • Separates reliability from order CS 640

  15. Stop & wait sequence numbers Sender Receiver Sender Receiver Sender Receiver Frame 0 Frame 0 Frame 0 imeout imeout ACK 0 ACK 0 ACK 0 T T Frame 0 Frame 1 Frame 0 imeout ACK 0 imeout ACK 1 T ACK 0 T Frame 0 (c) (d) ACK 0 (e) • Simple sequence numbers enable the client to discard duplicate copies of the same frame • Stop & wait allows one outstanding frame, requires two distinct sequence numbers CS 640

  16. 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 Sliding Window Example Receiver Sender 0 1 2 A3 3 4 5 6 A4 CS 640

  17. Sliding Window Summary • Sliding window is best known algorithm in networking • First role is to enable reliable delivery of packets • Timeouts and acknowledgements • Second role is to enable in order delivery of packets • Receiver doesn’t pass data up to app until it has packets in order • Third role is to enable flow control • Prevents server from overflowing receiver’s buffer CS 640

  18. The Transport Layer Chapter 6

  19. The Transport Service • Services Provided to the Upper Layers • Transport Service Primitives • Berkeley Sockets

  20. Services Provided to the Upper Layers The network, transport, and application layers.

  21. Why the transport layer ? 1. The network layer exists on end hosts and routers in the network. The end-user cannot control what is in the network. So the end-user establishes another layer, only at end hosts, to provide a transport service that is more reliable than the underlying network service. 2. While the network layer deals with only a few transport entities, the transport layer allows several concurrent applications to use the transport service. 3. It provides a common interface to application writers, regardless of the underlying network layer. In essence, an application writer can write code once using the transport layer primitive and use it on different networks (but with the same transport layer).

  22. Transport Service Primitives The primitives for a simple transport service.

  23. Transport Service Primitives (2) The nesting of TPDUs, packets, and frames.

  24. Transport Service Primitives (3) A state diagram for a simple connection management scheme. Transitions labelled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.

  25. Berkeley Sockets The socket primitives for TCP.

  26. Elements of Transport Protocols • Addressing • Connection Establishment • Connection Release • Flow Control and Buffering • Multiplexing • Crash Recovery

  27. Transport Protocol (a) Environment of the data link layer. (b) Environment of the transport layer. Both data link layer and transport layer do error control, flow control, sequencing. The differences are: 1. Storage capacity in subnet. Frames must arrive sequentially, TPDUs can arrive in any sequence. 2. Frames are delivered to hosts, TPDUs need to be delivered to users, so per user addressing and flow control within the hosts is necessary.

  28. Addressing TSAPs (Transport Service Access Point) , NSAPs (Network SAP). TCP calls TSAP s ... ports ATM calls TSAPs ... AAL-SAP

  29. Connection Establishment (1) How a user process in host 1 establishes a connection with a time-of-day server in host 2.

  30. Connection Establishment (2) Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.

  31. Connection Establishment (3) (a) TPDUs may not enter the forbidden region. (b) The resynchronization problem.

  32. Connection Release Abrupt disconnection with loss of data.

  33. Connection Release (2) The two-army problem.

  34. Connection Release (3) Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost. 6-14, a, b

  35. Connection Release (4) (c) Response lost. (d) Response lost and subsequent DRs lost. 6-14, c,d

  36. Flow Control and Buffering Dynamic buffer allocation. Buffer allocation info travels in separate TPDUs. The arrows show the direction of transmission. ‘…’ indicates a lost TPDU. Potential deadlock if control TPDUs are not sequenced or timed out

  37. Multiplexing • Upward multiplexing. • Downward multiplexing. Used to increase the bandwidth, e.g., two ISDN connections of 64 kbps each yield 128 kbps bandwidth.

  38. The Internet Transport Protocols: UDP • Introduction to UDP • Remote Procedure Call • The Real-Time Transport Protocol

  39. Introduction to UDP The UDP header. UDP only provides TSAPs (ports) for applications to bind to. UDP does not provide reliable or ordered service. The checksum is optional.

  40. Remote Procedure Call Steps in making a remote procedure call. The stubs are shaded.

  41. The Real-Time Transport Protocol (a) The position of RTP in the protocol stack. (b) Packet nesting.

  42. The Real-Time Transport Protocol (2) The RTP header. X indicated the presence of an extension header. CC says how many contributing sources are present (0 to 15). Syn. Source Id. tells which stream the packet belongs to. For feedback information is used an associated protocol called RTCP (Real Time Control Protocol)

  43. The Internet Transport Protocols: TCP • Introduction to TCP • The TCP Service Model • The TCP Protocol • The TCP Segment Header • TCP Connection Establishment • TCP Connection Release • TCP Connection Management Modeling • TCP Transmission Policy • TCP Congestion Control • TCP Timer Management • Wireless TCP and UDP • Transactional TCP

  44. The TCP Service Model Some assigned ports. Port Protocol Use 21 FTP File transfer 23 Remote login Telnet E-mail 25 SMTP 69 Trivial File Transfer Protocol TFTP Finger Lookup info about a user 79 80 World Wide Web HTTP POP-3 110 Remote e-mail access USENET news 119 NNTP

  45. The TCP Service Model (2) (a) Four 512-byte segments sent as separate IP datagrams. (b) The 2048 bytes of data delivered to the application in a single READ CALL.

  46. TCP Service Model (3) All TCP connections are full-duplex and point-to-point. TCP provides a byte stream. i.e it does not preserve message boundaries At sender TCP may immediately send or buffer data at its discretion. Sender can use a PUSH flag to instruct TCP not to buffer the send. Sender can use URGENT flag to have TCP send data immediately and have the receiver TCP signal the receiver application that there is data to be read.

  47. Some TCP features Every byte has its own 32 bit sequence number. Sending and receiving entities exchange data in segments Each segment is the 20 byte header and data (total up to 64K) TCP may aggregate multiple writes into one segment or split one write into several segments. A segment size if the smaller of either 64K or the MTU of the network layer (MTU of Ethernet is about 1500 bytes) A segment must fit in a single IP payload.

  48. Some TCP features TCP uses the sliding window protocol as its base. Sender sends segment, starts timer waits for ack. It no ack then retransmit. Receiver acks in separate segment or “piggyback” on data segment. TCP must deal with reordred segments. A lot of algorithms have been developed to make TCP efficient under diverse network conditions. We will look at a few of them.

More Related