Arhitecturi și Protocoale de Comunicații (APC) Protocoale de nivel Transport

Size: px
Start display at page:

Download "Arhitecturi și Protocoale de Comunicații (APC) Protocoale de nivel Transport"

Transcription

1 Arhitecturi și Protocoale de Comunicații (APC) Protocoale de nivel Transport

2 End-to-end data transport Web apps HTTP File transfer FTP Other apps SMTP, POP, IMAP Other apps SMTP, POP, IMAP File transfer FTP Web apps HTTP Transport layer Controls end-to-end transfer. IP philosophy: minimum functionality in the network (best effort service). Important role reserved for transport layer protocols. Host Router(s) TL TL PHY NL DL PHY Octavian Catrina 2 NL DL NL DL PHY Host NL DL PHY

3 Transport layer: main functions Addressing Identify data transport endpoints ("applications"). Transport address = Network address + Transport selector (port). Error control (end-to-end) Connectionless: Detect and discard damaged data units. Connection-oriented: Ensure data stream integrity. Detect and correct lost, damaged, reordered data units. Flow control (end-to-end) Connection-oriented: Adapt the transmitter's data rate to the receiver's data rate. Congestion control Connection-oriented: Limit the transmitter's data rate to avoid network congestion. Octavian Catrina 3

4 Review: TCP/IP protocol stack Web browser, ,... Applications Application protocols: HTTP, SMTP, FTP,... Other user applications User space Application Programming Interface (API) IGMP RARP ICMP ARP TCP IP UDP RIP Transport OSPF Network OS kernel LAN DL technology WAN DL technology Data Link Octavian Catrina 4

5 Addressing Applications TCP, UDP IP DL PHY IP address + TCP/UDP port IP address + Protocol id IP address Applications TCP, UDP IP DL PHY Which host? IP address. 32 bits (IPv4), in IP packet header. Which transport protocol? Protocol id. 8 bits (IPv4), in IP packet header. Which application process (and communication endpoint)? TCP/UDP port number. 16 bits, TCP/UDP header. Octavian Catrina 5

6 TCP/UDP ports and the Client-Server model Server Wait for service request Receive request Serve request Send result Distributed application Client Start Send request Receive result Stop Transport protocol Server Listens continuously for requests on a port known to clients. Reserved server ports: < 1024 (see RFC 1700). However, many servers use port numbers > Client A currently unused port ( 1024) is dynamically allocated for the duration of its life. Issues request to known server port. Octavian Catrina 6

7 Example: HTTP server and clients neptun.elc.ro hugo.int.fr zola.int.fr port: 3135 HTTP client TCP IP HTTP session TCP connection : 3135, : 80 IP datagrams HTTP server HTTP port: 80 TCP IP HTTP session TCP connection : 5768, : 80 IP datagrams port: 5768 HTTP client TCP IP Clients connect to the "well-known" HTTP server port 80. A server can handle concurrently connections with multiple clients. They can always be distinguished because of different client side addresses (different client IP addresses or port numbers). Octavian Catrina 7

8 UDP datagrams Pseudoheader IP header (20 bytes + opt.) UDP header (8 bytes) UDP data Source IP address Destination IP address 0 Protocol (17) UDP datagram length Source UDP port Destination UDP port Length Checksum Data Pseudo-header Part of IP header contents. Accompanies UDP datagram at the interface between UDP and IP. UDP checksum Covers UDP datagram and pseudo-header. Checksum computation is optional. Octavian Catrina 8

9 TCP packets ("segments") Pseudoheader IP header (20 octets + opt.) TCP header (20 octets +opt.) TCP data Acknowledgement number (cumulative) Hdr.len. - Control bits Window (size) Checksum Source IP address Destination IP address 0 Protocol TCP segment length Source TCP port Sequence number Options (if any) Destination TCP port Urgent pointer Data (if any) Control bits (flags): URG ACK PSH RST SYN FIN Checksum covers TCP header, data and pseudo-header. Options: Selective acknowledgments (SACK), Max. Segment Size (MSS), etc. Octavian Catrina 9

10 TCP header fields Source Port: 16 bits. The source port number. Destination Port: 16 bits. The destination port number. Sequence Number: 32 bits. The sequence number of the first data octet in this segment (except when SYN is present). If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. Acknowledgment Number: 32 bits. If the ACK control bit is set this field contains the value of the next sequence number the sender of the segment is expecting to receive. Once a connection is established this is always sent. Header Length (Data Offset): 4 bits. The number of 32 bit words in the TCP Header. This indicates where the data begins. The TCP header (even one including options) is an integral number of 32 bits long. Reserved: 6 bits. Reserved for future use. Must be zero. Control Bits: 6 bits (from left to right): URG: Urgent Pointer field significant. ACK: Acknowledgment field significant. PSH: Push Function. RST: Reset the connection. SYN: Synchronize sequence numbers. FIN: No more data from sender. Window (size): 16 bits. The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept. Checksum: 16 bits. The checksum field is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header and payload. Octavian Catrina 10

11 Overview of TCP operation User A (initiator) Open-Active CLOSED SYN-SENT Open-Success TCP A TCP B User B SYN,... SYN+ACK,... CLOSED Open-Passive LISTEN SYN-RCVD ESTABLISHED ACK,... Open-Success Send(dt[100]) Close FIN-WAIT-1 FIN-WAIT-2 Terminate TIME-WAIT CLOSED..., dt[100] FIN,... ACK,... ACK,... ACK,... FIN,... ESTABLISHED Receive(dt[100]) Closing CLOSE-WAIT Close LAST-ACK CLOSED Terminate (listener) Octavian Catrina 11

12 TCP state machine SYN RECVD Open- Passive/ SYN/ SYN+ACK ACK/ RST/ CLOSED LISTEN Close/ Open- Active/SYN SYN+ACK/ACK SYN SENT U-1 TCP-1 TCP-2 U-2 CLOSED CLOSED Open-Active Open-Passive SYN-SENT [SYN,...] LISTEN Open-Success [SYN+ACK,...] SYN-RCVD ESTAB. [ACK,...] Open-Success Send(100) ESTAB. [..., data(100)] Close/FIN FIN WAIT-1 ACK/ FIN WAIT-2 Close/FIN FIN/ACK FIN-ACK/ACK FIN/ACK ESTAB- LISHED CLOSING ACK/ TIME WAIT FIN/ACK Exp. 2*MSL CLOSE WAIT Close/FIN LAST ACK ACK/ Close FIN-WAIT-1 FIN-WAIT-2 Terminate TIME-WAIT CLOSED [ACK,...] [FIN,...] [ACK,...] [FIN,...] [ACK,...] Deliver(100) Closing CLOSE-WAIT Close LAST-ACK Terminate CLOSED Octavian Catrina 12

