Fall & Walrand Lecture 22. n A > Seq k, SYN > B. n A <--- Seq j, ACK k+1, SYN+ACK <-- B

Similar documents
Transport Layer Protocols

Computer Networks UDP and TCP

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

Internet Architecture and Philosophy

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

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

IP - The Internet Protocol

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

Computer Networks. Chapter 5 Transport Protocols

Chapter 5. Transport layer protocols

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

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

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

Network Layer: Network Layer and IP Protocol

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

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

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

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

What is a DoS attack?

Ethernet. Ethernet. Network Devices

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

Final for ECE374 05/06/13 Solution!!

Access Control: Firewalls (1)

IP address format: Dotted decimal notation:

Visualizations and Correlations in Troubleshooting

Overview of TCP/IP. TCP/IP and Internet

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)

ACHILLES CERTIFICATION. SIS Module SLS 1508

How do I get to

TCP Performance Management for Dummies

Transport Layer. Chapter 3.4. Think about

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

This sequence diagram was generated with EventStudio System Designer (

Higher Layer Protocols: UDP, TCP, ATM, MPLS

Lecture Computer Networks

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

NETWORK LAYER/INTERNET PROTOCOLS

Objectives of Lecture. Network Architecture. Protocols. Contents

IP addressing and forwarding Network layer

RARP: Reverse Address Resolution Protocol

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

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

Internet Protocols. Background CHAPTER

Lecture 16: TCP/IP Vulnerabilities: IP Spoofing and Denial-of-Service Attacks. Lecture Notes on Computer and Network Security

Internet Protocols Fall Lectures 7-8 Andreas Terzis

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

Network Programming TDC 561

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

CPS221 Lecture: Layered Network Architecture

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

Chapter 11. User Datagram Protocol (UDP)

8.2 The Internet Protocol

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

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

2 TCP-like Design. Answer

Internet Protocols Fall Outline

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

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

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

[Prof. Rupesh G Vaishnav] Page 1

Command Manual - Network Protocol Quidway S3000 Series Ethernet Switches. Table of Contents

Application Note. Windows 2000/XP TCP Tuning for High Bandwidth Networks. mguard smart mguard PCI mguard blade

Introduction to IP networking

Introduction to TCP/IP

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

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

Troubleshooting Tools

Attack Lab: Attacks on TCP/IP Protocols

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

Improved Digital Media Delivery with Telestream HyperLaunch

TCP in Wireless Mobile Networks

Subnetting,Supernetting, VLSM & CIDR

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

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

Networks: IP and TCP. Internet Protocol

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

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

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Networking Test 4 Study Guide

Exercises TCP/IP Networking. Solution. With Solutions

CS 78 Computer Networks. Internet Protocol (IP) our focus. The Network Layer. Interplay between routing and forwarding

04 Internet Protocol (IP)

Recent advances in transport protocols

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

Introduction to IP v6

Network Simulation Traffic, Paths and Impairment

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

Network Security I: Overview

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

Route Discovery Protocols

Internet Control Protocols Reading: Chapter 3

Transport and Network Layer

Answers to Sample Questions on Network Layer

Understanding Layer 2, 3, and 4 Protocols

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

Classful IP Addressing. Classless Addressing: CIDR. Routing & Forwarding: Logical View of a Router. IP Addressing: Basics

TCP Offload Engines. As network interconnect speeds advance to Gigabit. Introduction to

TCP over Wireless Networks

Transcription:

Steady State Operation, Lecture 22 Kevin Fall kfall@cs.berkeley.edu Jean Walrand wlr@eecs.berkeley.edu Typical operation looks like this: Seq CK Win Seq CK Win - Fall & Walrand 783 TCP Sequence Numbers Sequence numbers are used to provide reliability (ordering, protection from duplicates, etc) Each endpoint chooses its own initial sequence number (which is not fixed) Need a way for each endpoint to learn the other endpoint s sequence number space Do this during connection establishment TCP Connection Setup TCP Connections are bi-directional, so need each end to understand its peer s starting sequence number (not zero). Uses a three-way handshake: n -----------> Seq k, SYN ------------> n <--- Seq j, CK k+1, SYN+CK <-- n ----> Seq k+1, CK j+1, CK ----> - Fall & Walrand 784 - Fall & Walrand 785 TCP Connection Tear-Down Need to tear down both directions of the TCP connection. Uses modified 3- way handshake: n ---- Seq k, CK j+1, FIN+CK ------> n <--- Seq j, CK k+1, CK <-- n... sometime later... n <--- Seq j, CK k+1, FIN+CK <-- n ----> Seq k, CK j+1, CK ----> TCP State Transitions Each end of each TCP connection operates as a finite state machine States are used primarily to indicate pending connection open or pending connection close - Fall & Walrand 786 - Fall & Walrand 787

TCP State Diagram Seq:i SYN Win - Fall & Walrand 788 SYN_SENT LISTEN - Fall & Walrand 789 Seq:i+1 CK:j+1 CK Win Seq:j CK:i+1 SYN,CK Win SYN_SENT SYN_RCVD - Fall & Walrand 790 ESTLISHED SYN_RCVD - Fall & Walrand 791 oth ESTLISHED, exchange data... Connection tear-down... Seq:t CK:q CK,FIN Win ESTLISHED ESTLISHED - Fall & Walrand 792 FIN_WIT_1 ESTLISHED - Fall & Walrand 793

pp on must now close... Seq:q CK:t+1 CK Win FIN_WIT_1 CLOSE_WIT - Fall & Walrand 794 FIN_WIT_2 CLOSE_WIT - Fall & Walrand 795 Connection tear-down... Connection tear-down... Seq:t+1 CK:q+1 CK Win Seq:q CK:t+1 CK,FIN Win FIN_WIT_2 LST_CK - Fall & Walrand 796 TIMED_WIT LST_CK - Fall & Walrand 797 Client now waits 2*MSL before returning to CLOSED state ( may RTX a FIN) TIMED_WIT - Fall & Walrand 798 CLOSED 2MSL Wait MSL (Max Segment Lifetime) n specified as 2 minutes (RFC793, 1122) n When cleaning up a connection, it is conceivable that packets belonging to the connection are still in the network n y holding the connection state, can absorb these without them returning to new instantiations of the same connection - Fall & Walrand 799

Related Issue So, we mentioned that TCPs do not use zero for an initial sequence number ISNs are supposed to be chosen so that packets belonging to an earlier instantiation of the same connection aren t accepted as valid One way is to use a system-wide ISN counter (increment every 4us say) Security concerns suggest random ISNs Urgent Data In the TCP header, we see support for urgent data Urgent data may be indicated by an application, and appears immediately after a TCP header in the data stream Marked in a segment by the URG bit being on, and the pointer indicating the offset of the last byte of urgent data Urgent data overcomes flow control - Fall & Walrand 0 - Fall & Walrand 1 Maximum Segment Size (MSS) TCP chooses the size of segments it will send During connection establishment, a TCP can specify to its peer its MSS. Peer will not send segments of size > MSS. Congestion control computations usually performed in terms of MSS Is peer s MSS the right size to use? Choosing a Segment Size Never want to send segments longer than peer s MSS, but what about smaller: n if larger than path MTU, may fragment n if smaller than path MTU, inefficient Recall, we may use path MTU discovery: n set DF bit in IP header of each packet n look for ICMP unreachable messages; newer ones contain next-hop MTU n if lacking that, just choose common sizes - Fall & Walrand 2 - Fall & Walrand 3 The Push Function TCP spec has a notion of push function which would presumably cause data to be delivered without delay Generally, no way for app to express its desire to perform push, thus no guarantee of effectiveness That said, most TCPs turn on the PSH bit when emptying send buffer The TCP Checksum TCP checksum is completely analogous to the UDP checksum (same algorithm, but required for TCP) Uses slightly different pseudoheader: Source IP Destination IP zero proto TCP length length field is derived entirely from IP - Fall & Walrand 4 - Fall & Walrand 5

TCP Performance Issues Recall sliding window protocols obtain throughput ~ (w/rtt) If w is artificially limited, can reduce throughput: n send buffer limitation at sender n receive buffer limitation at receiver n inability of protocol to represent large windows TCP Window Scaling Option Note that ordinary TCP header allocates only 16 bits for window advertisement Limits maximum window to 64K, limiting max throughput TCPs supporting RFC1323 provide window scaling, shifts window field left by up to 14 (about 1Gyte) - Fall & Walrand 6 - Fall & Walrand 7 TCP Timestamp Option Conventional TCP keeps only 1 timer, maintained and endpoint With RFC1323 timestamps, each segment contains a timestamp Sender computes RTT estimate based on returned timestamps in CKs Provides another useful property Wrapped Sequence Numbers TCP Sequence and CK fields contain 32-bit values If we used a 1G window, we could conceivably wrap the sequence number space to a point where old (misdirected) packets could reappear and contain a valid sequence number Timestamp field extends sequence number to resolve this condition - Fall & Walrand 8 - Fall & Walrand 9 Recent (Major) Enhancements Selective CK RFC 2018, 2883 n Use option area to indicate to sender what out of order data exists at receiver n Sender may skip already-delivered data n Sender uses special congestion control during recovery n RFC 2883 introduces DSCKs which carry information about duplicate segments received n Can help to distinguish re-ordering vs loss Recent (Major) Enhancements Explicit Congestion Notification (ECN) n Router can mark bit in IP header indicating packet encountered congestion in transit n TCP receiver reflects CE bit in returning TCP option space until sender slows down n TCP endpoints cooperate to slow down prior to packet drops [may use RED for QM] n RFC 3168 - Fall & Walrand 810 - Fall & Walrand 811

Recent (Minor) Enhancements New-Reno Congestion voidance n During recovery, delay deflation of window n Helps avoid Reno lock-up w/multiple drops n RFC 2582 Limited Transmit n lways allowed to send off the top for first 2 DUPCKs received n Helps in cases of loss with small windows, [see RFC 3042] TCP Summary Reliable, connection oriented transport Stream service on IP datagram network Flow control, congestion control Silly window avoidance (Nagle) daptive retransmission with exponential backoff (Karn) Several options improve performance (described in RFC1323) - Fall & Walrand 812 - Fall & Walrand 813 Word on Implementation The pplication View Typical implementations are of the following form: PI Transport Network Drivers User Space Services pp Protocols System-Level PI TCP UDP IP D1 D2 D3 D4 Kernel - Fall & Walrand 814 pplications are written to a particular PI (e.g. sockets) providing access to multiple protocols asic functions: n open and close connections n send and receive datagrams n read and write data n set/get options - Fall & Walrand 815 PI Implementation Networking PI is a combination of libraries and system calls: n libraries: application-layer, linked with app n system calls: function calls implemented within the operating system (executed via traps) Important internal objects: n buffering data structure (e.g. Unix mbufs) n lookup maps (e.g. Unix PC s) n event and timer management uffers Used pervasively to hold packets, and sometimes for other things too Used to form queues: n Input: interface receive queue, IP input queue, IP fragment reassembly queues, TCP reassembly queues, app queue (socket buffer) n Output: app queue (socket buffer), TCP retransmission queue, interface output queue - Fall & Walrand 816 - Fall & Walrand 817

Operations on uffers Important operations on buffers: n enque, deque n prepend/remove headers n partial or full copy Other issues: n placement of packet in buffer may have profound impact on performance... for example, typically better to arrange for word alignment of IP header on receive and extra space at beginning on allocation Lookup Maps Often need a way to map a received network message to its intended receiver: n Ethernet type field to network protocol n IP protocol field to transport protocol n port number pair to intended receive process w [note: this one may be very large] Original techniques based on linear search didn t scale. Now mostly hashing. - Fall & Walrand 818 - Fall & Walrand 819 Timers and Events Uses for timers: TCP timers (RTX, persist, keep-alive, 2*MSL, delayed CK), frag reassembly, RP cache, IGMP reports Timers generally run off the computer s clock interrupt, often divided down to intervals such as 10ms up to 500ms Two common techniques: use system-defined periodic dispatcher [common in TCP/IP], use specific deadline - Fall & Walrand 820