0% found this document useful (0 votes)
4 views

Chapter7-TCP Transport

The document provides an overview of the Transmission Control Protocol (TCP), detailing its characteristics such as being stream-oriented, connection-oriented, and reliable. It explains the TCP header structure, including sequence and acknowledgment numbers, control bits, and flow control mechanisms like sliding windows. Additionally, it covers TCP connection establishment through a three-way handshake and discusses timeout and retransmission processes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter7-TCP Transport

The document provides an overview of the Transmission Control Protocol (TCP), detailing its characteristics such as being stream-oriented, connection-oriented, and reliable. It explains the TCP header structure, including sequence and acknowledgment numbers, control bits, and flow control mechanisms like sliding windows. Additionally, it covers TCP connection establishment through a three-way handshake and discusses timeout and retransmission processes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

UNIVERSITY OF SCIENCE, VNU-HCM

FACULTY OF ELECTRONICS AND TELECOMMUNICATIONS


DEPARTMENT OF TELECOMMUNICATIONS AND NETWORKS

COURSE
BASIC COMPUTER NETWORK

Chapter 1 Transmission Control Protocol


TCP TRANSPORT
07
Editor: Nguyen Viet Ha, Ph.D.

Reference: Peter L Dordal

Lecturer: Nguyen Minh Tri, Ph.D. Email: [email protected] 2

1. Transmission Control Protocol 1. Transmission Control Protocol


TCP is: The End-to-End Principle
Stream-oriented It states in effect that transport issues are the responsibility of the
o Application can write data in very small or very large amounts endpoints (not the core network).
and the TCP layer will take care of appropriate packetization.
Connection-oriented o Data corruption
o Established before the beginning of any data transfer. For the first, even though essentially all links on the Internet
Reliable have link-layer checksums to protect against data corruption,
o Correct order of delivery TCP still adds its own checksum.
o Timeout/retransmission mechanism
Congestion control o Congestion
o TCP automatically uses the sliding windows algorithm to achieve TCP is today essentially the only layer that addresses
throughput relatively close to the maximum available. congestion management.

3/29
/50 4/29
/50
2. TCP Header

It is traditional to refer to the


data portion of TCP packets
(PDU Packet Data Unit) as
segments.

2 TCP Header

5 6/29
/50

2. TCP Header 2. TCP Header


Sequence number (32 bits) -
numbering the data, at the byte
Reserved (6 bits) - is reserved
level.
for the future.
The first byte of the
current data payload.
Control bits (6 bits) -
Includes bit codes, or flags, that
Acknowledgement number
indicate the purpose and
(32 bits) - Indicates the data
function of the TCP segment.
that has been received.
The first byte of the next
Window size (16 bits) -
data payload.
Indicates the number of
segments that can be accepted
Header length (4 bits) -
at one time.
Indicates the length of the TCP
segment header.
7/29
/50 8/29
/50
2. TCP Header 2. TCP Header
URG ACK PSH RST SYN FIN

6 Bits 0 = OFF 1 = ON

SYN for SYNchronize; marks packets


Checksum (16 bits) - Used that are part of the new-connection
for error checking of the handshake
segment header and data.
FIN for FINish; marks packets
involved in the connection closing
RST for ReSeT; indicates various error conditions
Urgent pointer (16 bits) - ACK indicates that the header Acknowledgment field is valid; that is,
Indicates if data is urgent. all but the first packet.
PSH for PuSH; marks - packets that should be delivered
promptly at the far end.
URG for URGent; part of a now-seldom-used mechanism for high-
priority data.
9/29
/50 10/29
/50

2. TCP Header 2. TCP Header


PSH: URG:
If A sends a series of small packets to B, then B has the option of In telnet connection, A sent a large amount of data to B. Suddenly,
assembling them into a full-sized I/O buffer before releasing them A wishes to abort that processing by sending the interrupt
to the receiving application. character CNTL-C.

