SlideShare a Scribd company logo
1 of 31
Transmission Control Protocol
Ms.Varsha RameshKumar,S6 CSE
Varsha RameshKumar
INTRODUCTION
• TCP:Transmission Control Protocol
• TCP is a connection oriented,reliable
transport protocol that creates a virtual
connection between two TCPs to send
data.
Varsha RameshKumar
Introduction (continued)
• IP datagram service is unreliable in that
datagrams may be
– Lost (usually dropped due to congestion)
– Duplicated
– Delivered out of order
• TCP provides reliable service nevertheless
Varsha RameshKumar
Ports, Connections, and Endpoints
• TCP port numbers do not correspond to a
single object;objects are identified by
connections.
• A connection is a pair of endpoints.
• An endpoint is a pair, (host, port).
• Two connections might share one
endpoint.
Varsha RameshKumar
TCP Connections
• Virtual
• An ordered pair of endpoints
– An endpoint is an ordered pair containing
• An IP address
• A TCP port number
• This information is kept by the OS
– netstat
Varsha RameshKumar
The Transmission Control Protocol
• Very complex
– Specifies format of data and acks
– Specifies how TCP software distinguishes
among multiple destinations on a host
– How hosts recover from lost or duplicated
packets
– How hosts initiate and terminate a transfer
Varsha RameshKumar
The Transmission Control Protocol
• Does not include
– The details of interaction with an application
• Eg, sockets
• Can be used with a variety of packet
delivery systems
Varsha RameshKumar
TCP Services
• Process to process communication
• Stream Delivery service(deliver stream of
data)
• Full duplex communication(two way
communication)
• Connection oriented service(establish and
terminate connection)
• Reliable Service(ack check)
Varsha RameshKumar
TCP Features
• Numbering System
– Consists of two fields sequence number and
acknowledgement number.
– These two fields refer to byte number
– Byte number:TCP generates random number
between 0 to 2^32 -1(Eg:If 1057 is the random
number and 6000 bytes are to be sent then
bytes are numbered from 1057 to 7057)
– Sequence number:After bytes are numbered
TCP assigns a sequence number to each
segment being sent.
Varsha RameshKumar
– Acknowledgement number:The value of the
acknowledgement fields in a segment defines
the number of the next byte a party expects to
service.
• Flow control:receiver of data controls what
amount of data is to be sent by
sender(byte oriented).
• Error control:considers a segment as a
unit of data for error detection(loss or
corrupted) Varsha RameshKumar
• Congestion Control:amount of data sent Is
controlled by receiver and also congestion
in network.
Varsha RameshKumar
Flow control VS Congestion control
• Flow control involves preventing senders from
overrunning the capacity of the receivers
• Congestion control involves preventing too much
data from being injected into the network,
thereby causing switches or links to become
overloaded
Varsha RameshKumar
TCP Segment
• TCP is a byte-oriented protocol, which means
that the sender writes bytes into a TCP
connection and the receiver reads bytes out of
the TCP connection.
• Although ―byte stream‖ describes the service
TCP offers to application processes, TCP does
not, itself, transmit individual bytes over the
Internet.
Varsha RameshKumar
TCP Segment
• TCP on the source host buffers enough bytes
from the sending process to fill a reasonably
sized packet and then sends this packet to its
peer on the destination host.
• TCP on the destination host then empties the
contents of the packet into a receive buffer, and
the receiving process reads from this buffer at its
leisure.
• The packets exchanged between TCP peers are
called segments.
Varsha RameshKumar
TCP Segment
How TCP manages a byte stream.
Varsha RameshKumar
TCP Header
TCP Header Format
Varsha RameshKumar
TCP Header
• The SrcPort and DstPort fields identify the source and
destination ports, respectively.
• The Acknowledgment, SequenceNum, and
AdvertisedWindow fields are all involved in TCP’s sliding
window algorithm.
• Because TCP is a byte-oriented protocol, each byte of
data has a sequence number; the SequenceNum field
contains the sequence number for the first byte of data
carried in that segment.
• The Acknowledgment and AdvertisedWindow fields carry
information about the flow of data going in the other
direction.
Varsha RameshKumar
TCP Header
• The 6-bit Flags field is used to relay control information
between TCP peers.
• The possible flags include SYN, FIN, RESET, PUSH,
URG, and ACK.
• The SYN and FIN flags are used when establishing and
terminating a TCP connection, respectively.
• The ACK flag is set any time the Acknowledgment field
is valid, implying that the receiver should pay attention to
it.
Varsha RameshKumar
TCP Header
• The URG flag signifies that this segment contains urgent
data. When this flag is set, the UrgPtr field indicates
where the nonurgent data contained in this segment
begins.
• The urgent data is contained at the front of the segment
body, up to and including a value of UrgPtr bytes into the
segment.
• The PUSH flag signifies that the sender invoked the
push operation, which indicates to the receiving side of
TCP that it should notify the receiving process of this
fact.
Varsha RameshKumar
TCP Header
• RESET flag signifies that the receiver has become
confused, it received a segment it did not expect to
receive—and so wants to abort the connection.
• Checksum field is used in exactly the same way as for
UDP—it is computed over the TCP header, the TCP
data, and the pseudoheader, which is made up of the
source address, destination address, and length fields
from the IP header.
Varsha RameshKumar
Achieving Reliability
• A major challenge
– One computer reboots during a file transfer
– It is rebooted and a second connection is
established
– Messages from the two sessions get mixed
up
– Packets from the first session must be
rejected
Varsha RameshKumar
End-to-end Issues
• At the heart of TCP is the sliding window
algorithm
• As TCP runs over the Internet rather than a
point-to-point link, the following issues need to
be addressed by the sliding window algorithm
– TCP supports logical connections between processes
that are running on two different computers in the
Internet
– TCP connections are likely to have widely different
RTT times
– Packets may get reordered in the Internet
Varsha RameshKumar
End-to-end Issues
– TCP needs a mechanism using which each side of a
connection will learn what resources the other side is
able to apply to the connection
– TCP needs a mechanism using which the sending
side will learn the capacity of the network
Varsha RameshKumar
The Idea Behind Sliding Windows
• Stop-and-wait wastes network bandwidth
• Sliding window protocols allow the sender
to transmit multiple packets before waiting
for an acknowledgement.
Varsha RameshKumar
Connection Establishment/Termination in TCP
Timeline for three-way handshake algorithm
Varsha RameshKumar
Sliding Window Revisited
• TCP’s variant of the sliding window algorithm, which
serves several purposes:
– (1) it guarantees the reliable delivery of data,
– (2) it ensures that data is delivered in order, and
– (3) it enforces flow control between the sender and the receiver.
Varsha RameshKumar
Sliding Window Revisited
Relationship between TCP send buffer (a) and receive buffer (b).
Varsha RameshKumar
TCP Sliding Window
• Sending Side
– LastByteAcked ≤ LastByteSent
– LastByteSent ≤ LastByteWritten
• Receiving Side
– LastByteRead < NextByteExpected
– NextByteExpected ≤ LastByteRcvd + 1
Varsha RameshKumar
Positive Acknowledgement
• Suppose an acknowledgement is lost.
• A duplicate packet will be sent.
• Sequence numbers are used to allow the
destination software to reassemble a
packet.
Varsha RameshKumar
Positive Acknowledgement with
Retransmission
• Retransmission is one of many techniques
– Send packet – start timer
– Two possibilities
• Packet arrives
– Acknowledgement is sent back
– Stop timer and proceed
• Packet fails to arrive
– Timer goes off
– Resend packet and set another timer
Varsha RameshKumar
THANK YOU !
Varsha RameshKumar

