CSCD 330 Network Programming Winter 2015

Similar documents
CSCD 330 Network Programming Spring 2018 Lecture 11a Transport Layer

CNT 6885 Network Review on Transport Layer

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

Lecture 11. Transport Layer (cont d) Transport Layer 1

CSCI Topics: Internet Programming Fall 2008

CC451 Computer Networks

Computer Networking Introduction

Lecture 8. TCP/IP Transport Layer (2)

Flow and Congestion Control (Hosts)

Mid Term Exam Results

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

CSCI Topics: Internet Programming Fall 2008

Chapter 3 Transport Layer

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Chapter 3- parte B outline

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Chapter 3 Transport Layer

Chapter III: Transport Layer

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

Chapter 3 Transport Layer

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

CS Lecture 1 Review of Basic Protocols

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 10

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Master Course Computer Networks IN2097

Chapter 6 Transport Layer

CSCI Topics: Internet Programming Fall 2008

Chapter 3 Transport Layer

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

Lecture 15: Transport Layer Congestion Control

TCP congestion control:

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Transport Protocols and TCP

Transport Layer: outline

CS321: Computer Networks Congestion Control in TCP

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

Go-Back-N. Pipelining: increased utilization. Pipelined protocols. GBN: sender extended FSM

Chapter 3 Transport Layer

Congestion Control. Principles of Congestion Control. Network-assisted Congestion Control: ATM. Congestion Control. Computer Networks 10/21/2009

UNIT IV -- TRANSPORT LAYER

The Transport Layer Congestion control in TCP

3.7 TCP congestion. reliable data transfer. sliding window. Lecture 4: Transport layer III: flow control and congestion control & Network layer I: IP

Foundations of Telematics

Transport Layer Congestion Control

Chapter III: Transport Layer

Fall 2012: FCM 708 Bridge Foundation I

Congestion Control. Principles of Congestion Control. Network assisted congestion. Asynchronous Transfer Mode. Computer Networks 10/23/2013

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

Transport Layer: Outline

Data Communications & Networks. Session 9 Main Theme Network Congestion Causes, Effects, Controls, and TCP Applications. Dr. Jean-Claude Franchitti

CSC 8560 Computer Networks: TCP

CSC 4900 Computer Networks: TCP

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Outline. CS5984 Mobile Computing

Chapter 3 Transport Layer

Master Course Computer Networks IN2097

TCP: Overview RFCs: 793,1122,1323, 2018, 2581

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

ECE 610: Homework 4 Problems are taken from Kurose and Ross.

CSE 4213: Computer Networks II

CSC 401 Data and Computer Communications Networks

Detecting half-open connections. Observed TCP problems

TCP Congestion Control

TCP Congestion Control

10 minutes survey (anonymous)

NWEN 243. Networked Applications. Layer 4 TCP and UDP

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

TCP : Fundamentals of Computer Networks Bill Nace

Flow and Congestion Control Marcos Vieira

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

Transport Protocols and TCP: Review

Chapter 3 Transport Layer

CSCD 330 Network Programming

Chapter 3 Transport Layer

ECE 650 Systems Programming & Engineering. Spring 2018

Congestion Control in TCP

Congestion Control. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Principles of congestion control

CSC 401 Data and Computer Communications Networks

The Transport Layer: TCP & Congestion Control

Chapter 3 Transport Layer

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

ECE697AA Lecture 3. Today s lecture

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

CSCE 463/612 Networks and Distributed Processing Spring 2017

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Multiple unconnected networks

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Internet Applications and the Application Layer Material from Kurose and Ross, Chapter 2: The Application Layer

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

Transcription:

CSCD 330 Network Programming Winter 2015 Lecture 11a Transport Layer Reading: Chapter 3 Some Material in these slides from J.F Kurose and K.W. Ross All material copyright 1996-2007 1

Chapter 3 Sections Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Pipelined vs. Stop and Wait Protocols Connection-oriented transport: TCP segment structure reliable data transfer Flow control Connection management Stop Here 2

Introduction Said that TCP is reliable TCP protocol does many things to manage reliability Acknowledgments, Retransmit lost segments, Timer for retransmit management Look at other features used by TCP Flow Control Congestion Control First, examine Connection Management The States of a TCP connection 3

Connection Management 4

