Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.

Slides:



Advertisements
Similar presentations
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Advertisements

2: Transport Layer 31 Transport Layer 3. 2: Transport Layer 32 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transmission Control Protocol (TCP)
Transportation Layer. Very similar to the data link layer. – two hosts connected by a link or two hosts connected by a network differences: – When two.
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 16 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Layer3-1 Summary of Reliable Data Transfer Checksums help us detect errors ACKs and NAKs help us deal with errors If ACK/NAK has errors sender.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Transport Layer3-1 Pipelined protocols Pipelining: sender allows multiple, “in-flight”, yet-to- be-acknowledged pkts m range of sequence numbers must be.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter3_2.
Chapter 3 outline 3.1 transport-layer services
Transport Layer 3-1 outline r TCP m segment structure m reliable data transfer m flow control m congestion control.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer 3-1 Outline r TCP m Congestion control m Flow control.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
1 Announcement r Project 2 out m Much harder than project 1, start early! r Homework 2 due next Tuesday.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
CSE 124 Networked Services Fall 2009 B. S. Manoj, Ph.D 10/20/20091CSE 124 Networked Services Fall 2009 Some.
Announcement Project 2 out –Much harder than project 1, start early! Homework 2 due next Tu.
Chapter 3 Transport Layer
1 TCP latency modeling. 2 Q: How long does it take to receive an object from a Web server after sending a request? r TCP connection establishment r data.
The Future r Let’s look at the homework r The next test is coming the 19 th (just before turkey day!) r Monday will finish TCP canned slides r Wednesday.
Transport Layer3-1 Data Communication and Networks Lecture 7 Transport Protocols: TCP October 21, 2004.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
Transport Layer3-1 TCP sender (simplified) NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from.
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
More on TCP Acknowledgements Sequence Number Field Initial Sequence Number Acknowledgement Number Field.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
1 End-to-End Protocols (UDP, TCP, Connection Management)
Transport Layer3-1 Transport Layer Our lives begin to end, the day we become silent about things that matter.
September 26 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
ECE 4110 – Internetwork Programming
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Transport Layer1 Goals: r understand principles behind transport layer services and protocols: m UDP m TCP Overview: r transport layer services r multiplexing/demultiplexing.
Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
09-Transport Layer: TCP Transport Layer.
Chapter 3 outline 3.1 Transport-layer services
Chapter 3 outline 3.1 transport-layer services
CS 1652 Jack Lange University of Pittsburgh
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Chapter 3 Transport Layer
Chapter 3 outline 3.1 Transport-layer services
Chapter 3 Transport Layer
Transport Layer 9/22/2019.
Presentation transcript:

Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m Service characteristics m segment structure m Connection management m flow control r 3.6 Principles of congestion control r 3.7 TCP congestion control

Transport Layer3-2 TCP service characteristics r End-to-end reliable service m guarantee the reliable data transfer between application processes r connection-oriented service r full duplex transmission m Data can flow in both direction at the same time. r stream-oriented transmission m TCP views messages from application processes as continuous byte stream, not as separate packets. r Graceful connection release m When the connection terminates, TCP releases the connection after data transfer is completed.

Transport Layer3-3 How to provide reliable services(1) r Transmission unit is segment. m The data from application processes are fragmented to have the size proper for transmission. Each fragmented data is called a segment. m On the contrary, UDP does not fragment the application data, instead send the data as it was given from application processes. r Management of the segment sequence m Each segment is given a sequence number (viewed as byte streams), so receiver TCP can recognize any loss of segments and the out-of-sequence of arriving segments.

Transport Layer3-4 How to provide reliable services(2) r ACK transmission m When TCP receives correct segments, it always replies with ACK segment. m For enhancing performance, it uses the accumulative ACK. r Timer management m When TCP sends segments, it starts a timer. When the ACK for the segments sent does not arrive until the timer times out, it resends the same segment.

Transport Layer3-5 How to provide reliable services(3) r Error control (checksum) m TCP checks any error on the segments it received using the checksum field in the header. If it finds any error, it discards the segment. m Also using the sequence number on the segment, it checks any loss of segments or out-of-sequence of the segments. r Order control m The receiver stores the packets it receives in the buffer, and after keeping the order of segments, it delivers them to application processes. r Detection and discard of duplicate segments m When the same segments arrives, the receiver discards one of them.

