Error Control in TCP Simplified TCP Sender Loss detection: sender - - PowerPoint PPT Presentation

error control in tcp simplified tcp sender
SMART_READER_LITE
LIVE PREVIEW

Error Control in TCP Simplified TCP Sender Loss detection: sender - - PowerPoint PPT Presentation

Error Control in TCP Simplified TCP Sender Loss detection: sender based (Timer) switch (event) { - adaptive timeout calculation data received from application above: create TCP segment w/sequence number NextSeqNum - triple duplicate ACK if


slide-1
SLIDE 1

Error Control in TCP

  • Loss detection: sender based (Timer)
  • adaptive timeout calculation
  • triple duplicate ACK
  • Acknowledgement: cumulative ACK
  • sequence number: next octet that the receiver expects to get.
  • variable message length; retransmitted messages can include

more than the original.

  • Retransmision: (no specification)
  • until 1987: GBN
  • since 1987: Selective Retransmit
  • proposed modification: selective ACK

Simplified TCP Sender

switch (event) { data received from application above: create TCP segment w/sequence number NextSeqNum if (timer not running) start timer pass segment to IP NextSeqNum += length(data) timer timeout: retranmit not-yet-acknowledged segment with smallest sequence number start timer ACK received, with ACK field value of y: if (y > SendBase) { SendBase = y if (not-yet-acknowledged segments) start timer } }

Connection Management

  • Connectionless vs. connection-oriented
  • Connection:

association between a pair of protocol entities.

  • Connection record:

state information about a particular connection (data structure at sender and receiver).

  • Connection identifier:

identifier for a particular connection.

  • Handshake-based or timer-based

Connection Management

  • Requirements:
  • no identifier reuse while copies of a PDU/ACK are alive.
  • identifiers from a previously terminated connections should

not cause a new connection to be opened/closed.

  • PDUs from previous connections should not be accepted.
  • graceful close
  • receiver: all possible retransmissions received and responded to them.
  • sender: received all ACKs of sent PDUs.
  • Problems:
  • reuse of connection id
  • limited storage (release of connection records)
  • crash
slide-2
SLIDE 2

Connection Management in TCP

Connection state only in end nodes (intermediate nodes are not aware of the connection)

Connection Establishment:

three-way handshake initial sequence number = clock

Connection Release:

three-way handshake (graceful) ... or abort

[SYN] Seq=X [ACK] Ack=Y+1 [ S Y N , A C K ] S e q = Y , A c k = X + 1 [ F I N ] [ACK] Ack=Y+W+1 [ A C K ] [ S E Q , F I N ] S e q = Y

Connection Management in GSM

Mobile Station Network ÚÄ Ä¿ PAGING REQUEST <------------------------- CHANNEL REQUEST RR connection

  • ------------------------> establishment

IMMEDIATE ASSIGNMENT (MT) <------------------------ ÀÄ ÄÙ ÚÄ Ä¿ PAGING RESPONSE

  • ------------------------> Service request

ÀÄ ÄÙ ÚÄ Ä¿ AUTHENTICATION REQUEST Authentication <------------------------- AUTHENTICATION RESPONSE

  • ------------------------->

ÀÄ ÄÙ ÚÄ Ä¿ CIPHER MODE COMMAND <------------------------- Ciphering CIPHER MODE COMPLETE mode setting

  • ------------------------->

ÀÄ ÄÙ ÚÄ Ä¿ SETUP <-------------------------- Call initiation CALL CONFIRMED

  • ------------------------->

ÀÄ ÄÙ ÚÄ Ä¿ ASSIGNMENT COMMAND <-------------------------- Assignment of ASSIGNMENT COMPLETE

  • ------------------------->

ÀÄ ÄÙ ÚÄ Ä¿ ALERTING

  • ------------------------> User alerting

ÀÄ ÄÙ information ÚÄ Ä¿ CONNECT

  • -------------------------> Call accepted

CONNECT ACKNOWLEDGE <-------------------------- ÀÄ ÄÙ

broadcast channel dedicated control channel traffic channel RR connection establishment ciphering mode setting assignment of a traffic channel user alerting information authentication service request call initiation call accepted

Flow and Congestion Control

Flow Control Receiver busy Congestion Control Network congested Consequence: Packet loss Adapt send rate to not overwhelm the receiver (flow control) or the network (congestion control).

Flow Control: Receive Window

  • Announce the receive window size to the sender.

Source: Kurose&Ross

slide-3
SLIDE 3

Flow Control

  • Example: RTS/CTS in modem lines
  • Receiver Window

Receiver: RcvWindow = RcvBuffer - (LastByteRcvd - LastByteRead) Announce RcvWindow to the sender via ACKs. Sender: LastByteSent - LastByteAcked RcvWindow Problem: RcvWindow=0 > no send > no ACK > ...

  • Rate Control: Leaky bucket

Source: Kurose&Ross

Leaky Bucket

  • Problem: control the send rate of data to conform

with specified average rate, peak rate, and burst rate.

  • Bucket can hold b tokens:
  • generate r tokens per second
  • add the token to the bucket if it is not full
  • Packet arrives:
  • send if there is a token in the bucket,

else wait until there is one

  • Remove one token from the bucket
  • burst rate: b packets
  • average rate over time t: tr + b

Congestion Control

  • How does a sender know when the network is

congested (too much data in the network)?

  • Explicit (network assisted): feedback from the network
  • Implicit (end-to-end):

acknowledgements > low traffic timeouts > loss in the network

S R

??

S R

24Mbit/s 1Gbit/s 100Mbit/s 56kbit/s

  • Data from application:
  • assign nextseqnum to the packet
  • send if (nextseqnum < base + N)

mark as sent but not acknowledged

  • nextseqnum++;
  • ACK arrives:
  • if (ack >= base) base = ack + 1 (move window)

mark all packets with (seqnum < base) as acknowledged

  • send all packets (seqnum < base + N)

mark them as sent but not acknowledged

Sliding Window

slide-4
SLIDE 4

Sliding Window Example

not sent sent, no ACK ACK:ed Free Action: ACK of oldest sent packet arrives Action: Application has more data to send Action: ACK arrives in the middle Action: Application has more data to send Action: ACK of already ACK:ed packet arrives

Send Send Send Send

Sliding Window at Receiver

  • Sliding-window (with Selective Retransmit)

Source: Kurose&Ross

Sliding Window at Receiver

  • Represents the maximum buffer size for segments

received but still not red

  • If a segment that does not fit inside the window

arrives (either too new or too old), it is discarded. However, an ACK is sent.

  • To avoid running out of buffer space, the receiver can

inform the sender about available buffer space in each ACK.

Avoiding Packet Loss (Reminder)

  • Be conservative about what you send and liberal

about what you receive.

  • Do not send data that will be lost due to...
  • a slow receiver
  • a congested network
  • Do not inject more data than necessary
  • it increases the load on the network
  • Typical approach:
  • keep track of the amount of outstanding data
  • estimate how much data can be in the pipe
  • do not put more data in the network than the estimate

suggests.

slide-5
SLIDE 5

Congestion Control in TCP

  • loss event:
  • Timeout (congestion)
  • 3 duplicate ACK (sporadic loss)
  • Congestion window W
  • loss event: reduce CongWindow significantly
  • ack: increase CongWindow
  • sendWindow = min{RecWindow, CongWindow}
  • Slow Start
  • W<Threshold: exponential growth (W=W+1 for every ACK)
  • W>Threshold: linear growth
  • Reaction to loss events
  • Timeout: Threshold=W/2; W=1; slow start until Threshold
  • 3 duplicate ACK: W=W/2 (fast recovery)

Congestion Window in TCP

Source: Kurose&Ross

Fairness in TCP

Source: Kurose&Ross