Observing TCP behavior On using our classroom’s network hardware capabilities to perform experiments with TCP sockets.

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

Introduction to TCP A first look at the sockets API for ‘connection-oriented’ client/server application programs.
Guide to TCP/IP, Third Edition
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
Netprog: TCP Details1 TCP Details. Netprog: TCP Details2 TCP Lingo When a client requests a connection, it sends a “SYN” segment (a special TCP segment)
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
Performance Interactions Between P-HTTP and TCP Implementations J. Heidemann ACM Computer Communication Review April 1997 김호중 CA Lab., KAIST.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Netprog: TCP Details1 TCP Details Introduction to Networking John Otto TA Jan 31, 2007 Recital 4.
Interactions Between Delayed Acks and Nagle’s Algorithm in HTTP and HTTPS: Problems and Solutions Arthur Goldberg Robert Buff New York University March.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
TDC375 Winter 03/04 John Kristoff - DePaul University 1 Network Protocols Transmission Control Protocol (TCP)
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Common network diagnostic and configuration utilities A ‘toolkit’ for network users and managers when ‘troubleshooting’ is needed on your network.
1 K. Salah Module 6.1: TCP Flow and Congestion Control Connection establishment & Termination Flow Control Congestion Control QoS.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Socket options A way for network applications to ‘tweak’ the processing done at lower-levels of the TCP/IP stack.
UDP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
Process-to-Process Delivery:
The Transport Layer.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
1 Transport Layer Computer Networks. 2 Where are we?
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
1 TCP : Transmission Control Protocol ( Stevens TCP/ IP Illustrated Volume 1) TCP is connection oriented Unit of information passed by TCP to IP is a segment.
1 7-Oct-15 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
26-TCP Dr. John P. Abraham Professor UTPA. TCP  Transmission control protocol, another transport layer protocol.  Reliable delivery  Tcp must compensate.
Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation.
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
2000 년 11 월 20 일 전북대학교 분산처리실험실 TCP Flow Control (nagle’s algorithm) 오 남 호 분산 처리 실험실
Copyright © Lopamudra Roychoudhuri
1 TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in.
S305 – Network Infrastructure Chapter 5 Network and Transport Layers.
1 TCP Timeout And Retransmission Chapter 21 TCP sets a timeout when it sends data and if data is not acknowledged before timeout expires it retransmits.
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Data Transfer in TCP Acknowledgements Flow Control.
ECE 4110 – Internetwork Programming
TCP continued. Discussion – TCP Throughput TCP will most likely generate the saw tooth type of traffic. – A rough estimate is that the congestion window.
IP Configuration API. Network Interface Configuration NAIfconfigIsDeviceUp() NAIfconfigDeviceFromInterface() NAIfconfigBringDeviceUp() NAIfconfigSetIpAddress()
Fall 2004FSU CIS 5930 Internet Protocols1 TCP – Data Exchange Reading: Section 24.4.
CPSC TCP Plots r Slides originally from Williamson at Calgary r Minor modifications are made.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
INF3190 – Home Exam 2. Goal The goal of this exercise is to provide network layer reliability for the monitoring/administration tool presented in “home.
1 Network Communications A Brief Introduction. 2 Network Communications.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
1 14-Jun-16 S Ward Abingdon and Witney College CCNA Exploration Semester 1 OSI transport layer CCNA Exploration Semester 1 Chapter 4.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco Public 1 OSI transport layer CCNA Exploration Semester 1 – Chapter 4.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
The Transport Layer Implementation Services Functions Protocols
TCP - Part II.
Chapter 5 Network and Transport Layers
Introduction to Networking Recital 4
Chapter 17 and 18: TCP is connection oriented
TCP/IP Networking An Example
Process-to-Process Delivery:
PUSH Flag A notification from the sender to the receiver to pass all the data the receiver has to the receiving application. Some implementations of TCP.
CS4470 Computer Networking Protocols
Transmission Control Protocol (TCP) Part II Neil Tang 11/21/2008
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Presentation transcript:

Observing TCP behavior On using our classroom’s network hardware capabilities to perform experiments with TCP sockets

‘slowecho.cpp’ This is a TCP ‘echo-server’ which sends back data it receives, one-byte-at-a-time, with a user-specified time-delay after any byte has been transmitted The user specifies a desired time-delay (in microseconds) by typing a command-line argument when this server is launched; e.g., for a one-second time-delay, type $./slowecho