13 TCP state machine (cont.) LISTEN - waiting for a connection request (CTRL=SYN) from any remote TCP. SYN-SENT - waiting for a matching reply after having sent a connection request (CTRL=SYN). SYN-RECEIVED - waiting for a matching connection acknowledgment (CTRL=ACK) after having received a connection request (CTRL=SYN) and replied (CTRL=SYN+ACK). ESTABLISHED - connection is open, user data can be sent and received. FIN-WAIT-1 - waiting for connection termination request from the remote TCP (CTRL=FIN+ACK), or acknowledgment of the termination request previously sent. FIN-WAIT-2 - waiting for a connection termination request from the remote TCP. CLOSE-WAIT - waiting for a connection termination request from the local user. CLOSING - waiting for connection termination request acknowledgment from remote TCP. LAST-ACK - waiting for acknowledgment of the connection termination request previously sent to the remote TCP (after acknowledging its termination request). TIME-WAIT - waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request. CLOSED - no connection active or pending. Octavian Catrina, International University in Germany 13

14 Connection establishment User A (initiator) Open-Active CLOSED SYN-SENT Open-Success ESTABLISHED TCP A TCP B User B (listener) SYN, seq=x, wnd=w1 ACK, seq=x+1, ack=y+1 SYN+ACK seq=y, ack=x+1, wnd=w2 CLOSED Open-Passive LISTEN SYN-RCVD Open-Success ESTABLISHED Passive open: Listener (e.g., server) is ready to communicate. Accepts incoming connections on specified port number. Active open: User initiates the communication (e.g., client). SYN segment: Requests the establishment of a new connection. SYN+ACK segment: Confirms (accepts) the connection establishment. Three-way handshake procedure Together with the choice of initial sequence numbers avoids connection establishment anomalies. Octavian Catrina 14

15 Example: Connection establishment TCP connection establishment from to with negotiation of TCP options TCP options in this example: Maximum data segment size = 1460 octets (MSS option). Selective acknowledgments (SACK option). SYN segment details Supports (and wants to use) the selective acknowledgement (SACK) mechanism Octavian Catrina 15

16 Data transfer Reliable transfer of byte streams Same octet values, same octet count and order. Checksum to detect and drop segments with bit-errors. Sequence numbers associated to data octets. Structure of submitted data stream not preserved. Urgent data service User can request immediate delivery of a subset of data in the byte stream (URG flag + pointer). Main functions Error control. Flow control. Congestion control. Octavian Catrina 16

17 Error control: Data acknowledgement User A TCP A TCP B User B ESTABLISHED ESTABLISHED Send(data[500]) Send(data[300]) Send(data[200]) Receive(data[400]) ACK, seq=s1, ack=s2, data[500] ACK, seq=s2, ack=s1+500 ACK, seq=s1+500, ack=s2, data[300] ACK, seq=s1+800, ack=s2, data[200] ACK, seq=s2, ack=s1+800 ACK, seq=s2, ack=s1+1000, data[400] ACK, seq=s1+1000, ack=s2+400 Receive(data[500]) Receive(data[300]) Send(data[400]) Receive(data[200]) Basic error control: cumulative acknowledgements and retransmission timer. The receiver returns an acknowledgement segment for every received data segment. The acknowledgement field indicates current in-order received data. Octavian Catrina 17

18 Error control: Sequence numbers Send sequence space Data sent, acknowledged Data sent, unacknowledged Data not sent SND.UNA SEG.ACK Receive sequence space Ack. sent, not received Data sent, not received SND.NXT SEG.SEQ RCV.NXT SEG.SEQ+SEG.LEN SEG.ACK Data received Data not received TCP segment header fields used for error control: Sequence number (SEG.SEQ) Acknowledgment number (SEG.ACK) Checksum. TCP state variables used for error control Send Sequence Variables SND.UNA - Send Unacknowledged SND.NXT - Send Next Receive Sequence Variables RCV.NXT - Receive Next Octavian Catrina 18

19 Basic data retransmission User A TCP A TCP B User B ESTABLISHED ESTABLISHED Send(data[500]) Send(data[300]) Send(data[200]) ACK, seq=s1, data[500] ACK, seq=s1+500, data[300] ACK, seq=s1+800, data[200] ACK, ack=s1 Store in buffer 500? 300 ACK, ack=s1 500? Timeout Retransmission of the data from s1 to s1+500 triggered by timeout ACK, seq=s1, data[500] ACK, ack=s Receive(data[1000]) Error control using cumulative acknowledgements and a retransmission timer. The receiver may save out-of-order data (beyond RCV.NXT) in its buffer to reduce retransmissions. Cumulative acks do not provide precise information about lost data. Inefficient, especially when multiple data segments are lost. Octavian Catrina 19

20 Dynamic timer adjustment TCP A TCP B Tdata[k], s1+500 seq=s1, data[500] RTT[k] = Tack[k]-Tdata[k] Tdata[k+1], s1+800 seq=s1+500, data[300] ACK, ack=s1+500 RTT[k+1] = Tack[k+1]-Tdata[k+1] Tack[k] ACK, ack=s1+800 Tack[k+1] Permanent round-trip time (RTT) measurements: RTT[k]. Computation of smoothed RTT: SRTT[k]. Computation of smoothed RTT deviation: SDEV[k]. New timer value: RTO[k] = SRTT[k] + 4 SDEV[k]. (Details in the annex) Octavian Catrina 20

21 Selective retransmission User A TCP A TCP B User B ESTABLISHED ESTABLISHED Send(data[500]) Send(data[300]) Send(data[200]) Retransmission of the data from s1 to s1+500 triggered by selective ack. Faster recovery ACK, seq=s1, data[500] ACK, seq=s1+500, data[300] ACK, seq=s1+800, data[200] ACK, ack=s1, sack=(s1+500 s1+800) ACK, ack=s1, sack=s1+500 s1+1000) ACK, seq=s1, data[500] ACK, ack=s Store in buffer 500? ? Receive(data[1000]) IF the SACK option is supported and enabled, the receiver uses selective acknowledgments to tell the sender what out-of-order data (beyond RCV.NXT) is saved in its buffer, and hence what data has to be retransmitted. Faster recovery, especially when multiple data segments are lost. Octavian Catrina 21

22 Example: Fast retransmission, no SACK HTTP data transfer over TCP connection from to without SACK. Fast retransmission: The sender retransmits after receiving > 3 duplicate acknowledgements. Data segment length: 1024 octets. Single lost packet. Lost data: seq [78354, 79378), 1 data segment Retransmission of lost data segment Lost data has been recovered Octavian Catrina 22

23 Selective acknowledgment (SACK) Cumulative acknowledgment: All data has been received up to sequence number Missing data from sequence number to (1024 octets) Selective acknowledgment option (SACK): Further data received from sequence number to Octavian Catrina 23

24 Example: Selective retransmission (1) HTTP data transfer over TCP connection from to with selective acknowledgements (SACK) Data segment length: 1024 octets. SLE: SACK Left Edge. SRE: SACK Right Edge. Single lost packet. Lost data: seq [162232, ), 1 data segment Retransmission of lost data segment All the lost data has now been recovered Octavian Catrina 24

25 Example: Selective retransmission (2) HTTP data transfer over TCP connection from to with selective acknowledgements (SACK) Data segment length: 1024 octets. SLE: SACK Left Edge. SRE: SACK Right Edge. Congested network path, multiple lost packets. Lost data, seq [40466, 43538) 3 data segments (congestion) Lost data, seq [45586, 46610) 1 data segment Retransmission of the 4 lost data segments All the lost data has now been recovered Octavian Catrina 25

