ch 3. transport layer myungchul kim [email protected]

63
Ch 3. Transport Layer Myungchul Kim [email protected]

Upload: theresa-jennings

Post on 25-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

Ch 3. Transport Layer

Myungchul Kim

[email protected]

Page 2: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

2

Transport-Layer Service

– A transport-layer protocol: logical communications between application processes running on different hosts.

– Processes vs hosts– A transport protocol can offer reliable data transfer service to an

application even when the underlying ntwork protocol is unreliable.

– IP, a best-effort delivery service: logical communications between hosts, unreliable service

– Extending host-to-host delivery to process-to-process delivery is called transport-layer multiplexing and demultiplexing.

Page 3: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

3

Page 4: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

4

Multiplexing and demultiplexing

– Demultiplexing: delivering the data in a transport-layer segment to the correct socket

– Multiplexing: passing the segments to the network layer– 16 bit number for port number including 1 to 1023 for well-known

port numbers

Page 5: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

5

- Each socket in the host could be assigned a port number.- A UDP socket is identified by a destination IP address an

d destination port number- A TCP socket is identifed by a four-tuple

Page 6: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

6

Page 7: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

7

Page 8: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

8

Connectionless Transport: UDP

– Multiplexing/demultiplexing and light error checking– No handshaking – Finer application-level control over what data is sent, and when– No connection establishment– No connection state– Small packet header overhead: TCP 20 bytes of header and UD

P 8 bytes of overhead– TCP is increasingly being used for streaming media transport– The lack of congesting control in UDP?

Page 9: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

9

Page 10: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

10

– UDP checksum: the 1’s complement of the sum of all the 16-bit words in the segment at the sender -> if no errors are introduced into the packet, the sum at the receiver will be all 1’s.

– Errors in a link-layer or a router’s memory

Page 11: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

11

Principles of reliable data transfer

– Unidirection data transfer

Page 12: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

12

Reliable data transfer over a perfectly reliable channel rdt1.0

Page 13: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

13

Reliable data transfer over a channel with bit errors rdt2.0– Rdt1.0: perfectly reliable channel, no limit of receiving speed– Error detection and Acknowledgement (ack, nak)– Automatic Repeat reQuest (ARQ) protocols; error detection, rec

eiver feedback and retransmission– Stop-and-wait protocol

Page 14: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

14

Page 15: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

15

Reliable data transfer over a channel with bit errors rdt2.1– Rdt 2.0: ack or nak packet could be corrupted– Sequence number of 0 or 1– Duplicate acks: a sender that receives two ACKs for the same p

acket knows that receivers did not correctly receive the packets following the duplicated acked packet.

Page 16: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

16

Page 17: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

17

Page 18: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

18

Reliable data transfer over a channel with bit errors rdt2.2– a NAK-free protocol – same functionality as rdt2.1, using ACKs only– instead of NAK, receiver sends ACK for last pkt received OK

receiver must explicitly include seq # of pkt being ACKed – duplicate ACK at sender results in same action as NAK: retrans

mit current pkt

Page 19: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

19

Page 20: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

20

Page 21: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

21

Reliable data transfer over a lossy channel with bit errors rdt3.0– Rdt 2.0: packet loss– Countdown timer– Alternating-bit protocol

Page 22: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

22

Page 23: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

23

Page 24: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

24

Pipelined reliable data transfer protocols

– Rdt3.0: performance problem due to a stop-and-wait protocol– Transmission delay = L/R = 8000 bits/packet / 10 9 bits/sec

= 8 microseconds.

where R= 1 Gbps, L = 1,000 bytes– Utilization of sender U sender = L/R / (RTT + L/R)

= .008 / 30.008 = 0.00027

where RTT = 30 milliseconds- Effective throughput of only 267kbps for a 1 Gbps link- Pipelining: the sender is allowed to send multiple packets withou

t waiting for acknowledgements.

Page 25: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

25

Page 26: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

26

Go-Back-N (GBN)

– Window size– A sliding window protocol– Receipt of an ack at the sender: Cumulative acknowledgement– The receiver discards out-of-order packets -> no buffers at the re

ceiver

Page 27: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

27

Page 28: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

28

Page 29: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

29

Page 30: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

30

Selective Repeat (SR)

– The receiver individually acknowledge correctly received packets.– The sender and receiver will not always have an identical view of

