20-TransportProtocols

57
Data and Computer Data and Computer Communications Communications Eighth Edition Eighth Edition by William Stallings by William Stallings Lecture slides by Lawrie Brown Lecture slides by Lawrie Brown Chapter 20 Chapter 20 ±  ± Transport Protocols Transport Protocols

Transcript of 20-TransportProtocols

Page 1: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 1/57

Data and Computer Data and Computer 

CommunicationsCommunications

Eighth EditionEighth Editionby William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

Chapter 20Chapter 20 ± ± Transport ProtocolsTransport Protocols

Page 2: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 2/57

Transport ProtocolsTransport Protocols

The foregoing observations should make usThe foregoing observations should make us

reconsider the widely held view that birds livereconsider the widely held view that birds live

only in the present. In fact, birds are aware of only in the present. In fact, birds are aware of 

more than immediately present stimuli; theymore than immediately present stimuli; theyremember the past and anticipate the future.remember the past and anticipate the future.

 ²The Minds of Birds, Alexander Skutch

Page 3: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 3/57

Transport ProtocolsTransport Protocols

endend--toto--end data transfer serviceend data transfer service

shield upper layers from network detailsshield upper layers from network details

reliable, connection orientedreliable, connection oriented has greater complexityhas greater complexity

eg. TCPeg. TCP

best effort, connectionlessbest effort, connectionless

datagramdatagram

eg. UDPeg. UDP

Page 4: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 4/57

Connection OrientedConnection Oriented

Transport ProtocolsTransport Protocols provides establishment, maintenance &provides establishment, maintenance &

termination of a logical connectiontermination of a logical connection

most common servicemost common service used for a wide variety of applicationsused for a wide variety of applications

is reliableis reliable

but complexbut complex

first discuss evolution from reliable tofirst discuss evolution from reliable tounreliable network servicesunreliable network services

Page 5: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 5/57

Reliable Sequencing NetworkReliable Sequencing Network

ServiceService assume virtually 100% reliable delivery byassume virtually 100% reliable delivery by

network service of arbitrary length messagesnetwork service of arbitrary length messages

eg. reliable packet switched network with X.25eg. reliable packet switched network with X.25 eg. frame relay with LAPF control protocoleg. frame relay with LAPF control protocol

eg. IEEE 802.3 with connection oriented LLC serviceeg. IEEE 802.3 with connection oriented LLC service

transport service is a simple, end to end protocoltransport service is a simple, end to end protocol

between two systems on same networkbetween two systems on same network issues are: addressing, multiplexing, flow control,issues are: addressing, multiplexing, flow control,

connection establishment and terminationconnection establishment and termination

Page 6: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 6/57

AddressingAddressing

establish identity of other transport entity by:establish identity of other transport entity by:

user identification (host, port)user identification (host, port)

�� a socket in TCPa socket in TCP transport entity identification (on host)transport entity identification (on host)

�� specify transport protocol (TCP, UDP)specify transport protocol (TCP, UDP)

host address of attached network devicehost address of attached network device

�� in an internet, a global internet addressin an internet, a global internet address

network number network number 

transport layer passes host to network layer transport layer passes host to network layer 

Page 7: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 7/57

Finding AddressesFinding Addresses

know address ahead of timeknow address ahead of time

well known addresseswell known addresses

eg. common servers like FTP, SMTP etceg. common servers like FTP, SMTP etc

name server name server 

does directory lookupdoes directory lookup

sending request to well known addresssending request to well known addresswhich spawns new process to handle itwhich spawns new process to handle it

Page 8: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 8/57

Page 9: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 9/57

Flow ControlFlow Control

issues:issues: longer transmission delay between transport entitieslonger transmission delay between transport entities

compared with actual transmission time delayscompared with actual transmission time delays

communication of flow control infocommunication of flow control info variable transmission delay so difficult to use timeoutsvariable transmission delay so difficult to use timeouts

