TCP Overview. Connection-oriented Byte-stream

Similar documents
Reliable Byte-Stream (TCP)

Internet transport protocols

End-to-End Protocols. End-to-End Protocols

Internet Protocols Fall Outline

Transport Protocols CS 640 1

TCP Adaptive Retransmission Algorithm - Original TCP. TCP Adaptive Retransmission Algorithm Jacobson

End-to-End Protocols: UDP and TCP. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

Fundamentals of Computer Networks ECE 478/578. Transport Layer. End- to- End Protocols 4/16/13. Spring Application. Application.

Problem. Chapter Outline. Chapter Goal. End-to-end Protocols. End-to-end Protocols. Chapter 5. End-to-End Protocols

CSE/EE 461 Lecture 12 TCP. A brief Internet history...

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

Application Service Models

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

EE 122: Transport Protocols: UDP and TCP

EE 122: Transport Protocols. Kevin Lai October 16, 2002

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

Introduc)on to Computer Networks

End-to-End Protocols. Transport Protocols. User Datagram Protocol (UDP) Application Layer Expectations

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

11/24/2009. Fundamentals of Computer Networks ECE 478/578. Flow Control in TCP

Introduc)on to Computer Networks

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

Flow and Congestion Control Marcos Vieira

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [NETWORKING] Frequently asked questions from the previous class surveys

Chapter 5 End-to-End Protocols

TCP & UDP. Transport Layer. Transport. Network. Functions. End-to-end Reliable Byte Stream. Unreliable End-to-end. C.K. Kim

Outline Computer Networking. Functionality Split. Transport Protocols

Transport Protocols. CSCI 363 Computer Networks Department of Computer Science

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Page 1. Goals for Today" Placing Network Functionality" Basic Observation" CS162 Operating Systems and Systems Programming Lecture 15

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

User Datagram Protocol

TCP. TCP: Overview. TCP Segment Structure. Maximum Segment Size (MSS) Computer Networks 10/19/2009. CSC 257/457 - Fall

Transport Layer: outline

Flow Control, and Congestion Control

TCP: Transmission Control Protocol UDP: User Datagram Protocol TCP - 1

Mobile Transport Layer Lesson 02 TCP Data Stream and Data Delivery


CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably?

UNIT IV. UDP TCP Adaptive Flow Control-Adaptive Retransmission Congestion Control Congestion avoidance QoS.

Kent State University

7. TCP 최양희서울대학교컴퓨터공학부

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

Transport Layer: Outline

Transport Layer Marcos Vieira

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

CSE 461 Module 11. Connections

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

ECE 333: Introduction to Communication Networks Fall 2001

05 Transmission Control Protocol (TCP)

Functionality Split Computer Networking. Transport Protocols. Overview. Multiplexing & Demultiplexing

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

CS4700/CS5700 Fundamentals of Computer Networks

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

CS457 Transport Protocols. CS 457 Fall 2014

CE693 Advanced Computer Networks

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

Flow Control, and Congestion Control

UNIT IV TRANSPORT LAYER

Intro to LAN/WAN. Transport Layer

Internet Transport Protocols UDP and TCP

ECE 650 Systems Programming & Engineering. Spring 2018

Sequence Number. Acknowledgment Number. Data

Transport Protocols and TCP

CS118 Discussion 1A, Week 4. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

Chapter 3- parte B outline

Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP)

Introduction to Networks and the Internet

Networking Technologies and Applications

Lecture 8. TCP/IP Transport Layer (2)

Reliable Transport I: Concepts and TCP Protocol

CSC 401 Data and Computer Communications Networks

Networked Systems and Services, Fall 2018 Chapter 3

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

TCP : Fundamentals of Computer Networks Bill Nace

Lecture 3: The Transport Layer: UDP and TCP

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Transport Protocols. Raj Jain. Washington University in St. Louis

Reliable Transport I: Concepts and TCP Protocol

Network Model. Why a Layered Model? All People Seem To Need Data Processing

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

The aim of this unit is to review the main concepts related to TCP and UDP transport protocols, as well as application protocols. These concepts are

Lecture 4: Congestion Control

10 minutes survey (anonymous)

ICS 451: Today's plan. Sliding Window Reliable Transmission Acknowledgements Windows and Bandwidth-Delay Product Retransmission Timers Connections

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

Transcription:

TCP Overview Connection-oriented Byte-stream app writes bytes TCP sends segments app reads bytes Full duplex Flow control: keep sender from overrunning receiver Congestion control: keep sender from overrunning network Application process Application process Write bytes Read bytes TCP Send buffer TCP Receive buffer Segment Segment Segment Transmit segments page 1

Remember TCP: Segments, IP: packets, Ethernet: Frames TCP segments are encapsulated as IP data which are encapsulated as Ethernet frame data page 2

Data Link Versus Transport (TCP) Potentially connects many different hosts need explicit connection establishment and termination TCP three way hand-shake Potentially different RTT need adaptive timeout mechanism Potentially long delay in network need to be prepared for arrival of very old packets Sequence number space should be well thought out Potentially different capacity at destination need to accommodate different node capacity Flow control Potentially different network capacity need to be prepared for network congestion Congestion control page 3

Segment Format 0 4 10 16 31 SrcPort DstPort SequenceNum Acknowledgment HdrLen 0 Flags Checksum AdvertisedWindow UrgPtr Options (variable) Data page 4

Segment Format (cont) Each connection identified with 4-tuple: (SrcPort, SrcIPAddr, DstPort, DstIPAddr) Sliding window + flow control acknowledgment, SequenceNum, AdvertisedWindow Data (SequenceNum) Sender Receiver Acknowledgment + AdvertisedWindow Flags SYN, FIN, RESET, PUSH, URG, ACK Checksum pseudo header + TCP header + data page 5