26 Flow control Allows the receiver to slow down a faster transmitter End-to-end flow control using sliding-window mechanism. Flow control window Upper limit for the amount of data that a transmitter can send (beyond the acknowledged sequence). Explicitly indicated by the receiver. Sender Data (sequence number) Receiver, bottleneck. Update transmitter window ACK(acknowledgement number, window size) Indicate receiver window Octavian Catrina 26

27 Flow control: Sender/receiver windows Send sequence space Data sent, acknowledged Last advertised window (SND.WND SEG.WND) Consumed Data sent, unacknowledged Available Can be sent (sender window) Cannot be sent (out of window) SND.UNA SEG.ACK Ack. sent, not received Data sent, not received SND.NXT SEG.SEQ SND.UNA + SND.WND Receive sequence space Data received RCV.NXT SEG.ACK Can be received (receiver window) RCV.NXT + RCV.WND Cannot be received Advertised window size (RCV.WND SEG.WND) Octavian Catrina 27

28 Flow control: example User A TCP A TCP B User B ESTABLISHED Send(data[500]) Send(data[300]) Send(data[400]) Waiting for credit Stop Retrans Timer Start Persist Timer Stop Persist Timer ACK, seq=s1, data[500] ACK, seq=s1+500, data[300] ACK, seq=s1+800, data[200] ACK, ack=s1, wnd=1000 ACK, ack=s1+500, wnd=500 ACK, ack=s1+800, wnd=200 ACK, ack=s1+1000, wnd=0 ACK, ack=s1+1000,wnd=800 ACK, seq=s1+1000, data[200] ACK, ack=s1+1200,wnd=600 ESTABLISHED Receiver buffer Receive(data[800]) Octavian Catrina 28

29 Congestion control Limits transmission to avoid network congestion As congestion is building up, IP routers start dropping packets. Also, the transfer delay increases (due to queuing delay). TCP congestion control adjusts the transmission rate according to implicit congestion signals from the network. Assumes that packets are lost due to congestion rather than bit errors. Details in next section. LAN LAN IP network (bottleneck) Slow down TCP transmitter Dropped packets (detected by error control) Octavian Catrina 29

30 Graceful close User A TCP A TCP B User B ESTABLISHED ESTABLISHED Close FIN-WAIT-1 Closing stream AB FIN-WAIT-2 Stream AB closed Terminate TIME-WAIT Streams AB closed CLOSED FIN, ACK, seq=s1, ack=s2 ACK, seq=s2, ack=s1+1 FIN, ACK, seq=s2, ack=s1+1 ACK, seq=s1+1, ack=s2+1 Separate, independent closing of each of the two data streams. Complete data delivery guaranteed. Closing CLOSE-WAIT Stream AB closed Close LAST-ACK Closing stream BA Terminate CLOSED Streams AB closed TIME-WAIT state: wait twice the Maximum Segment Lifetime (MSL) before releasing the connection's state (e.g., 1-2 min.). Octavian Catrina 30

31 Closing: avoiding anomalies TIME-WAIT state Waiting time before releasing the connection's state after closing. Duration: 2MSL. Roles MSL = Maximum Segment Lifetime (e.g., 1-2 min.). Allow recovery of the last closing handshake. Prevent the reuse of the connection's address pair as long as its packets can survive Avoid interference between successive connection instances. Octavian Catrina 31

32 Congestion in IP networks Non-responsive Flows Octavian Catrina 32

33 Packet forwarding model R1 Limited packet queue (buffer) size R5 R3 Bottleneck link R4 R2 Packets dropped when the queue overflows R6 A router determines the interface on which a packet has to be sent out, and appends the packet to its queue. Packet queues allow routers to handle short term overload, i.e., received packet bursts exceeding the link bandwidth. In case of persistent overload (or large bursts), queues overflow, and packets are discarded. Octavian Catrina 33

34 Example: Congestion in IP networks R1 r1=10 r2=90 r=100 r=100 R3 r=20 r1=2 r2=18 R4 R5 r=10 r1=2 r=1 r2=1 Overall throughput: r1+r2 = 2+1 = 3 But we could get: r1+r2 = 10+1 = 11 R2 R6 How? Overload combined with waste of resources E.g., bottleneck links: insufficient bandwidth on links R3-R4-R6 for the red flow; overloaded link R3-R4 for the blue flow. R3 and R4 drop many packets, because the bandwidth of the links R3-R4 and R4-R6 is largely exceeded. The red flow throttles the blue flow: its packets consume a lot of bandwidth on R3-R4, and are dropped later at R4! Very inefficient and unfair operation Octavian Catrina 34

35 Delay Throughput Congestion Behavior under heavy load Knee: point after which throughput increases slowly. delay increases quickly. Cliff: point after which throughput decreases quickly to zero - congestion collapse. delay goes to infinity. Cause of congestion collapse Resources are consumed by useless packets, e.g., discarded later, repeated retransmissions. Congestion avoidance: stay at knee Congestion control: stay left of the cliff knee under utilization saturation Octavian Catrina 35 cliff Congestion collapse over utilization Load Load

36 Congestion experiments (1) H0 H1 r0 = 8 r1 = 8 BW0 = 100 Test 1: H0, H1 send at r0 = r1 = 8 (UDP) r0' 8 r1' 8 r3 = 16 BW1 = 100 R1 BW = 20 Bottleneck link N3 R2 N4 BW5 =10 BW6 =10 H5 H6 r5 = 8 r6 = 8 Data rates are measured at H0, H1, H5, H6 and on the bottleneck link. The color code is shown in the picture above. No congestion. No data lost. Network delivers r = 16 (up to 20). Flow H0 to H5 starts at 0. Flow H1 to H6 starts at 20. Measured throughput includes 20% encapsulation overhead! Octavian Catrina 36

37 Congestion experiments (2) H0 H1 r0 = 8 r1 = 80 BW0 = 100 Test 2: H1 sends at r1 = 80 (UDP) r0' 1.82 r1' r3 = 20 BW1 = 100 R1 BW = 20 Bottleneck link N3 R2 N4 BW5 =10 BW6 =10 H5 H6 r5 1.8 r6 10 Data rates are measured at H0, H1, H5, H6 and on the bottleneck link. Color code is shown in the picture above. Congestion: inefficient, unfair network utilization. - H1 sends at r=80 on path with BW=10. Only r=10 delivered. - H1 takes most of the BW on the bottleneck link. Almost nothing left for H0, almost all data lost. - Network delivers r 11.8, although r = 8+10 = 18 <20 is possible. Octavian Catrina 37

38 Congestion experiments (3) H0 H1 r0 = 8 r1 = 80 BW0 = 100 Test 3: H1 sends at r1 = 80 (UDP), BW6 = 1 r0' 1.82 r1' r3 = 20 BW1 = 100 R1 BW = 20 Bottleneck link N3 R2 N4 BW5 =10 BW6 =1 Bottleneck link H5 H6 r5 1.8 r6 1 Data rates are measured at H0, H1, H5, H6 and on the bottleneck link. Color code is shown in the picture. Congestion collapse: hardly anything delivered. - Network delivers r 2.8, although r = 8+1 = 9 < 11 is possible. Octavian Catrina 38