what has been received correctly and what has not.

Page 31: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

31

Page 32: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

32

Page 33: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

33

Connection-oriented Transport: TCP

– Full-duplex service– Point-to-point– Three-way handshake– Maximum segment size (MSS)– Maximum transmission unit (MTU)

Page 34: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

34

Page 35: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

35

– Cumulative acknowledgements– The acknowledgement number that Host A puts in its segment is

the sequence number of the next byte Host A is expecting from Host B.

Page 36: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

36

Page 37: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

37

Round-trip time estimation and timeout

– EstimatedRTT = (1-α) * EstimatedRTT + α * SampleRTT– α = 0.125– DevRTT = (1 -β)*DevRTT + β * |SampleRTT – EstimatedRTT|– TimeoutInterval = EstimatedRTT + 4* DevRTT

Page 38: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

38

Reliable data transfer

– A single retransmission timer; associate with the oldest unacknowledged segment

– TCP uses cumulative acknowledgement

Page 39: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

39

Page 40: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

40

Page 41: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

41

Page 42: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

42

Page 43: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

43

Doubling the Timeout Interval– Each time TCP retransmits, it sets the next timeout interval to twi

ce the previous value.

Fast retransmit– A duplicate ACK is an ACK that reacknowledgements a segment

for which the sender has already received an earlier acknowledgement.

– Three duplicate ACKs -> TCP sender performs a fast retransmit, retransmitting the missing segment before that segment’s timer expires.

– why three?

TCP is a hybrid of GBN and SR protocols.

Page 44: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

44

Page 45: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

45

Flow control

– Eliminate the possibility of the sender overflowing the receiver’s buffer

– Sender maintains a variable called the receive window– LastByteRead: the number of the last byte in the data stream rea

d from the buffer by the application process in B– LastByteRcvd: the number of the last byte in the data stream tha

t has arrived from the network and has been placed in the receive buffer at B

Page 46: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

46

– LastByteRcvd – LastByteRead ≤ RcvBuffer– RcvWindow = RcvBuffer – [ LastByteRcvd – LastByteRead]

– No overflow at the receive buffer : LastByteSent – LastByteAcked ≤ RcvWindow (at the sender)

– Host A continues to send segments with one data byte when B’s receive window is zero.

Page 47: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

47

TCP connection management

– Three-way handshake

Page 48: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

48

Page 49: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

49

Page 50: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

50

Principles of congestion control

– Scenario 1

Page 51: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

51

Page 52: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

52

– Scenario 2– Offered load to the network

Page 53: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

53

Page 54: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

54

– Scenario 3

Page 55: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

55

Page 56: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

56

Approaches to congestion control

End-to-end congestion control– The network layer provides no explicit support to the transport la

yer for congestion control purpose.– Congestion is inferred on observed network behavior such pack

et loss and delay.– TCP

Network-assisted congestion control– ATM Available bit-rate (ABR) congestion control

Page 57: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

57

Page 58: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

58

Network-assisted congestion-control example: ATM ABR congestion control

– Explicitly signaling to the sender to reduce its rate when the switch becomes congested.

– Resource-management cells (RM cells)

Signaling congestion-related information– Explicit forward congestion indication (EFCI) bit in data cells– Congestion indication (CI) and No increase (NI) bits in RM cells– Explict rate setting

Page 59: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

59

TCP congestion control

– Congestion window– LastByteSent – LastByteAcked ≤ min{CongWin, RcvWindow}– At the beginning: sending rate = CongWin / RTT

Additive-Increase, Multiplicative-Decrease (AIMD)– Halving the current value of CongWin after a loss event– Not allowed to drop below 1 MSS– Increase CongWin by 1 MSS every round-trip time– Congestion avoidance

Page 60: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

60

Slow start– A TCP sender increases its rate exponentially by doubling its val

ue of CongWin every RTT

Page 61: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

61

Reaction to timeout events– A triple duplicate ACK -> fast recovery: ½ CongWin – A timeout -> a slow start– Vegas: the longer the RTT of the packets, the greater the conge

stion in the routers

Page 62: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

62

Fairness

Page 63: Ch 3. Transport Layer Myungchul Kim mckim@icu.ac.kr

63

– Fairness and UDP– Fairness and parallel TCP connections