TCP and UDP: Connection-Oriented and Connectionless Protocols - Prof. Bradley Noble, Study notes of Electrical and Electronics Engineering

An outline of the cs 461 course from spring 2002, focusing on reliable byte-stream (tcp) and simple demultiplexor (udp). Topics include connection establishment and termination, sliding window, flow control, adaptive timeout, end-to-end protocols, segment format, and various algorithms for handling window sizes, nagle's algorithm, and protection against wrap around. The document also covers the differences between data link and transport layers.

Typology: Study notes

Pre 2010

Uploaded on 08/16/2009

koofers-user-2lr
koofers-user-2lr 🇺🇸

5

(1)

10 documents

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Reliable Byte-Stream (TCP)
Outline
Spring 2002 CS 461 1
Outline
Connection Establishment/Termination
Sliding Window Revisited
Flow Control
Adaptive Timeout
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download TCP and UDP: Connection-Oriented and Connectionless Protocols - Prof. Bradley Noble and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Reliable Byte-Stream (TCP) Outline

Spring 2002

CS 461

Outline

Connection Establishment/TerminationSliding Window RevisitedFlow ControlAdaptive Timeout

End-to-End Protocols

-^

Underlying best-effort network^ –

drop messages

-^

re-orders messages

-^

delivers duplicate copies of a given message

-^

limits messages to some finite size

-^

delivers messages after an arbitrarily long delay

-^

Common end

  • to
  • end services

Spring 2002

CS 461

-^

Common end

  • to
  • end services

–^

guarantee message delivery

-^

deliver messages in the same order they are sent

-^

deliver at most one copy of each message

-^

support arbitrarily large messages

-^

support synchronization

-^

allow the receiver to flow control the sender

-^

support multiple application processes on each host

TCP Overview

-^

Connection-oriented

-^

Byte-stream^ –

app writes bytes

-^

TCP sends

segments

–^

app reads bytes

-^

Full duplex

-^

Flow control: keep senderfrom overrunning receiver

-^

Congestion control: keepsender from overrunning network

Spring 2002

CS 461

network

Application process

Writebytes

TCP Send buffer

Segment

Segment

Segment

Transmit segments

Application process

Readbytes

TCP Receive buffer

■ ■ ■

Data Link Versus Transport

-^

Potentially connects many different hosts^ – need explicit connection establishment and termination

-^

Potentially different RTT^ – need adaptive timeout mechanism

-^

Potentially long delay in network Spring 2002

CS 461

-^

Potentially long delay in network^ – need to be prepared for arrival of very old packets

-^

Potentially different capacity at destination^ – need to accommodate different node capacity

-^

Potentially different network capacity^ – need to be prepared for network congestion

Segment Format (cont)

-^

Each connection identified with 4-tuple:^ –

(SrcPort, SrcIPAddr, DsrPort, DstIPAddr)

-^

Sliding window + flow control^ –

acknowledgment, SequenceNum, AdvertisedWinow

Sender

Data

(SequenceNum)

Receiver

Spring 2002

CS 461

-^

Flags^ –

SYN, FIN, RESET, PUSH, URG, ACK

-^

Checksum^ –

pseudo header + TCP header + data

Sender

Acknowledgment +AdvertisedWindow

Receiver

Connection Establishment and

Termination

Active participant

(client)

Passive participant

(server)

Spring 2002

CS 461

Sliding Window Revisited

Sending application LastByteWritten

TCP LastByteSent

LastByteAcked

Receiving application

LastByteRead

TCP LastByteRcvd

NextByteExpected

(a)

(b)

Spring 2002

CS 461

-^

Sending side^ –

LastByteAcked

LastByteSent

LastByteSent

LastByteWritten

-^

buffer bytes between LastByteAcked

and

LastByteWritten

-^

Receiving side^ –

LastByteRead

NextByteExpected

NextByteExpected

LastByteRcvd +

-^

buffer bytes between NextByteRead

and

LastByteRcvd

Flow Control

-^

Send buffer size:

MaxSendBuffer

-^

Receive buffer size:

MaxRcvBuffer

-^

Receiving side^ –

LastByteRcvd

-^

LastByteRead

MaxRcvBuffer

AdvertisedWindow

MaxRcvBuffer

NextByteExpected

NextByteRead

-^

Sending side Spring 2002

CS 461

11

-^

Sending side^ –

LastByteSent

-^

LastByteAcked

AdvertisedWindow

EffectiveWindow

AdvertisedWindow

LastByteSent

LastByteAcked

LastByteWritten

-^

LastByteAcked

MaxSendBuffer

–^

block sender if (

LastByteWritten

LastByteAcked

y

MaxSenderBuffer

-^

Always send ACK in response to arriving data segment

-^

Persist when

AdvertisedWindow =

Nagle’s Algorithm

-^

How long does sender delay sending data?^ – too long: hurts interactive applications– too short: poor network utilization^ –

strategies: timer

  • based vs self
  • clocking

Spring 2002

CS 461

strategies: timer

  • based vs self
  • clocking -^

When application generates additional data^ – if fills a max segment (and window open): send it– else

•^

if there is unack’ed data in transit: buffer it until ACK arrives

  • else: send it

Protection Against Wrap Around

-^

32-bit

SequenceNum

Bandwidth

Time Until Wrap Around

T1 (1.5 Mbps)

6.4 hours

Spring 2002

CS 461

Ethernet (10 Mbps)

57 minutes

T3 (45 Mbps)

13 minutes

FDDI (100 Mbps)

6 minutes

STS-3 (155 Mbps)

4 minutes

STS-12 (622 Mbps)

55 seconds

STS-24 (1.2 Gbps)

28 seconds

TCP Extensions

-^

Implemented as header options

-^

Store timestamp in outgoing segments

-^

Extend sequence space with 32

  • bit timestamp

Spring 2002

CS 461

-^

Extend sequence space with 32

  • bit timestamp

(PAWS)

-^

Shift (scale) advertised window

Adaptive Retransmission

(Original Algorithm)

-^

Measure

SampleRTT

for each segment / ACK pair

-^

Compute weighted average of RTT^ –

EstRTT

α

x

EstRTT

β

x

SampleRTT

where

α

β

Spring 2002

CS 461

where

α

β

α

between 0.8 and 0.

β

between 0.1 and 0.

-^

Set timeout based on

EstRTT

TimeOut

x

EstRTT

Jacobson/ Karels Algorithm

-^

New Calculations for average RTT

Diff

SampleRTT

EstRTT

EstRTT = EstRTT + (

x

Diff)

Dev =

Dev +

|Diff| - Dev)

–^

where

δ

is a factor between 0 and 1

-^

Consider variance when setting timeout value

Spring 2002

CS 461

-^

Consider variance when setting timeout value

TimeOut

μ

x

EstRTT

φ

x

Dev

–^

where

= 1 and

φ^

-^

Notes^ –

algorithm only as good as granularity of clock (500ms on Unix)

-^

accurate timeout mechanism important to congestion control (later)