39 Congestion in IP networks TCP Congestion Control Octavian Catrina 39

40 IP and TCP congestion control IP network behavior When congestion builds up, the packets accumulate in routers' packet queues. The transfer delay increases, the routers start dropping packets. IP congestion control Routers use queue management mechanisms to control the queue size and decide which packets to forward or drop and when. TCP host behavior TCP monitors the amount of data in transit, the round-triptime, and the lost packets. It assumes that lost packets are congestion symptoms. TCP congestion control TCP limits its transmission using a congestion window, dynamically adjusted based on congestion symptoms. Goals Efficiency: Avoid overload (collapse) as well as underutilization. Fairness: Allocate a fair share of resources to all flows. Smooth convergence (low oscillations) to efficiency and fairness. Octavian Catrina 40

41 TCP data transfer (1/3) Transmission rate R' DATA Amount of data in the pipe: N = R D Data pipe with rate R and delay D The network path used by a TCP connection is (roughly) a data pipe with rate R and delay D The rate R is limited by the slowest link. The delay D is the sum of per hop transmission, propagation and queuing delays. Ideally, the source sends at rate R' R and, once the data pipe fills up, data flows at the maximum throughput. If the source sends faster, the pipe "leaks" and some data is lost (i.e., discarded by the routers). Problem: R and D are variable (depending on network traffic) and the TCP sender does not know them. Octavian Catrina 41

42 TCP data transfer (2/3) Transmission rate R' DATA Amount of data in the pipe: N = R D Data pipe with rate R and delay D ACK RTT (Round-Trip Time) seq=s1, data[1000] seq=s1+1000, data[1000] seq=s1+2000, data[1000] seq=s1+3000, data[1000] seq=s1+4000, data[1000] seq=s1+5000, data[1000] ACK, ack=s ACK, ack=s ACK, ack=s ACK, ack=s The TCP acknowledgment mechanism allows TCP to fill the pipe (handle multiple unacknowledged data segments), and to estimate the current RTT and the current amount of data in the pipe. Sent during RTT Unacknowledged = SND.NXT - SND.UNA. Octavian Catrina 42

43 TCP data transfer (3/3) DATA TCP sender: R =? D =? CWND R RTT R' CWND / RTT Transmission rate R' Amount of data in the pipe: N = R D Data pipe with rate R and delay D ACK TCP adjusts its transmission rate to the available data rate on the network path: Maintains a congestion window CWND which approximates RRTT. Limits transmission such that the amount of unacknowledged data (SND.NXT - SND.UNA) is less than CWND (also less than the window advertised by the receiver, for end-to-end flow control). Advances the window (and sends more data) when ACKs arrive, indicating that some data was delivered (hence exited the pipe). Therefore, ACKs also provide transmission timing (self-clocking). How to dynamically adjust CWND such that to satisfy the goals (efficiency, fairness, smooth convergence)? Octavian Catrina 43

44 ... Efficiency and fairness Source 1 Source 2 Source n x 1 x 2 x n Control system model x k Binary feedback: - decrease x k - increase x k increase: x k (t+1) = a I x k (t) + b I decrease: x k (t+1) = a D x k (t) + b D Goals This system converges to data rates meeting the efficiency and fairness goals only for additive or multiplicative increase and (x 1,x 2 ) multiplicative decrease. (a D x 1 +b I, Best: Additive Increase & Multiplicative Decrease (AIMD): Additive Increase: x k (t+1)=x k (t)+b I Multiplicative Decrease: x k (t+1)=a D x k (t) Basic solution used by TCP congestion control mechanisms (+ enhancements). a D x 2 +b I ) Flow 1, rate x 1 Octavian Catrina 44 Flow 2, rate x 2 Flow 2, rate x 2 Goals: Efficiency and fairness Example: 2 flows underutilization x 1 +x 2 C (a D x 1, a D x 2 ) x 2 > x 1 too much for x 2 x 1 > x 2 too much for x1 Flow 1, rate x 1 fairness line: x1=x2 overutilization x 1 +x 2 C efficiency line: x 1 +x 2 =C fairness line efficiency line

45 TCP congestion control Congestion window (CWND) adjustment At steady state, CWND oscillates around the current optimal value, CWND R RTT, for the throughput R that the network path can offer to the TCP flow, and the current RTT. congestion window Additive increase Multiplicative decrease time Basic algorithm components Additive increase: "Congestion avoidance. Multiplicative decrease: After detecting packet loss. "Slow Start : Gradual increase of CWND from 1 to SSTHRESH (slow start threshold) after connection setup and timeouts. Enhancements: "Fast Retransmit" and "Fast Recovery". Octavian Catrina 45

46 Slow Start, Congestion Avoidance (1/3) cwnd Slow Start (fast additive increase!) ssthresh Congestion Avoidance (slow additive increase) Timeout (multiplicative decrease) Slow Start ssthresh Congestion Avoidance time Slow start: if cwnd ssthresh - additive increase Increment cwnd by one segment for each (non-duplicate) received ACK. The congestion window starts from 1 segment and doubles every RTT. Congestion avoidance: if cwnd ssthresh - additive increase Increment cwnd by 1/cwnd for each (non-duplicate) ACK. The congestion window grows linearly, with one segment every RTT. Timeout (congestion symptom) - multiplicative decrease ssthresh max(sentunacked/2, 2segment); cwnd 1segment. Octavian Catrina 46

47 Slow Start, Congestion Avoidance (2/3) cwnd DATA... ACK Variation of the congestion window during Slow start and Congestion Avoidance cwnd slow start congestion avoidance ssthresh=8 round-trip times cwnd = congestion window (segments) ssthresh = slow-start threshold (segm.) (Simplified - see RFC 2581) Initially: cwnd = 1; ssthresh = large; Ack received (not a duplicate): // Additive increase if (cwnd < ssthresh) // Slow Start cwnd = cwnd + 1; else // Congestion Avoidance cwnd = cwnd + 1/cwnd; Timeout: // Multiplicative decrease ssthresh = SentUnacked/2; cwnd = 1; Octavian Catrina 47

48 Slow Start, Congestion Avoidance (3/3) cwnd ssthresh (initial) Slow Start (fast additive increase!) Timeout (multipl. decrease) Slow Start ssthresh Congestion Avoidance (slow additive increase) Timeout (multipl. decrease) Slow Start ssthresh Congestion Avoidance time Another scenario: timeout during slow start Note how ssthresh is adjusted after each timeout. ssthresh max(sentunacked/2, 2segment); cwnd 1segment. Octavian Catrina 48

