Movatterモバイル変換


[0]ホーム

URL:


Uploaded byjoshvenky04
PPTX, PDF10 views

computer networks tcp road map from kurose

computer netwoks

Embed presentation

Download to read offline
Chapter 3: roadmap Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP• segment structure• reliable data transfer• flow control• connection management Principles of congestion control TCP congestion controlTransport Layer: 3-1
TCP: overview RFCs: 793,1122, 2018, 5681, 7323 cumulative ACKs pipelining:• TCP congestion and flow controlset window size connection-oriented:• handshaking (exchange of controlmessages) initializes sender,receiver state before data exchange flow controlled:• sender will not overwhelm receiver point-to-point:• one sender, one receiver reliable, in-order bytestream:• no “message boundaries" full duplex data:• bi-directional data flow insame connection• MSS: maximum segment sizeTransport Layer: 3-2
TCP segment structuresource port # dest port #32 bitsnotused receive window flow control: # bytesreceiver willing to acceptsequence numbersegment seq #: countingbytes of data into bytestream(not segments!)applicationdata(variable length)data sent byapplication intoTCP socketAacknowledgement numberACK: seq # of next expectedbyte; A bit: this is an ACKoptions (variablelength)TCP optionsheadlenlength (of TCP header)checksumInternet checksumRST, SYN, FIN: connectionmanagementFSRUrg data pointerPUC EC, E: congestion notificationTransport Layer: 3-3RST: reset the connectionSyn: Synchronize the sequence numberFIN: Finish the connection
4The 4-bit header length field:•This specifies the length of the TCP header in 32-bit words•The TCP header can be of variable length due to the TCP options field•Typically, the options field is empty, so that the length of the typical TCP header is 20bytes- The flag field: contains 6 bits•The ACK bit is used to indicate that the value carried in the acknowledgment field isvalid, that is, the segment contains an acknowledgment for a segment that has beensuccessfully received•The RST, SYN, and FIN bits are used for connection setup and teardown•Other flags are typically not used
5Sequence Numbers and ACK Numbers- As discussed earlier for RDT protocols, the sequence number and ACK number arerequired for ensuring reliability- But, TCP interprets the sequence and ACK numbers differently from our earlystudy of RDT protocols- In RDT protocols discussed earlier, the sequence and ACK numbers areinterpreted to be the index of the data packet and the index of the data packetbeing acknowledged, respectively- But, TCP views the application data as an unstructured but ordered stream ofbytes rather than as a sequence of data packets- TCP’s use of sequence numbers reflects this view•That is the TCP sequence numbers are over the stream of transmitted bytes and notover the series of transmitted segments
6Thus the sequence number for a segment is therefore the byte-stream number of thefirst byte in the segment;for example•Suppose that the data stream consists of a file consisting of 500,000 bytes, that the MSS is1,000 bytes, and that the first byte of the data stream is numbered 0•Then, TCP constructs 500 segments out of the data stream•The first segment gets assigned sequence number 0, the second segment gets assignedsequence number 1,000, the third segment gets assigned sequence number 2,000, and soon•Each sequence number is inserted in the sequence number field in the header of theappropriate TCP segment
7TCP is full-duplex, so that Host A may be receiving data from Host B while it sends data to Host B (as partof the same TCP connection).Host B to Host AEach of the segments that arrive from Host B has a sequence number for the data flowing from B to A.The acknowledgment number that Host A puts in its segment is the sequence number of the next byteHost A is expecting from Host B.Suppose that Host A has received all bytes numbered 0 through 535 from B and suppose that it is aboutto send a segment to Host B. Host A is waiting for byte 536 and all the subsequent bytes in Host B’s datastream. So Host A puts 536 in the acknowledgment number field of the segment it sends to B..
8
9Host B to Host Asuppose that Host A has received one segment from Host B containing bytes 0 through 535 and anothersegment containing bytes 900 through 1,000.For some reason Host A has not yet received bytes 536 through 899.In this example, Host A is still waiting for byte 536 (and beyond) in order to re-create B’s data stream.Thus, A’s next segment to B will contain 536 in the acknowledgment number field.Because TCP only acknowledges bytes up to the first missing byte in the stream, TCP is said to providecumulative acknowledgments.
10Urgent DataFor example, if the segment sequence number is 15000 and the value of the urgent pointer is 200, thefirst byte of urgent data is the byte 15000 and the last byte is the byte 15200. The rest of the bytes in thesegment (if present) are non-urgent.
TCP sequence numbers, ACKshost ACKs receiptof echoed ‘C’host ACKs receipt of‘C’,echoes back ‘C’simple telnet scenarioHost BHost AUser types‘C’Seq=42, ACK=79, data = ‘C’Seq=79, ACK=43, data = ‘C’Seq=43, ACK=80Transport Layer: 3-11Telnet (short for "telecommunications network") is aclient/server application protocol that provides access to virtualterminals of remote systems on local area networks or theInternet.
12suppose the starting sequence numbers are 42 and 79 for the client and server, respectively.Recall that the sequence number of a segment is the sequence number of the first byte in the data field. Thus,the first segment sent from the client will have sequence number 42; the first segment sent from the server willhave sequence number 79.Recall that the acknowledgment number is the sequence number of the next byte of data that the host iswaiting for. After the TCP connection is established but before any data is sent, the client is waiting for byte 79and the server is waiting for byte 42.
TCP round trip time, timeoutQ: how to set TCP timeoutvalue? longer than RTT, but RTT varies! too short: premature timeout,unnecessary retransmissions too long: slow reaction tosegment lossQ: how to estimate RTT? SampleRTT:measured timefrom segment transmission untilACK receipt• ignore retransmissions SampleRTT will vary, wantestimated RTT “smoother”• average several recentmeasurements, not just currentSampleRTTTransport Layer: 3-13the SampleRTT values will fluctuate from segment to segment dueto congestion in the routers and to the varying load on the end systems
TCP round trip time, timeoutEstimatedRTT = (1- )*EstimatedRTT + *SampleRTT exponential weighted moving average (EWMA) influence of past sample decreases exponentially fast typical value:  = 0.125RTT: 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 RTTRTT(milliseconds)RTT: gaia.cs.umass.edu to fantasia.eurecom.frsampleRTTEstimatedRTTtime(seconds) Transport Layer: 3-14
TCP sequence numbers, ACKsSequence numbers:• byte stream “number” offirst byte in segment’s datasource port # dest port #sequence numberacknowledgement numberchecksumrwndurg pointeroutgoing segment from receiverAsentACKedsent, not-yet ACKed(“in-flight”)usablebut notyet sentnotusablewindow sizeNsender sequence number spacesource port # dest port #sequence numberacknowledgement numberchecksumrwndurg pointeroutgoing segment from senderAcknowledgements:• seq # of next byte expectedfrom other side• cumulative ACKTransport Layer: 3-15
TCP round trip time, timeout timeout interval: EstimatedRTT plus “safety margin”• large variation in EstimatedRTT: want a larger safety marginTimeoutInterval = EstimatedRTT + 4*DevRTTestimated RTT “safety margin”DevRTT = (1-)*DevRTT + *|SampleRTT-EstimatedRTT|(typically,  = 0.25) DevRTT: EWMA of SampleRTT deviation from EstimatedRTT:Transport Layer: 3-16
17
18TCP maintains a single timer and sets the timeout value asTimeoutInterval = EstimatedRTT + 4 *DevRTTThink of the timer as being associated with the oldest unacknowledged segmentAn initial TimeoutInterval value of 1 second is recommended when the connection is established; assoon as a segment is received and EstimatedRTT is updated, the TimeoutInterval is computed using theformula aboveWhen a timeout occurs, the value of TimeoutInterval is doubled to avoid a premature timeout occurringfor a subsequent segment; as soon as a segment is received and EstimatedRTT is updated, theTimeoutInterval is computed using the formula aboveSimilarly, if application layer data is received but no timer is already running (this could happen, forexample, when the application did not generate data for a sufficiently long time) then theTimeoutInterval is computed using the formula above
19A Simplified TCP Sender (uses only timeouts to recover fromlost segments)- There are three major events related to data transmissionand retransmission in the simplified TCP sender:•Data received from application above•Timer timeout•ACK receipt
20- Data received from above• TCP receives data from the application, encapsulates the data ina segment, and passes the segment to IP• Each segment includes a sequence number that is the byte-stream number of the first data byte in the segment• If the timer is already not running for some other segment, TCPstarts the timer when the segment is passed to IP and sets theTimeoutInterval to a value that is calculated from EstimatedRTTand DevRTT- TimeoutTCP retransmits only the oldest unacknowledged segment andthen restarts the timer
21Arrival of an ACK (i.e., a segment containing the ACK bit set)• TCP compares the ACK value y with its variable SendBase• The TCP state variable SendBase is the sequence number ofthe oldest unacknowledged byte• Thus SendBase - 1 is the sequence number of the last byte thatis known to have been received correctly and in order at thereceiver• Since TCP uses cumulative acknowledgments, y acknowledgesthe receipt of all bytes before byte number y• If y > SendBase, then the ACK is acknowledging one or morepreviously unacknowledged segments; then the senderupdates its SendBase variable; it also restarts the timer if thereare any not-yet-acknowledged segments
22
23
24
TCP fast retransmitHost BHost AtimeoutACK=100ACK=100ACK=100ACK=100XSeq=92, 8 bytes of dataSeq=100, 20 bytes ofdataSeq=100, 20 bytes of dataReceipt of three duplicate ACKsindicates 3 segments receivedafter a missing segment – lostsegment is likely. So retransmit!if sender receives 3 additionalACKs for same data (“tripleduplicate ACKs”), resend unACKedsegment with smallest seq # likely that unACKed segment lost,so don’t wait for timeoutTCP fast retransmitTransport Layer: 3-25
26Mid Term exam portion till this slide
27Is TCP like Go-Back-N or Selective-Repeat?• TCP’s error-recovery mechanism is probably bestcategorized as a hybrid of GBN and SR protocols• - Features like Go-Back-N• TCP acknowledgments are cumulative and correctlyreceived but out-of-order segments are not individuallyACKed by the receiver• TCP sender need only maintain the smallest sequencenumber of a transmitted but unacknowledged byte(SendBase) and the sequence number of the next byte tobe sent (NextSeqNum)
28Book 2
29Isn=initial sequencenumber
30Book 2
31Book 2
32
33Features like Selective-Repeat• Many TCP implementations buffer correctly received butout-of-order segments• TCP retransmits only one segment when a timeout occursor triple-duplicate ACKs are recived, unlike Go-Back-N thatretransmits all outstanding segments• A proposed modification to TCP, the so-called selectiveacknowledgment [RFC 2018], allows a TCP receiver toacknowledge out-of-order segments selectively rather thanjust cumulatively acknowledging the last correctly received,in-order segment
34
35
TCP 3-way handshakeSYNbit=1, Seq=xchoose init seq num, xsend TCP SYN msgESTABSYNbit=1, Seq=yACKbit=1; ACKnum=x+1choose init seq num, ysend TCP SYNACKmsg, acking SYNACKbit=1, ACKnum=y+1received SYNACK(x)indicates server is live;send ACK for SYNACK;this segment may containclient-to-server datareceived ACK(y)indicates client is liveSYNSENTESTABSYN RCVDClient stateLISTENServer stateLISTENclientSocket = socket(AF_INET, SOCK_STREAM)serverSocket = socket(AF_INET,SOCK_STREAM)serverSocket.bind((‘’,serverPort))serverSocket.listen(1)connectionSocket, addr = serverSocket.accept()clientSocket.connect((serverName,serverPort))Transport Layer: 3-36