More Related Content

What's hot (20)

ICMP
ICMPICMP
ICMP
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
 
QOS (Quality of Services) - Computer Networks
 QOS (Quality of Services) - Computer Networks QOS (Quality of Services) - Computer Networks
QOS (Quality of Services) - Computer Networks
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
Icmp
IcmpIcmp
Icmp
 
IPv4
IPv4IPv4
IPv4
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Network layer logical addressing
Network layer logical addressingNetwork layer logical addressing
Network layer logical addressing
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocol
 
Sctp
SctpSctp
Sctp
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Transport protocols
Transport protocolsTransport protocols
Transport protocols
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Transport layer
Transport layer Transport layer
Transport layer
 

Viewers also liked (20)

TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 
Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
UDP - User Datagram Protocol
UDP - User Datagram ProtocolUDP - User Datagram Protocol
UDP - User Datagram Protocol
 
Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)
 
TCP & UDP protocols
TCP & UDP protocols TCP & UDP protocols
TCP & UDP protocols
 
TCP Model
TCP ModelTCP Model
TCP Model
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
An overview of TCP (Transmission Control Protocol)
An overview of TCP (Transmission Control Protocol)An overview of TCP (Transmission Control Protocol)
An overview of TCP (Transmission Control Protocol)
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udp
 
TCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet ProtocolTCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet Protocol
 
TCP/IP Presentation
TCP/IP PresentationTCP/IP Presentation
TCP/IP Presentation
 
FASB and Standard Setting
FASB and Standard SettingFASB and Standard Setting
FASB and Standard Setting
 
Tcp Header
Tcp HeaderTcp Header
Tcp Header
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
Introduction to TCP
Introduction to TCPIntroduction to TCP
Introduction to TCP
 
