Networking (from an OS perspective) Yin Lou 10/08/2009.

Slides:



Advertisements
Similar presentations
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Advertisements

Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
3-1 TCP Protocol r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 16 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
Transport Layer3-1 Summary of Reliable Data Transfer Checksums help us detect errors ACKs and NAKs help us deal with errors If ACK/NAK has errors sender.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
10/7/ /9/2003 TCP and Congestion Control October 7-9, 2003.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
1 Announcement r Project 2 out m Much harder than project 1, start early! r Homework 2 due next Tuesday.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
Announcement Project 2 out –Much harder than project 1, start early! Homework 2 due next Tu.
The Future r Let’s look at the homework r The next test is coming the 19 th (just before turkey day!) r Monday will finish TCP canned slides r Wednesday.
Transport Layer3-1 Data Communication and Networks Lecture 7 Transport Protocols: TCP October 21, 2004.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Announcement Homework 1 graded Homework 2 out –Due in a week, 1/30 Project 2 problems –Minet can only compile w/ old version of gcc (2.96). –Only tlab-login.
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
A Simulation of Adaptive Packet Size in TCP Congestion Control Zohreh Jabbari.
Transport Layer3-1 TCP sender (simplified) NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from.
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
CS540/TE630 Computer Network Architecture Spring 2009 Tu/Th 10:30am-Noon Sue Moon.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
2: Transport Layer 21 Transport Layer 2. 2: Transport Layer 22 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_b Transport Protocols - TCP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
1 End-to-End Protocols (UDP, TCP, Connection Management)
Copyright © Lopamudra Roychoudhuri
What is TCP? Connection-oriented reliable transfer Stream paradigm
Computer Networking Lecture 18 – More TCP & Congestion Control.
TCP: Transmission Control Protocol Part II : Protocol Mechanisms Computer Network System Sirak Kaewjamnong Semester 1st, 2004.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Congestion Avoidance and Control Van Jacobson and Michael Karels Presented by Sui-Yu Wang.
September 26 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
ECE 4110 – Internetwork Programming
TCP. TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already.
TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
Chapter 3 Transport Layer
Chapter 3 outline 3.1 Transport-layer services
DMET 602: Networks and Media Lab
CS 1652 Jack Lange University of Pittsburgh
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Chapter 5 TCP Transmission Control
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
CS4470 Computer Networking Protocols
Chapter 3 Transport Layer
Presentation transcript:

Networking (from an OS perspective) Yin Lou 10/08/2009

Outline Background TCP Review Congestion Avoidance and Control TCP Congestion Control with a Misbehaving Receiver Summary

Background IEEE: “A Protocol for Packet Network Interconnection.” – In May, 1974 Vint Cerf and Bob Kahn – Turing Award "pioneering work on internetworking, including.. the Internet's basic communications protocols.. and for inspired leadership in networking." – “The father of the Internet” Background

Outline Background TCP Review Congestion Avoidance and Control TCP Congestion Control with a Misbehaving Receiver Summary

OSI Levels TCP Review Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical Network Data Link Physical Node ANode B Router

Overview Connection-oriented – Handshaking before data exchange Reliable, ordered, byte-stream protocol Full duplex data – bi-directional data flow in same connection – MSS: maximum segment size Flow controlled – Sender will not overwhelm receiver TCP Review

Sender Events Event at Sender Data received from app Timeout ACK received TCP Sender action Create segment with seq. # Start timer if not already running Retransmit segment that caused timeout Restart timer If acknowledges previously unacked segments Update what is known to be acked Start timer if there are outstanding segments TCP Review

Retransmission Host A Seq=92, 8 bytes data ACK=100 loss timeout Lost ACK scenario Host B X Seq=92, 8 bytes data ACK=100 time SendBase = 100 TCP Review

Retransmission TCP Review Host A Seq=100, 20 bytes data ACK=100 time Premature timeout Host B Seq=92, 8 bytes data ACK=120 Seq=92, 8 bytes data Seq=92 timeout ACK=120 Seq=92 timeout SendBase = 120 SendBase = 120 Sendbase = 100

