COMP 431 Transport Layer Protocols & Services Internet Services - - PowerPoint PPT Presentation

comp 431 transport layer protocols services internet
SMART_READER_LITE
LIVE PREVIEW

COMP 431 Transport Layer Protocols & Services Internet Services - - PowerPoint PPT Presentation

COMP 431 Transport Layer Protocols & Services Internet Services & Protocols Outline application Fundamental transport layer transport The Transport Layer services network data link network Multiplexing/Demultiplexing


slide-1
SLIDE 1

1

COMP 431 Internet Services & Protocols The Transport Layer

Pipelined Transport Protocols Jasleen Kaur

February 25, 2020

2

Transport Layer Protocols & Services

Outline

◆ Fundamental transport layer

services

» Multiplexing/Demultiplexing » Error detection » Reliable data delivery » Pipelining » Flow control » Congestion control

◆ Service implementation in

Internet transport protocols

» UDP » TCP

network data link physical regional ISP home network Institutional network application transport network data link physical application transport network data link physical network data link physical

Logical end-to-end transport

slide-2
SLIDE 2

3

Transport Protocol Performance

Performance of RDT3.0

◆ Can an end-system make efficient use of a network under RDT

3.0?

◆ Consider a 1 Gbps link with 15 ms end-to-end propagation delay ◆ How busy is the network under RDT 3.0?

transmission time

=

8 µs 109 bps 1 kB packet x 8 b/byte

=

utilization = observation interval time network busy

=

packet generation time time to transmit a packet

◆ How long does it take to transmit a 1,000 byte packet? ◆ How fast can an end-system generate packets?

4

wait for rdt_send 1

rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt)

wait for ACK 0

Transport Protocol Performance

Performance of RDT3.0

◆ How fast can an end-system generate packets?

» Packet transmission time = 8 µs » Propagation delay to receiver = 15 ms » ACK generation/transmission time ≈ 8 µs » Propagation time for ACK to return to sender = 15 ms

◆ Best case: 1 packet every 30.016 ms wait for rdt_send

rdt_send(data) ... udt_send(sndpkt0) start_timer rdt_send(data) ... udt_send(sndpkt1) start_timer

slide-3
SLIDE 3

5

Transport Protocol Performance

Performance of RDT3.0

◆ How busy is the network under RDT 3.0?

0.027% 30.016 ms 8 µs

= =

utilization = observation interval time network busy

=

packet generation time time to transmit a packet

◆ Is this good?

» 1,000 byte packet every 30 ms results in (maximum) throughput of 266 kbps over a 1 Gbps link! (266,000 bps over a 1,000,000,000 bps link)

Network protocols limit the use of physical resources!

6

Improving Transport Protocol Performance

Pipelining data transmissions

◆ Performance can be improved by allowing the sender to have

multiple unacknowledged packets “in flight”

◆ Issues?

» The range of sequence numbers must be increased » More packets must be buffered at sender and receiver Stop-and-Wait protocol Pipelined protocol

ACK packets data packets ACK packets data packets

slide-4
SLIDE 4

7

Pipelined Protocols

“Go-Back-n” protocols

◆ Packet header contains a k-bit sequence number ◆ A “window” of up to N ≤ 2kconsecutive, unacknowledged packets

allowed to be in-flight

» Up to N packets may be buffered at the sender » Window advances as ACKs are received

◆ Receiver generates “cumulative ACKs”

» ACKs contain the sequence number of the last in-order packet received

Packet sequence

Sliding window Sent and ACK’ed Sent and unACK’ed Unsent and eligible Unsent and ineligible window base sequence number next sequence number

1st Packet Last Packet

8

Packet sequence

Pipelined Protocols

“Go-Back-n” protocols

◆ Receiver protocol

» Use cumulative ACKs —ACK packet n only if all packets numbered less than n have been received » If losses occur, sender may receive duplicate ACKs

◆ Sender protocol

» A timer is set for each (or just the oldest) in-flight packet » On timeout for packet n, retransmit packet n and all higher number packets in the current window Sliding window Sent and ACK’ed Sent and unACK’ed Unsent and eligible Unsent and ineligible window base sequence number next sequence number

