SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Transmission Control
Protocol (TCP)
T S Pradeep Kumar
VIT Chennai
http://www.nsnam.com
TCP Introduction
• Process to Process communication like UDP
• Stream Delivery service (Stream of Packets)
• Uses buffers at sending and receiving
• Segments
• Full Duplex
• Connection Oriented
• Reliable
TCP
TCP with Pseudo Headers
Control Field - TCP
Connection Establishment
• Three Way handshaking
• passive open, active open
• Data Transfer
• Connection Termination
• Connection Reset
• deny (, abort (abnormal, use RST) , terminate (idle for
long time, Use RST)
TCP
• A SYN segment cannot carry data, but consumes one
sequence number
• A SYN +ACK segment cannot carry data, but
consumes one sequence number.
• An ACK segment, if carrying no data, consumes no
sequence number.
Three way handshaking
Data Transfer
Connection Termination
Windows in TCP
• send window
• receive window
Send window
Window in TCP
• rwnd = buffer size - number of waiting bytes to be
pulled
• send window will open, close and shrink
• receive window will never shrink
Flow Control
• Opening and closing of windows
• Send window
• closes if the receiver tells (when ack comes)
• opens move the right wall to right (based on rwnd)
• on some occasions it shrinks
• receive window
• closes (left wall moves to right) when more bytes arrive
• opens (right wall moves to right) when bytes consumed by process
Flow control
Error Control
• error control for
• detecting and resending corrupted segments
• resending lost segments
• storing out of order segments
• detecting and discarding duplicated segments.
• Error control achieved by
• checksum
• acknowledgement
• Time out
Checksum
• Each segment carries a checksum value.
• If a segment is corrupted as deleted by an invalid
checksum, the segment is discarded and considered
as lost.
Acknowledgement
• Control and data segments consumes a sequence
number, so they will be acknowledged
• but ACK segments do not consume sequence
numbers and they are not acknowledged
• Types of acknowledgement
• cumulative (ACK)
• selective (SACK)
Acknowledgement
• Cumulative (ACK)
• sends the ack with a segment to be received
• ignoring all the out of order or lost segments
• Selective ack (SACK)
• cumulative ack + additional information to the sender
• reports the block of data that are out of order, duplicated
segments.
• usually this is implemented in the options field of the TCP headers.
ACK
• Retransmission of segments
• The segments are stored until the ACK is sent
• a segment is retransmited
• if three duplicate ACKs are received for the first segment
• retransmission timer expires
• Out of Order Segments
• they are never discarded but stored temporarily until the missing
segments arrive
• but they are never delivered to the process
Fast retransmit
Receive window
Congestion Control
• There are two windows
• rwnd (receiver window)
• cwnd (congestion window)
• congestion window is the window in the network
• Sender window = minimum (rwnd, cwnd)
• sender will reduce the window size based on the
receiver and network window size.
Congestion Control
• Slow start
• exponential increase till the threshold is reached
• then congestion avoidance, if congestion is
detected, goes back to slow start or congestion
avoidance
• Congestion avoidance
• congestion detection
Slow Start Threshold
• Starts the congestion window size with Maximum Segment Size
(1)
• Increase exponentially, for each ACK, the cwnd is increased by 1.
• When it reaches the threshold, the phase changes to congestion
avoidance (additive increase of cwnd).
• If multiple segments are acknowledge accumulatively, the MSS
increases to 1 and not 3. But still the growth is exponential, but
not in powers of 2
Slow Start Threshold
Congestion Avoidance
• Additive increase of window size
• when whole window of segments, the size of the
congestion is increase by one
• This phase will go on until congestion is detected.
• Once congestion is detected, the system goes back to
ssthrehold or congestion avoidance based on the
severity of the congestion.
congestion avoidance
Congestion Detection
• Multiplicative Decrease
• Sender understands the congestion, only when there
is a need to retransmit a segment
• RTO timer expires (Severe congestion)
• Three duplicate ACKs (Mild congestion)
Congestion detection
• If a time-out occurs, there is a stronger possibility of
congestion; a segment has probably been dropped in
the network and there is no news about the following
sent segments. In this case TCP reacts strongly:
• It sets the value of the threshold to half of the
current window size.
• It reduces cwnd back to one segment
• It starts the slow start phase again.
Congestion Detection
• If three duplicate ACKs are received, there is a weaker possibility
of congestion; a segment may have been dropped but some
segments after that have arrived safely since three duplicate
ACKs are received. This is called fast transmission and fast
recovery. In this case, TCP has a weaker reaction as shown
below:
• It sets the value of the threshold to half of the current window
size.
• It sets cwnd to the value of the threshold (some
implementations add three segment sizes to the threshold).
• It starts the congestion avoidance phase.
Congestion control policy
Tcp Timers
• Timers
• Retransmission
• Persistence
• Keepalive
• TIME WAIT
Retransmission Timers
• To retransmit lost segments, TCP employs one retransmission timer (for
the whole connection period) that handles the retransmission time-out
(RTO), the waiting time for a acknowledgment of a segment.
• When TCP sends the segment in front of the sending queue, it starts
the timer.
• When the timer expires, TCP resends the first segment in front of the
queue, and restarts the timer.
• When a segment (or segments) are cumulatively acknowledged, the
segment (or segments) are purged from the queue.
• If the queue is empty, TCP stops the timer; otherwise, TCP restarts the
timer.
Persistence Timer
• This timer is started when a size zero window is received by
the sender.
• Once a size zero window received, persistence timer is
started and the sending node sends a special segment
called a probe (1byte data which consumes a sequence
number but this probe will never be acknowledged)
• The probe causes the receiving TCP to resend the
acknowledgment.
• This process will go on until the non zero window size is
received by the sender.
Keepalive Timer
• This timer is to prevent a long idle connection between two TCPs
• If a client is crashed after it opens a Tcp connection, the connection is
open forever.
• So a server is running with a keepalive timer
• Each time the server hears from a client, it resets this timer.
• The time-out is usually 2 hours.
• If the server does not hear from the client after 2 hours, it sends a
probe segment. If there is no response after 10 probes, each of which
is 75 s apart, it assumes that the client is down and terminates the
connection.
TIME WAIT Timer
• Timer is used during connection termination
• When the FIN segment is received, the client sends an
ACK segment and goes to the TIME-WAIT state and
sets a timer for a time-out value of twice the maximum
segment lifetime (MSL).

Weitere ähnliche Inhalte

Was ist angesagt?

TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
Application Layer and Protocols
Application Layer and ProtocolsApplication Layer and Protocols
Application Layer and ProtocolsRubal Sagwal
 
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocolsBE Smârt
 
Flow control and error control
Flow control and error controlFlow control and error control
Flow control and error controlBHUVIJAYAVELU
 
Asychronous transfer mode(atm)
Asychronous transfer mode(atm)Asychronous transfer mode(atm)
Asychronous transfer mode(atm)Meenakshi Devi
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion controlAbdo sayed
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcpsamarai_apoc
 
TCP congestion control
TCP congestion controlTCP congestion control
TCP congestion controlShubham Jain
 
Computer network switches & their structures
Computer network switches & their structuresComputer network switches & their structures
Computer network switches & their structuresSweta Kumari Barnwal
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSDr. SELVAGANESAN S
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control ProtocolPeter R. Egli
 

Was ist angesagt? (20)

RTP & RTCP
RTP & RTCPRTP & RTCP
RTP & RTCP
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Ieee 802.11 wireless lan
Ieee 802.11 wireless lanIeee 802.11 wireless lan
Ieee 802.11 wireless lan
 
Application Layer and Protocols
Application Layer and ProtocolsApplication Layer and Protocols
Application Layer and Protocols
 
07 coms 525 tcpip - udp
07    coms 525 tcpip - udp07    coms 525 tcpip - udp
07 coms 525 tcpip - udp
 
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocols
 
Flow control and error control
Flow control and error controlFlow control and error control
Flow control and error control
 
Asychronous transfer mode(atm)
Asychronous transfer mode(atm)Asychronous transfer mode(atm)
Asychronous transfer mode(atm)
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion control
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
TCP congestion control
TCP congestion controlTCP congestion control
TCP congestion control
 
HIGH SPEED NETWORKS
HIGH SPEED NETWORKSHIGH SPEED NETWORKS
HIGH SPEED NETWORKS
 
smds
smdssmds
smds
 
Icmp
IcmpIcmp
Icmp
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Computer network switches & their structures
Computer network switches & their structuresComputer network switches & their structures
Computer network switches & their structures
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
RTP.ppt
RTP.pptRTP.ppt
RTP.ppt
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 

Andere mochten auch

Virtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonVirtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonPradeep Kumar TS
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded ComputingPradeep Kumar TS
 
Functions of osi layer in computer networks
Functions of osi layer in computer networksFunctions of osi layer in computer networks
Functions of osi layer in computer networksPradeep Kumar TS
 
IEEE 802 Standard for Computer Networks
IEEE 802 Standard for Computer NetworksIEEE 802 Standard for Computer Networks
IEEE 802 Standard for Computer NetworksPradeep Kumar TS
 
Lecture 3,4 operating systems
Lecture 3,4   operating systemsLecture 3,4   operating systems
Lecture 3,4 operating systemsPradeep Kumar TS
 
Lecture 1 introduction to operating systems
Lecture 1  introduction to operating systemsLecture 1  introduction to operating systems
Lecture 1 introduction to operating systemsPradeep Kumar TS
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab FileKandarp Tiwari
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationPradeep Kumar TS
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1Pradeep Kumar TS
 

Andere mochten auch (20)

Virtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue ButtonVirtual classrooms and labs using Big Blue Button
Virtual classrooms and labs using Big Blue Button
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded Computing
 
Tracing and awk in ns2
Tracing and awk in ns2Tracing and awk in ns2
Tracing and awk in ns2
 
OSI Layers
OSI Layers OSI Layers
OSI Layers
 
Functions of osi layer in computer networks
Functions of osi layer in computer networksFunctions of osi layer in computer networks
Functions of osi layer in computer networks
 
IEEE 802 Standard for Computer Networks
IEEE 802 Standard for Computer NetworksIEEE 802 Standard for Computer Networks
IEEE 802 Standard for Computer Networks
 
Lecture 7 cpu scheduling
Lecture 7   cpu schedulingLecture 7   cpu scheduling
Lecture 7 cpu scheduling
 
Lecture 3,4 operating systems
Lecture 3,4   operating systemsLecture 3,4   operating systems
Lecture 3,4 operating systems
 
Cs problem [repaired]
Cs problem [repaired]Cs problem [repaired]
Cs problem [repaired]
 
Lecture 1 introduction to operating systems
Lecture 1  introduction to operating systemsLecture 1  introduction to operating systems
Lecture 1 introduction to operating systems
 
Hardware7
Hardware7Hardware7
Hardware7
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1
 
Lecture 5 process concept
Lecture 5   process conceptLecture 5   process concept
Lecture 5 process concept
 
Operating System fo IoT
Operating System fo IoTOperating System fo IoT
Operating System fo IoT
 
Ch24
Ch24Ch24
Ch24
 
TCPIP
TCPIPTCPIP
TCPIP
 
Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)
 

