This sequence diagram was generated with EventStudio System Designer (http://www.eventhelix.com/eventstudio).



Similar documents
Computer Networks. Chapter 5 Transport Protocols

Transport Layer Protocols

TCP in Wireless Mobile Networks

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

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

Chapter 5. Transport layer protocols

COMP 3331/9331: Computer Networks and Applications. Lab Exercise 3: TCP and UDP (Solutions)

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

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

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

Data Networks Summer 2007 Homework #3

Prefix AggregaNon. Company X and Company Y connect to the same ISP, and they are assigned the prefixes:

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

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

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

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

[Prof. Rupesh G Vaishnav] Page 1

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

Final for ECE374 05/06/13 Solution!!

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

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

Transport Layer. Chapter 3.4. Think about

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

Improved Digital Media Delivery with Telestream HyperLaunch

Multipath TCP in Practice (Work in Progress) Mark Handley Damon Wischik Costin Raiciu Alan Ford

High Speed Internet Access Using Satellite-Based DVB Networks

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

This sequence diagram was generated with EventStudio System Designer (

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. G.Bianchi, G.Neglia, V.Mancuso

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

Advanced Computer Networks Project 2: File Transfer Application

How To Design A Layered Network In A Computer Network

TCP over Wireless Networks

Computer Networks UDP and TCP

TOE2-IP FTP Server Demo Reference Design Manual Rev1.0 9-Jan-15

VPN over Satellite A comparison of approaches by Richard McKinney and Russell Lambert

Access Control: Firewalls (1)

Solving complex performance problems in TCP/IP and SNA environments.

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

The Wireless Network Road Trip

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

2 TCP-like Design. Answer

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

How do I get to

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

A Qos SCHEME TO ADDRESS COMMUNICATION LATENCY ISSUES FOR CRITICAL NETWORK FLOWS IN BEST-EFFORT NETWORKS USING MOBILE AGENTS

Firewall Port Handling in TENA Applications

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

Voice over IP. Demonstration 1: VoIP Protocols. Network Environment

Project 4: (E)DoS Attacks

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

Ethernet. Ethernet. Network Devices

FILE TRANSFER PROTOCOL INTRODUCTION TO FTP, THE INTERNET'S STANDARD FILE TRANSFER PROTOCOL

Effect of Packet-Size over Network Performance

TCP Westwood for Wireless

Host Fingerprinting and Firewalking With hping

CS5008: Internet Computing

Exercises TCP/IP Networking. Solution. With Solutions

Computer Networks - CS132/EECS148 - Spring

A Transport Protocol for Multimedia Wireless Sensor Networks

Expert Reference Series of White Papers. Troubleshooting Slow Networks with Wireshark

Congestions and Control Mechanisms n Wired and Wireless Networks

EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics and Computer Science

1 An application in BPC: a Web-Server

On Inferring TCP Behavior

Policy Based Forwarding

High Performance VPN Solutions Over Satellite Networks

SJBIT, Bangalore, KARNATAKA

IP address format: Dotted decimal notation:

THE UNIVERSITY OF AUCKLAND

Networks: IP and TCP. Internet Protocol

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

A Survey: High Speed TCP Variants in Wireless Networks

Understanding Slow Start

TCP in Wireless Networks

Understanding Layer 2, 3, and 4 Protocols

File Transfer Protocol (FTP) Throughput Testing by Rachel Weiss

TCP Adaptation for MPI on Long-and-Fat Networks

Mobile Communications Chapter 9: Mobile Transport Layer

DO NOT REPLICATE. Analyze IP. Given a Windows Server 2003 computer, you will use Network Monitor to view and analyze all the fields of IP.

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

APPENDIX 1 USER LEVEL IMPLEMENTATION OF PPATPAN IN LINUX SYSTEM

(Refer Slide Time: 02:17)

Middleboxes. Firewalls. Internet Ideal: Simple Network Model. Internet Reality. Middleboxes. Firewalls. Globally unique idenpfiers

An enhanced approach for transmission control protocol traffic management Mechanism for Wireless Network

CS268 Exam Solutions. 1) End-to-End (20 pts)

Network Security TCP/IP Refresher

SELECTIVE-TCP FOR WIRED/WIRELESS NETWORKS

Transport and Network Layer

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

his document discusses implementation of dynamic mobile network routing (DMNR) in the EN-4000.

Network Security I: Overview

Solution of Exercise Sheet 5

Objectives of Lecture. Network Architecture. Protocols. Contents

Applications. Network Application Performance Analysis. Laboratory. Objective. Overview

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Networking Test 4 Study Guide

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

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Internet Ideal: Simple Network Model

Transcription:

Client App Network Server App 25-May-13 15:32 (Page 1) This sequence diagram was generated with EventStudio System Designer (http://www.eventhelix.com/eventstudio). TCP is an end to end protocol which operates over the heterogeneous Internet. TCP has no advance knowledge of the network characteristics, thus it has to adjust its behavior according to the current state of the network. TCP has built in support for congestion control. Congestion control ensures that TCP does not pump data at a rate higher than what the network can handle. In this sequence diagram we will analyse "Slow start", an important part of the congestion control mechanisms built right into TCP. As the name suggests, "Slow Start" starts slowly, increasing its window size as it gains confidence about the networks throughput. Socket initialization Server socket initialization Server Socket create Server Application creates a Socket Closed seq_num = 100 Passive_Open Listen The Socket is created in Closed state Server sets the initial sequence number to 100 Server application has initiated a passive open. In this mode, the socket does not attempt to establish a TCP connection. The socket listens for TCP connection request from clients Socket transitions to the Listen state Server awaits client socket connections. Client socket initialization create Client Socket Client Application creates Socket Closed The socket is created in the Closed state seq_num = 0 Initial sequence number is set to 0 Active_Open Client initiated three way handshake to establish a TCP connection Application wishes to communicate with a destination server using a TCP connection. The application opens a socket for the connection in active mode. In this mode, a TCP connection will be attempted with the server. Typically, the client will use a well known port number to communicate with the remote Server. For example, HTTP uses port 80.

SYN src = Client_Port, dst = Server_Port, seq_num = 0 SYN Sent SYN+ src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535 src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000 Established SYN src = Client_Port, dst = Server_Port, seq_num = 0 SYN+ src = Server_Port, dst = Client_Port, seq_num = 100, ack_num = 1, window = 65535 src = Client_Port, dst = Server_Port, ack_num = 101, window = 5000 SYN Received 25-May-13 15:32 (Page 2) Client sets the SYN bit in the TCP header to request a TCP connection. The sequence number field is set to 0. Since the SYN bit is set, this sequence number is used as the initial sequence number Socket transitions to the SYN Sent state SYN TCP segment is received by the server Server sets the SYN and the bits in the TCP header. Server sends its initial sequence number as 100. Server also sets its window to 65535 bytes. i.e. Server has buffer space for 65535 bytes of data. Also note that the ack sequence numer is set to 1. This signifies that the server expects a next byte sequence number of 1 Now the server transitions to the SYN Received state Client receives the "SYN+" TCP segment Client now acknowledges the first segment, thus completing the three way handshake. The receive window is set to 5000. Ack sequence number is set to 101, this means that the next expected sequence number is 101. At this point, the client assumes that the TCP connection has been established Server receives the TCP segment Established Now the server too moves to the Established state A TCP connection starts in the "Slow Start" state. In this state, TCP adjusts its transmission rate based on the rate at which the acknowledgements are received from the other end. TCP Slow start is implemented using two variables, viz cwnd (Congestion Window)and ssthresh (Slow Start Threshold). cwnd is a self imposed transmit window restriction at the sender end. cwnd will increase as TCP gains more confidence on the network's ability to handle traffic. ssthresh is the threshold for determining the point at which TCP exits slow start. If cwnd increases beyond ssthresh, the TCP session in that direction is considered to be out of slow start phase TCP slow start

cwnd = 512 (1 segment) ssthresh = 65535 Slow Start cwnd = 512 (1 segment) 25-May-13 15:32 (Page 3) Client maintains a congestion window (cwnd). Initially the window is set to lower of the maximum TCP segment size and receiver's allowed window size. In most cases the segment size is smaller than receiver window, thus cwnd is set to the maximum TCP segment size (512 in this example) Note here that cwnd implements a transmitter end flow control. The receiver advertised window implements a receiver enforced flow control. TCP connections start with ssthresh set to 64K. This variable will be used to determine the point at which TCP exits slow start Client end TCP connection moves to slow start state By the same logic, the server also sets cwnd to 512 Data size = 5120 ssthresh = 65535 Slow Start Server end TCP connection moves to slow start state Client application sends 5120 bytes of data to the socket Roundtrip #1 of data transmission seq_num = 1, ack_num = 513 cwnd = 1024 (2 segments) seq_num = 1, ack_num = 513 The first TCP segment is sent with a sequence number of 1. This is the sequence number for the first byte in the segment. Server acknowledges the data segments with the next expected sequence number as 513 TCP typically sends an acknowledgement every two received segments but in this case it times out for another segment and decides to acknowledge the only segment received. Client receives the acknowledgement for the first TCP data segment As the TCP session is in slow start, receipt of an acknowledgement increments the congestion window by one 1 segment. Roundtrip #2 of data transmission

seq_num = 513, 25-May-13 15:32 (Page 4) Since the congestion window has increased to 2, TCP can now send two segments without waiting for an ack seq_num = 1025, seq_num = 513, seq_num = 1025, ack_num = 1537 Receiver generates a TCP on receiving the two segments ack_num = 1537 cwnd = 1536 (3 segments) Receipt for ack again moves the congestion window Roundtrip #3 of data transmission seq_num = 1537, Now three segments can be sent without waiting for an ack seq_num = 2049, seq_num = 2561, seq_num = 1537, Network delivers the three segments to the destination server seq_num = 2049, ack_num = 2561 TCP acknowledges receipt of two segments seq_num = 2561, ack_num = 3073 TCP times for another segment and acknowledges the only pending segment

ack_num = 2561 25-May-13 15:32 (Page 5) The TCP acknowlegements again increment cwnd. This time two acks are received, so cwnd will get incremented by 2 cwnd = 2048 (4 segments) ack_num = 3073 cwnd = 2560 (5 segments) seq_num = 3073, Since cwnd has reached 5 segments, TCP is allowed to send 5 segments without waiting for the ack Roundtrip #4 of data transmission seq_num = 3585, seq_num = _4097, seq_num = _4609, seq_num = _5121, seq_num = 3073, The 5 segments are received by the destination server seq_num = 3585, ack_num = 4097 TCP Ack is sent after first two segments seq_num = 4097, seq_num = 4609, ack_num = 5121 Ack for next two segments seq_num = 5121,

ack_num = 4097 ack_num = 5633 25-May-13 15:32 (Page 6) Ack for last segment Three acknowledgements will be received for the 5 TCP segments. Now the cwnd has almost started increasing geometrically for every round trip between the client and the server. cwnd = 3072 (6 segments) ack_num = 5121 cwnd = 3584 (7 segments) ack_num = 5633 cwnd = 4096 (8 segments) Roundtrip #5 of data transmission This time 8 TCP segments are sent Ack for first two segments Ack for next two segments Ack for next two segments Ack for next two segments Now four acks will be received, thus moving cwnd even more quickly

cwnd = 4608 (9 segments) 25-May-13 15:32 (Page 7) cwnd = 5120 (10 segments) cwnd = 5630 (11 segments) cwnd = 6144 (12 segments) Within a few more roundtrip interactions cwnd will exceed ssthresh. At this point the session will be considered out of slow start. Note that the TCP connection from the client side is out of slow start but the server end is still in slow start as it has not sent any data to the client. Exiting slow start signifies that the TCP connection has reached an equilibrium state where the congestion window closely matches the networks capacity. From this point on, the congestion window will not move geometrically. cwnd will move linearly once the connection is out of slow start. Congestion Avoidance Once slow start ends, the session enters congestion avoidance state. This will be discussed in a subsequent article. Client closes TCP connection Client to server TCP connection release Close FIN Client application wishes to release the TCP connection Client sends a TCP segment with the FIN bit set in the TCP header FIN Wait 1 Client changes state to FIN Wait 1 state FIN Close Wait Server receives the FIN Server responds back with to acknowledge the FIN Server changes state to Close Wait. In this state the server waits for the server application to close the connection Client receives the FIN Wait 2 Client changes state to FIN Wait 2. In this state, the TCP connection from the client to server is closed. Client now waits close of TCP connection from the server end Server to client TCP connection release

FIN FIN Last Ack Close 25-May-13 15:32 (Page 8) Server application closes the TCP connection FIN is sent out to the client to close the connection Server changes state to Last Ack. In this state the last acknowledgement from the client will be received Client receives FIN Client sends Close_Timer Time Wait Client starts a timer to handle scenarios where the last ack has been lost and server resends FIN Client waits in Time Wait state to handle a FIN retry Server receives the Closed delete Server moves the connection to closed state Close_Timer Close timer has expired. Thus the client end connection can be closed too. Closed delete This sequence diagram was generated with EventStudio System Designer (http://www.eventhelix.com/eventstudio).