Transport Layer3-6 How to provide reliable services(4) r Clear connection management m When one end station happens to reboot, the station will setup another TCP connection in addition to the current TCP connection. In this case, TCP can distinguish the segments of the previous connection and the newly established connection. r Flow control m TCP uses a buffer, and notifies the other TCP on the connection of the available space in the buffer for receiving. So the other TCP can send only the amount of segments and stop. r Congestion control m TCP controls transmission rate depending on congestion state in the network.

Transport Layer3-7 Stream-oriented transmission r TCP views messages from application processes as continuous byte stream, not as separate packets.

Transport Layer3-8 Sending and Receiving Buffers r Data from the application process is stored in the sending buffer. r Then TCP groups a number of bytes together into a segment.

Transport Layer3-9 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m Service characteristics m segment structure m connection management m flow control r 3.6 Principles of congestion control r 3.7 TCP congestion control

Transport Layer3-10 TCP Segment TCP headerTCP data IP datagram(packet) TCP segment 20 octets IP header

Transport Layer3-11 TCP Header

Transport Layer3-12 Sequence Number r Segment number identifies the byte in the stream of data from the sending TCP to the receiving TCP that the first byte of data in the segment represents. r The number does not necessarily start from 0. r The unit is not segments, but bytes.. r The size is 2 32 that is large enough to detect duplicate segments.

Transport Layer3-13 Application process TCP [seq=300, data] [seq=500, data] [seq=650, data] SEND (200 byte data) SEND (100 byte data) SEND (150 byte data)

Transport Layer3-14 Example 1 Imagine a TCP connection is transferring a file of 6000 bytes. The first byte is numbered What are the sequence numbers for each segment if data are sent in five segments with the first four segments carrying 1000 bytes and the last segment carrying 2000 bytes? Solution The following shows the sequence number for each segment: Segment 1 ==> sequence number: 10,010 (range: 10,010 to 11,009) Segment 2 ==> sequence number: 11,010 (range: 11,010 to 12,009) Segment 3 ==> sequence number: 12,010 (range: 12,010 to 13,009) Segment 4 ==> sequence number: 13,010 (range: 13,010 to 14,009) Segment 5 ==> sequence number: 14,010 (range: 14,010 to 16,009)

Transport Layer3-15 Acknowledge Number r Accumulative ACK Sender TCPReceiver TCP [seq=1000, 100 byte data] [seq=1100, 200 byte data] [seq=1300, 100 byte data] [ACK=1400] By convention, the ACK number is the byte number of the segment that the receiver expects to receive next time.

Transport Layer3-16 Window Size r TCP flow control m This field is used for TCP flow control (often called “Credit technique”). m It is used for a receiver to notify a sender of the size of empty space in the receiver TCP buffer. m The unit is byte. m If the buffer size is larger than 2 16, it can be extended using the option field. m Its use is independent of the use of the acknowledge number field that says the success or failure of the segment transmission.

Transport Layer3-17 TCP Control Field

Transport Layer3-18 Pushing Data(1) r When an application process sends a stream of data to the sending TCP, TCP stores data in the buffer and then makes segments at an appropriate time. r The receiving TCP also store the receiving data in its buffer, and then sends data to an application process when it is convenient.

Transport Layer3-19 Pushing Data(2) r In some application such as interactive application, this kinds of TCP operation causes some problem r To avoid this situation, the sending application process request a push operation which means the sending TCP should not wait for the window to be filled. r The receiving TCP also sends the data immediately to the application process without any delay when the PUSH bit is set in the segment.

Transport Layer3-20 Urgent Data r The sending application process tells the sending TCP that some data is urgent, so should be delivered immediately. Then the sending TCP sets URG bit and appends the urgent data and its location in the payload of the segment is pointed by the urgent pointer r The receiving TCP sends the urgent data to the application process immediately when it sees the URG bit in the segment it receives.

Transport Layer3-21 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m Service characteristics m segment structure m connection management m flow control r 3.6 Principles of congestion control r 3.7 TCP congestion control

