Presentation is loading. Please wait.

Presentation is loading. Please wait.

DMET 602: Networks and Media Lab

Similar presentations


Presentation on theme: "DMET 602: Networks and Media Lab"— Presentation transcript:

1 DMET 602: Networks and Media Lab
Amr El Mougy Yasmeen Essam Mohamed Karam

2 Exp 1: Transmission Parameters

3 Four sources of packet delay
1. nodal processing: check bit errors determine output link 2. queuing: time waiting at output link for transmission depends on congestion level of router A B propagation transmission nodal processing queuing Introduction

4 Delay in packet-switched networks
3. Transmission delay: R=link bandwidth (bps) L=packet length (bits) time to send bits into link = L/R 4. Propagation delay: d = length of physical link s = propagation speed in medium (~2x108 m/sec) propagation delay = d/s Note: s and R are very different quantities! A B propagation transmission nodal processing queuing Introduction

5 Throughput (more) Rs < Rc What is average end-end throughput?
Rc bits/sec Rs bits/sec Rs > Rc What is average end-end throughput? Rs bits/sec Rc bits/sec link on end-end path that constrains end-end throughput bottleneck link Introduction

6 TCP: Overview point-to-point: full duplex data:
one sender, one receiver reliable, in-order byte steam: no “message boundaries” pipelined: TCP congestion and flow control set window size send & receive buffers full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control msgs) init’s sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver Transport Layer

7 TCP segment structure Transport Layer source port # dest port #
32 bits application data (variable length) sequence number acknowledgement number Receive window Urg data pointer checksum F S R P A U head len not used Options (variable length) URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes of data (not segments!) Internet (as in UDP) Transport Layer

8 TCP seq. #’s and ACKs Seq. #’s:
byte stream “number” of first byte in segment’s data ACKs: seq # of next byte expected from other side cumulative ACK Q: how receiver handles out- of-order segments A: TCP spec doesn’t say, - up to implementer Host A Host B User types ‘C’ Seq=42, ACK=79, data = ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ Seq=79, ACK=43, data = ‘C’ host ACKs receipt of echoed ‘C’ Seq=43, ACK=80 time simple telnet scenario Transport Layer

9 TCP reliable data transfer (RDT)
TCP creates RDT service on top of IP’s unreliable service pipelined segments cumulative ACKs TCP uses single retransmission timer retransmissions are triggered by: timeout events duplicate ACKs initially consider simplified TCP sender: ignore duplicate ACKs ignore flow control, congestion control Transport Layer

10 TCP sender events: data rcvd from app: create segment with seq #
seq # is byte-stream number of first data byte in segment start timer if not already running (think of timer as for oldest unACKed segment) timeout: retransmit segment that caused timeout restart timer ACK rcvd: if acknowledges previously unACKed segments update what is known to be ACKed start timer if there are outstanding segments

11 TCP: retransmission scenarios
Host A Seq=92, 8 bytes data ACK=100 loss timeout lost ACK scenario Host B X time Host A Host B Seq=92 timeout Seq=92, 8 bytes data Seq=100, 20 bytes data ACK=100 ACK=120 Seq=92, 8 bytes data Seq=92 timeout ACK=120 premature timeout time

12 TCP retransmission scenarios (more)
Host A Seq=92, 8 bytes data ACK=100 loss timeout Cumulative ACK scenario Host B X Seq=100, 20 bytes data ACK=120 time

13 Fast Retransmit time-out period often relatively long:
long delay before resending lost packet detect lost segments via duplicate ACKs. sender often sends many segments back-to-back if segment is lost, there will likely be many duplicate ACKs for that segment If sender receives 3 ACKs for same data, it assumes that segment after ACKed data was lost: fast retransmit: resend segment before timer expires Transport Layer

14 X time Host A Host B seq # x1 seq # x2 seq # x3 ACK x1 seq # x4
triple duplicate ACKs resend seq X2 timeout time

15 TCP ACK generation Event at Receiver TCP Receiver action
Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap

16 TCP Flow Control receiver side of TCP connection has a receive buffer:
sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control IP datagrams TCP data (in buffer) (currently) unused buffer space application process rwnd speed-matching service: matching send rate to receiving application’s drain rate guarantees receiver’s buffer doesn’t overflow RcvBuffer app process may be slow at reading from buffer receiver: advertises unused buffer space by including rwnd value in segment header sender: limits # of unACKed bytes to rwnd

17 TCP Congestion Control
Sliding Window Protocol Sender maintains a congestion window (cwnd), in addition to the receiver’s window (rwnd) advertised in ACK Allowed-window = min(cwnd, rwnd) If no congestion: Allowed-window = rwnd Packet loss is interpreted as congestion occurrence: reduce congestion window size. TCP congestion control has three modes: slow start, congestion avoidance and fast recovery Transport Layer

18 TCP Congestion Control
Slow start: Start: cwnd = 1MSS, ssthresh = 64 KB For every new received ACK, cwnd = cwnd + MSS If cwnd ≥ ssthresh  go to congestion avoidance Congestion avoidance For every new received ACK, cwnd = cwnd + MSS(MSS/cwnd)

19 TCP Tahoe Does not have any mechanism to deal with 3 duplicate ACKs  ignores them The only event that triggers an action is the timeout Timeout  go to slow start, ssthresh = cwnd/2, cwnd = 1 MSS For every received ACK, cwnd = cwnd + MSS Transport Layer

20 TCP Reno Deals with timeouts exactly the same as TCP Tahoe (goes to slow start) If 3 duplicate ACKs are received  go to fast recovery, ssthresh = cwnd/2, cwnd = cwnd/2 Once a new ACK is received  go directly to congestion avoidance If TCP is in congestion avoidance and 3 duplicate ACKs are received  go to fast recovery

21 TCP Congestion Control

22 TCP Connection Management
Three way handshake: Step 1: client host sends TCP SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data

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

24 TCP Connection Management (cont.)
Step 3: client receives FIN, replies with ACK. Enters “timed wait” - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed client server closing FIN ACK closing FIN ACK timed wait closed closed


Download ppt "DMET 602: Networks and Media Lab"

Similar presentations


Ads by Google