TCP Flow Control - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

TCP Flow Control

Description:

E.g. time travel across a network with five routers and four links is 4ms. Background 2 ... Rx sends AAA this signals to transmitter. N received but. N 100 missing ... – PowerPoint PPT presentation

Number of Views:150
Avg rating:3.0/5.0
Slides: 39
Provided by: Jo66
Category:
Tags: tcp | aaa | control | flow | travel

less

Transcript and Presenter's Notes

Title: TCP Flow Control


1
TCP Flow Control
  • Control Algorithms

2
Background 1
  • Time to transmit data across one link
  • Operating rate 10Mbps
  • Time to send 1 bit is 0.1microsec
  • Time for 1 byte is 0.8microsec
  • Time for 1000 bytes is 0.8millisec
  • Round trip time say - 1ms
  • E.g. time travel across a network with five
    routers and four links is 4ms

3
Background 2
  • Assume RTT is about 4ms
  • Sliding window represents
  • Bytes that may be sent in RTT
  • Example Bandwidth delay product
  • window BW RTT (10106)(410-3)
  • window 40K bytes typical
  • In TCP window size normally represented by two
    bytes i.e. 64K max

4
Background 2
  • After sending 40K an ACK should be immediately
    received at transmitter
  • 40K ACK 40K - ACK
  • Transmitter operating at full rate
  • No ACK received signals that packets buffered or
    lost

5
Background 3
  • TCP original specification RFC 793
  • TCP Tahoe 1988 congestion control
  • Slow start
  • Congestion avoidance
  • Fast retransmit
  • Reno 1990
  • Fast Recovery
  • Vegas

6
Definition of terms
  • Quality of Service in IP Networks
  • Armitage MacMillan Press 2000
  • ISBN 1-58870-189-9, page 264
  • Acknowledge - ACK
  • Congestion window (TX) cwnd
  • Receiver window rwnd
  • Slow start ss
  • Slow start threshold ssthresh

7
Terms 1
  • Congestion avoidance CA
  • Retransmission timeout RTO
  • Round trip time RTT
  • RTT estimated using RFC1122
  • Segment the window
  • Sliding window control mechanism, RFC2581

8
TCP Flow Control 1
  • End to end performance
  • Data segment size selected to fit into IP packets
  • Transmit segments inside IP packets
  • Each segment has a sequence number
  • Each segment is ACKed by receiver

9
TCP Flow Control 2
  • Assume lost if not ACKed in a certain time
  • Or lost if - receiver explicitly indicates
  • TCP uses sliding window mechanism
  • Two state variables
  • 1. Congestion window cwnd
  • transmitter belief about the networks current
    capacity

10
TCP Flow Control 3
  • 2. Receivers window rwnd
  • Receivers current buffering and processing
    capacity
  • Transmit more segments when ACK confirm receipt
    of segments at other end
  • TCP is said to be ACK clocked
  • TCP is a cumulative ACK system
  • ACK N implies others prior segments ACKed

11
TCP Flow Control 4
  • Delayed ACK every second segment or 500mS, which
    ever sooner
  • Window control variables
  • Set cwnd 1
  • Slow start threshold ssthresh
  • At start ssthresh rwnd
  • Gracefully establish operating point
  • Two growth modes

12
TCP Flow Control 5
  • 1 - Slow start SS
  • 2 - Congestion avoidance CA
  • SS mode increments cwnd by 1 whereas
  • CA mode increments cwnd by 1/cwnd
  • Cwnd cwnd 1 (linear)
  • However this implies a doubling of segment size
    exponential rise in cwnd
  • TCP uses use SS to ramp up to ssthresh

13
TCP Flow Control 6
  • TCP switches to CA at ssthresh
  • CA mode carefully probes for network capacity
    above ssthresh
  • Cwnds, rwnd and ssthresh stored in units of bytes
  • Maximum segment size MSS
  • MSS - negotiated between transmitter and receiver
    during connection establishment

14
TCP Flow Control 7
  • TCP reduces cwnd and ssthresh if congestion
    occurs between Tx and Rx
  • Original design assumes
  • Link loss small compared to packet loss
  • Congestion is inferred through the existence of
    lost packets
  • Packet loss vastly outweighs link errors
  • cwnd and ssthresh - modified in two ways

15
Response to Timeouts
  • Transmitter round trip timer RTT timeout

16
Transmitter Timeout 1
  • Response to timeouts in transmitter (1)
  • Round trip timer overrun RTO
  • RTO initially set to 3 seconds later set to
    estimated RTT
  • When Tx receives no ACK Tx resends unacknowleged
    segment and sets
  • ssthresh min(cwnd, rwnd) / 2

17
Transmitter Timeout 2
  • Action forces Tx into SS mode
  • Set cwnd 1
  • Result Half transmit rate
  • Start SS again build to half rate and then probe
    network in CA mode
  • RTO is doubled each time packet retransmitted due
    to expiration of time out timer wait long and
    reduce throughput
  • If RTO exceeds a value (e.g.100 ) connection
    terminated