Transmission Control Protocol
Transmission Control ProtocolTransmission Control Protocol
Transmission Control Protocol
 

Similar to Tcp

Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksManimaran A
 
Network protocols and vulnerabilities
Network protocols and vulnerabilitiesNetwork protocols and vulnerabilities
Network protocols and vulnerabilitiesG Prachi
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptxpoonamsngr
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................SwatiHans10
 
Networking essentials lect3
Networking essentials lect3Networking essentials lect3
Networking essentials lect3Roman Brovko
 
tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxAlphaKoiSylvester
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overviewMy cp
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP PresentationHarish Chand
 
CN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptxCN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptxPondinesh2
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot LayerMaulik Patel
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocolsNitesh Singh
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxNischayBahl1
 

Similar to Tcp (20)

Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer Networks
 
Network protocols and vulnerabilities
Network protocols and vulnerabilitiesNetwork protocols and vulnerabilities
Network protocols and vulnerabilities
 
Transport layer.pptx
Transport layer.pptxTransport layer.pptx
Transport layer.pptx
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptx
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Networking essentials lect3
Networking essentials lect3Networking essentials lect3
Networking essentials lect3
 
tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptx
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overview
 
TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
08 coms 525 tcpip - tcp 1
08   coms 525 tcpip - tcp 108   coms 525 tcpip - tcp 1
08 coms 525 tcpip - tcp 1
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Tcp ip presentation
Tcp ip presentationTcp ip presentation
Tcp ip presentation
 
CN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptxCN Unit 2 - cs8591.pptx
CN Unit 2 - cs8591.pptx
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
Working of TCP
Working of TCP Working of TCP
Working of TCP
 
Mod4
Mod4Mod4
Mod4
 
lecturer3.pptx
lecturer3.pptxlecturer3.pptx
lecturer3.pptx
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocols
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
 

