SlideShare a Scribd company logo
1 of 33
Presented By
Anurag Jagetiya
Astt. Prof.
MLV Textile & Engineering College, Bhilwara
Anurag Jagetiya 1
TCP: Flow Control
• Introduction
• Flow Control in TCP
• Sliding Window
– Introduction
– Terminology
– Flow Control Through Sliding Window
• Problems with TCP transmission
– Delay ACK
– Silly Window Syndrome
– Solutions to Silly Window Syndrome
• TCP Error Control
– Checksum
– Ack
– Retransmission
• References
Outline
Anurag Jagetiya 2
TCP: Flow Control
• Flow Control balances the Sender’s rate (lightly
loaded) of sending data with the Receiver’s rate
(heavily loaded) of properly receiving data.
• Otherwise:
– Receiver will lost the data  Sender has to
retransmit the data  unnecessarily Consume
resources  Cost increases  Performance
decreases  User Frustration…
Introduction
Anurag Jagetiya 3
TCP: Flow Control
• Sender can not overrun receiver with lots of information.
• Allows receiver to restrict transmission until it has
sufficient buffer space to accommodate more data
• Flow control in TCP is similar to Data Link layer’s Go
Back N and Selective Repeat in following manners:
.
Flow Control in TCP
Data Link Layer
Protocol
Similarities with TCP Flow Control
Go Back N It does not use NAK
Selective Repeat Holds out of order segments until missing one
arrives
Anurag Jagetiya 4
TCP: Flow Control
• But, there are differences as well in flow control mechanism
of TCP and Data Link layer
• TCP uses Sliding Window to handle flow control.
Contd…
Anurag Jagetiya 5
TCP: Flow Control
TCP Flow Control Data Link Flow Control
Byte oriented Uses Frames
TCP sliding window is of variable
size
Fixed Size window
• Introduction
– All packets inside the window can be transmitted.
– When an acknowledgment for packet 1 is received
the window slides to the right and allows the
transmission of packet 9
Sliding Window in TCP
Anurag Jagetiya 6
TCP: Flow Control
1 2 3 4 5 6 7 8 9 10
Window
Figure 1: SlidingWindow
• Conceptually partitions the window into three
classes:
– Sent and acknowledged [left side, out side the window]
– Being Transmitted [inside the window]
– Waiting to be transmitted [right side, out side the window]
Contd..
Anurag Jagetiya 7
TCP: Flow Control
Figure 2: SlidingWindow Representation
• Only unacknowledged packets are retransmitted
– TCP keeps separate timer for each packet.
• Performance:
– Depends on the window size and the speed of the
underlying network.
– Increase window size so that sender is transmitting
packets as fast as the network can carry them.
– Eliminates network idle time.
Contd…
Anurag Jagetiya 8
TCP: Flow Control
Terminology used in Sliding Window:
– Imaginary window with two walls: Left and right
– The window can perform three activities namely:
– Opening, Closing, and Shrinking
Contd…
Anurag Jagetiya 9
TCP: Flow Control
NOTE: These activities are controlled by the Receiver and depend
on the congestion in the Network
Figure 3: SlidingWindow terminology
• Opening a window
– Moving the right wall to the right
– Allows more new bytes in the buffer that are eligible for
sending
• Closing a window
– Moving left wall to right
– Some bytes have been acknowledged
• Shrinking a window
– Moving right wall to left.
– Removing eligibility of some packets.
– [Warning: Strongly discouraged and not allowed in some
implementation ]
Contd…
Anurag Jagetiya 10
TCP: Flow Control
NOTE: Left wall cannot move to left, as this will revoke some of
previously sent Acknowledges (ACKs)
• Sliding window takes the help of two other windows
namely:
– Receiver window (rwnd)
– Congestion window (cwnd)
• Receiver window (rwnd)
– Value advertised by the opposite end in a segment
containing ACK.
– It is number of Bytes which can be accepted by the other
end before its buffer overflows.
Contd…
Anurag Jagetiya 11
TCP: Flow Control
• Congestion window (cwnd)
– Value determined by the Network (MTU) to avoid
congestion.
• The size of sliding window at one end is determined
by the lesser of two values:
i.e. Window_Size = Min (rwnd, cwnd)
• TCP window can be open/ close by the receiver. But
should not shrunk.
Contd…
Anurag Jagetiya 12
TCP: Flow Control
• Each window can vary in size over time
– Each ACK contains a window advisement
– Specifies how many additional Bytes of data the receiver
is willing to accept
– Sender increases or decreases sending window sized
based on the receiver’s advise
• Provides end-to-end flow control while Data link layer
provides
Flow Control through Sliding Window
Anurag Jagetiya 13
TCP: Flow Control
NOTE: In reality the window size is thousands of Bytes
Example of Flow Control
Anurag Jagetiya 14
TCP: Flow Control
In this
example, It is
assumed that
there is only
unidirectional
communicatio
n between
client and
server
Figure 4:
Flow Control [1]
• Sender will send the data based upon Receiver’s
Advertized Window Size (Free space in Buffer)
• If, this Window is Zero, sender will not send data.
And, what if Receiver’s advertisements are getting
lost??-------------Deadlock
• Sender may send a One byte segment to make the
receiver re-announce its next byte expected and
window size
Problems with TCP Transmission
Anurag Jagetiya 15
TCP: Flow Control
• Sending data in very small segments.
– E.g. Telnet connection to an interactive editor that reacts
to every key-stroke
– Worst Case: When a single character is arrived at TCP,
TCP creates a 21 Bytes segment and further, IP creates 41
Bytes Datagram…..
– Receiver, on the other hand, acknowledge by 40 Bytes
ACK. --------------------Wastage of scarce Band width
– Solution:
• Delay Acknowledgement and window advertisement
Contd…
Anurag Jagetiya 16
TCP: Flow Control
•The receiver waits until there is decent amount of
space in its incoming buffer before acknowledging
the arrived segments
•The delayed acknowledgement can be piggyback
on the returning data
• Reduces traffic
•Disadvantage: it may force the sender to
retransmit the unacknowledged segments
•To balance: should not be delayed by more than
500ms
Delayed Acknowledgement
Anurag Jagetiya 17
TCP: Flow Control
• Sending application program creates data slowly or
the receiving application program consumes data
slowly, or both. (e.g. 1 byte at a time)
• Server application asks client to create data slowly
if it goes continue, window size goes smaller and
smaller.
• At a time, it becomes smaller than its header size,
Making data transmission extremely inefficient.
Silly Window Syndrome
Anurag Jagetiya 18
TCP: Flow Control
• In the given figure:
• The receiving TCP announces a window size of 1 byte.
• The sending TCP sends only 1 byte.
Contd…
Anurag Jagetiya 19
TCP: Flow Control
Figure 5: Receiver’s Silly
Window [2]
• Clark’s Solution: For receiving application
– Do not send a window update of 1 byte until there is
enough space to accommodate a segment of max. size
or until half of the buffer is empty.
• Nagle’s Solution: For sending application
– When data come into sender one byte at a time.
– Send first byte and buffer all the rest until the outgoing
byte is acknowledged.
Solution to Silly Window Syndrome
Anurag Jagetiya 20
TCP: Flow Control
GOAL: Sender should not send small segment and the
receiver not ask for them
• Alternative method
– Receiving TCP will buffer data, and it can BLOCK a
READ request from application until it has large chunk
of data.
– This will reduce number of calls to TCP and Overhead.
– Trade-Off: Response time will also increase
– Acceptable in Non-Interactive applications like: file
transfer.
Anurag Jagetiya 21
TCP: Flow Control
• NET-SEAL
[Teaching Computer NETwork Through
Simulation Experiment and Animation Library]
Simulation of TCP Flow Control
Anurag Jagetiya 22
TCP: Flow Control
• TCP is reliable so it will deliver entire stream to the
destination without error/ loss/ duplicity.
• TCP error control provides mechanism for detecting
corrupted/ lost/ out of order and duplicate segment.
• Error detection and correction in TCP is achieved
through:
– Checksum
– Acknowledgement (ACK)
– Time out
Error Control in TCP
Anurag Jagetiya 23
TCP: Flow Control
• Checksum is used to find out whether the segments are
corrupted or not.
• TCP uses 16 bit checksum: Mandatory in every segment.
• E.g. 8 bit checksum
Checksum
Anurag Jagetiya 24
TCP: Flow Control
Calculating Checksum Verifying Checksum
Sum
Checksum
10101001
00111001
-----------
11100010
00011101 Sum
Complement
10101001
00111001
00011101
-----------
11111111
0000000
• TCP uses ACK to confirm receipt of data segments.
• Control segments that carry no data but consume a
sequence number are also Acknowledged.
• An ACK do not consume sequence number and it is
never Acknowledged.
Acknowledgement (ACK)
Anurag Jagetiya 25
TCP: Flow Control
• When a segment is corrupted, lost, or delayed, it is
retransmitted.
• TCP maintains a Retransmission Timer for each
connection
– The timer is started during a transmission. A timeout
causes a retransmission.
Retransmission
Anurag Jagetiya 26
TCP: Flow Control
Q: How to set this time out value for the RetransmissionTimer?
• Round Trip Time measurement
– The RTT is based on time difference between segment
transmission and ACK.
– But, TCP does not ACK each segment Each connection
has only one timer.
Retransmission (Contd…)
Anurag Jagetiya 27
TCP: Flow Control
Segment 1
Segment 4
ACK for Segment 1
Segment 2
Segment 3
ACK for Segment 2 + 3
Segment 5
ACK for Segment 4
ACK for Segment 5
RTT
#1
RTT
#2
RTT
#3
Figure 6: RTT [1]
• The setting of the retransmission timer is crucial for
efficiency
– Timeout value too small
• Results in unnecessary retransmissions
– Timeout value too large
• long waiting time before a retransmission can be
issued
• A problem is that the delays in the network are not
fixed.
• Therefore, the retransmission timers must be
Dynamic.
Retransmission (Contd…)
Anurag Jagetiya 28
TCP: Flow Control
• Retransmission Time Out (RTO)
• If the timer of any segment is expired, that segment is
simply re sent to the destination
• Fast Retransmission:
– If Retransmission time is large, one segment is lost and
receiver received so many out of order segments
– Store out of order segments in buffer
– Worse Case: Limited Buffer Size 
– Remedy: Three duplicate ACKs rule
Retransmission (Contd…)
Anurag Jagetiya 29
TCP: Flow Control
• If three or more duplicate ACKs are received in a
row, the TCP sender believes that a segment has
been lost.
• Then TCP performs a retransmission of what seems
to be the missing segment, without waiting for a
timeout to happen.
Fast Retransmission (3 ACK Rule)
Anurag Jagetiya 30
TCP: Flow Control
Example of Fast Retransmission
Anurag Jagetiya 31
TCP: Flow Control
Figure 7: 3 ACK [1]
1. Behrouz A Forouzan, “Transport Layer”, in Data Communication and
Networking, 4th Edition, Tata McGraw Hill, Special Indian Edition, 2006.
2. Andrew S. Tanenbaum, “The Transport Layer”, in Computer Network, 4th
Edition, Prentice Hall India, 2005
3. www.Net-seal.net
References
Anurag Jagetiya 32
TCP: Flow Control
Anurag Jagetiya 33
TCP: Flow Control