Recommended

PPTX
3.5_TCP_video_slides_discover_rdt_protocol.pptx
PPT
KandR_TCP (1).ppt notes for congestion control
PPTX
Transport layer in OSI Layers in detail.pptx
PPTX
Week8 lec1-bscs1
PPTX
Advanced Computer Networks Containing TCP
PPTX
Transmission Control Protocol (TCP)
 
PPT
Lecture 5
 
PPTX
Week5 lec3-bscs1
PPT
TCP _
PPT
Transmission control protocol _
PDF
PPT
Transmission control protocol ...............................
PPTX
Part5-tcp-improvements.pptx
PPT
Adhoc and Sensor Networks - Chapter 07
PPT
lecturllllllllllllllllllllllllllle13.ppt
PPT
the TCP transmission control protocol
PPT
OSI Model - transport Layer protocols
PPTX
Computer networks unit iv
PPT
05Transport protocols and internet design.ppt
PPT
transport layer Explained-www.kxkks,skkqk-qw.ppt
PPTX
High Performance Networking with Advanced TCP
PPT
05Transport.ppt
PPTX
Part4-reliable-tcp.pptx
PPTX
Part4-reliable-tcp.pptx
PPTX
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
PPTX
Transport_Layer_Protocols.pptx
DOCX
transport layer
PPT
Transport ppt for students examination.ppt
PDF
Digital Electronics – Registers and Their Applications
PPTX
Plant Breeding: Its History and Contribution

