TCP transmission control protocol

Similar documents
Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

TCP/IP Optimization for Wide Area Storage Networks. Dr. Joseph L White Juniper Networks

Chapter 5. Transport layer protocols

B-2 Analyzing TCP/IP Networks with Wireshark. Ray Tompkins Founder of Gearbit

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

TCP over Multi-hop Wireless Networks * Overview of Transmission Control Protocol / Internet Protocol (TCP/IP) Internet Protocol (IP)

TCP Performance Management for Dummies

Outline. TCP connection setup/data transfer Computer Networking. TCP Reliability. Congestion sources and collapse. Congestion control basics

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

[Prof. Rupesh G Vaishnav] Page 1

Congestions and Control Mechanisms n Wired and Wireless Networks

Computer Networks UDP and TCP

Transport Layer. Chapter 3.4. Think about

Lecture Objectives. Lecture 07 Mobile Networks: TCP in Wireless Networks. Agenda. TCP Flow Control. Flow Control Can Limit Throughput (1)

TCP in Wireless Mobile Networks

Access Control: Firewalls (1)

TCP over Wireless Networks

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

TCP/IP Networking for Wireless Systems. Integrated Communication Systems Group Ilmenau University of Technology

Mobile Communications Chapter 9: Mobile Transport Layer

Names & Addresses. Names & Addresses. Hop-by-Hop Packet Forwarding. Longest-Prefix-Match Forwarding. Longest-Prefix-Match Forwarding

Simulation-Based Comparisons of Solutions for TCP Packet Reordering in Wireless Network

Final for ECE374 05/06/13 Solution!!

TCP and Wireless Networks Classical Approaches Optimizations TCP for 2.5G/3G Systems. Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme

La couche transport dans l'internet (la suite TCP/IP)

Improving the Performance of TCP Using Window Adjustment Procedure and Bandwidth Estimation

First Midterm for ECE374 03/09/12 Solution!!

Data Networks Summer 2007 Homework #3

Transport layer protocols for ad hoc networks

1. The subnet must prevent additional packets from entering the congested region until those already present can be processed.

Transport Layer and Data Center TCP

Ethernet. Ethernet. Network Devices

Protocols and Architecture. Protocol Architecture.

Higher Layer Protocols: UDP, TCP, ATM, MPLS

TCP in Wireless Networks

TCP/IP Inside the Data Center and Beyond. Dr. Joseph L White, Juniper Networks

Lecture 15: Congestion Control. CSE 123: Computer Networks Stefan Savage

TCP for Wireless Networks

IP - The Internet Protocol

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

SELECTIVE-TCP FOR WIRED/WIRELESS NETWORKS

