Anda di halaman 1dari 13

TCP

Transmission Control Protocol


(TCP)

TCP is called a connection-oriented, reliable


transport protocol
Connection-Oriented Service
When a process at site A wants to send and
receive data from another process at site B, the
following occurs:
1. The two TCPs establish a connection between
them.
2. Data are exchanged in both directions.
3. The connection is terminated.

Stream delivery Service

Sending and receiving buffers

TCP segments

TCP segment format

Source port address:


16-bit field
port number of the application program in the
host that is sending the segment.
Destination port address:
a 16-bit field
port number of the application program in the
host that is receiving the segment.
Sequence number:
32-bit field defines the number assigned to the
first byte of data contained in this segment.
each byte to be transmitted is numbered.

Acknowledgment number:
This 32-bit field defines the byte number
that the receiver of the segment is
expecting to receive from the other party.
Acknowledgment and data can be
piggybacked together.
Header length:
4-bit field indicates the number of 4-byte
words in the TCP header
The length of the header can be between
20 and 60 bytes
The value of this field can be between 5 (5
x 4 =20) and 15 (15 x 4 =60).

Window size:

TCP is handled using a variable-sized


sliding window
This field defines the size of the
window, in bytes, that the other
party must maintain
maximum size of the window is
65,535 bytes

Checksum:

The calculation of the checksum for


TCP follows the same procedure as
the one described for UDP

Options:
There can be up to 40 bytes of optional
information in the TCP header
Some options are carried when a
connection is established to negotiate or
inform the other side of capabilities
Other options are carried on packets
during the lifetime of the connection.

Control field:

Urgent pointer:
l6-bit field, which is valid only if the urgent
flag(URG) is set, is used when the segment
contains urgent data.
The sending application program wants a piece
of data to be read out of order by the receiving
application program
ACK :
The ACK bit is set to 1 to indicate that the
Acknowledgement number is valid.
If ACK is 0, the segment does not contain an
acknowledgement, so the Acknowledgement
number field is ignored.

PSH: (PUSHed data)


The receiver is hereby kindly requested to
deliver the data to the application upon
arrival and not buffer it until a full buffer
has been received
SYN:
The SYN bit is used to establish
connections
FIN:
The FIN bit is used to release a connection.

Anda mungkin juga menyukai