Ähnlich wie Introduction to TCP

Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit ivJAIGANESH SEKAR
 
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxtcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxGOKULKANNANMMECLECTC
 
congestion control data communication.pdf
congestion control data communication.pdfcongestion control data communication.pdf
congestion control data communication.pdfnqck82120b
 
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfNetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfoptokunal1
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion AvoidanceRam Dutt Shukla
 
TCP timers in transport layer .pptx
TCP timers in  transport layer     .pptxTCP timers in  transport layer     .pptx
TCP timers in transport layer .pptxanair23
 
Tcp Reliability Flow Control
Tcp Reliability Flow ControlTcp Reliability Flow Control
Tcp Reliability Flow ControlRam Dutt Shukla
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................SwatiHans10
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPDilum Bandara
 
Data link layer elementry protocols
Data link layer elementry protocolsData link layer elementry protocols
Data link layer elementry protocolssabitha sairam
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasIOSR Journals
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasIOSR Journals
 

Ähnlich wie Introduction to TCP (20)

6610-l14.pptx
6610-l14.pptx6610-l14.pptx
6610-l14.pptx
 
Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit iv
 
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptxtcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
tcpflowcontrolanurag-150513130509-lva1-app6892 (1).pptx
 
congestion control data communication.pdf
congestion control data communication.pdfcongestion control data communication.pdf
congestion control data communication.pdf
 