‘peekdemo.cpp’ This is a ‘client’ for the ‘slowecho’ server, but instead of using the ‘read()’ function, it uses ‘recv()’ and it supplies ‘MSG_PEEK’ as the flag-argument, thus allowing users to watch the data arriving from ‘slowecho’ while it sits in the socket’s receive-queue It also shrinks the size of its TCP socket’s receive-buffer, for a dramatic new demo

Packet ‘sniffing’ If we turn off the socket’s ‘window scaling’ option, so the ‘window size’ field in every outgoing acknowledgement-packet’s TCP Header expresses the number of bytes of available space remaining in this client’s receive-buffer, we will create an concrete visualization for the window-size’s role

Setup steps Step 2: logon ‘hrn23511’ Disable TCP ‘window scaling’; and then launch ‘slowecho’ with a one-second time-delay Step 3: logon ‘hrn23512’ Assign an IP-address to ‘eth1’; Launch our ‘peekdemo’ client specifying the IP-address for ‘hrn23511’ as the target-server Step 1: logon ‘hrn23511’ Assign an IP-address to the ‘eth1’ interface and bring it UP (using ‘sudo /sbin/ifconfig’), then lauch ‘nicwatch eth1’ We will need to use a ‘quiet’ network (e.g, our ‘eth1’ interfaces) so we won’t be distracted by seeing hundreds of irrelevant network-packets! (So those interfaces will need to configured with private IP-addresses)

What to watch? ACK sequence number window size to server from client

W. Richard Stevens “A book on networking needs a real network to work with along with access to the Internet” “This book is the result of my being asked lots of questions on TCP/IP for which I could find no quick answers. It was then that I realized that the easiest way to obtain the answers was to run small tests, forcing certain conditions to occur, and just watch what happens.” Preface, page xix “TCP/IP Illustrated, Volume 1: The Protocols” Addison-Wesley (1994)

The ‘silly window’ syndrome This situation arises when data-bytes are sent one-at-a-time within TCP/IP packets Such packets have at least 20 bytes of IP Header plus 20 bytes of TCP Header, yet only 1 byte of data, thus a 40-to-1 ratio of “protocol overhead” to “useful information” On Ethernet, with14 more bytes of header, this yields an efficiency-rate of under 2%

The Nagle algorithm It’s a means for improving the efficiency of TCP/IP networks, by reducing the number of packets that need to be transmitted It combines several small-sized outgoing packets and sends them out all at once (It can interact poorly with TCP’s ‘delayed acknowledgement’ algorithm, so a way to disable it is quite commonly provided)

pseudo-code // A high-level description of John Nagle’s algorithm for congestion control if there is any available data to send { if the window-size is >= MSS and available data >= MSS send a complete MSS packet now else { if there is unacknowledged data still in transit enqueue data in the send buffer until an ACK arrives else send available data immediately } // NOTE: Here MSS denotes the TCP socket’s ‘Maximum Segment Size’

‘usenagle.cpp’ This program allows us to see the default behavior of Linux’s TCP implementation, by using our ‘nicwatch’ packet-sniffer Unless it has been overridden by a TCP ‘socket option’, Linux employs the Nagle algorithm as a way to cut down on the number of TCP packets being exchanged Use this with our ‘tcpserver.cpp’ program

Three windows again Launch our ‘nicwatch’ packet sniffer here Launch our ‘tcpserver’ application here Launch our ‘usenagle’ application here

‘nodelay.cpp’ This is a modified version of the code we used in the previous ‘usenagle’ program It overrides use of the Nagle Algorithm by using the ‘TCP_NODELAY’ socket option With ‘nicwatch’ you can see the effect on the total number of packets exchanged when we use this client with our original ‘tcpserver.cpp’ application

‘corkdemo.cpp’ This is a very different modification of our ‘usenagle’ program, which makes use of the TCP_CORK socket-option rather than TCP_NODELAY With ‘nicwatch’ you will see a dramatically different result when you count the total number of packets that are exchanged with our earlier ‘tcpserver’ application

Applications Connection-oriented applications such as ‘telnet’ need a quick response to any key a user presses (i.e., TCP_NODELAY) But an application that transfers bulk data such as ‘ftp’ is more efficient if lots of the data is transmitted within each individual packet (i.e., the TCP_CORK option) Nagle is compromise between these two

In-class exercises Apply the same 3-window setup that we used for observing the Nagle Algorithm How many packets are needed when you execute our ‘nodelay.cpp’ application? How many packets are needed when you execute our ‘corkdemo.cpp’ application? Do you think it make sense to regard the Nagle Algorithm as a “compromise”?