TOC: Transport Protocols

Similar documents
Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

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

Computer Networks UDP and TCP

This sequence diagram was generated with EventStudio System Designer (

Chapter 5. Transport layer protocols

Transport Layer. Chapter 3.4. Think about

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

[Prof. Rupesh G Vaishnav] Page 1

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

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

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

Visualizations and Correlations in Troubleshooting

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

IP address format: Dotted decimal notation:

Final for ECE374 05/06/13 Solution!!

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

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

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

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

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

Access Control: Firewalls (1)

TCP in Wireless Mobile Networks

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

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

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

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

Ethernet. Ethernet. Network Devices

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

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

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

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

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

Network Security TCP/IP Refresher

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

How do I get to

Networks: IP and TCP. Internet Protocol

A Transport Protocol for Multimedia Wireless Sensor Networks

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

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

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

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Advanced Computer Networks Project 2: File Transfer Application

Exercises TCP/IP Networking. Solution. With Solutions

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

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

Internet Packets. Forwarding Datagrams

CS155 - Firewalls. Simon Cooper <sc@sgi.com> CS155 Firewalls 22 May 2003

Mobile Communications Chapter 9: Mobile Transport Layer

TCP Performance Management for Dummies

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

Overview of TCP/IP. TCP/IP and Internet

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

(Refer Slide Time: 02:17)

Internet Protocols. Background CHAPTER

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

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

Objectives of Lecture. Network Architecture. Protocols. Contents

IP - The Internet Protocol

TCP/IP and the Internet

Effect of Packet-Size over Network Performance

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

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

Network layer: Overview. Network layer functions IP Routing and forwarding

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

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

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

The Transport Layer and Implica4ons for Network Monitoring. CS 410/510 Spring 2014

Protocols. Packets. What's in an IP packet

Network Programming TDC 561

CSMA/CA. Information Networks p. 1

CHAPTER 1 PRINCIPLES OF NETWORK MONITORING

Data Networks Summer 2007 Homework #3

Frequently Asked Questions

The Transport Layer. Antonio Carzaniga. October 24, Faculty of Informatics University of Lugano Antonio Carzaniga

8.2 The Internet Protocol

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

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

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

Challenges of Sending Large Files Over Public Internet

The present and the future of TCP/IP

CPS221 Lecture: Layered Network Architecture

Improved Digital Media Delivery with Telestream HyperLaunch

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

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

Internet Control Protocols Reading: Chapter 3

MASTER'S THESIS. Testing as a Service for Machine to Machine Communications. Jorge Vizcaíno 2014

EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics and Computer Science

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

Internet Architecture and Philosophy

LESSON Networking Fundamentals. Understand TCP/IP

Internet Protocol: IP packet headers. vendredi 18 octobre 13

A Distributed Approach to Collecting End-to-End Network Performance Measurements

Network Security I: Overview

Lecture Computer Networks

Data Link Layer Overview

Solution of Exercise Sheet 5

Introduction to TCP/IP

Digital Audio and Video Data

Transcription:

TOC: Transport Protocols Why? Overview UDP TCP Summary TOC Transport

Why? IP provides a weak, but efficient service model (best-effort) Packets can be delayed, dropped, reordered, duplicated Packets have limited size (why?) IP packets are addressed to a host How to decide which application gets which packets? How should hosts send into the network? Too fast is bad; too slow is not efficient TOC Transport Why?

Overview Basic Features Illustration Ports UDP TCP Headers TOC Transport Overview

Basic Features Can provide more reliability, in order delivery, at most once delivery Supports messages of arbitrary length Provide a way to decide which packets go to which applications (multiplexing/demultiplexing) Govern when hosts should send data TOC Transport Overview Basic Features

Illustration Application HTTP RA DNS ports p1 p2 p1 p2 p3 p1 p2 Transport IP A B C [A B p1 p2 ] UDP: Not reliable TCP: Ordered, reliable, well-paced TOC Transport Overview Illustration

Ports Need to decide which application gets which packets Solution: map each socket to a port Client must know server s port Separate 16-bit port address space for UDP and TCP (src IP, src port, dst IP, dst port) uniquely identifies TCP connection Well known ports (0-1023): everyone agrees which services run on these ports e.g., ssh:22, http:80 on UNIX, must be root to gain access to these ports (why?) ephemeral ports(most 1024-65535): given to clients e.g. chatclient gets one of these TOC Transport Overview Ports

UDP User Datagram Protocol minimalist transport protocol same best-effort service model as IP messages of up to 64KB provides multiplexing/demultiplexing to IP does not provide congestion control advantage over TCP: does not increase end-to-end delay over IP application example: video/audio streaming TOC Transport Overview UDP

TCP Transmission Control Protocol reliable, in-order, and at most once delivery messages can be of arbitrary length provides multiplexing/demultiplexing to IP provides congestion control and avoidance increases end-to-end delay over IP e.g., file transfer, chat TOC Transport Overview TCP

Headers IP header used for IP routing, fragmentation, error detection (we study that when we explore IP) UDP header used for multiplexing/demultiplexing, error detection TCP header used for multiplexing/demultiplexing, flow and congestion control Sender Receiver data Application Application data TCP/UDP data TCP UDP TCP UDP TCP/UDP data IP TCP/UDP data IP IP IP TCP/UDP data TOC Transport Overview Headers

UDP Service: Send datagram from (IPa, Port 1) to (IPb, Port 2) Service is unreliable, but error detection possible Header: 0 16 31 Source port Destination port UDP length UDP checksum Payload (variable) UDP length is UDP packet length (including UDP header and payload, but not IP header) Optional UDP checksum is over UDP packet Why have UDP checksum in addition to IP checksum? Why not have just the UDP checksum? Why is the UDP checksum optional? TOC Transport UDP

TCP Service Steps 3-Way Handshake State Diagram: 1 State Diagram: 2 Header Sliding Window Protocol TOC Transport TCP

Service Start a connection Reliable byte stream delivery from (IPa, TCP Port 1) to (IPb, TCP Port 2) Indication if connection fails: Reset Terminate connection TOC Transport TCP Service

Steps SYN n; ACK k+1 ACK k+n+1 SYN k DATA k+1; ACK n+1 3-way handshake data exchange FIN ACK FIN FIN FIN ACK ½ close ½ close TOC Transport TCP Steps

3WH Description Rationale TOC Transport TCP 3WH

Description Goal: agree on a set of parameters: the start sequence number for each side Starting sequence numbers are random. Client (initiator) Active connect() Open SYN, SeqNum = x SYN and ACK, SeqNum = y and Ack = x + 1 Server listen() accept() Passive Open ACK, Ack = y + 1 allocate buffer space TOC Transport TCP 3WH - Description

Rationale Three-way handshake adds 1 RTT delay Why? congestion control: SYN (40 byte) acts as cheap probe Protects against delayed packets from other connection (would confuse receiver) TOC Transport TCP 3WH - Rationale

State Diagram 1 Closed A SYN B SYN sent Established Data + ACK SYN + ACK ACK FIN Wait-1 FIN FIN.ack Timed Wait Closed FIN Wait-2 (1) FIN FIN.ack Listen SYN received Established Close Wait Last Ack Closed (1): A waits in case B retransmits FIN and A must ack again TOC Transport TCP State Diagram 1

State Diagram 2 TOC Transport TCP State Diagram 2

Header 0 4 10 16 31 Source port Destination port Sequence number Acknowledgement HdrLen Flags Advertised window Checksum Urgent pointer Options (variable) Payload (variable) Sequence number, acknowledgement, and advertised window used by sliding-window based flow control Flags: SYN, FIN establishing/terminating a TCP connection ACK set when Acknowledgement field is valid URG urgent data; Urgent Pointer says where non-urgent data starts PUSH don t wait to fill segment RESET abort connection TOC Transport TCP Header

Sliding Window Protocol Objectives Stop & Wait Go-Back-n TOC Transport TCP SWP

Objectives Retransmit missing packets Numbering of packets and ACKs Do this efficiently Keep transmitting whenever possible Detect missing ACKs and retransmit quickly TOC Transport TCP SWP Objectives

Stop & Wait Send; wait for ack If timeout, retransmit; else repeat TRANS Sender DATA Receiver RTT ACK Inefficient if TRANS << RTT Time TOC Transport TCP SWP S&W

Go-Back-n (GBN) Definition Illustration without errors Illustration with errors Sliding window rules Sliding window example Observations Round-Trip Timing The question of ACKs TOC Transport TCP SWP GBN

Definition Transmit up to n unacknowledged packets If timeout for ACK(k), retransmit k, k+1, TOC Transport TCP SWP GBN Definition

Example without errors n = 9 packets in one RTT instead of 1 Fully efficient Time TOC Transport TCP SWP GBN No Errors

Example with errors Timeout Packet 5 1 2 3 4 5 6 7 5 6 7 Window size = 3 packets Time Sender Receiver TOC Transport TCP SWP GBN Errors

Sliding Window Rules window = collection of adjacent sequence numbers the size of the collection is the window size Let A be the last ack d packet of sender without gap; then window of sender = {A+1, A+2,, A+n} Sender can send packets in its window Let B be the last received packet without gap by receiver, then window of receiver = {B+1,, B+n} Receiver can accept out of sequence, if in window TOC Transport TCP SWP GBN Rules

Sliding Window Example 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 3 2 6 5 4 7 5 7 6 Last ACKed (without gap) Last received (without gap) TOC Transport TCP SWP GBN SW Ex.

Observations With sliding windows, it is possible to fully utilize a link, provided the window size is large enough. Throughput is ~ (w/rtt); Stop & Wait is like w = 1. Sender has to buffer all unacknowledged packets, because they may require retransmission Receiver may be able to accept out-of-order packets, but only up to its buffer limits TOC Transport TCP SWP GBN Observations

Timing Objective Illustration Adaptation Algorithm TOC Transport TCP SWP GBN Timing

Objective So, the sender needs to set timers in order to know when to retransmit a packet the may have been lost How long to set the timer for? Too short: may retransmit before data or ACK has arrived, creating duplicates Too long: if a packet is lost, will take a long time to recover (inefficient) TOC Transport TCP SWP GBN Timing Objective

Illustrations 1 1 RTT 1 1 1 Timer too long Timer too short TOC Transport TCP SWP GBN Timing Illustrations

Adaptation The amount of time the sender should wait is about the round-trip time (RTT) between the sender and receiver For link-layer networks (LANs), this value is essentially known For multi-hop WANS, rarely known Must work in both environments, so protocol should adapt to the path behavior Measure successive ack delays T(n) Set timeout = average + 4 deviations TOC Transport TCP SWP GBN Timing Adaptation

Algorithm Use exponential averaging: A(n) = ba(n- 1) + (1 b)t(n) D(n) = bd(n-1) + (1 b) T(n) A(n) Timeout(n) = A(n) +4D(n) Notes: 1. Measure T(n) only for original transmissions 2. Double Timeout after timeout Justification: timeout indicates likely congestion; Further retransmissions would make things worse 3. Reset Timeout = A + 4D for new packet and when receive ACK TOC Transport TCP SWP GBN Timing Algorithm

The question of ACKs What exactly should the receiver ACK? Some possibilities: ACK every packet, giving its sequence number use cumulative ACK, where an ACK for number n implies ACKS for all k < n use negative ACKs (NACKs), indicating which packet did not arrive use selective ACKs (SACKs), indicating those that did arrive, even if not in order TOC Transport TCP SWP GBN Timing ACKs

Summary UDP: Multiplex, detect errors TCP: Reliable Byte Stream 3WH; Exchange; Close Reliable transmissions: ACKs S&W not efficient Go-Back-n What to ACK? (cumulative, ) Timer Value: based on measured RTT Next: Congestion and Flow Control TOC Transport Summary