49 Data retransmission seq=s1, data[1000] seq=s1, data[1000] seq=s1+1000, data[1000] seq=s1+1000, data[1000] seq=s1+2000, data[1000] seq=s1+3000, data[1000] ACK, ack=s1 ACK, ack=s1 seq=s1+2000, data[1000] seq=s1+3000, data[1000] ACK, ack=s1 ACK, ack=s1 ACK, ack=s1 2 duplicate ACKs ACK, ack=s1 Retransmission timer expires seq=s1, data[1000] Timeout retransmission ACK, ack=s seq=s1, data[1000] Could retransmit (?) ACK, ack=s RFC 2581 requires the reception of three duplicate ACKs before fast retransmission Timeout retransmission The timer is adjusted based on RTT measurements, but set to a conservative value (substantially larger than RTT). Duplicate ACKs When data arrives out of order due to the loss of previous segments, the receiver returns an ACK indicating the expected sequence number. Can be used to trigger earlier retransmission. Octavian Catrina 49

50 Fast Retransmit, Fast Recovery cwnd Fast retransmit TCP Tahoe cwnd Fast retrs.+ Fast recovery TCP Reno Slow Start Congestion Avoidance Slow Start Congestion Avoidance Slow Start Congestion Avoidance Congestion Avoidance time time Fast Retransmit Add another congestion symptom event: three duplicate ACKs. Faster than waiting for timeout. Introduced in TCP Tahoe. Fast Recovery Duplicate ACKs are received The network still delivers data Light congestion Do not empty the pipe, just reduce the amount of data to half. Set CWND=ssthresh=SentUnacked/2. See details in RFC 2581 and RFC Added in TCP Reno. Octavian Catrina 50

51 Analysis TCP transmission rate R k L/(T q 1/2 ) (bps) L = packet length; T = round-trip-time. q = packet loss rate; k = (3/2) 1/ Approximation of the TCP behavior congestion window W W/2 time T 0 2T 0 Limitations of TCP congestion control mechanisms Vulnerable to non-congestion related loss (e.g., wireless). Flows with very long RTT are penalized (lower throughput). All sources must cooperate. Otherwise, the sources that respond to congestion are locked out by the sources that do not. TCP friendly applications Some applications do not use TCP (e.g., voice/video). IETF solution: Applications must be "TCP friendly", i.e., use an adaptive transmission algorithm with the same data rate as a TCP connection experiencing the same packet loss. Octavian Catrina 51

52 Simulation setup Traffic sources TCP or UDP (CBR) Traffic sinks TCP or UDP Monitor queue size Monitor link throughput Monitor TCP cwnd,... R1 Bottleneck link Trace packets dropped when the queue overflows Queue management: FIFO, Tail-drop R2 Monitor end-to-end throughput Octavian Catrina 52

53 TCP Tahoe Bottleneck link TCP R1 queue size (capacity: 5000) ssthresh Slow Start Congestion Avoidance Octavian Catrina 53

54 TCP Reno Bottleneck link TCP R1 queue size (capacity: 5000) ssthresh Slow Start Congestion Avoidance Fast Recovery Octavian Catrina 54

55 TCP (Reno) + UDP/CBR Link TCP; TCP; CBR CBR start: 80 R1 queue size (<= 5000) Octavian Catrina 55

User Datagram Protocol

User Datagram Protocol Topics Transport Layer TCP s three-way handshake TCP s connection termination sequence TCP s TIME_WAIT state TCP and UDP buffering by the socket layer 2 Introduction UDP is a simple, unreliable datagram

More information

TCP: Transmission Control Protocol UDP: User Datagram Protocol TCP - 1

TCP: Transmission Control Protocol UDP: User Datagram Protocol   TCP - 1 TCP/IP Family of Protocols (cont.) TCP: Transmission Control Protocol UDP: User Datagram Protocol www.comnets.uni-bremen.de TCP - 1 Layer 4 Addressing: Port Numbers To talk to another port, a sender needs

More information

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transmission Control Protocol. ITS 413 Internet Technologies and Applications Transmission Control Protocol ITS 413 Internet Technologies and Applications Contents Overview of TCP (Review) TCP and Congestion Control The Causes of Congestion Approaches to Congestion Control TCP Congestion

More information

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action CS314-27 TCP: Transmission Control Protocol IP is an unreliable datagram protocol congestion or transmission errors cause lost packets multiple routes may lead to out-of-order delivery If senders send

More information

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol) Transport Layer -UDP (User Datagram Protocol) -TCP (Transport Control Protocol) 1 Transport Services The transport layer has the duty to set up logical connections between two applications running on remote

More information

7. TCP 최양희서울대학교컴퓨터공학부

7. TCP 최양희서울대학교컴퓨터공학부 7. TCP 최양희서울대학교컴퓨터공학부 1 TCP Basics Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 2009 Yanghee Choi

More information

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

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections Application / Transport Interface Application requests service from transport layer Transport Layer Application Layer Prepare Transport service requirements Data for transport Local endpoint node address

More information

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

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP CS 5520/ECE 5590NA: Network Architecture I Spring 2008 Lecture 13: UDP and TCP Most recent lectures discussed mechanisms to make better use of the IP address space, Internet control messages, and layering

More information

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

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP Transport layer Review principles: Reliable data transfer Flow control Congestion control Instantiation in the Internet UDP TCP 1 UDP: User Datagram Protocol [RFC 768] No frills, bare bones Internet transport

More information

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1 6. Transport Layer 6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1 6.1 Internet Transport Layer Architecture The

More information

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

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control Transport layer Review principles: Reliable data transfer Flow control Congestion control Instantiation in the Internet UDP TCP 1 UDP: User Datagram Protocol [RFC 768] No frills, bare bones Internet transport

More information

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 최양희서울대학교컴퓨터공학부 Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 1 2004 Yanghee Choi 2 Addressing: application

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Transport Layer Literature: Forouzan: ch 11-12 2004 Image Coding Group, Linköpings Universitet Lecture 4: Outline Transport layer responsibilities UDP TCP 2 Transport layer in OSI model Figure

More information

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018 CMSC 417 Computer Networks Prof. Ashok K Agrawala 2018 Ashok Agrawala Message, Segment, Packet, and Frame host host HTTP HTTP message HTTP TCP TCP segment TCP router router IP IP packet IP IP packet IP

More information

Transport Protocols. Raj Jain. Washington University in St. Louis

Transport Protocols. Raj Jain. Washington University in St. Louis Transport Protocols Raj Jain Washington University Saint Louis, MO 63131 Jain@cse.wustl.edu These slides are available on-line at: http://www.cse.wustl.edu/~jain/cse473-05/ 16-1 Overview q TCP q Key features

More information

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service EEC7B/ECS5C Review: Internet Protocol Stack Review: TCP Application Telnet FTP HTTP Transport Network Link Physical bits on wire TCP LAN IP UDP Packet radio Do you remember the various mechanisms we have

More information

05 Transmission Control Protocol (TCP)

05 Transmission Control Protocol (TCP) SE 4C03 Winter 2003 05 Transmission Control Protocol (TCP) Instructor: W. M. Farmer Revised: 06 February 2003 1 Interprocess Communication Problem: How can a process on one host access a service provided

More information

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP EEC7B/ECS5C Review: Internet Protocol Stack Review: TCP Application Telnet FTP HTTP Transport Network Link Physical bits on wire TCP LAN IP UDP Packet radio Transport Layer Services Design Issue Underlying

More information

Transport Protocols and TCP