Tcp

  • 1. Transmission Control Protocol Ms.Varsha RameshKumar,S6 CSE Varsha RameshKumar
  • 2. INTRODUCTION • TCP:Transmission Control Protocol • TCP is a connection oriented,reliable transport protocol that creates a virtual connection between two TCPs to send data. Varsha RameshKumar
  • 3. Introduction (continued) • IP datagram service is unreliable in that datagrams may be – Lost (usually dropped due to congestion) – Duplicated – Delivered out of order • TCP provides reliable service nevertheless Varsha RameshKumar
  • 4. Ports, Connections, and Endpoints • TCP port numbers do not correspond to a single object;objects are identified by connections. • A connection is a pair of endpoints. • An endpoint is a pair, (host, port). • Two connections might share one endpoint. Varsha RameshKumar
  • 5. TCP Connections • Virtual • An ordered pair of endpoints – An endpoint is an ordered pair containing • An IP address • A TCP port number • This information is kept by the OS – netstat Varsha RameshKumar
  • 6. The Transmission Control Protocol • Very complex – Specifies format of data and acks – Specifies how TCP software distinguishes among multiple destinations on a host – How hosts recover from lost or duplicated packets – How hosts initiate and terminate a transfer Varsha RameshKumar
  • 7. The Transmission Control Protocol • Does not include – The details of interaction with an application • Eg, sockets • Can be used with a variety of packet delivery systems Varsha RameshKumar
  • 8. TCP Services • Process to process communication • Stream Delivery service(deliver stream of data) • Full duplex communication(two way communication) • Connection oriented service(establish and terminate connection) • Reliable Service(ack check) Varsha RameshKumar
  • 9. TCP Features • Numbering System – Consists of two fields sequence number and acknowledgement number. – These two fields refer to byte number – Byte number:TCP generates random number between 0 to 2^32 -1(Eg:If 1057 is the random number and 6000 bytes are to be sent then bytes are numbered from 1057 to 7057) – Sequence number:After bytes are numbered TCP assigns a sequence number to each segment being sent. Varsha RameshKumar
  • 10. – Acknowledgement number:The value of the acknowledgement fields in a segment defines the number of the next byte a party expects to service. • Flow control:receiver of data controls what amount of data is to be sent by sender(byte oriented). • Error control:considers a segment as a unit of data for error detection(loss or corrupted) Varsha RameshKumar
  • 11. • Congestion Control:amount of data sent Is controlled by receiver and also congestion in network. Varsha RameshKumar
  • 12. Flow control VS Congestion control • Flow control involves preventing senders from overrunning the capacity of the receivers • Congestion control involves preventing too much data from being injected into the network, thereby causing switches or links to become overloaded Varsha RameshKumar
  • 13. TCP Segment • TCP is a byte-oriented protocol, which means that the sender writes bytes into a TCP connection and the receiver reads bytes out of the TCP connection. • Although ―byte stream‖ describes the service TCP offers to application processes, TCP does not, itself, transmit individual bytes over the Internet. Varsha RameshKumar
  • 14. TCP Segment • TCP on the source host buffers enough bytes from the sending process to fill a reasonably sized packet and then sends this packet to its peer on the destination host. • TCP on the destination host then empties the contents of the packet into a receive buffer, and the receiving process reads from this buffer at its leisure. • The packets exchanged between TCP peers are called segments. Varsha RameshKumar
  • 15. TCP Segment How TCP manages a byte stream. Varsha RameshKumar
  • 16. TCP Header TCP Header Format Varsha RameshKumar
  • 17. TCP Header • The SrcPort and DstPort fields identify the source and destination ports, respectively. • The Acknowledgment, SequenceNum, and AdvertisedWindow fields are all involved in TCP’s sliding window algorithm. • Because TCP is a byte-oriented protocol, each byte of data has a sequence number; the SequenceNum field contains the sequence number for the first byte of data carried in that segment. • The Acknowledgment and AdvertisedWindow fields carry information about the flow of data going in the other direction. Varsha RameshKumar
  • 18. TCP Header • The 6-bit Flags field is used to relay control information between TCP peers. • The possible flags include SYN, FIN, RESET, PUSH, URG, and ACK. • The SYN and FIN flags are used when establishing and terminating a TCP connection, respectively. • The ACK flag is set any time the Acknowledgment field is valid, implying that the receiver should pay attention to it. Varsha RameshKumar
  • 19. TCP Header • The URG flag signifies that this segment contains urgent data. When this flag is set, the UrgPtr field indicates where the nonurgent data contained in this segment begins. • The urgent data is contained at the front of the segment body, up to and including a value of UrgPtr bytes into the segment. • The PUSH flag signifies that the sender invoked the push operation, which indicates to the receiving side of TCP that it should notify the receiving process of this fact. Varsha RameshKumar
  • 20. TCP Header • RESET flag signifies that the receiver has become confused, it received a segment it did not expect to receive—and so wants to abort the connection. • Checksum field is used in exactly the same way as for UDP—it is computed over the TCP header, the TCP data, and the pseudoheader, which is made up of the source address, destination address, and length fields from the IP header. Varsha RameshKumar
  • 21. Achieving Reliability • A major challenge – One computer reboots during a file transfer – It is rebooted and a second connection is established – Messages from the two sessions get mixed up – Packets from the first session must be rejected Varsha RameshKumar
  • 22. End-to-end Issues • At the heart of TCP is the sliding window algorithm • As TCP runs over the Internet rather than a point-to-point link, the following issues need to be addressed by the sliding window algorithm – TCP supports logical connections between processes that are running on two different computers in the Internet – TCP connections are likely to have widely different RTT times – Packets may get reordered in the Internet Varsha RameshKumar
  • 23. End-to-end Issues – TCP needs a mechanism using which each side of a connection will learn what resources the other side is able to apply to the connection – TCP needs a mechanism using which the sending side will learn the capacity of the network Varsha RameshKumar
  • 24. The Idea Behind Sliding Windows • Stop-and-wait wastes network bandwidth • Sliding window protocols allow the sender to transmit multiple packets before waiting for an acknowledgement. Varsha RameshKumar
  • 25. Connection Establishment/Termination in TCP Timeline for three-way handshake algorithm Varsha RameshKumar
  • 26. Sliding Window Revisited • TCP’s variant of the sliding window algorithm, which serves several purposes: – (1) it guarantees the reliable delivery of data, – (2) it ensures that data is delivered in order, and – (3) it enforces flow control between the sender and the receiver. Varsha RameshKumar
  • 27. Sliding Window Revisited Relationship between TCP send buffer (a) and receive buffer (b). Varsha RameshKumar
  • 28. TCP Sliding Window • Sending Side – LastByteAcked ≤ LastByteSent – LastByteSent ≤ LastByteWritten • Receiving Side – LastByteRead < NextByteExpected – NextByteExpected ≤ LastByteRcvd + 1 Varsha RameshKumar
  • 29. Positive Acknowledgement • Suppose an acknowledgement is lost. • A duplicate packet will be sent. • Sequence numbers are used to allow the destination software to reassemble a packet. Varsha RameshKumar
  • 30. Positive Acknowledgement with Retransmission • Retransmission is one of many techniques – Send packet – start timer – Two possibilities • Packet arrives – Acknowledgement is sent back – Stop timer and proceed • Packet fails to arrive – Timer goes off – Resend packet and set another timer Varsha RameshKumar
  • 31. THANK YOU ! Varsha RameshKumar