More Related Content

PPTX
3.5_TCP_video_slides_discover_rdt_protocol.pptx
PPT
KandR_TCP (1).ppt notes for congestion control
PPTX
Transport layer in OSI Layers in detail.pptx
PPTX
Week8 lec1-bscs1
PPTX
Advanced Computer Networks Containing TCP
PPTX
Transmission Control Protocol (TCP)
 
PPT
Lecture 5
 
PPTX
Week5 lec3-bscs1
3.5_TCP_video_slides_discover_rdt_protocol.pptx
KandR_TCP (1).ppt notes for congestion control
Transport layer in OSI Layers in detail.pptx
Week8 lec1-bscs1
Advanced Computer Networks Containing TCP
Transmission Control Protocol (TCP)
 
Lecture 5
 
Week5 lec3-bscs1

Similar to computer networks tcp road map from kurose

PPT
TCP _
PPT
Transmission control protocol _
PDF
PPT
Transmission control protocol ...............................
PPTX
Part5-tcp-improvements.pptx
PPT
Adhoc and Sensor Networks - Chapter 07
PPT
lecturllllllllllllllllllllllllllle13.ppt
PPT
the TCP transmission control protocol
PPT
OSI Model - transport Layer protocols
PPTX
Computer networks unit iv
PPT
05Transport protocols and internet design.ppt
PPT
transport layer Explained-www.kxkks,skkqk-qw.ppt
PPTX
High Performance Networking with Advanced TCP
PPT
05Transport.ppt
PPTX
Part4-reliable-tcp.pptx
PPTX
Part4-reliable-tcp.pptx
PPTX
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
PPTX
Transport_Layer_Protocols.pptx
DOCX
transport layer
PPT
Transport ppt for students examination.ppt
TCP _
Transmission control protocol _
Transmission control protocol ...............................
Part5-tcp-improvements.pptx
Adhoc and Sensor Networks - Chapter 07
lecturllllllllllllllllllllllllllle13.ppt
the TCP transmission control protocol
OSI Model - transport Layer protocols
Computer networks unit iv
05Transport protocols and internet design.ppt
transport layer Explained-www.kxkks,skkqk-qw.ppt
High Performance Networking with Advanced TCP
05Transport.ppt
Part4-reliable-tcp.pptx
Part4-reliable-tcp.pptx
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
Transport_Layer_Protocols.pptx
transport layer
Transport ppt for students examination.ppt

