SlideShare a Scribd company logo
1 of 22
TRANSPORT LAYER
DONE BY:
STEFFY
THIRD YEAR CSE -B
B.S.ABDUR RAHMAN UNIVERSITY
Contents
TCP Flow Control
• Host has a receiver buffer on each side of TCP
connection.
• Data will be placed in the receive buffer only if
the received data is correct.
• Application process running on the receiver host
will read data from this buffer.
Problem arises……
• Receiving application may be busy with
some other work.
• Data has to wait for a long time until it is read
by application process which is running on
host(receiver).
• Sender can easily overflow the receiver
buffer by sending too much of data quickly.
• To overcome this problem ,TCP provides
flow control service to its applications.
Continues….
• Flow control is a speed matching service the
rate at which sender is sending , against the rate
at the receiving application is reading.
• TCP provides flow control by having the sender
maintain a variable called the receive window.
• The receiver window is used to give the sender a
number of free buffer space is available at the
receiver.
• Since TCP is full duplex, sender at each side of
the connection will maintains a receiver
window.
File Transfer scenario
Host A Host B
TCP connection
Large file
Receiver Buffer
• Variables used in this scenario:
1.LastByteRead
2.LastByteRcvd
• Receive window is represented by RcvWindow
• RcvWindow=RcvBuffer-[LastByteRcvd-LastByteRead]
• TCP is not allow the sender to overflow the allocated receiver
buffer.
• LastByteRcvd-LastByteRead <=RcvBuffer.
• Spare room is changes with time, RcvWindow is dynamic.
How RcvWindow is used?
• Host B tells Host A no of spare room available in its
connection buffer.
• By placing the current value of RcvWindow in the
receive Window field of every segment it sends to A.
• Initially , RcvWindow=RcvBuffer
• Host A keep track of two variables:
1.LastByteSent
2.LastByteAcked
• LastByteSent - LastByteAcked=No of Unacknowledged
data
Continues….
• By keeping the unacknowledged
data value less than the value of
RcvWindow, Host A ensure that it
does not overflow the RcvBuffer at
Host B.
• LastByteSent-LastByteAcked <=
RcvWindow
TCP Connection Management
Client Server
Client- server scenario :In which process running in one host (client)
wants to connects with the process running on the other host (server).
Connection………
• Client application process informs the
client TCP that it wants to establish a
connection to a process in the server.
• Client TCP proceeds to establish a
connection with TCP in the server in the
following manner.
Establish a connection(1)
• Step 1: client TCP send a special segment to
server side TCP which does not contains
application layer data.
• SYN bit in client segment header will be set to 1.
• So , this segment is called as SYN segment.
• Client chooses an random sequence
number(client_isn) and placed this number in the
sequence number field of TCP client SYN
segment.
• This segment is encapsulated with IP datagram
and sent to the server.
Establish a connection(2)
• Step 2: Once TCP datagram arrives at server host , it extracts
the TCP SYN segment from the datagram allocates the TCP
buffers and variables to the connection and sends a
connection granted segment to the client TCP.
• This segment also contains no application data.
• It contains 3 important information:
1.SYN bit set to 1
2.Acknowledgement field of TCP segment
header is set to client_isn+1.
3.Own sequence number(server_isn)
Connection segment is also referred as SYNACK segment.
Establish a connection(3)
• Step 3: Once client receives the connection granted
segment , client also allocates buffers and variables to
the connection.
• Client sends a host a another segment which
acknowledges the server connection granted segment
by putting the server_isn+1(server sequence
number)in the acknowledgement field of the TCP
segment header.
• SYN bit is set to zero , since connection gets
established.
• In order to establish a connection, three packets are
sent between two hosts, Therefore this connection
procedure referred as three-way hand shake.
Closing a connection
• Step 1: client end system sends TCP FIN
set to 1 control segment to server
• Step 2: server receives FIN, replies with
ACK. Closes connection, sends FIN set to
1.
• Step 3: client receives FIN, replies with
ACK. Enters “timed wait” -will respond
with ACK to received FINs
• Step 4: server, receives ACK. Connection
closed.
Note: At this point ,all resources in the host
will be deallocated.
Client Life cycle
Server LifeCycle
RTT Estimation
• How to estimate RTT?
Sample RTT for a segment is the amount
of time between when the segment is sent
and when an acknowledgement for the
segment is received.
• TCP never computes a sample RTT for a
segments that has been retransmitted ; it
only computes sample RTT for a segment
that has been transmitted.
Continues ……
• Sample RTT values will be fluctuate from one
segment to segment due to congestion in routers.
• Because of this fluctuation , some RTT value may
be atypical.
• So, in order to estimate the typical RTT ,there is a
need to take a average of all sample RTT values.
• After obtaining new sampleRTT,TCP updates
EstimateRTT by
• EstimateRTT=(1- α).EstimatedRTT +
α.sampleRTT
Continues…….
• In the above formula,
1. EstimatedRTT is the weighted combinations of the
previous value of estimated RTT and the new value for
sample RTT.
2. α=0.125
Formula will be,
EstimateRTT=0.875.EstimatedRTT +
0.125.sampleRTT.
Now the EstimatedRTT is the weighted
average of the sample RTT values.
Such an average is called Exponential weighted
moving average
RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
100
150
200
250
300
350
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
RTT(milliseconds)
SampleRTT Estimated RTT
Thank you