Retransmission TCP Review Host A Seq=92, 8 bytes data ACK=100 loss timeout Cumulative ACK scenario Host B X Seq=100, 20 bytes data ACK=120 time SendBase = 120

Receiver Events Event at Receiver Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. #. Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap TCP Review

Fast Retransmission Long time-out period – long delay before resending lost packet Detect lost segments via duplicate ACKs – Sender often sends many segments back-to-back – If segment is lost, there will likely be many duplicate ACKs 3 ACKs indicates a segment loss – fast retransmit: resend segment before timer expires TCP Review

Outline Background TCP Review Congestion Avoidance and Control TCP Congestion Control with a Misbehaving Receiver Summary

Congestion Avoidance and Control Motivation – Data throughput from LBL to UC Berkeley dropped from 32Kbps to 40 bps (factor-of thousand drop) in Oct.’86 Conservation of packets – Connection “in equilibrium”: running stably with a full window of data in transit – Packet flow “conservative”: A new packet isn’t put into the network until an old packet leaves. Congestion Avoidance and Control

4BSD TCP slow-start round-trip-time variance estimation exponential retransmit timer backoff more aggressive receiver ACK policy dynamic window sizing on congestion Karn’s clamped retransmit backoff fast retransmit Congestion Avoidance and Control

Packet Conservation to Fail 1.The connection doesn’t get to equilibrium 2.A sender injects a new packet before an old packet has exited 3.The equilibrium can’t be reached because of resource limits along the path Congestion Avoidance and Control

Getting to Equilibrium: Slow Start When connection begins, cwnd = 1 MSS (congestion window) Increase rate exponentially until first loss event – double cwnd every RTT – done by incrementing cwnd for every ACK received Summary – initial rate is slow but ramps up exponentially fast Congestion Avoidance and Control Host A one segment RTT Host B time two segments four segments

Getting to Equilibrium: Slow Start Congestion Avoidance and Control Startup behavior of TCP without Slow-start

Getting to Equilibrium: Slow Start Congestion Avoidance and Control Startup behavior of TCP with Slow-start

Packet Conservation 1.The connection doesn’t get to equilibrium 2.A sender injects a new packet before an old packet has exited 3.The equilibrium can’t be reached because of resource limits along the path Congestion Avoidance and Control

Conservation at Equilibrium: RTT EstimatedRTT = α * EstimatedRTT + (1 - α) * SampleRTT – α = 0.9, filter gain constant Timeout Interval = β * EstimatedRTT – Β = 2 Common mistakes – Not estimating the variation of the RTT – A connection will respond to load increases by retransmitting packets that have only been delayed in transit. Forces the network to do useless work Congestion Avoidance and Control

Conservation at Equilibrium: RTT EstimatedRTT = (1 - g) * EstimatedRTT + g * SampleRTT – The paper suggests g = 0.125, the gain EstimtedRTT plus “safety margin” – large variation in EstimatedRTT -> larger safety margin How much SampleRTT deviates from EstimatedRTT: – DevRTT = 0.75* DevRTT * |SampleRTT-EstimatedRTT| Timeout Interval = EstimatedRTT + 4 * DevRTT Congestion Avoidance and Control

Packet Conservation 1.The connection doesn’t get to equilibrium 2.A sender injects a new packet before an old packet has exited 3.The equilibrium can’t be reached because of resource limits along the path Congestion Avoidance and Control

Adapting to the Path: Congestion Avoidance Packets get lost for two reasons: – Damaged in transit (<< 1%) – Network is congested and somewhere on the path there was insufficient buffer capacity Congestion avoidance strategy: – Network must be able to signal the transport endpoints – The endpoints must have a policy Congestion Avoidance and Control

Adapting to the Path: Congestion Avoidance On no congestion (Additive Increase): – cwnd i = cwnd i-1 + u (u << cwnd max ) – The paper suggests u = 1 On congestion (Multiplicative Decrease): – cwnd i = d * cwnd i-1 (d < 1) – The paper suggests d = 0.5 Congestion Avoidance and Control

