Académique Documents
Professionnel Documents
Culture Documents
12616
Covered
Prakriti
M.E.(IT)
Roll no.-
Topics to be discussed
Overview
TCP Services
TCP features
TCP format
Connection management in TCP
Establishing a connection
State Diagram
Overview
Byte Stream
Byte Stream
TCP
IP Internetwork
3
Connection-Oriented
Before any data transfer, TCP establishes a connection:
SERVER
waiting for
connection
request
Data Transer
Reliable
Byte stream is broken up into chunks which are called
segments
Detecting errors:
Application
1. read 40 bytes
2. read 40 bytes
3. read 40 bytes
TCP
queue of
bytes to be
transmitted
Segments
TCP
queue of
bytes that
have been
received
TCP Services
Figure shows
Relationship of TCP to the other
protocols in the TCP/IP protocol suite.
TCP lies between the application
layer and the network layer
Serves as the intermediary between
the application programs and the
network operations.
TCP features
1) Numbering System
2) Flow Control
3) Error Control
4) Congestion Control
Example
Suppose a TCP connection is transferring a file of 5,000
bytes. The first byte is numbered 10,001. What are the
sequence numbers for each segment if data are sent in
five segments, each carrying 1,000 bytes?
Solution
The following shows the sequence number for each
segment:
10
TCP Format
14
17
Control field/Flags
TCP Checksum:
TCP checksum covers over both TCP header and
TCP data (also covers some parts of the IP header)
Urgent Pointer:
Only valid if URG flag is set
22
kind=0
1 byte
NOP
(no operation)
kind=1
1 byte
Maximum
Segment Size
Window Scale
Factor
Timestamp
kind=2
len=4
maximum
segment size
1 byte
1 byte
2 bytes
kind=3
len=3
shift count
1 byte
1 byte
1 byte
kind=8
len=10
timestamp value
1 byte
1 byte
4 bytes
4 bytes
23
Timestamp Option
24
Connection Management in
TCP
Establishing a TCP Connection
Closing a TCP Connection
State Diagram
25
TCP Connection
Establishment
TCP uses a three-way handshake to open a
connection:
(1) ACTIVE OPEN: Client sends a segment with
Connection Establishment
Active participant
(client)
Passive participant
(server)
SYN,
Sequ
enceN
um =
x
= y,
m
u
ceN
SY
uen
q
+1
e
x
S
,
=
nt
CK
dgme
N+A
owle
n
k
c
A
ACK,
Ackno
wle
dgme
nt = y
+
CS 640
27
Connection Termination
Active participant
(server)
FIN, S
Passive participant
(client)
equen
c
eNum
=
=x+
t
n
e
dgm
e
l
w
o
= y
m
u
Ackn
N
ence
u
q
e
S
FIN,
Ackno
wledg
ment
=y +
CS 640
x
1
29
Thank you.
..