TCP Connection Management TCP sender, receiver establish connection before exchanging data segments Initialize TCP variables Sequence numbers Buffers, Flow control info (e.g. RcvWindow) Client - Connection initiator Socket clientsocket = new Socket("hostname",6789); Server - Contacted by client Socket connectionsocket = welcomesocket.accept(); 5

TCP Connection Management Opens Connection Three way handshake Step 1 Client host sends TCP SYN segment to server, Sets SYN flag Specifies initial sequence number No data Step 2 Server host receives SYN, replies with SYN/ACK segment Server allocates buffers Specifies server initial sequence number Step 3 Client receives SYNACK, replies with ACK segment Which may contain data Allocates buffers 6

TCP 3-Way Handshake 7

Packet 1: source: 130.57.20.10 dest.:130.57.20.1 TCP: ----- TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Initial sequence number = 12952 TCP: Next expected Seq number= 12953 TCP:.....1. = SYN TCP: Window = 8192 TCP: Checksum = 1303 (correct) TCP: Maximum segment size = 1460 (TCP Option) Packet 2: source: 130.57.20.1 dest: 130.57.20.10 TCP: ----- TCP header ----- TCP: Source port = 524 TCP: Destination port = 1026 TCP: Initial sequence number = 2744080 TCP: Next expected Seq number= 2744081 TCP: Acknowledgment number = 12953 TCP:.....1. = SYN TCP: Window = 32768 TCP: Checksum = D3B7 (correct) TCP: Maximum segment size = 1460 (TCP Option) Packet 3: source: 130.57.20.10 dest: 130.57.20.1 TCP: ----- TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Sequence number = 12953 TCP: Next expected Seq number= 12953 TCP: Acknowledgment number = 2744081 TCP:...1... = Acknowledgment TCP: Window = 8760 TCP: Checksum = 493D (correct) TCP: No TCP options Port: 1026 Only part of the TCP headers are displayed. 8 Port: 524

TCP Connection Management Closing a Connection While it takes three segments to establish a connection Takes four to terminate a connection Why do you think it takes four segments? 9

TCP Connection Management Why 4 Segments to Close TCP? TCP connection full-duplex Each direction must be shut down independently!! Rule that either end can send FIN when done sending data When TCP receives FIN, must notify application that other end has terminated that direction of data flow FIN is typically result of application issuing close, Socket.cose(); 10

TCP Connection Management (cont.) Closing a connection client server client closes socket: clientsocket.close(); Step 1: Client end system sends TCP FIN control segment to server close FIN ACK FIN close Step 2: Server receives FIN, replies with ACK Closes connection, sends FIN timed wait closed ACK 11

TCP Connection Management (cont.) Step 3: Client receives FIN, replies with ACK. Enters timed wait - will respond with ACK to received FINs closing client FIN ACK server closing Step 4: Server, receives ACK. Connection closed. FIN Timed wait is so that make sure ACK truly makes it, or Fin will get resent, connection will not be over!! timed wait closed ACK closed 12

TCP Connection Management (cont) TCP Server lifecycle TCP Client lifecycle 13

Wireshark Tutorial on TCP Sequence Numbers and ACK's Nice short tutorial plus example file on how TCP manages sequence numbers and acks http://packetlife.net/blog/2010/jun/7/understan ding-tcp-sequence-acknowledgment-numbers/

Two Types of TCP Performance Two issues to consider Flow control Coordination between sender/receiver Congestion control Behavior altered based on network conditions First, look at Flow Control

Buffers at Hosts Sending Buffer Maintains data sent but not ACKed Data written by application but not sent Receive Buffer Data that arrives out of order Data that is in correct order but not yet read by application

TCP Flow Control TCP connection created between Hosts A,B Buffers play important role in conversation between A and B!!! May be slow to read information Not required to be in sync with sender Sender can overflow buffer send data too fast How to coordinate sender/receiver flow? Use something called, Receiver Window 17

18 TCP Flow Control TCP is a sliding window protocol For window size n, can send up to n bytes without receiving an Acknowledgment When the data is acknowledged then the window slides forward Each packet advertises a window size Indicates number of bytes for which receiver has space

TCP Sliding Windows Sender Initial Window size Usable Window Can send ASAP Sender Working Window size Octets sent Usable Window Not ACKed Can send ASAP Sliding Window Protocol Sliding window algorithms for flow control Depend on receiver's Window size Sender computes its usable window = how much data it can immediately send Over time, sliding window moves to right, as receiver acknowledges data Receiver sends acknowledgments as its TCP receive buffer empties 19

Host A - Sender Host B - Receiver 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 Window size = 6 1 2 3 Octets received Octets sent Not ACKed Usable Window Can send ASAP ACK 4 1 2 3 4 5 6 7 8 9 10 11 12 13 Host B gives Host A window size of 6 (octets or bytes) Host A begins by sending octets to Host B: 1, 2, and 3 and slides it s window over showing it has sent those 3 octets Host A will not increase its usable window size by 3, until it receives an ACK from Host B that it has received some or all of octets Host B, not waiting for all 6 octets to arrive, after receiving third octet sends an ACK of 4 to Host A 20

Host A - Sender Host B - Receiver 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 Window size = 6 1 Octets sent Not ACKed Usable Window Can send ASAP 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 ACK 4 1 2 3 4 5 6 7 8 9 10 11 12 13 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 ACK 6 Host A doesn't have to wait for Ack from Host B to keep sending data, not until the window size reaches the window size of 6, so it sends octets 4 and 5 Host A receives ACK 4 and can now slide its window over to equal 6 octets, 2 octets not ACKed plus 4 more octets can be sent asap 21

Host A - Sender Host B - Receiver 22 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 Window size = 6 1 Octets sent Not ACKed Usable Window Can send ASAP 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 ACK 4 1 2 3 4 5 6 7 8 9 10 11 12 13 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 Host A doesn't have to wait for Ack from Host B to keep sending data, not until the window size reaches the window size of 6, so it sends octets 4 and 5 What happens next?

23 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 1 2 3 ACK 4 4 5 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 ACK 6 Host B - Receiver Host A - Sender Octets sent Not ACKed Usable Window Can send ASAP Window size = 6 13 12 11 10 9 8 7 6 5 4 3 2 1 7 6 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1

24 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 1 2 3 ACK 4 4 5 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 ACK 6 Host B - Receiver Host A - Sender Octets sent Not ACKed Usable Window Can send ASAP Window size = 6 13 12 11 10 9 8 7 6 5 4 3 2 1 7 6 9 8 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1

TCP Flow Control Receiver Advertises window size to sender based on buffer size allocated for the connection There is Advertised Window field in TCP header Sender cannot have more than Advertised Window bytes of unacknowledged data Buffers are of finite size RcvBuffer SendBuffer

Setting the Advertised Window On TCP Receiver side, LastByteRcvd -LastByteRead RcvBuffer Thus, it advertises space left in buffer i.e., RcvWindow = RcvBuffer - (LastByteRcvd -LastByteRead) As more data arrives i.e., more received bytes than read bytes, LastByteRcvd increases and hence, Advertised Window reduces

Sender Side Response At sender side, TCP sender should ensure that LastByteSent - LastByteAcked Advertised Window Define what is called Effective Window which limits amount of data that TCP can send Effective Window = Advertised Window - (LastByteSent - LastByteAcked) In order to prevent overflow of Send Side buffer LastByteWritten - LastByteAcked SendBuffer If application tries to write more, TCP blocks

TCP congestion control 28

Principles of Congestion Control Congestion: What causes congestion? Informally: too many sources sending too much data too fast for network to handle Different from flow control! Problem is result of many senders/receivers Symptoms of Congestion Lost packets (buffer overflow at routers) Long delays (queuing at routers) Transport Layer 3-29

Performance Metrics Two important performance measures Throughput Effective capacity (data rate) in bps reduced by protocol overhead (trans. delay for non-data bits, propagation, queueing and processing delays) Delay Transmission delay Time for transmitter to send all bits of packet Propagation delay Time for one bit to transit from source to destination Processing delay Time required to process packet at source prior to sending, at any intermediate router or switch We discussed these. What we did not discuss is Queuing delay: Time spent while waiting in queues

Queuing Delays Queuing delays are significant in performance of communications networks Grow dramatically as system approaches capacity In shared facility network, transmission line, road network, checkout lines Performance worsens exponentially as demand approaches capacity

What Is Congestion? Data network is a network of queues Congestion occurs when the number of packets being transmitted through the network approaches the packet handling capacity of the network Input and Output Queues at a Network Node

