TCP - Internet - Lecture Slides, Slides of Internet and Information Access

These lecture slides are very easy to understand the internet.The major points in these lecture slides are:Tcp, Flow Control, Error Control, Congestion Control, Algorithms, Overloads, Packet Losses, Information, Error Control, Congestion

Typology: Slides

2012/2013

Uploaded on 04/25/2013

bageshri
bageshri šŸ‡®šŸ‡³

4.3

(24)

175 documents

1 / 52

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
TCP - Part II
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34

Partial preview of the text

Download TCP - Internet - Lecture Slides and more Slides Internet and Information Access in PDF only on Docsity!

TCP - Part II

What is Flow/Congestion/Error Control

2

  • Flow Control: Algorithms to prevent that the sender

overruns the receiver with information

  • Error Control: Algorithms to recover or conceal the

effects from packet losses

  • Congestion Control: Algorithms to prevent that the sender

overloads the network

 The goal of each of the control mechanisms are different.

 In TCP, the implementation of these algorithms is combined

Sequence Numbers and Acknowledgments in TCP

  • TCP uses sequence numbers to keep track of transmitted and acknowledged data
  • Each transmitted byte of payload data is associated with a sequence number
  • Sequence numbers count bytes and not segments
  • Sequence number of first byte in payload is written in SeqNo field
  • Sequence numbers wrap when they reach 232 -
  • The sequence number of the first sequence number (Initial sequence number) is negotiated during connection setup

Sequence number (SeqNo) (32 bits)

Source Port Number Destination Port Number

Acknowledgement number (AckNo)(32 bits) headerlength 0 Flags window size TCP checksum urgent pointer

Sequence Numbers and Acknowledgments in TCP

  • An acknowledgment is a confirmation of delivery of data
  • When a TCP receiver wants to acknowledge data, it - writes a sequence number in the AckNo field, and - sets the ACK flag

IMPORTANT: An acknowledgment confirms receipt for all unacknowledged data that has a smaller sequence number than given in the AckNo field

Example: AckNo=5 confirms delivery for 1,2,3,4 (but not 5).

Sequence number (SeqNo) (32 bits)

Source Port Number Destination Port Number

Acknowledgement number (AckNo)(32 bits) headerlength 0 Flags window size TCP checksum urgent pointer

Cumulative Acknowledgements

• With cumulative ACKs, the receiver can only

acknowledge a segment if all previous segments have

been received

• With cumulative ACKs, receiver cannot selectively

acknowledge blocks of segments:

e.g., ACK for S 0 -S 3 and S 5 -S 7 (but not for S 4 )

• Note: The use of cumulative ACKs imposes constraints

on the retransmission schemes:

  • In case of an error, the sender may need to retransmit all

data that has not been acknowledged

Rules for sending Acknowledgments

  • TCP has rules that influence the transmission of

acknowledgments

  • Rule 1: Delayed Acknowledgments
    • Goal: Avoid sending ACK segments that do not carry data
    • Implementation: Delay the transmission of (some) ACKs
  • Rule 2: Nagle’s rule
    • Goal: Reduce transmission of small segments

Implementation: A sender cannot send multiple segments

with a 1-byte payload (i.e., it must wait for an ACK)

Observing Delayed Acknowledgements

  • This is the output of typing 3 (three) characters :

Time 44.062449: Argon  Neon: Push, SeqNo 0:1(1), AckNo 1 Time 44.063317: Neon  Argon: Push, SeqNo 1:2(1), AckNo 1 Time 44.182705: Argon  Neon: No Data, AckNo 2 Time 48.946471: Argon  Neon: Push, SeqNo 1:2(1), AckNo 2 Time 48.947326: Neon  Argon: Push, SeqNo 2:3(1), AckNo 2 Time 48.982786: Argon  Neon: No Data, AckNo 3 Time 55.116581: Argon  Neon: Push, SeqNo 2:3(1) AckNo 3 Time 55.117497: Neon  Argon: Push, SeqNo 3:4(1) AckNo 3 Time 55.183694: Argon  Neon: No Data, AckNo 4

10

Argon Neon

Telnet session from Argon to Neon

Why 3 segments per character?

  • We would expect four segments per character:
  • But we only see three segments per character:
  • This is due to delayed acknowledgements

11

character ACK of character

ACK of echoed character

echo of character

character ACK and echo of character

ACK of echoed character

  • Because of delayed ACKs, an ACK is often observed

for every other segment

13

Delayed Acknowledgement

A
B

Max. Delay for an ACK Docsity.com

Observing Nagle’s Rule

• This is the output of typing 7 characters :

Time 16.401963: Argon  Tenet: Push, SeqNo 1:2(1), AckNo 2 Time 16.481929: Tenet  Argon: Push, SeqNo 2:3(1) , AckNo 2 Time 16.482154: Argon  Tenet: Push, SeqNo 2:3(1) , AckNo 3 Time 16.559447: Tenet  Argon: Push, SeqNo 3:4(1), AckNo 3 Time 16.559684: Argon  Tenet: Push, SeqNo 3:4(1), AckNo 4 Time 16.640508: Tenet  Argon: Push, SeqNo 4:5(1) AckNo 4 Time 16.640761: Argon  Tenet: Push, SeqNo 4:8(4) AckNo 5 Time 16.728402: Tenet  Argon: Push, SeqNo 5:9(4) AckNo 8 14

argon.cs.virginia.edu

3000 miles

tenet.cs.berkeley.edu

Telnet session between argon.cs.virginia.edu and tenet.cs.berkeley.edu

Observing Nagle’s Rule

  • Observations:
    • Argon never has multiple unacknowledged segments outstanding
    • There are fewer transmissions than there are characters.
  • This is due to Nagle’s Rule:
    • Each TCP connection can have only one small (1-byte) segment outstanding that has not been acknowledged
  • Implementation: Send one byte and buffer all subsequent bytes until acknowledgement is received.Then send all buffered bytes in a single segment. (Only enforced if byte is arriving from application one byte at a time)
  • Goal of Nagle’s Rule: Reduce the amount of small segments.
  • The algorithm can be disabled.
  • Only one 1-byte segment can be in transmission (Here: Since no data is sent from B to A, we also see delayed ACKs)

17

A

B

Nagle’s Rule

Typed characters

Delayed ACK (^) Delayed ACK Delayed ACKDocsity.com

TCP Flow Control

• TCP uses a version of the sliding window flow

control, where

  • Sending acknowledgements is separated from setting the

window size at sender

  • Acknowledgements do not automatically increase the

window size

• During connection establishment, both ends of a

TCP connection set the initial size of the sliding

window

Window Management in TCP

• The receiver is returning two parameters to the sender

• The interpretation is:

  • I am ready to receive new data with SeqNo= AckNo, AckNo+1, …., AckNo+Win-

• Receiver can acknowledge data without opening the

window

• Receiver can change the window size without

acknowledging data

20

AckNo window size(win) 32 bits 16 bits