More Related Content

Similar to tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx

Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................SwatiHans10
 
congestion control data communication.pdf
congestion control data communication.pdfcongestion control data communication.pdf
congestion control data communication.pdfnqck82120b
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)NYversity
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Controlsoohyunc
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxTekle12
 
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
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcpsamarai_apoc
 
Transmission control protocol
Transmission control protocolTransmission control protocol
Transmission control protocolSundra Anand
 
Studying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfStudying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfIUA
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion AvoidanceRam Dutt Shukla
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68myrajendra
 

Similar to tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx (20)

Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
congestion control data communication.pdf
congestion control data communication.pdfcongestion control data communication.pdf
congestion control data communication.pdf
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Control
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptx
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
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
 
Mcseminar
McseminarMcseminar
Mcseminar
 
Congestion control avoidance
Congestion control avoidanceCongestion control avoidance
Congestion control avoidance
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
Tieu luan qo s
Tieu luan qo sTieu luan qo s
Tieu luan qo s
 
Transmission control protocol
Transmission control protocolTransmission control protocol
Transmission control protocol
 
Studying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfStudying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdf
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
09 coms 525 tcpip - tcp 2
09   coms 525 tcpip - tcp 209   coms 525 tcpip - tcp 2
09 coms 525 tcpip - tcp 2
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 
Transport layer
Transport layerTransport layer
Transport layer
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx

  • 1. Presented By Anurag Jagetiya Astt. Prof. MLV Textile & Engineering College, Bhilwara Anurag Jagetiya 1 TCP: Flow Control
  • 2. • Introduction • Flow Control in TCP • Sliding Window – Introduction – Terminology – Flow Control Through Sliding Window • Problems with TCP transmission – Delay ACK – Silly Window Syndrome – Solutions to Silly Window Syndrome • TCP Error Control – Checksum – Ack – Retransmission • References Outline Anurag Jagetiya 2 TCP: Flow Control
  • 3. • Flow Control balances the Sender’s rate (lightly loaded) of sending data with the Receiver’s rate (heavily loaded) of properly receiving data. • Otherwise: – Receiver will lost the data  Sender has to retransmit the data  unnecessarily Consume resources  Cost increases  Performance decreases  User Frustration… Introduction Anurag Jagetiya 3 TCP: Flow Control
  • 4. • Sender can not overrun receiver with lots of information. • Allows receiver to restrict transmission until it has sufficient buffer space to accommodate more data • Flow control in TCP is similar to Data Link layer’s Go Back N and Selective Repeat in following manners: . Flow Control in TCP Data Link Layer Protocol Similarities with TCP Flow Control Go Back N It does not use NAK Selective Repeat Holds out of order segments until missing one arrives Anurag Jagetiya 4 TCP: Flow Control
  • 5. • But, there are differences as well in flow control mechanism of TCP and Data Link layer • TCP uses Sliding Window to handle flow control. Contd… Anurag Jagetiya 5 TCP: Flow Control TCP Flow Control Data Link Flow Control Byte oriented Uses Frames TCP sliding window is of variable size Fixed Size window
  • 6. • Introduction – All packets inside the window can be transmitted. – When an acknowledgment for packet 1 is received the window slides to the right and allows the transmission of packet 9 Sliding Window in TCP Anurag Jagetiya 6 TCP: Flow Control 1 2 3 4 5 6 7 8 9 10 Window Figure 1: SlidingWindow
  • 7. • Conceptually partitions the window into three classes: – Sent and acknowledged [left side, out side the window] – Being Transmitted [inside the window] – Waiting to be transmitted [right side, out side the window] Contd.. Anurag Jagetiya 7 TCP: Flow Control Figure 2: SlidingWindow Representation
  • 8. • Only unacknowledged packets are retransmitted – TCP keeps separate timer for each packet. • Performance: – Depends on the window size and the speed of the underlying network. – Increase window size so that sender is transmitting packets as fast as the network can carry them. – Eliminates network idle time. Contd… Anurag Jagetiya 8 TCP: Flow Control
  • 9. Terminology used in Sliding Window: – Imaginary window with two walls: Left and right – The window can perform three activities namely: – Opening, Closing, and Shrinking Contd… Anurag Jagetiya 9 TCP: Flow Control NOTE: These activities are controlled by the Receiver and depend on the congestion in the Network Figure 3: SlidingWindow terminology
  • 10. • Opening a window – Moving the right wall to the right – Allows more new bytes in the buffer that are eligible for sending • Closing a window – Moving left wall to right – Some bytes have been acknowledged • Shrinking a window – Moving right wall to left. – Removing eligibility of some packets. – [Warning: Strongly discouraged and not allowed in some implementation ] Contd… Anurag Jagetiya 10 TCP: Flow Control NOTE: Left wall cannot move to left, as this will revoke some of previously sent Acknowledges (ACKs)
  • 11. • Sliding window takes the help of two other windows namely: – Receiver window (rwnd) – Congestion window (cwnd) • Receiver window (rwnd) – Value advertised by the opposite end in a segment containing ACK. – It is number of Bytes which can be accepted by the other end before its buffer overflows. Contd… Anurag Jagetiya 11 TCP: Flow Control
  • 12. • Congestion window (cwnd) – Value determined by the Network (MTU) to avoid congestion. • The size of sliding window at one end is determined by the lesser of two values: i.e. Window_Size = Min (rwnd, cwnd) • TCP window can be open/ close by the receiver. But should not shrunk. Contd… Anurag Jagetiya 12 TCP: Flow Control
  • 13. • Each window can vary in size over time – Each ACK contains a window advisement – Specifies how many additional Bytes of data the receiver is willing to accept – Sender increases or decreases sending window sized based on the receiver’s advise • Provides end-to-end flow control while Data link layer provides Flow Control through Sliding Window Anurag Jagetiya 13 TCP: Flow Control NOTE: In reality the window size is thousands of Bytes
  • 14. Example of Flow Control Anurag Jagetiya 14 TCP: Flow Control In this example, It is assumed that there is only unidirectional communicatio n between client and server Figure 4: Flow Control [1]
  • 15. • Sender will send the data based upon Receiver’s Advertized Window Size (Free space in Buffer) • If, this Window is Zero, sender will not send data. And, what if Receiver’s advertisements are getting lost??-------------Deadlock • Sender may send a One byte segment to make the receiver re-announce its next byte expected and window size Problems with TCP Transmission Anurag Jagetiya 15 TCP: Flow Control
  • 16. • Sending data in very small segments. – E.g. Telnet connection to an interactive editor that reacts to every key-stroke – Worst Case: When a single character is arrived at TCP, TCP creates a 21 Bytes segment and further, IP creates 41 Bytes Datagram….. – Receiver, on the other hand, acknowledge by 40 Bytes ACK. --------------------Wastage of scarce Band width – Solution: • Delay Acknowledgement and window advertisement Contd… Anurag Jagetiya 16 TCP: Flow Control
  • 17. •The receiver waits until there is decent amount of space in its incoming buffer before acknowledging the arrived segments •The delayed acknowledgement can be piggyback on the returning data • Reduces traffic •Disadvantage: it may force the sender to retransmit the unacknowledged segments •To balance: should not be delayed by more than 500ms Delayed Acknowledgement Anurag Jagetiya 17 TCP: Flow Control
  • 18. • Sending application program creates data slowly or the receiving application program consumes data slowly, or both. (e.g. 1 byte at a time) • Server application asks client to create data slowly if it goes continue, window size goes smaller and smaller. • At a time, it becomes smaller than its header size, Making data transmission extremely inefficient. Silly Window Syndrome Anurag Jagetiya 18 TCP: Flow Control
  • 19. • In the given figure: • The receiving TCP announces a window size of 1 byte. • The sending TCP sends only 1 byte. Contd… Anurag Jagetiya 19 TCP: Flow Control Figure 5: Receiver’s Silly Window [2]
  • 20. • Clark’s Solution: For receiving application – Do not send a window update of 1 byte until there is enough space to accommodate a segment of max. size or until half of the buffer is empty. • Nagle’s Solution: For sending application – When data come into sender one byte at a time. – Send first byte and buffer all the rest until the outgoing byte is acknowledged. Solution to Silly Window Syndrome Anurag Jagetiya 20 TCP: Flow Control GOAL: Sender should not send small segment and the receiver not ask for them
  • 21. • Alternative method – Receiving TCP will buffer data, and it can BLOCK a READ request from application until it has large chunk of data. – This will reduce number of calls to TCP and Overhead. – Trade-Off: Response time will also increase – Acceptable in Non-Interactive applications like: file transfer. Anurag Jagetiya 21 TCP: Flow Control
  • 22. • NET-SEAL [Teaching Computer NETwork Through Simulation Experiment and Animation Library] Simulation of TCP Flow Control Anurag Jagetiya 22 TCP: Flow Control
  • 23. • TCP is reliable so it will deliver entire stream to the destination without error/ loss/ duplicity. • TCP error control provides mechanism for detecting corrupted/ lost/ out of order and duplicate segment. • Error detection and correction in TCP is achieved through: – Checksum – Acknowledgement (ACK) – Time out Error Control in TCP Anurag Jagetiya 23 TCP: Flow Control
  • 24. • Checksum is used to find out whether the segments are corrupted or not. • TCP uses 16 bit checksum: Mandatory in every segment. • E.g. 8 bit checksum Checksum Anurag Jagetiya 24 TCP: Flow Control Calculating Checksum Verifying Checksum Sum Checksum 10101001 00111001 ----------- 11100010 00011101 Sum Complement 10101001 00111001 00011101 ----------- 11111111 0000000
  • 25. • TCP uses ACK to confirm receipt of data segments. • Control segments that carry no data but consume a sequence number are also Acknowledged. • An ACK do not consume sequence number and it is never Acknowledged. Acknowledgement (ACK) Anurag Jagetiya 25 TCP: Flow Control
  • 26. • When a segment is corrupted, lost, or delayed, it is retransmitted. • TCP maintains a Retransmission Timer for each connection – The timer is started during a transmission. A timeout causes a retransmission. Retransmission Anurag Jagetiya 26 TCP: Flow Control Q: How to set this time out value for the RetransmissionTimer?
  • 27. • Round Trip Time measurement – The RTT is based on time difference between segment transmission and ACK. – But, TCP does not ACK each segment Each connection has only one timer. Retransmission (Contd…) Anurag Jagetiya 27 TCP: Flow Control Segment 1 Segment 4 ACK for Segment 1 Segment 2 Segment 3 ACK for Segment 2 + 3 Segment 5 ACK for Segment 4 ACK for Segment 5 RTT #1 RTT #2 RTT #3 Figure 6: RTT [1]
  • 28. • The setting of the retransmission timer is crucial for efficiency – Timeout value too small • Results in unnecessary retransmissions – Timeout value too large • long waiting time before a retransmission can be issued • A problem is that the delays in the network are not fixed. • Therefore, the retransmission timers must be Dynamic. Retransmission (Contd…) Anurag Jagetiya 28 TCP: Flow Control
  • 29. • Retransmission Time Out (RTO) • If the timer of any segment is expired, that segment is simply re sent to the destination • Fast Retransmission: – If Retransmission time is large, one segment is lost and receiver received so many out of order segments – Store out of order segments in buffer – Worse Case: Limited Buffer Size  – Remedy: Three duplicate ACKs rule Retransmission (Contd…) Anurag Jagetiya 29 TCP: Flow Control
  • 30. • If three or more duplicate ACKs are received in a row, the TCP sender believes that a segment has been lost. • Then TCP performs a retransmission of what seems to be the missing segment, without waiting for a timeout to happen. Fast Retransmission (3 ACK Rule) Anurag Jagetiya 30 TCP: Flow Control
  • 31. Example of Fast Retransmission Anurag Jagetiya 31 TCP: Flow Control Figure 7: 3 ACK [1]
  • 32. 1. Behrouz A Forouzan, “Transport Layer”, in Data Communication and Networking, 4th Edition, Tata McGraw Hill, Special Indian Edition, 2006. 2. Andrew S. Tanenbaum, “The Transport Layer”, in Computer Network, 4th Edition, Prentice Hall India, 2005 3. www.Net-seal.net References Anurag Jagetiya 32 TCP: Flow Control
  • 33. Anurag Jagetiya 33 TCP: Flow Control