Congestion is unavoidable Arguably it s good! Packet switching because makes efficient use of links So, router buffers should be occupied If buffers are always empty, delay is low... but Usage of network is low too If buffers are always occupied, delay is high Using network more efficiently Goal is manage congestion through our protocols!!! 33

Response to Congestion Most transmission protocols use timeout and retransmission Respond to increased delay by retransmitting datagrams, increasing congestion This leads to congestion collapse So, TCP must reduce transmission rates when congestion occurs

35 Options for Network Congestion Control 1. Implemented by host versus network Endpoints deal with congestion vs. routers 2. Reservation-based, versus feedback-based Reservation based is to reserve bandwidth as in Circuit Switched Networks Feedback allows adaptation as conditions change 2. Window-based versus rate-based Window sets an amount for segments in flight Rate based negotiates a rate at time of connection

36 TCP Congestion Control TCP implements Host-based, Feedback-based, Window-based Congestion control TCP TCP sources attempt to determine how much capacity is available TCP sends packets, then reacts to observable events (loss)

TCP Congestion Control TCP doesn t rely on IP layer to provide congestion control Limits rate at which senders can send traffic using perceived congestion on path Questions: How to detect congestion? How to limit congestion? What algorithm to use to limit traffic? 37

TCP Congestion Control Old Days... Old TCPs would start a connection with sender injecting multiple segments Up to window size advertised by receiver While this is OK when two hosts on same LAN, Routers and slower links between sender and receiver, problems can arise Intermediate router could queue packets, and it's possible for that router to run out of space 38

TCP Congestion Control Goal of TCP Congestion Control Avoid!!!! Avoidance!!! Try to detect congestion and reduce load Because once congestion happens Happens at exponential rate Then, takes a long time for queues to drain Want to keep network pipes full but without danger of saturation 39

TCP Congestion Control Overall Strategy - simple Good times, no congestion -> Increase sending rate Bad times, congestion -> Decrease sending rate Details... a little more complex 40

TCP Congestion Control How does sender detect congestion? Concrete evidence Loss event Timeout, or 3 duplicate ACK's ACK ACK ACK What could you conclude about congestion if you get back acks? Acks getting back, conclude that congestion is not extreme 41

TCP Congestion Control How does sender limit congestion? TCP sender reduces rate after loss event TCP has one more variable CongWin Amount of unacked data sender can send What does it do? Imposes constraint on rate sender sends traffic into network Think of the Congestion Window like this... 42

TCP Congestion Control How does sender limit congestion? The Congestion window is flow control imposed by the sender While Receiver window is flow control imposed by the receiver Congestion Window based on sender's Assessment of perceived network congestion Receiver Window is related Amount of available buffer space at the receiver for this connection. 43

TCP Congestion Control What algorithm(s) to use to limit traffic? 3 of them AIMD Additive Inverse Multiplicative Decrease Slow start (SS) Congestion Avoidance (CA) - After timeout events Basically, Algorithms allow TCP to probe bandwidth Increases rate in response to ACK's until loss occurs Decreases rate strategically 44

TCP Congestion Control: details Adds one more constraint based on congestion So, sender limited by Either Congestion or flow at receiver Sender limits transmission: LastByteSent-LastByteAcked < min (CongWin,RcvWin) Roughly, if we ignore RcvWin SendRate = CongWin RTT Bytes/sec CongWin is dynamic, function of perceived network congestion Set to 1 MSS at beginning of connection 45

TCP Congestion Control Say, detect a loss (Lost) event Basic Idea TCP Sender decreases send rate by decreasing CongWin size Question is, by how much? Multiplicative Inverse Half the current value of CongWin size Example: CongWin 20 Kb -> 10 Kb -> 5 Kb 1 loss 2 loss Can t go lower than 1 MSS 46

TCP Congestion Control But, if no Detected Loss TCP increases its CongWin by 1 MSS Additive Increase Cautious increase since its probing for additional bandwidth Assume there is unused bandwidth could possibly take advantage of Does this every RTT!!!!! Thus, TCP Decreases its rate multiplicatively if congestion Increases its rate additively when no congestion 47