Transport Protocols and TCP Transport Protocols and TCP Functions Connection establishment and termination Breaking message into packets Error recovery ARQ Flow control Multiplexing, de-multiplexing Transport service is end to end

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Transport Layer Literature: Forouzan: ch 11-12 2004 Image Coding Group, Linköpings Universitet Lecture 4: Outline Transport layer responsibilities UDP TCP 2 Transport layer in OSI model Figure

More information

TCP/IP Performance ITL

TCP/IP Performance ITL TCP/IP Performance ITL Protocol Overview E-Mail HTTP (WWW) Remote Login File Transfer TCP UDP IP ICMP ARP RARP (Auxiliary Services) Ethernet, X.25, HDLC etc. ATM 4/30/2002 Hans Kruse & Shawn Ostermann,

More information

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

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment

More information

TSIN02 - Internetworking

TSIN02 - Internetworking TSIN02 - Internetworking Literature: Lecture 4: Transport Layer Forouzan: ch 11-12 Transport layer responsibilities UDP TCP 2004 Image Coding Group, Linköpings Universitet 2 Transport layer in OSI model

More information

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TCP/IP Networking. Part 4: Network and Transport Layer Protocols TCP/IP Networking Part 4: Network and Transport Layer Protocols Orientation Application Application protocol Application TCP TCP protocol TCP IP IP protocol IP IP protocol IP IP protocol IP Network Access

More information

Lecture 3: The Transport Layer: UDP and TCP

Lecture 3: The Transport Layer: UDP and TCP Lecture 3: The Transport Layer: UDP and TCP Prof. Shervin Shirmohammadi SITE, University of Ottawa Prof. Shervin Shirmohammadi CEG 4395 3-1 The Transport Layer Provides efficient and robust end-to-end

More information

Lecture 4: Congestion Control

Lecture 4: Congestion Control Lecture 4: Congestion Control Overview Internet is a network of networks Narrow waist of IP: unreliable, best-effort datagram delivery Packet forwarding: input port to output port Routing protocols: computing

More information

Chapter 3- parte B outline

Chapter 3- parte B outline Chapter 3- parte B outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles of reliable data transfer 3.5 connection-oriented transport:

More information

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

Network Technology 1 5th - Transport Protocol. Mario Lombardo - Network Technology 1 5th - Transport Protocol Mario Lombardo - lombardo@informatik.dhbw-stuttgart.de 1 overview Transport Protocol Layer realizes process to process communication data unit is called a

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Outline Literature: Lecture 4: Transport Layer Forouzan: ch 11-12 RFC? Transport layer introduction UDP TCP 2004 Image Coding Group, Linköpings Universitet 2 The Transport Layer Transport layer

More information

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology Transport Over IP CSCI 690 Michael Hutt New York Institute of Technology Transport Over IP What is a transport protocol? Choosing to use a transport protocol Ports and Addresses Datagrams UDP What is a

More information

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

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols Outline r Development of reliable protocol r Sliding window protocols m Go-Back-N, Selective Repeat r Protocol performance r Sockets, UDP, TCP, and IP r UDP operation r TCP operation m connection management

More information

COMP/ELEC 429/556 Introduction to Computer Networks

COMP/ELEC 429/556 Introduction to Computer Networks COMP/ELEC 429/556 Introduction to Computer Networks The TCP Protocol Some slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang T. S. Eugene Ng eugeneng at cs.rice.edu

More information

Protocol Overview. TCP/IP Performance. Connection Types in TCP/IP. Resource Management. Router Queues. Control Mechanisms ITL

Protocol Overview. TCP/IP Performance. Connection Types in TCP/IP. Resource Management. Router Queues. Control Mechanisms ITL Protocol Overview TCP/IP Performance E-Mail HTTP (WWW) Remote Login File Transfer TCP UDP ITL IP ICMP ARP RARP (Auxiliary Services) ATM Ethernet, X.25, HDLC etc. 2/13/06 Hans Kruse & Shawn Ostermann, Ohio

More information

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data ELEX 4550 : Wide Area Networks 2015 Winter Session UDP and TCP is lecture describes the two most common transport-layer protocols used by IP networks: the User Datagram Protocol (UDP) and the Transmission

More information

Transport Protocols & TCP TCP

Transport Protocols & TCP TCP Transport Protocols & TCP CSE 3213 Fall 2007 13 November 2007 1 TCP Services Flow control Connection establishment and termination Congestion control 2 1 TCP Services Transmission Control Protocol (RFC

More information

9th Slide Set Computer Networks

9th Slide Set Computer Networks Prof. Dr. Christian Baun 9th Slide Set Computer Networks Frankfurt University of Applied Sciences WS1718 1/49 9th Slide Set Computer Networks Prof. Dr. Christian Baun Frankfurt University of Applied Sciences

More information

CNT 6885 Network Review on Transport Layer

CNT 6885 Network Review on Transport Layer CNT 6885 Network Review on Transport Layer Jonathan Kavalan, Ph.D. Department of Computer, Information Science and Engineering (CISE), University of Florida User Datagram Protocol [RFC 768] no frills,

More information

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

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols Outline Development of reliable protocol Sliding window protocols Go-Back-N, Selective Repeat Protocol performance Sockets, UDP, TCP, and IP UDP operation TCP operation connection management flow control

More information

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

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios Chapter 3 outline TCP reliable 3.2 principles of reliable 3.3 connection-oriented flow 3.4 principles of congestion 3.5 TCP congestion TCP creates rdt service on top of IP s unreliable service pipelined

More information

User Datagram Protocol (UDP):

User Datagram Protocol (UDP): SFWR 4C03: Computer Networks and Computer Security Feb 2-5 2004 Lecturer: Kartik Krishnan Lectures 13-15 User Datagram Protocol (UDP): UDP is a connectionless transport layer protocol: each output operation

More information

CS118 Discussion 1A, Week 4. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

CS118 Discussion 1A, Week 4. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m. CS118 Discussion 1A, Week 4 Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m. 1 Outline Lecture review: Transport layer Project Questions? Midterm logistics 2 Stop and Wait Protocol Main Issue: limited

More information

Chapter 24. Transport-Layer Protocols

Chapter 24. Transport-Layer Protocols Chapter 24. Transport-Layer Protocols 23.1 Introduction 23.2 User Datagram Protocol 23.3 Transmission Control Protocol 23.4 SCTP Computer Networks 24-1 Position of Transport-Layer Protocols UDP is an unreliable

More information

Computer Networks. Wenzhong Li. Nanjing University

Computer Networks. Wenzhong Li. Nanjing University Computer Networks Wenzhong Li Nanjing University 1 Chapter 5. End-to-End Protocols Transport Services and Mechanisms User Datagram Protocol (UDP) Transmission Control Protocol (TCP) TCP Congestion Control

More information

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli) TCP CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli) 1 Sources Fall and Stevens, TCP/IP Illustrated Vol. 1, 2nd edition Congestion Avoidance

More information

CSCD 330 Network Programming Winter 2015

CSCD 330 Network Programming Winter 2015 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

More information

ECE4110 Internetwork Programming. Introduction and Overview