This sequence diagram was generated with EventStudio System Designer (

TCP Flow Control. TCP Receiver Window. Sliding Window. Computer Networks. Lecture 30: Flow Control, Reliable Delivery

Transport and Network Layer

First Midterm for ECE374 03/24/11 Solution!!

IP address format: Dotted decimal notation:

TCP/IP Over Lossy Links - TCP SACK without Congestion Control

TCP Over Wireless Network. Jinhua Zhu Jie Xu

A Study on TCP Performance over Mobile Ad Hoc Networks

La couche transport dans l'internet (la suite TCP/IP)

Parallel TCP Data Transfers: A Practical Model and its Application

Active Queue Management (AQM) based Internet Congestion Control

CSE 473 Introduction to Computer Networks. Exam 2 Solutions. Your name: 10/31/2013

How do I get to

Networking Overview. (as usual, thanks to Dave Wagner and Vern Paxson)

Low-rate TCP-targeted Denial of Service Attack Defense

Per-Flow Queuing Allot's Approach to Bandwidth Management

2 TCP-like Design. Answer

Effect of Packet-Size over Network Performance

Chapter 6 Congestion Control and Resource Allocation

Introduction to TCP/IP

8-bit Microcontroller. Application Note. AVR460: Embedded Web Server. Introduction. System Description

Transport layer issues in ad hoc wireless networks Dmitrij Lagutin,

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Visualizations and Correlations in Troubleshooting

High Speed Internet Access Using Satellite-Based DVB Networks

Introduction to IP networking

Recent advances in transport protocols

(Refer Slide Time: 02:17)

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Congestion Control Review Computer Networking. Resource Management Approaches. Traffic and Resource Management. What is congestion control?

Data Link Layer(1) Principal service: Transferring data from the network layer of the source machine to the one of the destination machine

Application Level Congestion Control Enhancements in High BDP Networks. Anupama Sundaresan

High-Speed TCP Performance Characterization under Various Operating Systems

Stop And Wait. ACK received; transmit frame 2 CS 455 3

Measuring the Evolution of Transport Protocols in the Internet. Alberto Medina Mark Allman Sally Floyd

A Survey: High Speed TCP Variants in Wireless Networks

TCP Adaptation for MPI on Long-and-Fat Networks

Network Security TCP/IP Refresher

CSE331: Introduction to Networks and Security. Lecture 9 Fall 2006

Question: 3 When using Application Intelligence, Server Time may be defined as.

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Servicesin ns-3. Outline SIMULACIÓN DE PROTOCOLOS DE ENRUTAMIENTO PARA REDES MÓVILES AD-HOC MEDIANTE HERRRAMIENTA DE SIMULACIÓN NS-3

CHAPTER 1 PRINCIPLES OF NETWORK MONITORING

Communication Systems Transport Layer - Protocols

CPS221 Lecture: Layered Network Architecture

On Inferring TCP Behavior

Analysis and Detection of a Denial-of-Service Attack Scenario generated by TCP Receivers to Edge Network

Title: DEVELOPING TCP/IP AND UDP TRAFFIC MONITORING TOOL. RAFIQ BIN CHE MAT ( )

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Ethernet. Ethernet Frame Structure. Ethernet Frame Structure (more) Ethernet: uses CSMA/CD

Homework 3 assignment for ECE374 Posted: 03/13/15 Due: 03/27/15

Encapsulating Voice in IP Packets

Internet Protocols. Background CHAPTER

Based on Computer Networking, 4 th Edition by Kurose and Ross

15-441: Computer Networks Homework 2 Solution

TCP based Denial-of-Service Attacks to Edge Network: Analysis and Detection

Network Layer: Network Layer and IP Protocol

Transcription:

TCP transmission control protocol Suguru Yamaguchi 2014 Information Network 1 Functions that transport layer provides! Model: inter-process communication Identification of process Communication pair of processes! Interfaces for upper layers Connection oriented (virtual circuit) Connectionless (datagram)! Contention and coordination of network resources Flow control, maximizing peer benefit. Congestion control, maximizing network welfare. 2014 Information Network 1

Transport protocols in Internet protocol suites! TCP Connection-oriented Almost all applications are using. Powerful functions! UDP Connectionless Simple, less overhead. IP + process identification! others Many implementations and standards, SCTP, RTP, DCCP,.. 2014 Information Network 1 Process and connection! Identification of process (IP, port)! Identification of TCP connection (source IP, source port, destination IP, destination port) (163.221.52.100, 1040) (203.178.136.36, 25) 1040 connection 25 80 connection 3175 163.221.52.100 2014 Information Network 1 203.178.136.36

port! Port is defined for each transport protocol, separately. TCP/25 is NOT equal to UDP/25 The number has meaning. IANA manages the numbers. Well-known port: 1 1023 www (world wide web) = 80 smtp (simple mail transfer protocol) = 25 Registered port: 1024 49151 Registration to IANA Private port: 49152 65535 http://www.iana.org/assignments/port-numbers 2014 Information Network 1 TCP service model (1)! Connection-oriented! Byte-stream service No explicit boundary among messages Message structure defined by applications! Full duplex Independent stream for sending and receiving! Reliable Managing message order, duplications, discarding, and bit errors. OLLEH OK TCP being viewed as byte-stream service OLLEH OK 2014 Information Network 1

Reliable steam, how?! ACK: acknowledgement Active acknowledgement Duplicate ACK = notification of packet drop! Timeout and retransmission In the case the sender does not receive ACK from its receiver, TIMEOUT! Suppose the message transmission did incomplete with some errors, sender does retransmission again for its receiver. Exponential back-off 2014 Information Network 1 ACK Sender Sent and acknowledged Sent but unacknowledged Nara Institute of Science and Technology User data arrives 10 16 Packet in transit Receiver Nara Insti 2014 Information Network 1

Piggybacking: speed up for ACK Sender Receiver Sent and acknowledged Sent but unacknowledged Nara Institute of Science and Technology User data arrives Graduate S Packet in transit Sender Receiver Nara Insti Graduate School of Information Science User data arrives Sent and acknowledged Sent but unacknowledged 2014 Information Network 1 *** Not accurate Duplicate ACK Sender Sent and acknowledged Sent but unacknowledged Nara Institute of Science and Technology User data arrives 10 16 16 Packet loss Outstanding packets Receiver Nara Institute o 2014 Information Network 1

TCP header IP Header TCP Header TCP segment TCP data 16bit source port 16bit destination port 32bit sequence number 32bit acknowledgment number 20 octets 4bit hlen reserved flags 16bit window size 16bit TCP checksum 16bit urgent pointer (options) (TCP data) 2014 Information Network 1 Nagle algorithm! Q. header (20bytes+20bytes) is too large for 1byte data. How can we deal with this?! Nagle algorithm Only one unacknowledged small segment in the connection If the sending segment is smaller than its receiver buffer, wait until it exceeds, or wait predefined time for transmission Small RTT - small waiting time Large RTT fill up the buffer for good throughput 2014 Information Network 1

TCP service model (2)! Buffered transfer Write messages as long as you want No explicit synchronization needed in application layer OS manages status of processes.! Virtual circuit Connection setup & release Detecting disconnection in communication 2014 Information Network 1 Buffered transfer process process write() read() write() read() Send buffer Recv buffer Send buffer Recv buffer TCP connection OS kernel OS kernel 2014 Information Network 1

TCP header again Sender port # Receiver port # Sequence # ACK # 20 octets Hdr len rsv Checksum flags Window size Pointer to OOB TCP option FIN SYN RST PSH ACK URG 2014 Information Network 1 TCP connection setup - 3-way Handshake Client (active open) Server (passive open) SYN_SENT ESTABLISHED SYN J SYN K, ACK J+1 ACK K+1 LISTEN SYN_RECEIVED ESTABLISHED 2014 Information Network 1

TCP connection release close FIN Ack of FIN FIN close ACK of FIN 2014 Information Network 1 TCP connection reset! RST Abortive release Nonexistent port 2014 Information Network 1

Options! TCP options in 3-way handshake Negotiation on options in 3way handshake MSS option Maximum segment Size negotiation Window scale option For huge message buffer, larger than 64k, with bit shift High speed networks Timestamp option More accurate RTT measurement With MSS option Many options available 2014 Information Network 1 TCP state transition appl: passive opem send: <nodata> start CLOSED Server Client LISTEN Passive open SYN_RCVD recv: SYN send: SYN, ACK Simul. open SYN_SENT Active open appl: CLOSE Or timeout recv: CLOSE send: FIN FIN_WAIT_1 recv: FIN send: <nodata> recv: FIN send: ACK ESTABLISHED Data transmission Simul.close CLOSING recv: ACK send: <nodata> recv: FIN send: ACK CLOSE_WAIT recv: CLOSE send: FIN LAST_ACK Passive close recv: ACK send: <nodata> FIN_WAIT_2 recv: FIN send: ACK TIME_WAIT 2MSL Active close 2014 Information Network 1

Summary! Functions in transport layer (L4)! Internet transport protocol! TCP service model! High performance: ACK, piggybacking, Nagle algorithm! Connection management 2014 Information Network 1 Tcpdump 3way handshake # tcpdump tcp and host iplab.naist.jp 15:26:50.965563 IP rm.naist.jp.64868 > iplab.naist.jp.http: S 2196338486:2196338486(0) win 32120 <mss 1460,nop,wscale 0,nop,nop,timestamp 234659186 0,sackOK,eol> 15:26:51.013517 IP iplab.naist.jp.http > rm.naist.jp.64868: S 2951392133:2951392133(0) ack 2196338487 win 57344 <mss 1414,nop,wscale 0,nop,nop,timestamp 10980172 234659186> 15:26:51.013634 IP rm.naist.jp.64868 > iplab.naist.jp.http:. ack 1 win 32246 <nop,nop,timestamp 234659187 10980172> Time src.port > dst.port flag [ from:to(nbytes) ack # ] win # opt 32bit sequence number & acknowledgement number flags 2014 Information Network 1

Tcpdump connection release 15:26:51.149121 IP rm.naist.jp.64868 > iplab.naist.jp.http:. ack 5857 win 30554 <nop,nop,timestamp 234659188 10980187> 15:27:06.103280 IP iplab.naist.jp.http > rm.naist.jp.64868: F 5857:5857(0) ack 430 win 58296 <nop,nop,timestamp 10981679 234659188> 15:27:06.103372 IP rm.naist.jp.64868 > iplab.naist.jp.http:. ack 5858 win 32246 <nop,nop,timestamp 234659337 10981679> 15:27:10.938811 IP rm.naist.jp.64868 > iplab.naist.jp.http: F 430:430(0) ack 5858 win 32246 <nop,nop,timestamp 234659385 10981679> 15:27:10.961089 IP iplab.naist.jp.http > rm.naist.jp.64868:. ack 431 win 58296 <nop,nop,timestamp 10982169 234659385> 2014 Information Network 1 Play with tcpdump! Tcpdump microscope of TCP communication RST use Packet transmission order TCP option MSS options Window scale options 2014 Information Network 1

TCP flow control & congestion control Suguru Yamaguchi 2014 information Network 1 Contention and coordination of resources! Flow control Negotiation of processing performance Recovery from message disorders Recovery from message duplication, discard and bit errors Maximizing performance of data transmission! Congestion control Sharing network bandwidth among connections, suppressing network congestions. Fair sharing Maximizing network welfare

Flow control! Stop-and-wait! Go Back N! Selective repeat! Many schemes ARQ (Adaptive Repeat request) Stop-and-wait ARQ Sender t 1 t 5 t 4 t 1 t 2 t 3 Receiver t 1 : transmission delay t 2 : frame transmission time t 3 : frame processing time t 4 : ACK transmission time t 5 : ACK processing time 2014 information Network 1 28

Go-back-N ARQ Timeout on frame3!! 1 2 3 4 5 3 4 5 6 1 2 4 5 3 4 5 6 2014 information Network 1 29 TCP flow control! End to End No global coordination Working with available bandwidth estimation at individual hosts No interference with intermediate routers Implicit signaling through packet drops! Scalable Working at each end host Autonomous less state management Scalable

End to end control in TCP Data flow ACK flow - timer & retransmission - packet interval handlings - on-the-fly packet control - buffering for retransmission Possible packet drop in Intermediate routers (both data and ACK) - timer & duplicate ACK - delayed ACKing - window size notification - buffering for reordering packets Many contributions for TCP! Very simple algorithm Macroscopic self-stabilization! No assumption with Greedy nodes No global control system No greedy node for eating bandwidth as much as possible Reject the idea of intermediate policing system! For many data-links General purpose Modest performance on almost all data-links! Long term tuning for last 20 years

TCP flow control! Bandwidth usage coordination Sliding window! Sequence number based control Window size! Packet gap control ACK clocking! others Error detection - TCP checksum Discard detection - duplicate ACK, timeout Sliding window Sender Sent and acknowledged Sent but unacknowledged Nara Institute of Science and Technology Window size User data arrives Sequence number 10 16 Packets in transit (on-the-fly packets, outstanding packets) Receiver Nara Insti 2014 information Network 1

Advertisement window size from receivers! Flow control of classic TCP! rwnd: advertisement window Notification from receiver, on maximum receivable packet size Coordination with sender s sliding window size Too sensitive on bottleneck link ACK clocking data Packets in the Bottle neck, with packet gap T Data flow ACK flow Transmission with receiving speed of ACK (bottle neck speed) self clocking in its balancing stituation ACK gen. (gap )

TCP congestion control TCP tahoe! Fair-share model: End to end! Increase/decrease of Window size Additive increase Multiplicative decrease For Self-stabilization (Jain, et.al)! Strategy on changing of Window size\! Detect congestion through packet drops More control parameters TCP tahoe! Parameters in sender Cwnd congestion window Init 1 Ssthresh slow start threshold, Init large Tcprecvthresh dup ACK number for fast recovery, Init 3 for many implementations

Increasing Window size! Increase congestion window (cwnd) exponentially, by slow start threshold (ssthresh)! Overview of algorithm On receiving an ACK: If (cwnd < ssthresh) { /* slow start */ send 2 packets on every ACK; /* exponentially growth*/ cwnd += 1; } else { } /* congestion avoidance */ send cwnd+1 packets on every ACK, cwnd += 1 / cwnd; /* liner behavior */ Increasing Window size! Slow start Exponential increase! Congestion avoidance Additive increase Liner growth # of packets congestion avoidance slow start T

Reducing Window size (idea)! In the case the transmission exceeds maximum throughput Packet drop may occur, because buffer overrun.! In the case of packet drop, Return Duplicate ACK Congested, but not serious (because ACK was traveled) Maybe OK for retransmission Timeout!! Retransmission Time Out (RTO) ACK cannot travel back, so serious heavy congestion. It s better to wait some.. Reducing Window size (overview of algorithm)! On detecting packet drop: If (dup ACK # == tcprecvthresh ) { } /* fast retransmit */ retransmission; ssthresh = cwnd / 2; cwnd = 1; /* again slow start */ If (timeout) { } retransmission; timeout *= 2; /* exponentially backoff */ cwnd = 1;

Totally, TCP behaves like this # of packets Max throughput (may change) slow start T RTO Calculation! Err = M A A A+ gerr D D + h( Err -D) RTO = A + 4D A: smoothed RTT D: smoothed mean deviation g: gain for the average (1/8) h: gain for the deviation (1/4)! simply RTO = {average RTT} + 4 {smoothed mean deviation}

More improvement TCP reno! Issues Tahoe Too much penalty on doing slow start after Fast retransmit More good control on cwnd! Fast recovery If (dup ACK # == tcprecvthresh) { } retransmission; /* fast retransmit */ ssthresh = cwnd / 2 ; cwnd = cwnd/2 + tcprecvthresh; If (dup ACK # > cwnd/2 ) send new one packet on every dup ACK; If (ACK on retransmission) cwnd = ssthresh ; Less penalty # of packets Maximum throughput (may change) slow start cwnd /2 T

More improvement! Selective Acknowledgement (SACK)! Rate flow control TCP vegas! TFRC - TCP Friendly Rate Control (RFC4828)! Explicit Congestion Notification (ECN)! Interaction with RED! TCP extensions for wireless links!. Summary! Flow control Stop-and-Wait Go back N Sliding window! Congestion control Slow start Congestion avoidance Fast retransmit Fast recovery