TCP Congestion Control: Additive Increase, Multiplicative Decrease Approach Increase transmission rate (window size), probing for usable bandwidth, until loss occurs Additive increase: Increase CongWin by 1 MSS every RTT until loss detected Multiplicative decrease: Cut CongWin in half after loss Saw tooth behavior: probing for bandwidth congestion window size 2 4 K b y t e s 1 6 K b y t e s 8 K b y t e s c o n g e s t i o n w i n d o w time t i m e 48

TCP Slow Start However, that wasn t fast enough. When Connection Begins, CongWin = 1 MSS Example: MSS = 500 bytes & RTT = 200 msec Initial rate = MSS/RTT or roughly 20 kbps Available bandwidth may be more than MSS/RTT Want to quickly ramp up to respectable rate Or, waste bandwidth So when connection begins Increase rate exponentially fast until first loss event 49

TCP Slow Start When connection begins, increase rate exponentially until first loss event: Double CongWin every RTT Done by incrementing CongWin for every ACK received Summary: Initial rate is slow but ramps up exponentially fast RTT Host A Host B one segment two segments four segments time 50

TCP Slow Start Packet Packet Philosphy Behind Slow Start... It operates by Observing that rate at which new packets should be injected into network Is rate at which acknowledgments are returned by other end

Refinement Implementation Yet another variable, Threshold Window size where slow start ends and linear increase begins, Congestion Avoidance At loss event, Threshold is set to 1/2 of CongWin just before loss event 52

Major TCP Variants TCP Tahoe (older) Assumed congestion signals = Lost segments Losses due to packet corruption less frequent than buffer overflows on routers Resorts back to Slow Start, until threshold where it does Congestion Avoidance, increase by 1 MSS TCP Reno Changed way it reacts to a loss If sender is still getting Acks, congestion is not so heavy, so sender can still send, since flow still exists But, send should send with less vigor So, does not fall back to slow start

More Refinement: Inferring loss After 3 dup ACKs: CongWin is cut in half Window then grows linearly But after timeout event: CongWin instead set to 1 MSS; Window then grows exponentially To a threshold, then grows linearly Philosophy: 3 dup ACKs indicates network capable of delivering some segments Timeout indicates a more alarming congestion scenario 54

Summary: TCP Congestion Control When CongWin is below Threshold, sender in slowstart phase, window grows exponentially When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS 55

TCP Sender Congestion Control State Event TCP Sender Action Commentary Slow Start (SS) Congestion Avoidance (CA) SS or CA ACK receipt for previously unacked data ACK receipt for previously unacked data Loss event detected by triple duplicate ACK CongWin = CongWin + MSS, If (CongWin > Threshold) set state to Congestion Avoidance CongWin = CongWin+MSS * (MSS/CongWin) Threshold = CongWin/2, CongWin = Threshold, Set state to Congestion Avoidance SS or CA Timeout Threshold = CongWin/2, CongWin = 1 MSS, Set state to Slow Start SS or CA Duplicate ACK Increment duplicate ACK count for segment being acked Resulting in a doubling of CongWin every RTT Additive increase, resulting in increase of CongWin by 1 MSS every RTT Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Enter slow start CongWin and Threshold not changed 56

Summary TCP congestion TCP flow 57

Takehome Midterm Email me if there are questions 58

1

Wireshark Tutorial on TCP Sequence Numbers and ACK's Nice short tutorial plus example file on how TCP manages sequence numbers and acks http://packetlife.net/blog/2010/jun/7/understan ding-tcp-sequence-acknowledgment-numbers/ 14

Performance Metrics Two important performance measures Throughput Effective capacity (data rate) in bps reduced by protocol overhead (trans. delay for non-data bits, propagation, queueing and processing delays) Delay Transmission delay Time for transmitter to send all bits of packet Propagation delay Time for one bit to transit from source to destination Processing delay Time required to process packet at source prior to sending, at any intermediate router or switch We discussed these. What we did not discuss is Queuing delay: Time spent while waiting in queues 30

Queuing Delays Queuing delays are significant in performance of communications networks Grow dramatically as system approaches capacity In shared facility network, transmission line, road network, checkout lines Performance worsens exponentially as demand approaches capacity 31

What Is Congestion? Data network is a network of queues Congestion occurs when the number of packets being transmitted through the network approaches the packet handling capacity of the network Input and Output Queues at a Network Node 32

33

35

36