Transport Layer3-22 TCP Connection Establishment r Three-way handshake r The client(sender) sends the first segment: a SYN segment. m It contains the initialization sequence number. r The server sends the second segment, a SYN and ACK segment. m It acknowledges the receipt of the first segment. m It contains the initialization sequence number. m The server must also define the client window size. r The client sends the third segment, ACK segment. m It acknowledges the receipt of the second segment. m The client must define the server window size.

Transport Layer3-23

Transport Layer3-24 TCP Connection Termination r Any of two parties can close the connection. r Graceful connection release m When connection in one direction is terminated, the other part can continue send data in other direction. r One host sends a FIN segment. r The other host sends an ACK segment.

Transport Layer3-25

Transport Layer3-26 Connection Resetting r TCP may request the resetting of a connection. m Resetting means that the current connection is destroyed. r For resetting, one host sends a segment with the RST bit set.

Transport Layer3-27 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m Service characteristics m segment structure m connection management m flow control r 3.6 Principles of congestion control r 3.7 TCP congestion control

Transport Layer3-28 TCP Flow Control r receive side of TCP connection has a receive buffer: r speed-matching service: matching the send rate to the receiving app’s drain rate r app process may be slow at reading from buffer sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control

Transport Layer3-29 TCP Flow control: how it works (Suppose TCP receiver discards out-of-order segments)  spare room in buffer = RcvWindow = RcvBuffer-[LastByteRcvd - LastByteRead]  Rcvr advertises spare room by including value of RcvWindow in segments  Sender limits unACKed data to RcvWindow m guarantees receive buffer doesn’t overflow

Transport Layer3-30 ACK is not enough! Window 가 닫힘 ACK(3) ACK 안보냄 Window 가 닫힘 I(2) I(0) I(1) TIMEOUT I(0) I(3) I(1) I(0) I(3) I(1) I(3),I(0),I(1) 재전송 Window 가 닫힘, BUSY CONDITION 네트워크 상황 및 수신부 상황 더 악화 Max. window size = 3 buffer

Transport Layer3-31 Window size advertisement Window 가 닫힘 ACK 3, Wsize 3 I(2) TIMEER 중지 I(0) I(3) I(1) I(3),I(0),I(1) 재전송 안함 Window 가 닫힘, BUSY CONDITION IDLE CONDITION ACK 2, Wsize 0 ACK 2, Wsize Window 가 닫힘 Window 가 열림 I(0) I(1) I(2) I(3) Max. window size = 3 buffer

Transport Layer3-32 Transport Entity ATransport Entity B A may send 1400 octets … … … 2601…. A shrinks its transmit window with each transmission A adjusts its window with each credit A exhausts its credit A receive new credit … …..… … B is prepared receive 1400 octets, beginning with 1001 B acknowledges 3 segments (600 octets) but is only B acknowledges 5 segments (1000 octets) and through 2600 original budget (I.e., B will accept octets 1601 prepared to receive 200 additional octets beyond the restore the original amount of credit SN = 1001 SN = 1401 A = 1601, W = 1000 SN = 1601 SN = 2001 A = 2601, W = 1400 SN = 1201 SN = 1601 SN = 1801 SN = 2201 SN = 2401 Example

Transport Layer3-33 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m Service characteristics m segment structure m connection management m flow control m Round-trip time estimation r 3.6 Principles of congestion control r 3.7 TCP congestion control

Transport Layer3-34 TCP Round Trip Time and Timeout EstimatedRTT = (1-  )*EstimatedRTT +  *SampleRTT r Exponential weighted moving average r influence of past sample decreases exponentially fast  typical value:  = 0.125

Transport Layer3-35 Example RTT estimation:

Transport Layer3-36 TCP Round Trip Time and Timeout Setting the timeout  EstimtedRTT plus “safety margin”  large variation in EstimatedRTT -> larger safety margin r first estimate of how much SampleRTT deviates from EstimatedRTT: TimeoutInterval = EstimatedRTT + 4*DevRTT DevRTT = (1-  )*DevRTT +  *|SampleRTT-EstimatedRTT| (typically,  = 0.25) Then set timeout interval: