101
Transmission Control Protocol (TCP) Antonio Carzaniga Faculty of Informatics University of Lugano November 5, 2014 © 2005–2007 Antonio Carzaniga

Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

  • Upload
    others

  • View
    41

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Transmission Control Protocol (TCP)

Antonio Carzaniga

Faculty of InformaticsUniversity of Lugano

November 5, 2014

© 2005–2007 Antonio Carzaniga

Page 2: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Outline

Introduction to TCP

Sequence numbers and acknowledgment numbers

Timeouts and RTT estimation

Reliable data transfer in TCP

Connection management

© 2005–2007 Antonio Carzaniga

Page 3: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Transmission Control Protocol

The Internet’s primary transport protocol

◮ defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and

RFC 2581

© 2005–2007 Antonio Carzaniga

Page 4: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Transmission Control Protocol

The Internet’s primary transport protocol

◮ defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and

RFC 2581

Connection-oriented service

◮ endpoints “shake hands” to establish a connection

◮ not a circuit-switched connection, nor a virtual circuit

© 2005–2007 Antonio Carzaniga

Page 5: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Transmission Control Protocol

The Internet’s primary transport protocol

◮ defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and

RFC 2581

Connection-oriented service

◮ endpoints “shake hands” to establish a connection

◮ not a circuit-switched connection, nor a virtual circuit

Full-duplex service

◮ both endpoints can both send and receive, at the same time

© 2005–2007 Antonio Carzaniga

Page 6: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Preliminary Definitions

© 2005–2007 Antonio Carzaniga

Page 7: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Preliminary Definitions

TCP segment: envelope for TCP data

◮ TCP data are sent within TCP segments

◮ TCP segments are usually sent within an IP packet

© 2005–2007 Antonio Carzaniga

Page 8: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Preliminary Definitions

TCP segment: envelope for TCP data

◮ TCP data are sent within TCP segments

◮ TCP segments are usually sent within an IP packet

Maximum segment size (MSS): maximum amount of

application data transmitted in a single segment

◮ typically related to the MTU of the connection, to avoid

network-level fragmentation (we’ll talk about all of this later)

© 2005–2007 Antonio Carzaniga

Page 9: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Preliminary Definitions

TCP segment: envelope for TCP data

◮ TCP data are sent within TCP segments

◮ TCP segments are usually sent within an IP packet

Maximum segment size (MSS): maximum amount of

application data transmitted in a single segment

◮ typically related to the MTU of the connection, to avoid

network-level fragmentation (we’ll talk about all of this later)

Maximum transmission unit (MTU): largest link-layer frame

available to the sender host

◮ path MTU: largest link-layer frame that can be sent on all links

from the sender host to the receiver host

© 2005–2007 Antonio Carzaniga

Page 10: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Segment Format

0 31

source port destination port

sequence number

acknowledgment number

hdrlen unused U A P R S F receive window

Internet checksum urgent data pointer

options field

data

© 2005–2007 Antonio Carzaniga

Page 11: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

© 2005–2007 Antonio Carzaniga

Page 12: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

Source and destination ports: (16-bit each) application

identifiers

© 2005–2007 Antonio Carzaniga

Page 13: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

Source and destination ports: (16-bit each) application

identifiers

Sequence number: (32-bit) used to implement reliable data

transfer

Acknowledgment number: (32-bit) used to implement reliable

data transfer

© 2005–2007 Antonio Carzaniga

Page 14: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

Source and destination ports: (16-bit each) application

identifiers

Sequence number: (32-bit) used to implement reliable data

transfer

Acknowledgment number: (32-bit) used to implement reliable

data transfer

Receive window: (16-bit) size of the “window” on the receiver

end

© 2005–2007 Antonio Carzaniga

Page 15: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

Source and destination ports: (16-bit each) application

identifiers

Sequence number: (32-bit) used to implement reliable data

transfer

Acknowledgment number: (32-bit) used to implement reliable

data transfer

Receive window: (16-bit) size of the “window” on the receiver

end

Header length: (4-bit) size of the TCP header in 32-bit words

© 2005–2007 Antonio Carzaniga

Page 16: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

Source and destination ports: (16-bit each) application

identifiers

Sequence number: (32-bit) used to implement reliable data

transfer

Acknowledgment number: (32-bit) used to implement reliable

data transfer

Receive window: (16-bit) size of the “window” on the receiver

end

Header length: (4-bit) size of the TCP header in 32-bit words

Optional and variable-length options field: may be used to

