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

Preview:

Citation preview

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.

3

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

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

6

7

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?

9

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

11

Principles of reliable data transfer

– Unidirection data transfer

12

Reliable data transfer over a perfectly reliable channel rdt1.0

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

14

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.

16

17

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

19

20

21

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

22

23

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.

25

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

27

28

29

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.

31

32

33

Connection-oriented Transport: TCP

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

34

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.

36

37

Round-trip time estimation and timeout

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

38

Reliable data transfer

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

– TCP uses cumulative acknowledgement

39

40

41

42

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.

44

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

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.

47

TCP connection management

– Three-way handshake

48

49

50

Principles of congestion control

– Scenario 1

51

52

– Scenario 2– Offered load to the network

53

54

– Scenario 3

55

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

57

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

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

60

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

ue of CongWin every RTT

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

62

Fairness

63

– Fairness and UDP– Fairness and parallel TCP connections

Recommended