Recently uploaded

PDF
Digital Electronics – Registers and Their Applications
PPTX
Plant Breeding: Its History and Contribution
PPTX
ATTENTION - PART 1.pptx cognitive processes -For B.Sc I Sem By Mrs.Shilpa Hot...
PPTX
Chapter 3. Pharmaceutical Aids (pharmaceutics)
PDF
IMPATT Diodes: Theory, Construction, Operation, and Microwave Applications"
PDF
বাংলাদেশ অর্থনৈতিক সমীক্ষা - ২০২৫ with Bookmark.pdf
PPTX
kklklklklklklklk;lkpoipor[3rjdkjoe99759893058085
PPTX
Elderly in India: The Changing Scenario.pptx
 
PDF
Risk Management and Regulatory Compliance - by Ms. Oceana Wong
PDF
AI Workflows and Workflow Rhetoric - by Ms. Oceana Wong
PDF
Multimodal and Multimedia AI - by Ms. Oceana Wong
PDF
ASRB NET 2025 Paper GENETICS AND PLANT BREEDING ARS, SMS & STODiscussion | Co...
PPTX
Prelims - History and Geography Quiz - Around the World in 80 Questions - IITK
PDF
Integrated Circuits: Lithography Techniques - Fundamentals and Advanced Metho...
PDF
Unit 1- Basics of Management Cha. of Magmt
PPTX
Masterclass on Cybercrime, Scams & Safety Hacks.pptx
PPTX
G-Protein-Coupled Receptors (GPCRs): Structure, Mechanism, and Functions
PPT
n-1-PMES-Guidelines-for-SY-2025-2026.ppt
PPTX
LYMPHATIC SYSTEM.pptx it includes lymph, lymph nodes, bone marrow, spleen
PPTX
Session 5 Overview of the PPST and Its Indicators (COI and NCOI).pptx
Digital Electronics – Registers and Their Applications
Plant Breeding: Its History and Contribution
ATTENTION - PART 1.pptx cognitive processes -For B.Sc I Sem By Mrs.Shilpa Hot...
Chapter 3. Pharmaceutical Aids (pharmaceutics)
IMPATT Diodes: Theory, Construction, Operation, and Microwave Applications"
বাংলাদেশ অর্থনৈতিক সমীক্ষা - ২০২৫ with Bookmark.pdf
kklklklklklklklk;lkpoipor[3rjdkjoe99759893058085
Elderly in India: The Changing Scenario.pptx
 
Risk Management and Regulatory Compliance - by Ms. Oceana Wong
AI Workflows and Workflow Rhetoric - by Ms. Oceana Wong
Multimodal and Multimedia AI - by Ms. Oceana Wong
ASRB NET 2025 Paper GENETICS AND PLANT BREEDING ARS, SMS & STODiscussion | Co...
Prelims - History and Geography Quiz - Around the World in 80 Questions - IITK
Integrated Circuits: Lithography Techniques - Fundamentals and Advanced Metho...
Unit 1- Basics of Management Cha. of Magmt
Masterclass on Cybercrime, Scams & Safety Hacks.pptx
G-Protein-Coupled Receptors (GPCRs): Structure, Mechanism, and Functions
n-1-PMES-Guidelines-for-SY-2025-2026.ppt
LYMPHATIC SYSTEM.pptx it includes lymph, lymph nodes, bone marrow, spleen
Session 5 Overview of the PPST and Its Indicators (COI and NCOI).pptx

computer networks tcp road map from kurose

  • 1.
    Chapter 3: roadmapTransport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP• segment structure• reliable data transfer• flow control• connection management Principles of congestion control TCP congestion controlTransport Layer: 3-1
  • 2.
    TCP: overview RFCs:793,1122, 2018, 5681, 7323 cumulative ACKs pipelining:• TCP congestion and flow controlset window size connection-oriented:• handshaking (exchange of controlmessages) initializes sender,receiver state before data exchange flow controlled:• sender will not overwhelm receiver point-to-point:• one sender, one receiver reliable, in-order bytestream:• no “message boundaries" full duplex data:• bi-directional data flow insame connection• MSS: maximum segment sizeTransport Layer: 3-2
  • 3.
    TCP segment structuresourceport # dest port #32 bitsnotused receive window flow control: # bytesreceiver willing to acceptsequence numbersegment seq #: countingbytes of data into bytestream(not segments!)applicationdata(variable length)data sent byapplication intoTCP socketAacknowledgement numberACK: seq # of next expectedbyte; A bit: this is an ACKoptions (variablelength)TCP optionsheadlenlength (of TCP header)checksumInternet checksumRST, SYN, FIN: connectionmanagementFSRUrg data pointerPUC EC, E: congestion notificationTransport Layer: 3-3RST: reset the connectionSyn: Synchronize the sequence numberFIN: Finish the connection
  • 4.
    4The 4-bit headerlength field:•This specifies the length of the TCP header in 32-bit words•The TCP header can be of variable length due to the TCP options field•Typically, the options field is empty, so that the length of the typical TCP header is 20bytes- The flag field: contains 6 bits•The ACK bit is used to indicate that the value carried in the acknowledgment field isvalid, that is, the segment contains an acknowledgment for a segment that has beensuccessfully received•The RST, SYN, and FIN bits are used for connection setup and teardown•Other flags are typically not used
  • 5.
    5Sequence Numbers andACK Numbers- As discussed earlier for RDT protocols, the sequence number and ACK number arerequired for ensuring reliability- But, TCP interprets the sequence and ACK numbers differently from our earlystudy of RDT protocols- In RDT protocols discussed earlier, the sequence and ACK numbers areinterpreted to be the index of the data packet and the index of the data packetbeing acknowledged, respectively- But, TCP views the application data as an unstructured but ordered stream ofbytes rather than as a sequence of data packets- TCP’s use of sequence numbers reflects this view•That is the TCP sequence numbers are over the stream of transmitted bytes and notover the series of transmitted segments
  • 6.
    6Thus the sequencenumber for a segment is therefore the byte-stream number of thefirst byte in the segment;for example•Suppose that the data stream consists of a file consisting of 500,000 bytes, that the MSS is1,000 bytes, and that the first byte of the data stream is numbered 0•Then, TCP constructs 500 segments out of the data stream•The first segment gets assigned sequence number 0, the second segment gets assignedsequence number 1,000, the third segment gets assigned sequence number 2,000, and soon•Each sequence number is inserted in the sequence number field in the header of theappropriate TCP segment
  • 7.
    7TCP is full-duplex,so that Host A may be receiving data from Host B while it sends data to Host B (as partof the same TCP connection).Host B to Host AEach of the segments that arrive from Host B has a sequence number for the data flowing from B to A.The acknowledgment number that Host A puts in its segment is the sequence number of the next byteHost A is expecting from Host B.Suppose that Host A has received all bytes numbered 0 through 535 from B and suppose that it is aboutto send a segment to Host B. Host A is waiting for byte 536 and all the subsequent bytes in Host B’s datastream. So Host A puts 536 in the acknowledgment number field of the segment it sends to B..
  • 8.
  • 9.
    9Host B toHost Asuppose that Host A has received one segment from Host B containing bytes 0 through 535 and anothersegment containing bytes 900 through 1,000.For some reason Host A has not yet received bytes 536 through 899.In this example, Host A is still waiting for byte 536 (and beyond) in order to re-create B’s data stream.Thus, A’s next segment to B will contain 536 in the acknowledgment number field.Because TCP only acknowledges bytes up to the first missing byte in the stream, TCP is said to providecumulative acknowledgments.
  • 10.
    10Urgent DataFor example,if the segment sequence number is 15000 and the value of the urgent pointer is 200, thefirst byte of urgent data is the byte 15000 and the last byte is the byte 15200. The rest of the bytes in thesegment (if present) are non-urgent.
  • 11.
    TCP sequence numbers,ACKshost ACKs receiptof echoed ‘C’host ACKs receipt of‘C’,echoes back ‘C’simple telnet scenarioHost BHost AUser types‘C’Seq=42, ACK=79, data = ‘C’Seq=79, ACK=43, data = ‘C’Seq=43, ACK=80Transport Layer: 3-11Telnet (short for "telecommunications network") is aclient/server application protocol that provides access to virtualterminals of remote systems on local area networks or theInternet.
  • 12.
    12suppose the startingsequence numbers are 42 and 79 for the client and server, respectively.Recall that the sequence number of a segment is the sequence number of the first byte in the data field. Thus,the first segment sent from the client will have sequence number 42; the first segment sent from the server willhave sequence number 79.Recall that the acknowledgment number is the sequence number of the next byte of data that the host iswaiting for. After the TCP connection is established but before any data is sent, the client is waiting for byte 79and the server is waiting for byte 42.
  • 13.
    TCP round triptime, timeoutQ: how to set TCP timeoutvalue? longer than RTT, but RTT varies! too short: premature timeout,unnecessary retransmissions too long: slow reaction tosegment lossQ: how to estimate RTT? SampleRTT:measured timefrom segment transmission untilACK receipt• ignore retransmissions SampleRTT will vary, wantestimated RTT “smoother”• average several recentmeasurements, not just currentSampleRTTTransport Layer: 3-13the SampleRTT values will fluctuate from segment to segment dueto congestion in the routers and to the varying load on the end systems
  • 14.
    TCP round triptime, timeoutEstimatedRTT = (1- )*EstimatedRTT + *SampleRTT exponential weighted moving average (EWMA) influence of past sample decreases exponentially fast typical value:  = 0.125RTT: 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 RTTRTT(milliseconds)RTT: gaia.cs.umass.edu to fantasia.eurecom.frsampleRTTEstimatedRTTtime(seconds) Transport Layer: 3-14
  • 15.
    TCP sequence numbers,ACKsSequence numbers:• byte stream “number” offirst byte in segment’s datasource port # dest port #sequence numberacknowledgement numberchecksumrwndurg pointeroutgoing segment from receiverAsentACKedsent, not-yet ACKed(“in-flight”)usablebut notyet sentnotusablewindow sizeNsender sequence number spacesource port # dest port #sequence numberacknowledgement numberchecksumrwndurg pointeroutgoing segment from senderAcknowledgements:• seq # of next byte expectedfrom other side• cumulative ACKTransport Layer: 3-15
  • 16.
    TCP round triptime, timeout timeout interval: EstimatedRTT plus “safety margin”• large variation in EstimatedRTT: want a larger safety marginTimeoutInterval = EstimatedRTT + 4*DevRTTestimated RTT “safety margin”DevRTT = (1-)*DevRTT + *|SampleRTT-EstimatedRTT|(typically,  = 0.25) DevRTT: EWMA of SampleRTT deviation from EstimatedRTT:Transport Layer: 3-16
  • 17.
  • 18.
    18TCP maintains asingle timer and sets the timeout value asTimeoutInterval = EstimatedRTT + 4 *DevRTTThink of the timer as being associated with the oldest unacknowledged segmentAn initial TimeoutInterval value of 1 second is recommended when the connection is established; assoon as a segment is received and EstimatedRTT is updated, the TimeoutInterval is computed using theformula aboveWhen a timeout occurs, the value of TimeoutInterval is doubled to avoid a premature timeout occurringfor a subsequent segment; as soon as a segment is received and EstimatedRTT is updated, theTimeoutInterval is computed using the formula aboveSimilarly, if application layer data is received but no timer is already running (this could happen, forexample, when the application did not generate data for a sufficiently long time) then theTimeoutInterval is computed using the formula above
  • 19.
    19A Simplified TCPSender (uses only timeouts to recover fromlost segments)- There are three major events related to data transmissionand retransmission in the simplified TCP sender:•Data received from application above•Timer timeout•ACK receipt
  • 20.
    20- Data receivedfrom above• TCP receives data from the application, encapsulates the data ina segment, and passes the segment to IP• Each segment includes a sequence number that is the byte-stream number of the first data byte in the segment• If the timer is already not running for some other segment, TCPstarts the timer when the segment is passed to IP and sets theTimeoutInterval to a value that is calculated from EstimatedRTTand DevRTT- TimeoutTCP retransmits only the oldest unacknowledged segment andthen restarts the timer
  • 21.
    21Arrival of anACK (i.e., a segment containing the ACK bit set)• TCP compares the ACK value y with its variable SendBase• The TCP state variable SendBase is the sequence number ofthe oldest unacknowledged byte• Thus SendBase - 1 is the sequence number of the last byte thatis known to have been received correctly and in order at thereceiver• Since TCP uses cumulative acknowledgments, y acknowledgesthe receipt of all bytes before byte number y• If y > SendBase, then the ACK is acknowledging one or morepreviously unacknowledged segments; then the senderupdates its SendBase variable; it also restarts the timer if thereare any not-yet-acknowledged segments
  • 22.
  • 23.
  • 24.
  • 25.
    TCP fast retransmitHostBHost AtimeoutACK=100ACK=100ACK=100ACK=100XSeq=92, 8 bytes of dataSeq=100, 20 bytes ofdataSeq=100, 20 bytes of dataReceipt of three duplicate ACKsindicates 3 segments receivedafter a missing segment – lostsegment is likely. So retransmit!if sender receives 3 additionalACKs for same data (“tripleduplicate ACKs”), resend unACKedsegment with smallest seq # likely that unACKed segment lost,so don’t wait for timeoutTCP fast retransmitTransport Layer: 3-25
  • 26.
    26Mid Term examportion till this slide
  • 27.
    27Is TCP likeGo-Back-N or Selective-Repeat?• TCP’s error-recovery mechanism is probably bestcategorized as a hybrid of GBN and SR protocols• - Features like Go-Back-N• TCP acknowledgments are cumulative and correctlyreceived but out-of-order segments are not individuallyACKed by the receiver• TCP sender need only maintain the smallest sequencenumber of a transmitted but unacknowledged byte(SendBase) and the sequence number of the next byte tobe sent (NextSeqNum)
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
    33Features like Selective-Repeat•Many TCP implementations buffer correctly received butout-of-order segments• TCP retransmits only one segment when a timeout occursor triple-duplicate ACKs are recived, unlike Go-Back-N thatretransmits all outstanding segments• A proposed modification to TCP, the so-called selectiveacknowledgment [RFC 2018], allows a TCP receiver toacknowledge out-of-order segments selectively rather thanjust cumulatively acknowledging the last correctly received,in-order segment
  • 34.
  • 35.
  • 36.
    TCP 3-way handshakeSYNbit=1,Seq=xchoose init seq num, xsend TCP SYN msgESTABSYNbit=1, Seq=yACKbit=1; ACKnum=x+1choose init seq num, ysend TCP SYNACKmsg, acking SYNACKbit=1, ACKnum=y+1received SYNACK(x)indicates server is live;send ACK for SYNACK;this segment may containclient-to-server datareceived ACK(y)indicates client is liveSYNSENTESTABSYN RCVDClient stateLISTENServer stateLISTENclientSocket = socket(AF_INET, SOCK_STREAM)serverSocket = socket(AF_INET,SOCK_STREAM)serverSocket.bind((‘’,serverPort))serverSocket.listen(1)connectionSocket, addr = serverSocket.accept()clientSocket.connect((serverName,serverPort))Transport Layer: 3-36

Editor's Notes

  • #2 TCP (Transmission Control Protocol) is a stream-oriented protocol, meaning it treats data as a continuous flow rather than discrete messages. This means there are no inherent message boundaries in TCP.
  • #11 Telnet, defined in RFC 854, is a popular application-layer protocol used for remotelogin. It runs over TCP and is designed to work between any pair of hosts. The key thing to note here is that the ACK number (43) on the B-to-A segment is one more than the sequence number (42) on the A-to-B segment that triggered that ACKSimilarly, the ACK number (80) on the last A-to-B segment is one more than the sequence number (79) on the B-to-A segment that triggered that ACK
  • #14 This is how TCP re-computes the estimated RTT each time a new SampleRTT is taken.The process is knows as an exponentially weighted moving average, shown by the equation here.<say it>Where alpha reflects the influence of the most recent measurements on the estimated RTT; a typical value of alpha used in implementations is .125The graph at the bottom show measured RTTs between a host in the Massachusetts and a host in France, as well as the estimated, “smoothed” RTT
  • #16 Given this value of the estimated RTT, TCP computes the timeout interval to be the estimated RTT plus a “safety margin” And the intuition is that if we are seeing a large variation in SAMPLERTT – the RTT estimates are fluctuating a lot - then we’ll want a larger safety marginSo TCP computes the Timeout interval to be the Estimated RTT plus 4 times a measure of deviation in the RTT.The deviation in the RTT is computed as the eWMA of the difference between the most recently measured SampleRTT from the Estimated RTT
  • #25 Let’s wrap up our study of TCP reliability by discussing an optimization to the original TCP known as TCP fast retransmit,Take a look at this example on the right where 5 segments are transmitted and the second segment is lost. In this case the TCP receiver sends an ACK 100 acknowledging the first received segment.When the third segment arrives at the receiver, the TCP receiver sends another ACK 100 since the second segment has not arrived. And similarly for the 4th and 5th segments to arrive.Now what does the sender see? The sender receives the first ACK 100 it has been hoping for, but then three additional duplicate ACK100s arrive. The sender knows that somethings’ wrong – it knows the first segment arrived at the receiver but three later arriving segments at the receiver – the ones that generated the three duplicate ACKs – we received correctly but were not in order. That is, that there was a missing segment at the receiver when each of the three duplicate ACK were generated.With fast retransmit, the arrival of three duplicate ACK causes the sender to retransmit its oldest unACKed segment, without waiting for a timeout event. This allows TCP to recover more quickly from what is very likely a loss eventspecifically that the second segment has been lost, since three higher -numbered segments were received
  • #36 TCP’s three way handshake, that operates as follows Let’s say the client and server both create a TCP socket as we learned about in Chapter 2 and enter the LISTEN stateThe client then connects to the server sending a SYN message with a sequence number x (SYN Message is an TCP Segment with SYN but set in the header – you might want to go back and review the TCP segment format!)The server is waiting for a connection, and receives the SYN message enters the SYN received state (NOT the established state and sends a SYN ACK message back.Finally the client sends an ACK message to the server, and when the server receiver this enters the Established state. This is when the application process would see the return from the wait on the socket accept() call

[8]ページ先頭

©2009-2025 Movatter.jp