ECE4110 Internetwork Programming. Introduction and Overview ECE4110 Internetwork Programming Introduction and Overview 1 EXAMPLE GENERAL NETWORK ALGORITHM Listen to wire Are signals detected Detect a preamble Yes Read Destination Address No data carrying or noise?

More information

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16 Guide To TCP/IP, Second Edition Chapter 5 Transport Layer TCP/IP Protocols Objectives Understand the key features and functions of the User Datagram Protocol (UDP) Explain the mechanisms that drive segmentation,

More information

Transport Protocols and TCP: Review

Transport Protocols and TCP: Review Transport Protocols and TCP: Review CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 1 19 September 2010 1 Connection Establishment and Termination 2 2 1 Connection Establishment

More information

CS321: Computer Networks Congestion Control in TCP

CS321: Computer Networks Congestion Control in TCP CS321: Computer Networks Congestion Control in TCP Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Causes and Cost of Congestion Scenario-1: Two Senders, a

More information

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24 Lecture 20 Overview Last Lecture Transport Control Protocol (1) This Lecture Transport Control Protocol (2) Source: chapters 23, 24 Next Lecture Internet Applications Source: chapter 26 COSC244 & TELE202

More information

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Janno< Last Class CLOSED Passive open Close Close LISTEN Introduction to TCP

More information

Sequence Number. Acknowledgment Number. Data

Sequence Number. Acknowledgment Number. Data CS 455 TCP, Page 1 Transport Layer, Part II Transmission Control Protocol These slides are created by Dr. Yih Huang of George Mason University. Students registered in Dr. Huang's courses at GMU can make

More information

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols ETSF05/ETSF10 Internet Protocols Transport Layer Protocols 2016 Jens Andersson Transport Layer Communication between applications Process-to-process delivery Client/server concept Local host Normally initialiser

More information

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST Information Network 1 TCP 1/2 Youki Kadobayashi NAIST 1 Transport layer: a birds-eye view Hosts maintain state for each transport-layer endpoint Routers don t maintain per-host state H R R R R H Transport

More information

Internet Transport Protocols UDP and TCP

Internet Transport Protocols UDP and TCP Outline Internet Transport Protocols UDP and TCP Transport Layer Review UDP Protocol UDP Characteristics UDP Functionalities TCP Protocol TCP Characteristics Connection Management TCP Flow and Congestion

More information

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet

Sequence Number. Acknowledgment Number. Checksum. Urgent Pointer plus Sequence Number indicates end of some URGENT data in the packet TCP Urgent Source Port Destination Port Sequence Number Acknowledgment Number HdrLen Reserved UA P RS F Checksum Window Size Urgent Pointer Urgent Pointer plus Sequence Number indicates end of some URGENT

More information

TCP Congestion Control

TCP Congestion Control TCP Congestion Control What is Congestion The number of packets transmitted on the network is greater than the capacity of the network Causes router buffers (finite size) to fill up packets start getting

More information

TCP Congestion Control

TCP Congestion Control What is Congestion TCP Congestion Control The number of packets transmitted on the network is greater than the capacity of the network Causes router buffers (finite size) to fill up packets start getting

More information

Networking Technologies and Applications

Networking Technologies and Applications Networking Technologies and Applications Rolland Vida BME TMIT Transport Protocols UDP User Datagram Protocol TCP Transport Control Protocol and many others UDP One of the core transport protocols Used

More information

Flow and Congestion Control Marcos Vieira

Flow and Congestion Control Marcos Vieira Flow and Congestion Control 2014 Marcos Vieira Flow Control Part of TCP specification (even before 1988) Goal: not send more data than the receiver can handle Sliding window protocol Receiver uses window

More information

Congestion / Flow Control in TCP

Congestion / Flow Control in TCP Congestion and Flow Control in 1 Flow Control and Congestion Control Flow control Sender avoids overflow of receiver buffer Congestion control All senders avoid overflow of intermediate network buffers

More information

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control Chapter 6 What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control OSI Model Hybrid Model Software outside the operating system Software inside

More information

6. The Transport Layer and protocols

6. The Transport Layer and protocols 6. The Transport Layer and protocols 1 Dr.Z.Sun Outline Transport layer services Transmission Control Protocol Connection set-up and tear-down Ports and Well-know-ports Flow control and Congestion control

More information

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

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure Correcting mistakes Go-back-N: big picture: sender can have up to N unacked packets in pipeline rcvr only sends cumulative acks doesn t ack packet if there s a gap sender has r for oldest unacked packet

More information

Overview. TCP & router queuing Computer Networking. TCP details. Workloads. TCP Performance. TCP Performance. Lecture 10 TCP & Routers

Overview. TCP & router queuing Computer Networking. TCP details. Workloads. TCP Performance. TCP Performance. Lecture 10 TCP & Routers Overview 15-441 Computer Networking TCP & router queuing Lecture 10 TCP & Routers TCP details Workloads Lecture 10: 09-30-2002 2 TCP Performance TCP Performance Can TCP saturate a link? Congestion control

More information

CSC 401 Data and Computer Communications Networks

CSC 401 Data and Computer Communications Networks CSC 401 Data and Computer Communications Networks Transport Layer Connection Oriented Transport: TCP Sec 3.5 Prof. Lina Battestilli Fall 2017 Transport Layer Chapter 3 Outline 3.1 Transport-layer Services

More information

Computer Networking Introduction

Computer Networking Introduction Computer Networking Introduction Halgurd S. Maghdid Software Engineering Department Koya University-Koya, Kurdistan-Iraq Lecture No.11 Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and

More information

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581) : Computer Networks Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581) TCP as seen from above the socket The TCP socket interface consists of: Commands to start

More information

NT1210 Introduction to Networking. Unit 10

NT1210 Introduction to Networking. Unit 10 NT1210 Introduction to Networking Unit 10 Chapter 10, TCP/IP Transport Objectives Identify the major needs and stakeholders for computer networks and network applications. Compare and contrast the OSI

More information

image 3.8 KB Figure 1.6: Example Web Page

