+ All Categories
Home > Documents > NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story...

NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story...

Date post: 15-Dec-2015
Category:
Upload: luz-giffin
View: 214 times
Download: 2 times
Share this document with a friend
Popular Tags:
16
NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol ... the story continues ... Sagan halda áfram 8/25/2009 1 NET0183 Networks and Communications by Dr Andy Brooks powerpoints from the recommended textbook are by Lami Kaya, LKaya@ powerpoints are © 2009 Pearson Education Inc. ontent has sometimes been edited by Andy Brooks. transport layer protocol/samskiptareglur flutnin
Transcript
Page 1: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

NET0183 Networks and Communications by Dr Andy Brooks

1

NET0183 Networks and Communications

Lecture 28TCP: a transport layer protocol

... the story continues

... Sagan halda áfram

8/25/2009

Lecture powerpoints from the recommended textbook are by Lami Kaya, [email protected] powerpoints are © 2009 Pearson Education Inc.Their content has sometimes been edited by Andy Brooks.

transport layer protocol/samskiptareglur flutningslags

Page 2: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

NET0183 Networks and Communications by Dr Andy Brooks

28/25/2009

The recommended textbook is Computer Networks and Internets by Douglas E. Comerhttp://www.coursesmart.com/0136066992/?a=1773944www.pearson-books.com/student (for additional discounts and offers)

Page 3: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

• The port numbers identify the applications.• Window is the number of bytes (beyond the sequence number in the

acknowledgement field) that the receiver is currently willing to receive.• If the ACK flag (A) is set, the value of Acknowledgement Number is the next

sequence number that the receiver is expecting (thus acknowledging receipt of all prior bytes).

• The Sequence Number is the sequence number of the first byte of data in the segment.

3

http://www.fatpipe.org/~mjb/Drawings/reminder

NET0183 Networks and Communications by Dr Andy Brooks8/25/2009

Page 4: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

NET0183 Networks and Communications by Dr Andy Brooks

4

• Sequence number (32 bits) – has a dual role:• If the SYN flag is set, then this is the initial sequence number. The sequence

number of the actual first data byte (and the acknowledged number in the corresponding ACK) will then be this sequence number plus 1.

• If the SYN flag is clear, then this is the accumulated sequence number of the first data byte of this packet for the current session.

8/25/2009

http://en.wikipedia.org/wiki/Transmission_Control_Protocol March 23, 2010

Page 5: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 5

26.12 TCP's Three-Way Handshake

• To establish or terminate connections reliably, TCP uses a 3-way handshake in which 3 messages are exchanged.

• During the 3-way handshake to start a connection, each side sends a control message that specifies an initial buffer size (for flow control) and a sequence number.

• TCP's 3-way exchange ensures unambiguous agreement. – despite packet loss, duplication, delay, and replay events

• The handshake insures that TCP will not open or close a connection until both ends have agreed.

Page 6: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 6

26.12 TCP's Three-Way Handshake

• The term synchronization segment or SYN segment is used to describe the control messages used in a 3-way handshake to create a connection.

• The term finish segment or FIN segment is used to describe control messages used in a 3-way handshake to close a connection.

• Figure 26.8 illustrates the 3-way handshake to create a connection.

• A key aspect of the 3-way handshake is the selection of sequence numbers.– TCP requires each end to generate a random 32-bit sequence

number that becomes the initial sequence number for data sent.

Page 7: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 7

26.12 TCP's Three-Way HandshakeConnection Establishment

Figure 26.8 The 3-way handshake used to create a TCP connection.

SYN bit on, ACK bit off

SYN bit on, ACK bit on

ACK bit on

Page 8: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 8

26.12 TCP's Three-Way Handshake • If an application attempts to establish a new TCP connection

after a computer reboots, TCP chooses a new random number.

• The probability of selecting a random value that matches the sequence used on a previous connection is very low.

• So TCP avoids replay problems:– The sequence numbers on the new connection will differ from the

sequence numbers used on the old connection.– Delayed packets from the old connection are detected and rejected.

• To close a connection, the 3-way handshake uses FIN segments.– An ACK is sent in each direction along with a FIN to guarantee that

all data has arrived before the connection is terminated.

• Figure 26.9 illustrates the exchange.

Page 9: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 9

26.12 TCP's Three-Way HandshakeConnection Termination

Figure 26.9 The 3-way handshake used to close a connection.

Page 10: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 10

26.13 TCP Congestion Control

• Retransmission can exacerbate congestion by injecting additional copies of a packet.

• To help avoid congestion collapse, TCP uses changes in delay as a measure of congestion, and it responds to congestion by reducing the rate at which it retransmits data.

– The timeout is made bigger. (The length of time the retransmission timer is set for.)

...avoid unnecessary retransmissions

Page 11: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

The retransmission timeout (RT0)http://en.wikipedia.org/wiki/Transmission_Control_Protocol 23.3.2010

11NET0183 Networks and Communications by Dr Andy Brooks8/25/2009

“In addition, senders employ a retransmission timeout (RTO) that is based on the estimated round-trip time (or RTT) between the sender and receiver, as well as the variance in this round trip time. The behavior of this timer is specified in RFC 2988. There are subtleties in the estimation of RTT. For example, senders must be careful when calculating RTT samples for retransmitted packets; typically they use Karn's Algorithm or TCP timestamps (see RFC 1323). These individual RTT samples are then averaged over time to create a Smoothed Round Trip Time (SRTT) using Jacobson's algorithm. This SRTT value is what is finally used as the round-trip time estimate.”

“Enhancing TCP to reliably handle loss, minimize errors, manage congestion and go fast in very high-speed environments are ongoing areas of research and standards development. As a result, there are a number of TCP congestion avoidance algorithm variations.”

A lot of reading!

Page 12: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 12

26.13 TCP Congestion Control

• A sending TCP can effectively reduce the data rate by temporarily reducing the window.

• In the extreme case where loss occurs, TCP temporarily reduces the window to one-half of its current value. (simplified story)

– A loss is assumed if no ACK arrives within the timeout (the length of time the retransmission timer is set for).

... when losses occur, don´t send all the data that the receiver says you can send.

Page 13: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

Explanation of TCP slow start

13

http://www.one-net.eu/jsw/img/image023.gif

NET0183 Networks and Communications by Dr Andy Brooks8/25/2009

“The above diagram and description is based on the Message Segment Size (MSS) of 1 KB, no datagrams or ACKs are lost, and the send window size (Ws) is maximum (64KB).”

Page 14: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

NET0183 Networks and Communications by Dr Andy Brooks

14

Explanation of TCP slow start

• TCP does not immediately send data to fill up a receiver´s window.

• TCP starts by sending one segment.– Wc (the congestion window) equals 1.

• If an ACK arrives before the retranmission timer is set to expire, Wc is increased by 1.

• This “doubling” continues until the slow start threshold (SST) is reached. Wc then increases by 1 segment for each set of ACKs that are received, rather than increase by 1 for each ACK received.

• Eventually data throughput reaches the maximum allowed by the receiver´s window.

8/25/2009

Page 15: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 15

26.14 TCP Segment Format

• TCP uses a single format for all messages.• TCP uses the term segment to refer to a message.• Figure 26.10 illustrates the TCP segment format.• A TCP connection contains two streams of data,

one flowing in each direction.

Page 16: NET0183 Networks and Communications Lecture 28 TCP: a transport layer protocol... the story continues... Sagan halda áfram 8/25/20091 NET0183 Networks.

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 16

26.14 TCP Segment Format

Figure 26.10 The TCP segment format used for both data and control messages.


Recommended