want TS flow control because:want TS flow control because: receiving user can not keep upreceiving user can not keep up

receiving transport entity can not keep upreceiving transport entity can not keep up which can result in buffer overflowingwhich can result in buffer overflowing

managing flow difficult because of gap betweenmanaging flow difficult because of gap betweensender and receiver sender and receiver 

Page 10: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 10/57

Coping with Flow ControlCoping with Flow Control

Requirements

Requirements

do nothingdo nothing

segments that overflow are discardedsegments that overflow are discarded

sender fail to get ACK and will retransmitsender fail to get ACK and will retransmit

refuse further segmentsrefuse further segments

triggers network flow control but clumsytriggers network flow control but clumsy

use fixed sliding window protocoluse fixed sliding window protocol

works well on reliable networkworks well on reliable network

does not work well on unreliable networkdoes not work well on unreliable network

use credit schemeuse credit scheme

Page 11: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 11/57

Page 12: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 12/57

Credit AllocationCredit Allocation

Page 13: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 13/57

Page 14: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 14/57

Establishment andEstablishment and

TerminationTermination need connection establishment andneed connection establishment and

termination procedures totermination procedures to allow:allow:

each end to know the other existseach end to know the other exists negotiation of optional parametersnegotiation of optional parameters

triggers allocation of transport entitytriggers allocation of transport entity

resourcesresources

Page 15: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 15/57

Connection State DiagramConnection State Diagram

Page 16: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 16/57

Connection EstablishmentConnection Establishment

Page 17: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 17/57

Connection TerminationConnection Termination

either or both sides by mutual agreementeither or both sides by mutual agreement

graceful or abrupt terminationgraceful or abrupt termination

if graceful, initiator must:if graceful, initiator must: send FIN to other end, requesting terminationsend FIN to other end, requesting termination

place connection in FIN WAIT stateplace connection in FIN WAIT state

when FIN received, inform user and close connectionwhen FIN received, inform user and close connection

other end must:other end must: when receives FIN must inform TS user and placewhen receives FIN must inform TS user and place

connection in CLOSE WAIT stateconnection in CLOSE WAIT state

when TS user issues CLOSE primitive, send FIN &when TS user issues CLOSE primitive, send FIN &close connectionclose connection

Page 18: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 18/57

Unreliable Network ServiceUnreliable Network Service

more difficult case for transport protocol sincemore difficult case for transport protocol since

segments may get lostsegments may get lost

segments may arrive out of order segments may arrive out of order 

examples includeexamples include

IP internet, frame relay using LAPF, IEEE 802.3 withIP internet, frame relay using LAPF, IEEE 802.3 with

unacknowledge connectionless LLCunacknowledge connectionless LLC

issues:issues: ordered delivery, retransmission strategy, duplicationordered delivery, retransmission strategy, duplication

detection, flow control, connection establishment &detection, flow control, connection establishment &

termination, crash recoverytermination, crash recovery

Page 19: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 19/57

Ordered DeliveryOrdered Delivery

segments may arrive out of order segments may arrive out of order 

hence number segments sequentiallyhence number segments sequentially

TCP numbers each octet sequentiallyTCP numbers each octet sequentially and segments are numbered by the firstand segments are numbered by the first

octet number in the segmentoctet number in the segment

Page 20: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 20/57

Retransmission StrategyRetransmission Strategy

retransmission of segmentretransmission of segment needed becauseneeded because

segment damaged in transitsegment damaged in transit

segment fails to arrivesegment fails to arrive

transmitter does not know of failuretransmitter does not know of failure

receiver must acknowledge successful receiptreceiver must acknowledge successful receipt

can use cumulative acknowledgement for efficiencycan use cumulative acknowledgement for efficiency

sender times out waiting for ACK triggerssender times out waiting for ACK triggersrere--transmissiontransmission

Page 21: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 21/57

Timer ValueTimer Value