Adapting to the Path: Congestion Avoidance The combined slow-start with congestion avoidance algorithm Additive increase / Multiplicative decrease (AIMD) Congestion Avoidance and Control

Summary Slow start RTT estimation Congestion avoidance algorithm (AIMD) Congestion Avoidance and Control

Outline Background TCP Review Congestion Avoidance and Control TCP Congestion Control with a Misbehaving Receiver Summary

TCP Congestion Control with A Misbehaving Receiver Misbehaving receiver can achieve the same result of the misbehaving sender – Less obviously compared to a misbehaving sender TCP’s vulnerabilities arise from a combination of: – unstated assumptions – casual specification – a pragmatic need to develop congestion control mechanisms that are backward compatible with previous TCP implementations TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – ACK Division RFC 2581: – During slow start, TCP increments cwnd by at most MSS bytes for each ACK received that acknowledges new data. – During congestion avoidance, cwnd is incremented by 1 full-sized segment per round-trip-time (RTT). Attack 1: – Receive a data segment containing N bytes – Receiver divides the resulting acknowledgement into M, where M ≤ N, separate acknowledgements – each covering one of M distinct pieces of the received data segment. TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – ACK Division Growing cwnd at a rate that is M times faster TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – DupACK Spoofing RFC 2581: – (Fast recovery) Set cwnd to ssthresh plus 3*MSS. This artificially "inflates" the congestion window by the number of segments(three) that have left the network and which the receiver has buffered. – For each additional duplicate ACK received, increment cwnd by MSS. This artificially inflates the congestion window in order to reflect the additional segment that has left the network. Problems: – It assumes that each segment that has left the network is full sized – TCP requires that duplicate ACKs be exact duplicates, there is no way to ascertain which data segment they were sent in response to. TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – DupACK Spoofing Attack 2: – Receive a data segment – The receiver sends a long stream of acknowledgements for the last sequence number received. TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – Optimistic ACKing Problems: – TCP’s algorithm assumes that the time between a data segment being sent and an acknowledgement for that segment returning is at least one round-trip time. – But the protocol does not use any mechanism to enforce its assumption. Attack 3: – Receive a data segment – The sender sends a stream of acknowledgements anticipating data that will be sent by the sender. TCP Congestion Control with A Misbehaving Receiver

Misbehaving Receiver – Optimistic ACKing TCP Congestion Control with A Misbehaving Receiver Data from the sender which is lost may be unrecoverable since it has already been ACKed.

Solutions – ACK division Modify the congestion control mechanisms to operate at byte granularity Guarantee that segment-level granularity is always respected – Perhaps simpler – Only increment cwnd by one MSS when a valid ACK arrives that covers the entire data segment sent. TCP Congestion Control with A Misbehaving Receiver

Solutions – ACK division TCP Congestion Control with A Misbehaving Receiver

Solutions – DupACK Spoofing Traditional method: Singular Nonce – Two new fields introduced into the TCP packet format: Nonce and Nonce reply. – For each segment, the sender fills the Nonce field with a unique random number generated when the segment is sent. The solution requires the modification of clients and servers and the addition of a TCP field. – Sender maintains a count of outstanding segments sent above the missing segment – For each duplicate acknowledgement this count is decremented – When it reaches zero any additional duplicate ACKs are ignored. TCP Congestion Control with A Misbehaving Receiver

Solutions – DupACK Spoofing TCP Congestion Control with A Misbehaving Receiver

Solutions – Optimistic ACKing Well addressed using nonce – Single nonce is imperfect: does not mirror the cumulative nature of TCP. Cumulative Nonce TCP Congestion Control with A Misbehaving Receiver

Solutions – Optimistic ACKing TCP Congestion Control with A Misbehaving Receiver

Different TCP Implementations TCP Congestion Control with A Misbehaving Receiver

Outline Background TCP Review Congestion Avoidance and Control TCP Congestion Control with a Misbehaving Receiver Summary

Congestion Avoidance and Control – Slow start – RTT estimation: Timeout Interval – Congestion avoidance Misbehaving Receiver – ACK division – DupACk spoofing – Optimistic ACKing Summary

Thank You