image 3.8 KB Figure 1.6: Example Web Page image. KB image 1 KB Figure 1.: Example Web Page and is buffered at a router, it must wait for all previously queued packets to be transmitted first. The longer the queue (i.e., the more packets in the

More information

Lecture 8. TCP/IP Transport Layer (2)

Lecture 8. TCP/IP Transport Layer (2) Lecture 8 TCP/IP Transport Layer (2) Outline (Transport Layer) Principles behind transport layer services: multiplexing/demultiplexing principles of reliable data transfer learn about transport layer protocols

More information

Computer Communication Networks Midterm Review

Computer Communication Networks Midterm Review Computer Communication Networks Midterm Review ICEN/ICSI 416 Fall 2018 Prof. Aveek Dutta 1 Instructions The exam is closed book, notes, computers, phones. You can use calculator, but not one from your

More information

NWEN 243. Networked Applications. Layer 4 TCP and UDP

NWEN 243. Networked Applications. Layer 4 TCP and UDP NWEN 243 Networked Applications Layer 4 TCP and UDP 1 About the second lecturer Aaron Chen Office: AM405 Phone: 463 5114 Email: aaron.chen@ecs.vuw.ac.nz Transport layer and application layer protocols

More information

8. TCP Congestion Control

8. TCP Congestion Control 8. TCP Congestion Control 1 TCP Congestion Control Slow-start increase Multiplicative decrease Congestion avoidance Measurement of variation Exponential timer backoff 2002 Yanghee Choi 2 Congestion Control

More information

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

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 10 CMPE 150/L : Introduction to Computer Networks Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 10 1 Midterm exam Midterm next Thursday Close book but one-side 8.5"x11" note is allowed (must

More information

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness Recap TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness 81 Feedback Signals Several possible signals, with different

More information

CSC 634: Networks Programming

CSC 634: Networks Programming CSC 634: Networks Programming Lecture 03: Review of Basic Networking Concepts (TCP/UDP) Instructor: Haidar M. Harmanani Recap 7-Layer OSI Model 7 6 5 4 3 2 1 Application Presentation (kinds of compression)

More information

ECE 333: Introduction to Communication Networks Fall 2001

ECE 333: Introduction to Communication Networks Fall 2001 ECE 333: Introduction to Communication Networks Fall 2001 Lecture 28: Transport Layer III Congestion control (TCP) 1 In the last lecture we introduced the topics of flow control and congestion control.

More information

Reliable Transport II: TCP and Congestion Control

Reliable Transport II: TCP and Congestion Control Reliable Transport II: TCP and Congestion Control Stefano Vissicchio UCL Computer Science COMP0023 Recap: Last Lecture Transport Concepts Layering context Transport goals Transport mechanisms and design

More information

CS4700/CS5700 Fundamentals of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks CS4700/CS5700 Fundamentals of Computer Networks Lecture 14: TCP Slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang Alan Mislove amislove at ccs.neu.edu Northeastern

More information

Introduction to TCP/IP networking

Introduction to TCP/IP networking Introduction to TCP/IP networking TCP/IP protocol family IP : Internet Protocol UDP : User Datagram Protocol RTP, traceroute TCP : Transmission Control Protocol HTTP, FTP, ssh What is an internet? A set

More information

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018 TCP Review Carey Williamson Department of Computer Science University of Calgary Winter 2018 Credit: Much of this content came courtesy of Erich Nahum (IBM Research) The TCP Protocol Connection-oriented,

More information

CSCI-GA Operating Systems. Networking. Hubertus Franke

CSCI-GA Operating Systems. Networking. Hubertus Franke CSCI-GA.2250-001 Operating Systems Networking Hubertus Franke frankeh@cs.nyu.edu Source: Ganesh Sittampalam NYU TCP/IP protocol family IP : Internet Protocol UDP : User Datagram Protocol RTP, traceroute

More information

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet Chapter 2 - Part 1 The TCP/IP Protocol: The Language of the Internet Protocols A protocol is a language or set of rules that two or more computers use to communicate 2 Protocol Analogy: Phone Call Parties

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Networking Transport Layer Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) TCP/IP Model 2 Transport Layer Problem solved:

More information

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

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri Department of Computer and IT Engineering University of Kurdistan Transport Layer By: Dr. Alireza Abdollahpouri TCP/IP protocol suite 2 Transport Layer The transport layer is responsible for process-to-process

More information

TCP so far Computer Networking Outline. How Was TCP Able to Evolve

TCP so far Computer Networking Outline. How Was TCP Able to Evolve TCP so far 15-441 15-441 Computer Networking 15-641 Lecture 14: TCP Performance & Future Peter Steenkiste Fall 2016 www.cs.cmu.edu/~prs/15-441-f16 Reliable byte stream protocol Connection establishments

More information

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals Transport Layer Protocols Application SMTP HTTP FTP Telnet DNS BootP DHCP ( M I M E ) Presentation Session SNMP TFTP Internet Transport Layer TCP Fundamentals, TCP Performance Aspects, UDP (User Datagram

More information

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

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018 CS 43: Computer Networks 19: TCP Flow and Congestion Control October 31, Nov 2, 2018 Five-layer Internet Model Application: the application (e.g., the Web, Email) Transport: end-to-end connections, reliability

More information

QUIZ: Longest Matching Prefix

QUIZ: Longest Matching Prefix QUIZ: Longest Matching Prefix A router has the following routing table: 10.50.42.0 /24 Send out on interface Z 10.50.20.0 /24 Send out on interface A 10.50.24.0 /22 Send out on interface B 10.50.20.0 /22

More information

Communication Networks

Communication Networks Communication Networks Spring 2018 Laurent Vanbever nsg.ee.ethz.ch ETH Zürich (D-ITET) April 30 2018 Materials inspired from Scott Shenker & Jennifer Rexford Last week on Communication Networks We started

More information

Internet and Intranet Protocols and Applications

Internet and Intranet Protocols and Applications Internet and Intranet Protocols and Applications Lecture 1b: The Transport Layer in the Internet January 17, 2006 Arthur Goldberg Computer Science Department New York University artg@cs.nyu.edu 01/17/06

More information

Congestion Control End Hosts. CSE 561 Lecture 7, Spring David Wetherall. How fast should the sender transmit data?

Congestion Control End Hosts. CSE 561 Lecture 7, Spring David Wetherall. How fast should the sender transmit data? Congestion Control End Hosts CSE 51 Lecture 7, Spring. David Wetherall Today s question How fast should the sender transmit data? Not tooslow Not toofast Just right Should not be faster than the receiver

More information

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures. Transport Protocols! Type A: ISO Defined Types of Network Service: Network connection with acceptable residual error rate and acceptable rate of signaled failures. - Reliable, sequencing network service

More information

TCP: Flow and Error Control

TCP: Flow and Error Control 1 TCP: Flow and Error Control Required reading: Kurose 3.5.3, 3.5.4, 3.5.5 CSE 4213, Fall 2006 Instructor: N. Vlajic TCP Stream Delivery 2 TCP Stream Delivery unlike UDP, TCP is a stream-oriented protocol

More information

Reliable Transport I: Concepts and TCP Protocol

Reliable Transport I: Concepts and TCP Protocol Reliable Transport I: Concepts and TCP Protocol Stefano Vissicchio UCL Computer Science COMP0023 Today Transport Concepts Layering context Transport goals Transport mechanisms and design choices TCP Protocol

More information

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput Topics TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput 2 Introduction In this chapter we will discuss TCP s form of flow control called a sliding window protocol It allows

More information

Congestion Control in Communication Networks

Congestion Control in Communication Networks Congestion Control in Communication Networks Introduction Congestion occurs when number of packets transmitted approaches network capacity Objective of congestion control: keep number of packets below

More information

Outline. CS5984 Mobile Computing

Outline. CS5984 Mobile Computing CS5984 Mobile Computing Dr. Ayman Abdel-Hamid Computer Science Department Virginia Tech Outline Review Transmission Control Protocol (TCP) Based on Behrouz Forouzan, Data Communications and Networking,

More information

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

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades Announcements 15-441 Computer Networking Lecture 16 Transport Protocols Mid-semester grades Based on project1 + midterm + HW1 + HW2 42.5% of class If you got a D+,D, D- or F! must meet with Dave or me

More information