Anda di halaman 1dari 17

TCP Segment

TCP segment

TCP Segment

Telematics Engineering
Universitat Politecnica de Catalunya (UPC)

1/17

TCP Segment

Outline
TCP segment

1 TCP segment

2/17

TCP Segment

TCP Segment I
TCP segment

It is the PDU (Protocol Data Unit) in TCP applications.


Used in:
Connections establishment / release.
Data transfer.
Data recognition.
Window size announcement...

3/17

TCP Segment

TCP Segment II
TCP segment

4/17

TCP Segment

Ports
TCP segment

TCP Socket: IPs,Ps,IPd,Pd


Mux/Demux

5/17

TCP Segment

Window
TCP segment

TCP provides an end to end Sliding-Window like flow


control (explained below).

6/17

TCP Segment

Sequence Numbers I
TCP segment

7/17

TCP Segment

Sequence Numbers II
TCP segment

Sequence numbers of 32 bits.


TCP transmits the byte stream splited into segments.
Each byte of the flow is identified by a unique sequence

number.
This number is reused cyclically (wrap around).
Sequence numbers refer to bytes in flight.

8/17

TCP Segment

Sequence Numbers III


TCP segment

The sequence number of the first flows byte is

randomly chosen at the start of the connection (Initial


Sequence Number).
In the following segments, reveals the first packed byte

into the byte stream.


In ACKs indicates the next byte that is expected to be

received.
TCP generates a RESET when an impossible

sequence number is received.

9/17

TCP Segment

Other Fields I
TCP segment

10/17

TCP Segment

Other Fields II
TCP segment

Header Length in 32 bits word.


The header size is variable as it may contain options.
Code Bits (6 bits):
SYN: Synchronism. Indicates the start of the
connection.
FIN: Reveals the end of the connection.
RST: Reset of the connection.
PSH: Force the delivery of information.
ACK: Valid recognition field.
URG: Valid urgent pointer field.
Urgent Data Pointer: position where urgent data ends.

11/17

TCP Segment

Urgent Mode
TCP segment

It provides a way to send offtopic data.


Another parallel flow (the flow urgent).
To do so:
An end can mark the data as urgent.
TCP must notify to the receiver process, and the
application must make sense of it.

12/17

TCP Segment

Checksum I
TCP segment

13/17

TCP Segment

Checksum II
TCP segment

UDP like.
However, in this case, the checksum is mandatory.
Check the integrity of TCP data, header and

pseudo-header taking keeping in mind:

Protection against faulty segments due to routing

errors.

14/17

TCP Segment

Options
TCP segment

15/17

TCP Segment

MSS Option
TCP segment

MSS (Maximum Segment Size)


Aims to inform the other end of the maximum Bytes a

TCP segment can contain.


This option can be sent within the SYN segment. Why
MSS? Efficiency!
Small Packets:
Inefficiency.
Large Packages:
Fragmentation.
The loss of fragment implies the retransmission of the
entire segment.

16/17

TCP Segment

Timestamp Option
TCP segment

Allows the transmitter to include time reference in each

segment.
The receiver echoes the timestamp.
By this option, the sender can estimate the segment

round trip time (RTT).


Very useful in precise timeout estimation.

17/17

Anda mungkin juga menyukai