More Related Content

What's hot

What's hot (20)

Flow Control
Flow ControlFlow Control
Flow Control
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocol
 
go back n protocol
go back n protocolgo back n protocol
go back n protocol
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocol
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010
 
6 data linkcontrol
6  data linkcontrol6  data linkcontrol
6 data linkcontrol
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error control
 
Simplex stop and_wait_protocol
Simplex stop and_wait_protocolSimplex stop and_wait_protocol
Simplex stop and_wait_protocol
 
GO BACK N PROTOCOL
GO BACK N PROTOCOLGO BACK N PROTOCOL
GO BACK N PROTOCOL
 
Ch 11
Ch 11Ch 11
Ch 11
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocol
 
Error control
Error controlError control
Error control
 
Stop And Wait ARQ
Stop And Wait ARQStop And Wait ARQ
Stop And Wait ARQ
 
Adoptive retransmission in TCP
Adoptive retransmission in TCPAdoptive retransmission in TCP
Adoptive retransmission in TCP
 
Week5 lec2-bscs1
Week5 lec2-bscs1Week5 lec2-bscs1
Week5 lec2-bscs1
 
Data link control
Data link controlData link control
Data link control
 
3a data link layer continued
3a data link layer continued3a data link layer continued
3a data link layer continued
 

Viewers also liked

Viewers also liked (14)

Quiz show
Quiz showQuiz show
Quiz show
 
Surya_Iseries_Resume
Surya_Iseries_ResumeSurya_Iseries_Resume
Surya_Iseries_Resume
 
SWISS BULLION
SWISS BULLIONSWISS BULLION
SWISS BULLION
 
Article
ArticleArticle
Article
 
1 s2.0-0022199679900175-main
1 s2.0-0022199679900175-main1 s2.0-0022199679900175-main
1 s2.0-0022199679900175-main
 
Elasticityofdemand
ElasticityofdemandElasticityofdemand
Elasticityofdemand
 
Gyasi et al, 2015b
Gyasi et al, 2015bGyasi et al, 2015b
Gyasi et al, 2015b
 
P.C.MISHRA Resume
P.C.MISHRA ResumeP.C.MISHRA Resume
P.C.MISHRA Resume
 
Kmc presentation
Kmc presentationKmc presentation
Kmc presentation
 
Chapter 13 presidency
Chapter 13 presidencyChapter 13 presidency
Chapter 13 presidency
 
HRAD_PAHTA_-_Justin_Jauk
HRAD_PAHTA_-_Justin_JaukHRAD_PAHTA_-_Justin_Jauk
HRAD_PAHTA_-_Justin_Jauk
 
Saleem Lawati CV
Saleem Lawati CVSaleem Lawati CV
Saleem Lawati CV
 
SWISSWAY 1500
SWISSWAY 1500SWISSWAY 1500
SWISSWAY 1500
 
Trane: Pasos para automatizar un hogar y oficina sin cables
Trane: Pasos para automatizar un hogar y oficina sin cables Trane: Pasos para automatizar un hogar y oficina sin cables
Trane: Pasos para automatizar un hogar y oficina sin cables
 

Similar to Flow control

Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit ivJAIGANESH SEKAR
 
Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksManimaran A
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptxpoonamsngr
 
Mobile computing-tcp data flow control
Mobile computing-tcp data flow controlMobile computing-tcp data flow control
Mobile computing-tcp data flow controlSushant Kushwaha
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overviewMy cp
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
Socket网络编程
Socket网络编程Socket网络编程
Socket网络编程qhm123
 
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxtcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxGOKULKANNANMMECLECTC
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9Waqas Ahmed Nawaz
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxNischayBahl1
 
Traffic Characterization
Traffic CharacterizationTraffic Characterization
Traffic CharacterizationIsmail Mukiibi
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptxAlmaOraevi
 
Eshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdEshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdOjas Kumar
 
Transmission control protocol
Transmission control protocolTransmission control protocol
Transmission control protocolSundra Anand
 

Similar to Flow control (20)

Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit iv
 
Working of TCP
Working of TCP Working of TCP
Working of TCP
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer Networks
 
4. tcp header.ppt
4. tcp header.ppt4. tcp header.ppt
4. tcp header.ppt
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptx
 
Mobile computing-tcp data flow control
Mobile computing-tcp data flow controlMobile computing-tcp data flow control
Mobile computing-tcp data flow control
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overview
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
Socket网络编程
Socket网络编程Socket网络编程
Socket网络编程
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxtcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
 
Traffic Characterization
Traffic CharacterizationTraffic Characterization
Traffic Characterization
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptx
 
Eshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdEshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltd
 
Olumide pidan b
Olumide pidan bOlumide pidan b
Olumide pidan b
 
Transmission control protocol
Transmission control protocolTransmission control protocol
Transmission control protocol
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 

Recently uploaded (20)

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

Flow control

  • 1. TRANSPORT LAYER DONE BY: STEFFY THIRD YEAR CSE -B B.S.ABDUR RAHMAN UNIVERSITY
  • 3. TCP Flow Control • Host has a receiver buffer on each side of TCP connection. • Data will be placed in the receive buffer only if the received data is correct. • Application process running on the receiver host will read data from this buffer.
  • 4. Problem arises…… • Receiving application may be busy with some other work. • Data has to wait for a long time until it is read by application process which is running on host(receiver). • Sender can easily overflow the receiver buffer by sending too much of data quickly. • To overcome this problem ,TCP provides flow control service to its applications.
  • 5. Continues…. • Flow control is a speed matching service the rate at which sender is sending , against the rate at the receiving application is reading. • TCP provides flow control by having the sender maintain a variable called the receive window. • The receiver window is used to give the sender a number of free buffer space is available at the receiver. • Since TCP is full duplex, sender at each side of the connection will maintains a receiver window.
  • 6. File Transfer scenario Host A Host B TCP connection Large file Receiver Buffer
  • 7. • Variables used in this scenario: 1.LastByteRead 2.LastByteRcvd • Receive window is represented by RcvWindow • RcvWindow=RcvBuffer-[LastByteRcvd-LastByteRead] • TCP is not allow the sender to overflow the allocated receiver buffer. • LastByteRcvd-LastByteRead <=RcvBuffer. • Spare room is changes with time, RcvWindow is dynamic.
  • 8. How RcvWindow is used? • Host B tells Host A no of spare room available in its connection buffer. • By placing the current value of RcvWindow in the receive Window field of every segment it sends to A. • Initially , RcvWindow=RcvBuffer • Host A keep track of two variables: 1.LastByteSent 2.LastByteAcked • LastByteSent - LastByteAcked=No of Unacknowledged data
  • 9. Continues…. • By keeping the unacknowledged data value less than the value of RcvWindow, Host A ensure that it does not overflow the RcvBuffer at Host B. • LastByteSent-LastByteAcked <= RcvWindow
  • 10. TCP Connection Management Client Server Client- server scenario :In which process running in one host (client) wants to connects with the process running on the other host (server).
  • 11. Connection……… • Client application process informs the client TCP that it wants to establish a connection to a process in the server. • Client TCP proceeds to establish a connection with TCP in the server in the following manner.
  • 12. Establish a connection(1) • Step 1: client TCP send a special segment to server side TCP which does not contains application layer data. • SYN bit in client segment header will be set to 1. • So , this segment is called as SYN segment. • Client chooses an random sequence number(client_isn) and placed this number in the sequence number field of TCP client SYN segment. • This segment is encapsulated with IP datagram and sent to the server.
  • 13. Establish a connection(2) • Step 2: Once TCP datagram arrives at server host , it extracts the TCP SYN segment from the datagram allocates the TCP buffers and variables to the connection and sends a connection granted segment to the client TCP. • This segment also contains no application data. • It contains 3 important information: 1.SYN bit set to 1 2.Acknowledgement field of TCP segment header is set to client_isn+1. 3.Own sequence number(server_isn) Connection segment is also referred as SYNACK segment.
  • 14. Establish a connection(3) • Step 3: Once client receives the connection granted segment , client also allocates buffers and variables to the connection. • Client sends a host a another segment which acknowledges the server connection granted segment by putting the server_isn+1(server sequence number)in the acknowledgement field of the TCP segment header. • SYN bit is set to zero , since connection gets established. • In order to establish a connection, three packets are sent between two hosts, Therefore this connection procedure referred as three-way hand shake.
  • 15. Closing a connection • Step 1: client end system sends TCP FIN set to 1 control segment to server • Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN set to 1. • Step 3: client receives FIN, replies with ACK. Enters “timed wait” -will respond with ACK to received FINs • Step 4: server, receives ACK. Connection closed. Note: At this point ,all resources in the host will be deallocated.
  • 18. RTT Estimation • How to estimate RTT? Sample RTT for a segment is the amount of time between when the segment is sent and when an acknowledgement for the segment is received. • TCP never computes a sample RTT for a segments that has been retransmitted ; it only computes sample RTT for a segment that has been transmitted.
  • 19. Continues …… • Sample RTT values will be fluctuate from one segment to segment due to congestion in routers. • Because of this fluctuation , some RTT value may be atypical. • So, in order to estimate the typical RTT ,there is a need to take a average of all sample RTT values. • After obtaining new sampleRTT,TCP updates EstimateRTT by • EstimateRTT=(1- α).EstimatedRTT + α.sampleRTT
  • 20. Continues……. • In the above formula, 1. EstimatedRTT is the weighted combinations of the previous value of estimated RTT and the new value for sample RTT. 2. α=0.125 Formula will be, EstimateRTT=0.875.EstimatedRTT + 0.125.sampleRTT. Now the EstimatedRTT is the weighted average of the sample RTT values. Such an average is called Exponential weighted moving average
  • 21. RTT: gaia.cs.umass.edu to fantasia.eurecom.fr 100 150 200 250 300 350 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 time (seconnds) RTT(milliseconds) SampleRTT Estimated RTT