o However, if A sets the PSH bit on each packet, then B should o Under normal conditions, the application at B would have to
release each packet immediately to the receiving application. finish processing all the pending data before getting to the
CNTL-C.
o However, if the URG bit is set, and the TCP Urgent
Pointer field points to the CNTL-C in the current packet, the
receiving application then skips ahead in its processing of the
arriving data stream until it reaches the urgent data.

11/29
/50 12/29
/50
3. TCP Connection Establishment
TCP connections are established via an exchange known as the three-
way handshake.

TCP Connection
3 Establishment

13 14/29
/50

3. TCP Connection Establishment 3. TCP Connection Establishment


Close the connection: two-way FIN/ACK handshakes. Example of a full exchange of packets
in a representative connection.

15/29
/50 16/29
/50
3. TCP Connection Establishment 3. TCP Connection Establishment
Each side chooses its Initial Sequence Number (ISN), and sends If B had not been LISTENing at the port to which A sent its SYN, its
that in its initial SYN. response would have been RST meaning in this context
All further sequence numbers sent are the ISN chosen by that side connection refused .
plus the relative sequence number.
Similarly, if A sent data to B before the SYN packet, the response would
have been RST.
It helps with the allocation of a sequence number that does not conflict
with other data bytes transmitted over a TCP connection.

RST can be sent by either side at any time to abort the connection.

17/29
/50 18/29
/50

4. Path MTU Discovery


TCP connections are more efficient if they can keep large packets
flowing between the endpoints.

Once upon a time, TCP endpoints included just 512 bytes of data in
each packet that was not destined for local delivery,

4
to avoid fragmentation.
Path MTU Discovery

TCP endpoints now typically engage in Path MTU Discovery which


almost always allows them to send larger packets.
Backbone ISPs are now usually able to carry 1500-byte packets.

19 20/29
/50
4. Path MTU Discovery 4. Path MTU Discovery
The IPv4 strategy is to send an initial data packet with the IPv4 IPv6 has no DONT_FRAG bit.
DONT_FRAG bit set.
Path MTU Discovery over IPv6 involves the periodic sending of larger
packets; if the ICMPv6 message Packet Too Big is received, a smaller
If the ICMP message Frag_Required/DONT_FRAG_Set comes back, packet size must be used.
or if the packet times out, the sender tries a smaller size.

If the sender receives a TCP ACK for the packet, on the other hand,
indicating that it made it through to the other end, it might try a
larger size.

21/29
/50 22/29
/50

5. TCP Flow Control


TCP Sliding Windows (are measured in terms
of bytes)
To improve throughput.
In the initial three-way handshake, each side specifies the maximum
window size it is willing to accept, in the Window Size field of the
TCP header.
5 TCP Flow Control o This 16-bit field can only go to 65,535 Bytes.
Window Scale option that can also be negotiated in the
opening handshake to increase the Window Size.
o The window size included in the TCP header is known as the
Advertised Window Size.

TCP may either transmit a bulk stream of data, using sliding


windows fully, or it may send slowly generated interactive data.
23 24/29
/50
5. TCP Flow Control 5. TCP Flow Control
TCP Flow Control Delayed ACKs
It is possible for a TCP sender to send data faster than the Simply mean that the ACK traffic volume is reduced.
receiver can process it.
Because ACKs are cumulative, one ACK from the receiver can in
o When this happens, a TCP receiver may reduce the advertised principle acknowledge multiple data packets from the sender.
Window Size value of an open connection

To inform the sender to switch to a smaller window size.

Default number of delayed ACKs is 2.

The maximum ACK delay timeout is 500 .


o Default is 200 .
25/29
/50 26/29
/50

6. TCP Timeout and Retransmission


When TCP sends a packet containing user data (this excludes ACK-only
packets), it sets a timeout.

If that timeout expires before the packet data is acknowledged, it is


retransmitted.
TCP Timeout and
6 Retransmission If the retransmission loss the sender doubles Timeout.

Retrying 5 times as the default.

27 28/29
/50
THANK YOU FOR YOUR ATTENTION

Nguyen Minh Tri, Ph.D.


Department of Telecommunications and Networks
Faculty of Electronics and Communications
University of Science, Vietnam National University, Ho Chi Minh City
Email: [email protected]

You might also like