fixed timer fixed timer  based on understanding of network behavior based on understanding of network behavior 

can not adapt to changing network conditionscan not adapt to changing network conditions

too small leads to unnecessary retoo small leads to unnecessary re--transmissionstransmissions too large and response to lost segments is slowtoo large and response to lost segments is slow

should be a bit longer than round trip timeshould be a bit longer than round trip time

adaptive schemeadaptive scheme may not ACK immediatelymay not ACK immediately can not distinguish between ACK of original segmentcan not distinguish between ACK of original segment

and reand re--transmitted segmenttransmitted segment

conditions may change suddenlyconditions may change suddenly

Page 22: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 22/57

Duplication DetectionDuplication Detection

if ACK lost, segment duplicated & reif ACK lost, segment duplicated & re--transmittedtransmitted

receiver must recognize duplicatesreceiver must recognize duplicates

if duplicate received prior to closing connectionif duplicate received prior to closing connection receiver assumes ACK lost and ACKs duplicatereceiver assumes ACK lost and ACKs duplicate

sender must not get confused with multiple ACKssender must not get confused with multiple ACKs

need a sequence number space large enough to notneed a sequence number space large enough to not

cycle within maximum life of segmentcycle within maximum life of segment

Page 23: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 23/57

Page 24: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 24/57

Flow ControlFlow Control

credit allocation quite robust with unreliable netcredit allocation quite robust with unreliable net

can ack data & grant creditcan ack data & grant credit

or just one or other or just one or other 

lost ACK recovers on next receivedlost ACK recovers on next received

have problem if AN=i, W=0 closing windowhave problem if AN=i, W=0 closing window

then send AN=i, W=j to reopen, but this is lostthen send AN=i, W=j to reopen, but this is lost

sender thinks window closed, receiver thinks it opensender thinks window closed, receiver thinks it open solution is to use persist timer solution is to use persist timer 

if timer expires, send somethingif timer expires, send something

could be recould be re--transmission of previous segmenttransmission of previous segment

Page 25: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 25/57

Connection EstablishmentConnection Establishment

two way handshaketwo way handshake

 A send SYN, B replies with SYN A send SYN, B replies with SYN

lost SYN handled by relost SYN handled by re--transmissiontransmission ignore duplicate SYNs once connectedignore duplicate SYNs once connected

lost or delayed data segments can causelost or delayed data segments can cause

connection problemsconnection problems

eg. segment from old connectioneg. segment from old connection

Page 26: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 26/57

Two WayTwo Way

Handshake:Handshake:

ObsoleteObsoleteDataData

SegmentSegment

Page 27: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 27/57

Page 28: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 28/57

Three WayThree Way

Handshake:Handshake:StateState

DiagramDiagram

Page 29: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 29/57

Three WayThree Way

Handshake:Handshake:ExamplesExamples

Page 30: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 30/57

Connection TerminationConnection Termination

like connection need 3like connection need 3--way handshakeway handshake

misordered segments could cause:misordered segments could cause:

entity in CLOSE WAIT state sends last data segment,entity in CLOSE WAIT state sends last data segment,

followed by FINfollowed by FIN

FIN arrives before last data segmentFIN arrives before last data segment

ceceiver accepts FIN, closes connection, loses dataceceiver accepts FIN, closes connection, loses data

need to associate sequence number with FINneed to associate sequence number with FIN receiver waits for all segments before FINreceiver waits for all segments before FIN

sequence number sequence number 

Page 31: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 31/57

Connection TerminationConnection Termination

Graceful CloseGraceful Close also have problems with loss of segmentsalso have problems with loss of segments

and obsolete segmentsand obsolete segments

need graceful close which will:need graceful close which will: send FIN i and receive AN isend FIN i and receive AN i

receive FIN j and send AN jreceive FIN j and send AN j

wait twice maximum expected segmentwait twice maximum expected segmentlifetimelifetime

