DOC PREVIEW
WMU CS 5550 - Lecture Notes

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion controlTCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) init’ssender, receiver state before data exchange flow controlled: sender will not overwhelm receiver point-to-point: one sender, one receiver reliable, in-order, byte steam: no “message boundaries” pipelined: TCP congestion and flow control set window size send & receive bufferssocketdoorTCPsend bufferTCPreceive buffersocketdoorsegmentapplicationwrites dataapplicationreads dataTCP segment structuresource port #dest port #32 bitsapplicationdata (variable length)sequence numberacknowledgement numberReceive windowUrg data pnterchecksumFSRPAUheadlennotusedOptions (variable length)URG: urgent data (generally not used)ACK: ACK #validPSH: push data now(generally not used)RST, SYN, FIN:connection estab(setup, teardowncommands)# bytes rcvr willingto acceptcountingby bytes of data(not segments!)Internetchecksum(as in UDP)TCP seq. #’s and ACKsSeq. #’s: byte stream “number” of first byte in segment’s dataACKs: seq # of next byte expected from other side cumulative ACKQ: how receiver handles out-of-order segments A: TCP spec doesn’t say, - up to implementorHost AHost BSeq=42, ACK=79, data = ‘C’Seq=79, ACK=43, data = ‘C’Seq=43, ACK=80Usertypes‘C’host ACKsreceipt of echoed‘C’host ACKsreceipt of‘C’, echoesback ‘C’timesimple telnet scenarioTCP Round Trip Time and TimeoutQ: how to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions too long: slow reaction to segment lossQ: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT “smoother” average several recent measurements, not just current SampleRTTTCP Round Trip Time and TimeoutEstimatedRTT = (1- α)*EstimatedRTT + α*SampleRTT Exponential weighted moving average influence of past sample decreases exponentially fast typical value: α = 0.125Example RTT estimation:RTT: gaia.cs.umass.edu to fantasia.eurecom.fr1001502002503003501 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106time (seconnds)RTT (milliseconds)SampleRTT Estimated RTTTCP Round Trip Time and TimeoutSetting the timeout EstimtedRTT plus “safety margin” large variation in EstimatedRTT -> larger safety margin first estimate of how much SampleRTT deviates from EstimatedRTT: TimeoutInterval = EstimatedRTT + 4*DevRTTDevRTT = (1-β)*DevRTT +β*|SampleRTT-EstimatedRTT|(typically, β = 0.25)Then set timeout interval:Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion controlTCP reliable data transfer TCP creates rdtservice on top of IP’s unreliable service Pipelined segments Cumulative acks TCP uses single retransmission timer Retransmissions are triggered by: timeout events duplicate acks Initially consider simplified TCP sender: ignore duplicate acks ignore flow control, congestion controlTCP sender events:data rcvd from app: Create segment with seq # seq # is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unackedsegment) expiration interval: TimeOutIntervaltimeout: retransmit segment that caused timeout restart timerAck rcvd: If acknowledges previously unackedsegments update what is known to be acked start timer if there are outstanding segmentsTCP Sender (simplified)NextSeqNum = InitialSeqNumSendBase = InitialSeqNumloop (forever) {switch(event)event: data received from application above create TCP segment with sequence number NextSeqNumif (timer currently not running)start timerpass segment to IP NextSeqNum = NextSeqNum + length(data) event: timer timeoutretransmit not-yet-acknowledged segment with smallest sequence numberstart timerevent: ACK received, with ACK field value of y if (y > SendBase) { SendBase = yif (there are currently not-yet-acknowledged segments)start timer } } /* end of loop forever */TCP: retransmission scenariosHost ASeq=100, 20 bytes dataACK=100timepremature timeoutHost BSeq=92, 8 bytes dataACK=120Seq=92, 8 bytes dataSeq=92 timeoutACK=120Host ASeq=92, 8 bytes dataACK=100losstimeoutlost ACK scenarioHost BXSeq=92, 8 bytes dataACK=100timeSeq=92 timeoutSendBase= 100SendBase= 120SendBase= 120Sendbase= 100TCP retransmission scenarios (more)Host ASeq=92, 8 bytes dataACK=100losstimeoutCumulative ACK scenarioHost BXSeq=100, 20 bytes dataACK=120timeSendBase= 120TCP ACK generation [RFC 1122, RFC 2581]Event at ReceiverArrival of in-order segment withexpected seq #. All data up toexpected seq # already ACKedArrival of in-order segment withexpected seq #. One other segment has ACK pendingArrival of out-of-order segmenthigher-than-expect seq. # .Gap detectedArrival of segment that partially or completely fills gapTCP Receiver actionDelayed ACK. Wait up to 500msfor next segment. If no next segment,send ACKImmediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byteImmediate send ACK, provided thatsegment starts at lower end of gapFast Retransmit Time-out period often relatively long: long delay before resending lost packet Detect lost segments via duplicate ACKs. Sender often sends many segments back-to-back If segment is lost, there will likely be many duplicate ACKs. If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before timer expiresevent: ACK received, with ACK field value of y if (y > SendBase) { SendBase = yif


View Full Document

WMU CS 5550 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?