Sequence Number Selection Initial sequence number (ISN) selection Why not simply chose 0? Must avoid overlap with earlier incarnation. New sequence number should be larger than previous number. Why can t the system remember the previous number used? Requirements for ISN selection Must operate correctly Without synchronized clocks Despite node failures page 6

ISN and Quiet Time Use local clock to select ISN Clock wraparound must be greater than max segment lifetime (MSL) Upon startup, cannot assign sequence numbers for MSL seconds Can still have sequence number overlap If sequence number space not large enough for highbandwidth connections page 7

Connection Establishment Active participant (client) Passive participant SYN, SequenceNum = x(server) SYN + ACK, SequenceNum = y Acknowledgment = x+1 Three way handshake ACK, Acknowledgment = y + 1 page 8

Connection Tear-down Normal termination Allow unilateral close Avoid sequence number overlap TCP must continue to receive data even after closing Cannot close connection immediately: what if a new connection restarts and uses same sequence number and receives retransmitted FIN from the current session? page 9

Tear-down Packet Exchange Sender FIN FIN-ACK Receiver Data write Data ack FIN FIN-ACK page 10

State Transition Diagram CLOSED Passive open Close LISTEN Close Active open/syn SYN_RCVD SYN/SYN + ACK Send/SYN SYN/SYN + ACK ACK SYN + ACK/ACK SYN_SENT Close/FIN ESTABLISHED FIN_WAIT_1 ACK Close/FIN FIN/ACK FIN/ACK CLOSE_WAIT Close/FIN FIN_WAIT_2 CLOSING LAST_ACK ACK + FIN/ACK FIN/ACK ACK TIME_WAIT Timeout after two segment lifetimes ACK CLOSED page 11

Sliding Window Revisited Sending application Receiving application TCP TCP LastByteWritten LastByteRead LastByteAcked LastByteSent NextByteExpected LastByteRcvd Sending side LastByteAcked < = LastByteSent LastByteSent < = LastByteWritten buffer bytes between LastByteAcked and LastByteWritten Receiving side LastByteRead < NextByteExpected NextByteExpected < = LastByteRcvd +1 buffer bytes between NextByteRead and LastByteRcvd page 12

Flow Control Fast sender can overrun receiver: Packet loss, unnecessary retransmissions Possible solutions: Sender transmits at pre-negotiated rate Sender limited to a window s worth of unacknowledged data Flow control different from congestion control page 13

Flow Control Send buffer size: MaxSendBuffer Receive buffer size: MaxRcvBuffer Receiving side LastByteRcvd - LastByteRead < = MaxRcvBuffer AdvertisedWindow = MaxRcvBuffer - (NextByteExpected - NextByteRead) Sending side LastByteSent - LastByteAcked < = AdvertisedWindow EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked) LastByteWritten - LastByteAcked < = MaxSendBuffer block sender if (LastByteWritten - LastByteAcked) + y > MaxSenderBuffer Always send ACK in response to arriving data segment Persist when AdvertisedWindow = 0 page 14

Round-trip Time Estimation Wait at least one RTT before retransmitting Importance of accurate RTT estimators: Low RTT -> unneeded retransmissions High RTT -> poor throughput RTT estimator must adapt to change in RTT But not too fast, or too slow! Problem: If the instantaneously calculated RTT is 10, 20, 5, 12, 3, 5, 6; what RTT should we use for calculations? page 15

Initial Round-trip Estimator Round trip times exponentially averaged: New RTT = α (old RTT) + (1 - α) (new sample) Recommended value for α: 0.8-0.9 Retransmit timer set to β RTT, where β = 2 Every time timer expires, RTO exponentially backed-off page 16

Retransmission Ambiguity A B A B Original transmission Original transmission Sample RTT retransmission ACK Sample RTT ACK retransmission page 17

Karn s Retransmission Timeout Estimator Accounts for retransmission ambiguity If a segment has been retransmitted: Don t count RTT sample on ACKs for this segment Keep backed off time-out for next packet Reuse RTT estimate only after one successful transmission page 18

Karn/Partridge Algorithm Do not sample RTT when retransmitting Double timeout after each retransmission Sender Receiver Sender Receiver SampleR TT Original transmission Retransmission ACK SampleR TT Original transmission ACK Retransmission page 19

Jacobson s Retransmission Timeout Estimator Key observation: Using β RTT for timeout doesn t work At high loads round trip variance is high Solution: If D denotes mean variation Timeout = RTT + 4D page 20

Jacobson/ Karels Algorithm New Calculations for average RTT Diff = SampleRTT - EstRTT EstRTT = EstRTT + (d x Diff) Dev = Dev + d( Diff - Dev) where d is a factor between 0 and 1 Consider variance when setting timeout value TimeOut = m x EstRTT + f x Dev where m = 1 and f = 4 Notes algorithm only as good as granularity of clock (500ms on Unix) accurate timeout mechanism important to congestion control (later) page 21

Congestion 10 Mbps 1.5 Mbps 100 Mbps If both sources send full windows, we may get congestion collapse Other forms of congestion collapse: Retransmissions of large packets after loss of a single fragment Non-feedback controlled sources page 22

Congestion Response throughput delay load load Avoidance keeps the system performing at the knee Control kicks in once the system has reached a congested state page 23

Separation of Functionality Sending host must adjust amount of data it puts in the network based on detected congestion Routers can help by: Sending accurate congestion signals Isolating well-behaved from ill-behaved sources page 24