Working of TCP
Working of TCP Working of TCP
Working of TCP
 
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfNetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
TCP timers in transport layer .pptx
TCP timers in  transport layer     .pptxTCP timers in  transport layer     .pptx
TCP timers in transport layer .pptx
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
Transport layer
Transport layerTransport layer
Transport layer
 
Mobile comn.pptx
Mobile comn.pptxMobile comn.pptx
Mobile comn.pptx
 
Tieu luan qo s
Tieu luan qo sTieu luan qo s
Tieu luan qo s
 
Tcp Reliability Flow Control
Tcp Reliability Flow ControlTcp Reliability Flow Control
Tcp Reliability Flow Control
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Data link layer elementry protocols
Data link layer elementry protocolsData link layer elementry protocols
Data link layer elementry protocols
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
 

Mehr von Pradeep Kumar TS

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and FootprintPradeep Kumar TS
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)Pradeep Kumar TS
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesPradeep Kumar TS
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingPradeep Kumar TS
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication ProtocolsPradeep Kumar TS
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksPradeep Kumar TS
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2Pradeep Kumar TS
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2Pradeep Kumar TS
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Pradeep Kumar TS
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2Pradeep Kumar TS
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3Pradeep Kumar TS
 
Evaluation in higher education
Evaluation in higher educationEvaluation in higher education
Evaluation in higher educationPradeep Kumar TS
 

Mehr von Pradeep Kumar TS (20)

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and Footprint
 
Open book Examination
Open book ExaminationOpen book Examination
Open book Examination
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of Graduates
 
Protothreads
ProtothreadsProtothreads
Protothreads
 
6LoWPAN
6LoWPAN 6LoWPAN
6LoWPAN
 
Software Defined Networks
Software Defined NetworksSoftware Defined Networks
Software Defined Networks
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper setting
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication Protocols
 
IoT Applications
IoT ApplicationsIoT Applications
IoT Applications
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy Networks
 
Mannasim for NS2
Mannasim for NS2Mannasim for NS2
Mannasim for NS2
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3
 
Evaluation in higher education
Evaluation in higher educationEvaluation in higher education
Evaluation in higher education
 

Kürzlich hochgeladen

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 

Kürzlich hochgeladen (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 

Introduction to TCP

  • 1. Transmission Control Protocol (TCP) T S Pradeep Kumar VIT Chennai http://www.nsnam.com
  • 2. TCP Introduction • Process to Process communication like UDP • Stream Delivery service (Stream of Packets) • Uses buffers at sending and receiving • Segments • Full Duplex • Connection Oriented • Reliable
  • 3. TCP
  • 4. TCP with Pseudo Headers
  • 6. Connection Establishment • Three Way handshaking • passive open, active open • Data Transfer • Connection Termination • Connection Reset • deny (, abort (abnormal, use RST) , terminate (idle for long time, Use RST)
  • 7. TCP • A SYN segment cannot carry data, but consumes one sequence number • A SYN +ACK segment cannot carry data, but consumes one sequence number. • An ACK segment, if carrying no data, consumes no sequence number.
  • 11. Windows in TCP • send window • receive window
  • 13. Window in TCP • rwnd = buffer size - number of waiting bytes to be pulled • send window will open, close and shrink • receive window will never shrink
  • 14. Flow Control • Opening and closing of windows • Send window • closes if the receiver tells (when ack comes) • opens move the right wall to right (based on rwnd) • on some occasions it shrinks • receive window • closes (left wall moves to right) when more bytes arrive • opens (right wall moves to right) when bytes consumed by process
  • 16.
  • 17. Error Control • error control for • detecting and resending corrupted segments • resending lost segments • storing out of order segments • detecting and discarding duplicated segments. • Error control achieved by • checksum • acknowledgement • Time out
  • 18. Checksum • Each segment carries a checksum value. • If a segment is corrupted as deleted by an invalid checksum, the segment is discarded and considered as lost.
  • 19. Acknowledgement • Control and data segments consumes a sequence number, so they will be acknowledged • but ACK segments do not consume sequence numbers and they are not acknowledged • Types of acknowledgement • cumulative (ACK) • selective (SACK)
  • 20. Acknowledgement • Cumulative (ACK) • sends the ack with a segment to be received • ignoring all the out of order or lost segments • Selective ack (SACK) • cumulative ack + additional information to the sender • reports the block of data that are out of order, duplicated segments. • usually this is implemented in the options field of the TCP headers.
  • 21. ACK • Retransmission of segments • The segments are stored until the ACK is sent • a segment is retransmited • if three duplicate ACKs are received for the first segment • retransmission timer expires • Out of Order Segments • they are never discarded but stored temporarily until the missing segments arrive • but they are never delivered to the process
  • 24. Congestion Control • There are two windows • rwnd (receiver window) • cwnd (congestion window) • congestion window is the window in the network • Sender window = minimum (rwnd, cwnd) • sender will reduce the window size based on the receiver and network window size.
  • 25. Congestion Control • Slow start • exponential increase till the threshold is reached • then congestion avoidance, if congestion is detected, goes back to slow start or congestion avoidance • Congestion avoidance • congestion detection
  • 26. Slow Start Threshold • Starts the congestion window size with Maximum Segment Size (1) • Increase exponentially, for each ACK, the cwnd is increased by 1. • When it reaches the threshold, the phase changes to congestion avoidance (additive increase of cwnd). • If multiple segments are acknowledge accumulatively, the MSS increases to 1 and not 3. But still the growth is exponential, but not in powers of 2
  • 28. Congestion Avoidance • Additive increase of window size • when whole window of segments, the size of the congestion is increase by one • This phase will go on until congestion is detected. • Once congestion is detected, the system goes back to ssthrehold or congestion avoidance based on the severity of the congestion.
  • 30. Congestion Detection • Multiplicative Decrease • Sender understands the congestion, only when there is a need to retransmit a segment • RTO timer expires (Severe congestion) • Three duplicate ACKs (Mild congestion)
  • 31. Congestion detection • If a time-out occurs, there is a stronger possibility of congestion; a segment has probably been dropped in the network and there is no news about the following sent segments. In this case TCP reacts strongly: • It sets the value of the threshold to half of the current window size. • It reduces cwnd back to one segment • It starts the slow start phase again.
  • 32. Congestion Detection • If three duplicate ACKs are received, there is a weaker possibility of congestion; a segment may have been dropped but some segments after that have arrived safely since three duplicate ACKs are received. This is called fast transmission and fast recovery. In this case, TCP has a weaker reaction as shown below: • It sets the value of the threshold to half of the current window size. • It sets cwnd to the value of the threshold (some implementations add three segment sizes to the threshold). • It starts the congestion avoidance phase.
  • 34. Tcp Timers • Timers • Retransmission • Persistence • Keepalive • TIME WAIT
  • 35. Retransmission Timers • To retransmit lost segments, TCP employs one retransmission timer (for the whole connection period) that handles the retransmission time-out (RTO), the waiting time for a acknowledgment of a segment. • When TCP sends the segment in front of the sending queue, it starts the timer. • When the timer expires, TCP resends the first segment in front of the queue, and restarts the timer. • When a segment (or segments) are cumulatively acknowledged, the segment (or segments) are purged from the queue. • If the queue is empty, TCP stops the timer; otherwise, TCP restarts the timer.
  • 36. Persistence Timer • This timer is started when a size zero window is received by the sender. • Once a size zero window received, persistence timer is started and the sending node sends a special segment called a probe (1byte data which consumes a sequence number but this probe will never be acknowledged) • The probe causes the receiving TCP to resend the acknowledgment. • This process will go on until the non zero window size is received by the sender.
  • 37. Keepalive Timer • This timer is to prevent a long idle connection between two TCPs • If a client is crashed after it opens a Tcp connection, the connection is open forever. • So a server is running with a keepalive timer • Each time the server hears from a client, it resets this timer. • The time-out is usually 2 hours. • If the server does not hear from the client after 2 hours, it sends a probe segment. If there is no response after 10 probes, each of which is 75 s apart, it assumes that the client is down and terminates the connection.
  • 38. TIME WAIT Timer • Timer is used during connection termination • When the FIN segment is received, the client sends an ACK segment and goes to the TIME-WAIT state and sets a timer for a time-out value of twice the maximum segment lifetime (MSL).