Page 32: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 32/57

Failure RecoveryFailure Recovery

after restart all state info is lostafter restart all state info is lost

may have half open connectionmay have half open connection as side that did not crash still thinks it is connectedas side that did not crash still thinks it is connected

close connection using keepalive timer close connection using keepalive timer  wait for ACK for (time out) * (number of retries)wait for ACK for (time out) * (number of retries)

when expired, close connection and inform user when expired, close connection and inform user 

send RST i in response to any i segment arrivingsend RST i in response to any i segment arriving

user must decide whether to reconnectuser must decide whether to reconnect have problems with lost or duplicate datahave problems with lost or duplicate data

Page 33: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 33/57

TCPTCP

Transmission Control Protocol (RFC 793)Transmission Control Protocol (RFC 793)

connection oriented, reliable communicationconnection oriented, reliable communication

over reliable and unreliable (inter)networksover reliable and unreliable (inter)networks

two ways of labeling data:two ways of labeling data: data stream pushdata stream push

user requires transmission of all data up to push flaguser requires transmission of all data up to push flag

receiver will deliver in same manner receiver will deliver in same manner 

avoids waiting for full buffersavoids waiting for full buffers urgent data signalurgent data signal

indicates urgent data is upcoming in streamindicates urgent data is upcoming in stream

user decides how to handle ituser decides how to handle it

Page 34: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 34/57

TCP ServicesTCP Services

a complex set of primitives:a complex set of primitives:

incl. passive & active open, active open withincl. passive & active open, active open withdata, send, allocate, close, abort, statusdata, send, allocate, close, abort, status

passive open indicates will accept connectionspassive open indicates will accept connections

active open with data sends data with openactive open with data sends data with open

and parameters:and parameters:

incl. source port, destination port & address,incl. source port, destination port & address,timeout, security, data, data length, PUSH &timeout, security, data, data length, PUSH &URGENT flags, send & receive windows,URGENT flags, send & receive windows,connection state, amount awaiting ACKconnection state, amount awaiting ACK

Page 35: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 35/57

TCP Header TCP Header 

Page 36: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 36/57

TCP and IPTCP and IP

not all parameters used by TCP are in itsnot all parameters used by TCP are in itsheader header 

TCP passes some parameters down to IPTCP passes some parameters down to IP

precedenceprecedence

normal delay/low delaynormal delay/low delay

normal throughput/high throughputnormal throughput/high throughput

normal reliability/high reliabilitynormal reliability/high reliability securitysecurity

min overhead for each PDU is 40 octetsmin overhead for each PDU is 40 octets

Page 37: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 37/57

TCP MechanismsTCP Mechanisms

ConnectionE

stablishmentConnectionE

stablishment three way handshakethree way handshake

SYN, SYNSYN, SYN--ACK, ACK ACK, ACK

connection determined by source andconnection determined by source anddestination sockets (host, port)destination sockets (host, port)

can only have a single connectioncan only have a single connection

between any unique pairs of portsbetween any unique pairs of ports but one port can connect to multiplebut one port can connect to multiple

different destinations (different ports)different destinations (different ports)

Page 38: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 38/57

TCP MechanismsTCP Mechanisms

Data Transfer Data Transfer  data transfer a logical stream of octetsdata transfer a logical stream of octets

octets numbered modulo 2octets numbered modulo 22323

flow control uses credit allocation of number of flow control uses credit allocation of number of 

octetsoctets data buffered at transmitter and receiver data buffered at transmitter and receiver 

sent when transport entity readysent when transport entity ready

unless PUSH flag used to force sendunless PUSH flag used to force send

can flag data as URGENT, sent immediatelycan flag data as URGENT, sent immediately

if receive data not for current connection, RSTif receive data not for current connection, RSTflag is set on next segment to reset connectionflag is set on next segment to reset connection

Page 39: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 39/57

TCP MechanismsTCP Mechanisms

Connection TerminationConnection Termination graceful closegraceful close

TCP user issues CLOSE primitiveTCP user issues CLOSE primitive

transport entity sets FIN flag on last segment senttransport entity sets FIN flag on last segment sent

with last of datawith last of data

abrupt termination by ABORT primitiveabrupt termination by ABORT primitive

entity abandons all attempts to send or receive dataentity abandons all attempts to send or receive data

RST segment transmitted to other endRST segment transmitted to other end

Page 40: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 40/57

TCP Implementation OptionsTCP Implementation Options

TCP standard precisely specifies protocolTCP standard precisely specifies protocol

have some implementation policy options:have some implementation policy options:

sendsend

deliver deliver 

acceptaccept

retransmitretransmit

acknowledgeacknowledge implementations may choose alternativeimplementations may choose alternative

options which may impact performanceoptions which may impact performance

Page 41: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 41/57

Send PolicySend Policy

if no push or close TCP entity transmits atif no push or close TCP entity transmits at

its own convenience in credit allocationits own convenience in credit allocation

data buffered in transmit buffer data buffered in transmit buffer may construct segment per batch of datamay construct segment per batch of data

from user from user 

quick response but higher overheadsquick response but higher overheadsmay wait for certain amount of datamay wait for certain amount of data

slower response but lower overheadsslower response but lower overheads

Page 42: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 42/57

Deliver PolicyDeliver Policy

in absence of push, can deliver data atin absence of push, can deliver data at

own convenienceown convenience

may deliver from each segment receivedmay deliver from each segment received higher O/S overheads but more responsivehigher O/S overheads but more responsive

may buffer data from multiple segmentsmay buffer data from multiple segments

less O/S overheads but slower less O/S overheads but slower 

Page 43: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 43/57

Accept PolicyAccept Policy

segments may arrive out of order segments may arrive out of order 

in order in order 

only accept segments in order only accept segments in order  discard out of order segmentsdiscard out of order segments

simple implementation, but burdens networksimple implementation, but burdens network

in windowsin windows accept all segments within receive windowaccept all segments within receive window

reduce transmissionsreduce transmissions

more complex implementation with bufferingmore complex implementation with buffering

Page 44: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 44/57

Retransmit PolicyRetransmit Policy

TCP has a queue of segments transmittedTCP has a queue of segments transmittedbut not acknowledgedbut not acknowledged

will retransmit if not ACKed in given timewill retransmit if not ACKed in given time

first onlyfirst only -- single timer, send one segment onlysingle timer, send one segment onlywhen timer expires, efficient, has delayswhen timer expires, efficient, has delays

batchbatch -- single timer, send all segments whensingle timer, send all segments whentimer expires, has unnecessary transmissionstimer expires, has unnecessary transmissions

individualindividual -- timer for each segment, complextimer for each segment, complex

effectivenesseffectiveness depends in part on receiver¶sdepends in part on receiver¶saccept policyaccept policy

Page 45: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 45/57

Page 46: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 46/57

Congestion ControlCongestion Control

flow control also used for congestionflow control also used for congestioncontrolcontrol

recognize increased transit times & droppedrecognize increased transit times & dropped

packetspackets react by reducing flow of datareact by reducing flow of data

RFC¶s 1122 & 2581 detail extensionsRFC¶s 1122 & 2581 detail extensions

Tahoe, Reno & NewReno implementationsTahoe, Reno & NewReno implementations two categories of extensions:two categories of extensions:

retransmission timer managementretransmission timer management

window managementwindow management

Page 47: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 47/57

Retransmission Timer Retransmission Timer 

ManagementManagement

static timer likely too long or too shortstatic timer likely too long or too short

estimate round trip delay by observing pattern of estimate round trip delay by observing pattern of delay for recent segmentsdelay for recent segments

set time to value a bit greater than estimateset time to value a bit greater than estimate simple average over a number of segmentssimple average over a number of segments