1st Packet Last Packet

slide-5
SLIDE 5

10

Go-Back-n Protocol

Sender extended FSM

rdt_send(data) if (nextseqnum < base+N) { compute chksum make_pkt(sndpkt[nextseqnum],nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) start_timer nextseqnum += 1 } else refuse_data(data) wait for data/ACK/ timeout timeout start_timer udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) ... udt_send(sndpkt[nextseqnum–1]) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) base := getacknum(rcvpkt) + 1 if (base == nextseqnum) stop_timer else start_timer

12

Go-Back-n Protocol

Receiver extended FSM

◆ In-order packets processed, out-of-order packets discarded

» Sender will eventually timeout and retransmit out-of-order packets » Thus the receiver need not buffer any packets

◆ Always send ACK for correctly-received packet with highest

in-order sequence number

» May generate duplicate ACKs » But minimal state — need only remember expectedseqnum

default udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seqnum(rcvpkt,expectedSeqNum) extract(rcvpkt,data) deliver_data(data) make_pkt(sndpkt,ACK,expectedSeqNum) expectedseqnum += 1 udt_send(sndpkt) wait for packet/ timeout

slide-6
SLIDE 6

13

Go-Back-n Protocol

Execution example

◆ Assume a window

size of 4 packets

◆ Receiver ignores out-

  • f-order packets

◆ Sender retransmits

  • nly on timeout

» (Duplicate ACK s now have no effect)

Sender Receiver

send pkt0 send pkt1 send pkt2 send pkt3 (wait) pkt2 timeout rcv pkt0 send ACK0 rcv ACK0 send pkt4 rcv pkt3, discard send ACK1 rcv ACK1 send pkt5 rcv pkt1 send ACK1 rcv pkt4, discard send ACK1 rcv pkt5, discard send ACK1 rcv pkt2 send ACK2 X rcv pkt3 send ACK3 send pkt2 send pkt3 send pkt4 send pkt5

14

Transport Protocol Performance

Performance of Go-Back-n protocols

◆ Can an end-system make more efficient use of a network under

a Go-Back-n protocol?

◆ Consider again transmitting 1,000 byte packets on a 1 Gbps link

with 15 ms end-to-end propagation delay

transmission time

=

8 µs 109 bps 1 kB packet x 8 b/byte

=

utilization = packet generation time time to transmit a packet

◆ How fast can an end-system transmit packets?

» Depends on the window size!

slide-7
SLIDE 7

15

Transport Protocol Performance

Performance of Go-Back-n protocols

◆ How fast can an end-system transmit packets?

» N packets can be sent before the sender must wait for an ACK

◆ N packets sent every 30.016 ms

» Packet generation/transmission time = 8 µs » Round-trip-time to receiver = 30 ms » ACK generation/transmission time ≈ 8 µs

rdt_send(data) if (nextseqnum < base+N) { compute chksum make_pkt(sndpkt[nextseqnum],nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) start_timer nextseqnum += 1 }

wait for data/ACK/ timeout

16

Transport Protocol Performance

Performance of Go-Back-n protocols

1 2 3 4 5

15.000 ms

1 2 3 4 5

15.008 ms 15.016 ms 15.024 ms 15.032 ms 15.040 ms 15.048 ms

6 7 8 9

10

0.000 ms 0.008 ms 0.016 ms 0.024 ms 0.032 ms 0.040 ms 30.008 ms 30.016 ms 30.024 ms 30.032 ms 30.040 ms 30.048 ms 30.054 ms

6 7

Sender Receiver

Window 1 Window 2 Window 1

45.016 ms 45.024 ms

Window 2

1 2 3 4 5 1 2 3 4 5

45.032 ms

x x

Data packet with sequence numbe r x ACK packet with sequence numbe r x

slide-8
SLIDE 8

17

Transport Protocol Performance

Performance of Go-Back-n protocols

◆ Performance with a window size of N = 64 packets: ◆ Is this good?

» 64 1,000 byte packets every 30 ms results in (maximum) throughput of 17 Mbps over a 1 Gbps link! utilization = time to receipt of first ACK time to transmit N packets 30.016 ms 512 µs

=

1.7%

= A 64x improvement!

18

Pipelined Protocols

“Selective Repeat” protocols

◆ Receiver individually acknowledges all correctly received

packets

» Buffers packets as needed for eventual in-order delivery to upper layer

◆ Sender only resends packets for which an ACK has not been

received

» Sender maintains a timer for each unACK’ed packet

◆ Sender window is the same as before

» N consecutive sequence numbers (Limits the sequence numbers of sent, unACK’ed packets)

slide-9
SLIDE 9

19

Selective Repeat Protocols

Sender and receiver windows

◆ Sender’s view of sequence number space ◆ Receiver’s view of sequence number space

Packet sequence

Sliding window Received and ACK’ed Acceptabl e Out-of-order but ACK’ed Expected, not received Not expected, not received

Packet sequence

Sliding window Sent and ACK’ed Sent and unACK’ed Sent and ACK’ed Unsent and eligible Unsent and ineligible

1st Packet Last Packet 1st Packet Last Packet

20

Selective Repeat Protocols

Sender state machine

◆ Call from above:

» If next available sequence number is within window, send the packet and start a timer for it

◆ Timeout for packet n:

» Resend packet n, restart timer for packet n

◆ ACK received for packet with sequence number n:

» If n in [sendBase, sendBase+N–1] then mark packet n as received » If n == sendBase, advance sendBase to next highest unACKed sequence number and move the window forward by that amount

Packet sequence

Sliding window Sent and ACK’ed Sent and ACK’ed Sent and unACK’ed Unsent and eligible Unsent and ineligible sendBase

1st Packet Last Packet

slide-10
SLIDE 10

21

Packet sequence

Selective Repeat Protocols

Receiver state machine

◆ Packet n in [rcvbase, rcvbase+N–1] correctly received:

» Send an ACK for packet n » If packet n is out-of-order then buffer » If n == rcvBase, deliver packet n, and all other buffered consecutive in-order packets, to application, and advance the window by the number of delivered packets

◆ Packet n in [rcvbase–N, rcvbase–1] received:

» Send an ACK for packet n

◆ Otherwise discard packet (without ACK’ing)

Sliding window Received and ACK’ed Acceptabl e Out-of-order but ACK’ed Expected, not received Not expected, not received rcvBase

1st Packet Last Packet

22

Receiver

receive pkt0, deliver, send ACK0 0 1 2 3 4 5 6 7 8 9 receive pkt1, deliver, send ACK1 0 1 2 3 4 5 6 7 8 9 receive pkt3, buffer, send ACK3 0 1 2 3 4 5 6 7 8 9 receive pkt4, buffer, send ACK4 0 1 2 3 4 5 6 7 8 9 receive pkt2, deliver 2-5, send ACK2 0 1 2 3 4 5 6 7 8 9

Sender

X send pkt0 0 1 2 3 4 5 6 7 8 9 send pkt1 0 1 2 3 4 5 6 7 8 9 send pkt2 0 1 2 3 4 5 6 7 8 9 send pkt3 0 1 2 3 4 5 6 7 8 9 receive ACK0, send pkt4 0 1 2 3 4 5 6 7 8 9 pkt2 timeout, send pkt2 0 1 2 3 4 5 6 7 8 9

Selective Repeat Protocols

Execution example

receive ACK1, send pkt5 0 1 2 3 4 5 6 7 8 9 receive pkt5, buffer, send ACK5 0 1 2 3 4 5 6 7 8 9

slide-11
SLIDE 11

23

◆ How many sequence

numbers do we need?

» As many as the largest number of packets that can be in flight?

◆ If the sequence number

space is close to the window size then the receiver can get confused

Selective Repeat Protocols

Window state ambiguity

Sender

0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2 pkt0 timeout 0 1 2 3 0 1 2

Receiver

0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2 Packet received with sequence number 0 pkt0 pkt1 pkt2

X

pkt0

Sender

0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2

Receiver

0 1 2 3 0 1 2 0 1 2 3 0 1 2 0 1 2 3 0 1 2 Packet received with sequence number 0 pkt0 pkt1 pkt2

X

pkt0 pkt3