0% found this document useful (0 votes)
140 views37 pages

Transmission Control Protocol (TCP) - Part I RFC 793: National Centre For Software Technology

Uploaded by

muktakankshi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views37 pages

Transmission Control Protocol (TCP) - Part I RFC 793: National Centre For Software Technology

Uploaded by

muktakankshi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 37

Transmission Control Protocol

(TCP) - Part I
RFC 793

 National Centre for Software Technology 1


Transmission Control Protocol
• Provides end to end connection
• ensures that data is delivered reliably, in
sequence and without error
• provides flow control
• responds to network conditions

 National Centre for Software Technology 2


TCP Concepts
• Operates in a client/server model
• provides full duplex service (acts as a
sender and a receiver)
• Point – point (no broadcast)
• puts data in segment and passes the data to
IP for delivery
• push data and urgent data
 National Centre for Software Technology 3
TCP Concepts
• What are TCP ports?
• Well known ports IANA (e.g. 20 -ftp data,
21 ftp, 25 SMTP)
• what port numbers client use?
• What is a socket?

 National Centre for Software Technology 4


TCP Mechanisms
• Every octet sent has a seq #
• segment’s TCP header has seq # of first
octet of data in the segment
• receiver ACK’s received data
• receiver keeps a watch on incoming seq #

 National Centre for Software Technology 5


TCP Protocol
• Data exchanged in form of segments
• Maximum segment size is 65,535
• Each segment must fit into the MTU
• Uses sliding window protocol

 National Centre for Software Technology 6


TCP Segment Header

 National Centre for Software Technology 7


TCP Segment Header
• Source/Destination port identify local end
points of a connection
• Sequence number and acknowledgement
number are 32 bits long
• every byte of data is numbered

 National Centre for Software Technology 8


TCP Segment Header
• TCP header length - No. of 32 bit words in
the TCP header
• URG flag - 1 if Urgent Pointer is in use
• ACK flag - 1 if acknowledgement number
is valid

 National Centre for Software Technology 9


TCP Segment Header
• PSH bit - indicates PUSHed data
• RST bit - reset connection
• SYN bit - used to set up a connection
• FIN bit - used to release a connection

 National Centre for Software Technology 10


TCP Segment Header
• Flow control using sliding window
• checksum - checksum the header, the data
and the pseudoheader
• Option - 0 or more 32 bit words
• Minimum TCP segment 536+20=556 bytes

 National Centre for Software Technology 11


Pseudoheader

 National Centre for Software Technology 12


TCP Connection Management
Three-way handshake

 National Centre for Software Technology 13


Establishing a connection
(3-way handshake)
• Server issues a passive open command
• client issues a active open command
• client TCP picks an initial seq #. It sends a
SYN (synchronize segment) with this seq #
(SYN seq # 700)
• when SYN arrives, server TCP picks its
initial seq #, Server TCP sends (SYN seq #
400 ACK 701)
 National Centre for Software Technology 14
Establishing a connection
(3-way handshake)
• When client TCP receives the servers
SYN/ACK, the client TCP send (seq # 701
ACK 401)
• Client TCP tells upper layer that connection
is open
• Server TCP tells upper layer that connection
is open after receiving the client TCP’s
ACK
 National Centre for Software Technology 15
Transmission Control Protocol
(TCP) - Part II
RFC 793

 National Centre for Software Technology 16


RELEASING A CONNECTION
• TCP connections are full duplex (they can
be thought of as two simplex connections)
• each simplex connection is released
independently.
• Two-army problem avoided using timers.

 National Centre for Software Technology 17


TCP Mechanisms
Closing a Connection
• Server has finished its work and tells TCP
to close the connection
• Server TCP sends a FIN segment
• Client TCP ACK’s FIN segment
• Client TCP tells application that the server
wishes to close
• Client TCP sends a FIN message
 National Centre for Software Technology 18
TCP Mechanisms
Closing a Connection
• Server TCP receive the client’s FIN and
ACK’s it
• Server TCP tells application that connection
is closed

 National Centre for Software Technology 19


TCP Finite State Machine

 National Centre for Software Technology 20


TCP Transmission Policy

 National Centre for Software Technology 21


TCP Transmission Policy

 National Centre for Software Technology 22


TCP Transmission Policy
Nagle’s Algorithm
• Data is coming to the sending TCP entity
one byte at a time
• send the first byte
• buffer the rest till first byte is ACKed
• send all buffered data in one TCP segment
• start buffering until an ACK is received

 National Centre for Software Technology 23


TCP Transmission Policy
Silly Window Syndrome

 National Centre for Software Technology 24


TCP Transmission Policy
Silly Window Syndrome
• The receiver should not send a window
update until it can handle the maximum
segment size it advertised when the
connection was established, or its buffer is
half empty, whichever is smaller.
• the sender should send a full segment or at
least one containing half of the receivers
buffer size.
 National Centre for Software Technology 25
TCP Connection Control
Slow Start by Jacobson

• Sender maintains two windows


• window granted by receiver
• congestion window
• Sender sends data equal to minimum of two
windows

 National Centre for Software Technology 26


TCP Congestion Control
Slow Start by Jacobson
• Suppose congestion windows is initialized
to 1K.
• 2K data send. No timeout
• 4K data send. No timeout
• 8K data send. No timeout
• 16K data send. Timeout occurred.

 National Centre for Software Technology 27


Network Congestion Algorithm

 National Centre for Software Technology 28


TCP Timer Management

 National Centre for Software Technology 29


User Datagram Protocol
RFC 768
• Connection less transport protocol
• gives unreliable service
• delivery not guaranteed
• duplicate protection not guaranteed

 National Centre for Software Technology 30


User Datagram Protocol

 National Centre for Software Technology 31


Remote Procedure Call

 National Centre for Software Technology 32


Real Time Transport Protocol

(a) The position of RTP in the protocol stack. (b) Packet nesting.

 National Centre for Software Technology 33


Real Time Transport Protocol (2)

The RTP header.


 National Centre for Software Technology 34
Wireless TCP and UDP

Splitting a TCP connection into two connections.


 National Centre for Software Technology 35
Transitional TCP

 National Centre for Software Technology 36


Just a word about diagrams

Diagrams are from


Computer Networks, 3rd edition
Andrew S. Tanenbaum
© Prentice Hall 1996

 National Centre for Software Technology 37

You might also like