exponential average using time series (RFC793)exponential average using time series (RFC793)

RTT Variance Estimation (Jacobson¶s algorithm)RTT Variance Estimation (Jacobson¶s algorithm)

Page 48: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 48/57

Use of Use of 

ExponentialExponentialAveragingAveraging

Page 49: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 49/57

Page 50: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 50/57

Exponential RTO Backoff Exponential RTO Backoff 

timeout probably due to congestiontimeout probably due to congestion

dropped packet or long round trip timedropped packet or long round trip time

hence maintaining RTO is not good ideahence maintaining RTO is not good idea better to increase RTO each time abetter to increase RTO each time a

segment issegment is

rere--transmittedtransmitted

RTO = q*RTORTO = q*RTO

commonly q=2 (binary exponential backoff)commonly q=2 (binary exponential backoff)

as in ethernet CSMA/CDas in ethernet CSMA/CD

Page 51: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 51/57

Karn¶s AlgorithmKarn¶s Algorithm

if segment is reif segment is re--transmitted, ACK may be for:transmitted, ACK may be for:

first copy of the segment (longer RTT than expected)first copy of the segment (longer RTT than expected)

second copysecond copy

no way to tellno way to tell

don¶t measure RTT for redon¶t measure RTT for re--transmitted segmentstransmitted segments

calculate backoff when recalculate backoff when re--transmission occurstransmission occurs

use backoff RTO until ACK arrives for segmentuse backoff RTO until ACK arrives for segmentthat has not been rethat has not been re--transmittedtransmitted

Page 52: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 52/57

Window ManagementWindow Management

slow startslow start

larger windows cause problem on connection createdlarger windows cause problem on connection created

at start limit TCP to 1 segmentat start limit TCP to 1 segment

increase when data ACK, exponential growthincrease when data ACK, exponential growth

dynamic windows sizing on congestiondynamic windows sizing on congestion

when a timeout occurs perhaps due to congestionwhen a timeout occurs perhaps due to congestion

set slow start threshold to half current congestionset slow start threshold to half current congestion

windowwindow

set window to 1 and slow start until thresholdset window to 1 and slow start until threshold

beyond threshold, increase window by 1 for each RTTbeyond threshold, increase window by 1 for each RTT

Page 53: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 53/57

Window ManagementWindow Management

Page 54: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 54/57

Fast RetransmitFast Retransmit

Fast RecoveryFast Recovery

retransmit timer rather longer than RTTretransmit timer rather longer than RTT

if segment lost TCP slow to retransmitif segment lost TCP slow to retransmit

fast retransmitfast retransmit if receive 4 ACKs for same segment thenif receive 4 ACKs for same segment then

immediately retransmit since likely lostimmediately retransmit since likely lost

fast recoveryfast recovery

lost segment means some congestionlost segment means some congestion halve window then increase linearlyhalve window then increase linearly

avoids slowavoids slow--startstart

Page 55: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 55/57

User Datagram ProtocolUser Datagram Protocol

(UDP)(UDP) connectionless service for application levelconnectionless service for application level

procedures specified in RFC 768procedures specified in RFC 768 unreliableunreliable

delivery & duplication control not guaranteeddelivery & duplication control not guaranteed reduced overheadreduced overhead

least common denominator serviceleast common denominator service

uses:uses: inward data collectioninward data collection outward data disseminationoutward data dissemination

requestrequest--responseresponse

real time applicationreal time application

Page 56: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 56/57

UDP Header UDP Header 

Page 57: 20-TransportProtocols

8/6/2019 20-TransportProtocols

http://slidepdf.com/reader/full/20-transportprotocols 57/57

SummarySummary

connectionconnection--oriented network and transportoriented network and transport

mechanisms and servicesmechanisms and services

TCP services, mechanisms, policiesTCP services, mechanisms, policies TCP congestion controlTCP congestion control

UDPUDP