18
Fast Retransmit
  • Goal to rapidly transmit missing segments

19
Fast Retransmit 1
  • Data segments
  • (N)
  • (N100) missing segment
  • (N200)
  • (N300)

20
Fast Retransmit 2
  • Transmitter receives 3 duplicate ACKs
  • Rx detects a hole in the sequence numbers in the
    segment arriving
  • Segments are buffered and eventually recombined
    with missing part
  • Tx receives duplicate ACKs therefore segments
    still getting through

21
Fast Retransmit 3
  • Rx sends 3 duplicate ACKs to signal loss
  • E.g. segment is 100 bytes long
  • N, N200, N300 assume (N100) is lost
  • RX sends 3 more ACKs for N and
  • a duplicate for each out of sequence segment
    arriving after N

22
Fast Retransmit 4
  • Rx sends AAA this signals to transmitter
  • N received but
  • N100 missing
  • Tx immediately sends N100
  • Missing segment (fast retransmit)
  • RX sends AA for each missing segment

23
Fast Retransmit 5
  • Data segments
  • (N) A (ackN) plus AAA
  • (N100) AA
  • (N200)
  • (N300)

24
Fast recovery mode
25
Fast recovery mode 1
  • Quote
  • The receipt of duplicate ACKS infers that
    subsequent segments are still getting through so
    transmitter infers that congestion is not too bad
    and goes into fast recovery mode.

26
Fast recovery mode 2
  • Duplicate ACKs implies packets are still getting
    through and that
  • Congestion is not too bad
  • Transmitter goes into fast recovery mode

27
Fast recovery mode 3
  • Receipt of duplicate ACKs
  • Transmitter goes into fast recovery mode
  • Operating in CA mode at start
  • Set ssthresh and cwnd to half previous value
  • Half transmission rate
  • Tx stays in CA mode
  • cwnd gt ssthresh but data rate half as fast

28
Fast recovery mode 4
  • For each duplicate ACK arriving at TX cwnd is
    incremented by 1
  • Because segments exit network leaving space
  • Duplicate ACKs not foolproof method
  • Internet may use alternative routes

29
Fast recovery mode 5
  • If packets reordered on the way to receiver
  • Receiver sees out-of-sequence segment and
  • Sends duplicate ACKs to Tx
  • Tx reduces window size and retransmits supposedly
    lost packet

30
Selective Acknowledgement
  • SACK - Selective Acknowledgement

31
Selective Acknowledgement 1
  • Segments
  • N
  • N100 - missing
  • N200
  • N300
  • The absence of N200 not detected until RTO
    expires at transmitter

32
Selective Acknowledgement 2
  • SACK aims to avoid forcing TX into
  • SS mode with CA 1 with ssthrshold/2
  • Quote
  • Sack allows a TCP receiver to issues an advisory
    in returned ACKs, indicating not only that some
    specific segments have been lost but that also
    that a range of subsequent segments have been
    received and are being buffered at the receiver.

33
Selective Acknowledgement 3
  • Quote
  • This process allows the transmitter to optimize
    its retransmission strategy, focussing upon
    missing segments. The assumption is that missing
    segments are filled in at the receiver, the
    receiver will resume ACKing the highest number
    segment received.

34
Bandwidth delay product
35
Bandwidth delay product 1
  • Effective pipe size along transmission path
  • Bandwidth delay product bandwidth RTT
  • Alternatively
  • Throughput window size/RTT
  • Number of Bytes/time
  • Traditional TCP limited to 64K
  • As cwnd and rwnd are 16 bit numbers

36
Bandwidth delay product 2
  • Round trip time measurement mechanism RTTM
  • An Example
  • Typical packets sizes 500, 1000, 1500 bytes
  • ACKs are 40 bytes long
  • TCP Packet typically gtgt ACK size
  • Ratio 1000/40 25

37
Papers and reports
  • Papers archive
  • http//cet-netres-srv.sunderland.ac.uk/website/Arc
    hive2004/
  • BT papers
  • http//cet-netres-srv.sunderland.ac.uk/bttj-papers
    /
  • NetSys project reports
  • http//cet-netres-srv.sunderland.ac.uk/netsys-proj
    ect-reports/

38
Installing ns2 in WinXT
  • A link to ns2 Win XT binaries
  • http//cet-netres-srv.sunderland.ac.uk/website/Net
    work-Simulation/ns2-win/
  • Binaries stored at the UoS
  • http//cet-netres-srv.sunderland.ac.uk/website/Net
    work-Simulation/
  • An ns2 tutorial created by UoS NetSys students
  • How get started, install ns and use xgraph etc
  • http//osiris.sunderland.ac.uk/cs0jti/NetSys/webs
    ite/JavaNP-web/sess1-2003-feb/web-list03feb.htm
Write a Comment
User Comments (0)
About PowerShow.com