negotiate protocol parameters

© 2005–2007 Antonio Carzaniga

Page 17: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

© 2005–2007 Antonio Carzaniga

Page 18: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

© 2005–2007 Antonio Carzaniga

Page 19: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

© 2005–2007 Antonio Carzaniga

Page 20: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

RST flag: (1-bit) used during connection setup and shutdown

© 2005–2007 Antonio Carzaniga

Page 21: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

RST flag: (1-bit) used during connection setup and shutdown

FIN flag: (1-bit) used during connection shutdown

© 2005–2007 Antonio Carzaniga

Page 22: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

RST flag: (1-bit) used during connection setup and shutdown

FIN flag: (1-bit) used during connection shutdown

PSH flag: (1-bit) “push” flag, used to solicit the receiver to pass

the data to the application immediately

© 2005–2007 Antonio Carzaniga

Page 23: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

RST flag: (1-bit) used during connection setup and shutdown

FIN flag: (1-bit) used during connection shutdown

PSH flag: (1-bit) “push” flag, used to solicit the receiver to pass

the data to the application immediately

URG flag: (1-bit) “urgent” flag, used to inform the receiver that

the sender has marked some data as “urgent”. The location of

this urgent data is marked by the urgent data pointer field

© 2005–2007 Antonio Carzaniga

Page 24: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

TCP Header Fields

ACK flag: (1-bit) signals that the value contained in the

acknowledgment number represents a valid acknowledgment

SYN flag: (1-bit) used during connection setup and shutdown

RST flag: (1-bit) used during connection setup and shutdown

FIN flag: (1-bit) used during connection shutdown

PSH flag: (1-bit) “push” flag, used to solicit the receiver to pass

the data to the application immediately

URG flag: (1-bit) “urgent” flag, used to inform the receiver that

the sender has marked some data as “urgent”. The location of

this urgent data is marked by the urgent data pointer field

Checksum: (16-bit) used to detect transmission errors

© 2005–2007 Antonio Carzaniga

Page 25: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

© 2005–2007 Antonio Carzaniga

Page 26: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

© 2005–2007 Antonio Carzaniga

Page 27: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

© 2005–2007 Antonio Carzaniga

Page 28: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

© 2005–2007 Antonio Carzaniga

Page 29: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

© 2005–2007 Antonio Carzaniga

Page 30: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

© 2005–2007 Antonio Carzaniga

Page 31: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

1. . . . . . 1024 1025. . .2048 2049. . .3072 3073. . .4096

© 2005–2007 Antonio Carzaniga

Page 32: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

1. . . . . . 1024 1025. . .2048 2049. . .3072 3073. . .4096

a TCP segment

© 2005–2007 Antonio Carzaniga

Page 33: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

1. . . . . . 1024 1025. . .2048 2049. . .3072 3073. . .4096

a TCP segment

2049

© 2005–2007 Antonio Carzaniga

Page 34: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers

Sequence numbers are associated with bytes in the datastream

◮ not with segments, as we have used them before

The sequence number in a TCP segment indicates the

sequence number of the first byte carried by that segment

application data stream

4Kb

MSS=1024b

1. . . . . . 1024 1025. . .2048 2049. . .3072 3073. . .4096

a TCP segment

2049

sequence number

© 2005–2007 Antonio Carzaniga

Page 35: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

© 2005–2007 Antonio Carzaniga

Page 36: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

An acknowledgment number represents the first sequence

number not yet seen by the receiver

◮ TCP acknowledgments are cumulative

© 2005–2007 Antonio Carzaniga

Page 37: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

An acknowledgment number represents the first sequence

number not yet seen by the receiver

◮ TCP acknowledgments are cumulative

A B

© 2005–2007 Antonio Carzaniga

Page 38: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

An acknowledgment number represents the first sequence

number not yet seen by the receiver

◮ TCP acknowledgments are cumulative

A B

[Seq# = 1200, . . .], size(data) = 1000

© 2005–2007 Antonio Carzaniga

Page 39: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

An acknowledgment number represents the first sequence

number not yet seen by the receiver

◮ TCP acknowledgments are cumulative

A B

[Seq# = 1200, . . .], size(data) = 1000

[Seq# = 2200, . . .], size(data) = 500

© 2005–2007 Antonio Carzaniga

Page 40: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Numbers

An acknowledgment number represents the first sequence

number not yet seen by the receiver

◮ TCP acknowledgments are cumulative

A B

[Seq# = 1200, . . .], size(data) = 1000

[Seq# = 2200, . . .], size(data) = 500

[Seq# = . . . ,Ack# = 2700]

© 2005–2007 Antonio Carzaniga

Page 41: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

© 2005–2007 Antonio Carzaniga

Page 42: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

© 2005–2007 Antonio Carzaniga

Page 43: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

© 2005–2007 Antonio Carzaniga

Page 44: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

[Seq# = 100,Data =“C”]

© 2005–2007 Antonio Carzaniga

Page 45: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

[Seq# = 100,Data =“C”]

[Ack# = 101, Seq# = 200,Data =“C”]

© 2005–2007 Antonio Carzaniga

Page 46: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

[Seq# = 100,Data =“C”]

[Ack# = 101, Seq# = 200,Data =“C”]

[Seq# = 101,Ack# = 201,Data =“i”]

© 2005–2007 Antonio Carzaniga

Page 47: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

[Seq# = 100,Data =“C”]

[Ack# = 101, Seq# = 200,Data =“C”]

[Seq# = 101,Ack# = 201,Data =“i”]

[Seq# = 201,Ack# = 102,Data =“i”]

© 2005–2007 Antonio Carzaniga

Page 48: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Sequence Numbers and ACK Numbers

Notice that a TCP connection is a full-duplex link

◮ therefore, there are two streams

◮ two different sequence numbers

E.g., consider a simple “Echo” application:

A B

[Seq# = 100,Data =“C”]

[Ack# = 101, Seq# = 200,Data =“C”]

[Seq# = 101,Ack# = 201,Data =“i”]

[Seq# = 201,Ack# = 102,Data =“i”]

Acknowledgments are “piggybacked” on data segments

© 2005–2007 Antonio Carzaniga

Page 49: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliability and Timeout

TCP provides reliable data transfer using a timer to detect lost

segments

◮ timeout without an ACK → lost packet → retransmission

© 2005–2007 Antonio Carzaniga

Page 50: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliability and Timeout

TCP provides reliable data transfer using a timer to detect lost

segments

◮ timeout without an ACK → lost packet → retransmission

How long to wait for acknowledgments?

© 2005–2007 Antonio Carzaniga

Page 51: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliability and Timeout

TCP provides reliable data transfer using a timer to detect lost

segments

◮ timeout without an ACK → lost packet → retransmission

How long to wait for acknowledgments?

Retransmission timeouts should be larger than the round-trip

time RTT = 2L

◮ as close as possible to the RTT

© 2005–2007 Antonio Carzaniga

Page 52: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliability and Timeout

TCP provides reliable data transfer using a timer to detect lost

segments

◮ timeout without an ACK → lost packet → retransmission

How long to wait for acknowledgments?

Retransmission timeouts should be larger than the round-trip

time RTT = 2L

◮ as close as possible to the RTT

TCP controls its timeout by continuously estimating the

current RTT

© 2005–2007 Antonio Carzaniga

Page 53: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Round-Trip Time Estimation

© 2005–2007 Antonio Carzaniga

Page 54: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Round-Trip Time Estimation

RTT is measured using ACKs

◮ only for packets transmitted once

Given a single sample S at any given time

Exponential weighted moving average (EWMA)

RTT = (1−α)RTT′+αS

© 2005–2007 Antonio Carzaniga

Page 55: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Round-Trip Time Estimation

RTT is measured using ACKs

◮ only for packets transmitted once

Given a single sample S at any given time

Exponential weighted moving average (EWMA)

RTT = (1−α)RTT′+αS

◮ RFC 2988 recommends α = 0.125

© 2005–2007 Antonio Carzaniga

Page 56: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Round-Trip Time Estimation

RTT is measured using ACKs

◮ only for packets transmitted once

Given a single sample S at any given time

Exponential weighted moving average (EWMA)

RTT = (1−α)RTT′+αS

◮ RFC 2988 recommends α = 0.125

TCP also measures the variability of RTT

DevRTT = (1− β)DevRTT′+ β|RTT

′− S|

© 2005–2007 Antonio Carzaniga

Page 57: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Round-Trip Time Estimation

RTT is measured using ACKs

◮ only for packets transmitted once

Given a single sample S at any given time

Exponential weighted moving average (EWMA)

RTT = (1−α)RTT′+αS

◮ RFC 2988 recommends α = 0.125

TCP also measures the variability of RTT

DevRTT = (1− β)DevRTT′+ β|RTT

′− S|

◮ RFC 2988 recommends β = 0.25

© 2005–2007 Antonio Carzaniga

Page 58: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Timeout Value

© 2005–2007 Antonio Carzaniga

Page 59: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Timeout Value

The timeout interval T must be larger than the RTT◮ so as to avoid unnecessary retransmission

However, T should not be too far from RTT◮ so as to detect (and retransmit) lost segments as quickly as

possible

© 2005–2007 Antonio Carzaniga

Page 60: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Timeout Value

The timeout interval T must be larger than the RTT◮ so as to avoid unnecessary retransmission

However, T should not be too far from RTT◮ so as to detect (and retransmit) lost segments as quickly as

possible

TCP sets its timeouts using the estimated RTT (RTT ) and the

variability estimate DevRTT :

T = RTT + 4DevRTT

© 2005–2007 Antonio Carzaniga

Page 61: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliable Data Transfer (Sender)

A simplified TCP sender

r_send(data)

if (timer not running)

start_timer()

u_send([data,next_seq_num])

next_seq_num ← next_seq_num+ length(data)

© 2005–2007 Antonio Carzaniga

Page 62: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliable Data Transfer (Sender)

A simplified TCP sender

r_send(data)

if (timer not running)

start_timer()

u_send([data,next_seq_num])

next_seq_num ← next_seq_num+ length(data)

timeout

u_send(pending segment with smallest sequence number)

start_timer()

© 2005–2007 Antonio Carzaniga

Page 63: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reliable Data Transfer (Sender)

A simplified TCP sender

r_send(data)

if (timer not running)

start_timer()

u_send([data,next_seq_num])

next_seq_num ← next_seq_num+ length(data)

timeout

u_send(pending segment with smallest sequence number)

start_timer()

u_recv([ACK,y])

if (y > base)

base← y

if (there are pending segments)

start_timer()

else . . .

© 2005–2007 Antonio Carzaniga

Page 64: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

© 2005–2007 Antonio Carzaniga

Page 65: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

© 2005–2007 Antonio Carzaniga

Page 66: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

© 2005–2007 Antonio Carzaniga

Page 67: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

© 2005–2007 Antonio Carzaniga

Page 68: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

◮ Cumulative ACK: immediately send cumulative ACK (for both

segments)

© 2005–2007 Antonio Carzaniga

Page 69: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

◮ Cumulative ACK: immediately send cumulative ACK (for both

segments)

Arrival of out of order segment with higher-than-expectedsequence number (gap detected)

© 2005–2007 Antonio Carzaniga

Page 70: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

◮ Cumulative ACK: immediately send cumulative ACK (for both

segments)

Arrival of out of order segment with higher-than-expectedsequence number (gap detected)

◮ Duplicate ACK: immediately send duplicate ACK

© 2005–2007 Antonio Carzaniga

Page 71: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

◮ Cumulative ACK: immediately send cumulative ACK (for both

segments)

Arrival of out of order segment with higher-than-expectedsequence number (gap detected)

◮ Duplicate ACK: immediately send duplicate ACK

Arrival of segment that (partially or completely) fills a gap inthe received data

© 2005–2007 Antonio Carzaniga

Page 72: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Acknowledgment Generation (Receiver)

Arrival of in-order segment with expected sequence number;all data up to expected sequence number alreadyacknowledged

◮ Delayed ACK: wait 500ms for another in-order segment; If that

does not arrive, send ACK

Arrival of in-order segment with expected sequence number.One other in-order segment waiting for ACK (see above)

◮ Cumulative ACK: immediately send cumulative ACK (for both

segments)

Arrival of out of order segment with higher-than-expectedsequence number (gap detected)

◮ Duplicate ACK: immediately send duplicate ACK

Arrival of segment that (partially or completely) fills a gap inthe received data

◮ Immediate ACK: immediately send ACK if the packet start at

the lower end of the gap

© 2005–2007 Antonio Carzaniga

Page 73: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reaction to ACKs (Sender)

© 2005–2007 Antonio Carzaniga

Page 74: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reaction to ACKs (Sender)

u_recv([ACK,y])

if (y > base)

base← y

if (there are pending segments)

start_timer()

© 2005–2007 Antonio Carzaniga

Page 75: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Reaction to ACKs (Sender)

u_recv([ACK,y])

if (y > base)

base← y

if (there are pending segments)

start_timer()

else

ack_counter[y]← ack_counter[y]+ 1

if (ack_counter[y] = 3)

u_send(segment with sequence number y)

© 2005–2007 Antonio Carzaniga

Page 76: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

© 2005–2007 Antonio Carzaniga

Page 77: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

Three-way handshake

© 2005–2007 Antonio Carzaniga

Page 78: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

Three-way handshake

client server

© 2005–2007 Antonio Carzaniga

Page 79: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

Three-way handshake

client server

[SYN, Seq# = cli_init_seq]

© 2005–2007 Antonio Carzaniga

Page 80: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

Three-way handshake

client server

[SYN, Seq# = cli_init_seq]

[SYN,ACK ,Ack# = cli_init_seq+ 1, Seq# = srv_init_seq]

© 2005–2007 Antonio Carzaniga

Page 81: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Setup

Three-way handshake

client server

[SYN, Seq# = cli_init_seq]

[SYN,ACK ,Ack# = cli_init_seq+ 1, Seq# = srv_init_seq]

[ACK , Seq# = cli_init_seq+ 1,Ack# = srv_init_seq+ 1]

© 2005–2007 Antonio Carzaniga

Page 82: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

© 2005–2007 Antonio Carzaniga

Page 83: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

client server

© 2005–2007 Antonio Carzaniga

Page 84: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

client server

[FIN]

© 2005–2007 Antonio Carzaniga

Page 85: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

client server

[FIN]

[ACK]

© 2005–2007 Antonio Carzaniga

Page 86: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

client server

[FIN]

[ACK]

[FIN]

© 2005–2007 Antonio Carzaniga

Page 87: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

Connection Shutdown

“This is it.”

“Okay, Bye now.”

“Bye.”

client server

[FIN]

[ACK]

[FIN]

[ACK]

© 2005–2007 Antonio Carzaniga

Page 88: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

© 2005–2007 Antonio Carzaniga

Page 89: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

© 2005–2007 Antonio Carzaniga

Page 90: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

ESTABLISHED

receive SYN,ACK

send ACK

© 2005–2007 Antonio Carzaniga

Page 91: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

ESTABLISHED

receive SYN,ACK

send ACK

FIN_WAIT_1

application

closes connection

send FIN

© 2005–2007 Antonio Carzaniga

Page 92: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

ESTABLISHED

receive SYN,ACK

send ACK

FIN_WAIT_1

application

closes connection

send FIN

FIN_WAIT_2

receive ACK

© 2005–2007 Antonio Carzaniga

Page 93: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

ESTABLISHED

receive SYN,ACK

send ACK

FIN_WAIT_1

application

closes connection

send FIN

FIN_WAIT_2

receive ACK

TIME_WAIT

receive FIN

send ACK

© 2005–2007 Antonio Carzaniga

Page 94: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Client)

CLOSED

SYN_SENT

application

opens connection

send SYN

ESTABLISHED

receive SYN,ACK

send ACK

FIN_WAIT_1

application

closes connection

send FIN

FIN_WAIT_2

receive ACK

TIME_WAIT

receive FIN

send ACK

wait 30 seconds

© 2005–2007 Antonio Carzaniga

Page 95: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

© 2005–2007 Antonio Carzaniga

Page 96: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

© 2005–2007 Antonio Carzaniga

Page 97: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

SYN_RCVD

receive SYN

send SYN,ACK

© 2005–2007 Antonio Carzaniga

Page 98: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

SYN_RCVD

receive SYN

send SYN,ACK

ESTABLISHED

receive ACK

© 2005–2007 Antonio Carzaniga

Page 99: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

SYN_RCVD

receive SYN

send SYN,ACK

ESTABLISHED

receive ACK

CLOSE_WAIT

receive FIN

send ACK

© 2005–2007 Antonio Carzaniga

Page 100: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

SYN_RCVD

receive SYN

send SYN,ACK

ESTABLISHED

receive ACK

CLOSE_WAIT

receive FIN

send ACK

LAST_ACK

send FIN

© 2005–2007 Antonio Carzaniga

Page 101: Transmission Control Protocol (TCP) · Transmission Control Protocol The Internet’s primary transport protocol defined in RFC 793, RFC 1122, RFC 1323, RFC 2018, and RFC 2581 Connection-oriented

The TCP State Machine (Server)

CLOSED

LISTEN

application

opens server socket

SYN_RCVD

receive SYN

send SYN,ACK

ESTABLISHED

receive ACK

CLOSE_WAIT

receive FIN

send ACK

LAST_ACK

send FIN

receive ACK

© 2005–2007 Antonio Carzaniga