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 physical Pipelined Transport Protocols data link » Error detection physical home » Reliable data delivery network network » Pipelining data link Jasleen Kaur Logical » Flow control physical end-to-end regional ISP transport » Congestion control February 25, 2020 ◆ Service implementation in Internet transport protocols » UDP » TCP application Institutional transport network network data link physical 1 2
Transport Protocol Performance Transport Protocol Performance Performance of RDT3.0 Performance of RDT3.0 ◆ Can an end-system make efficient use of a network under RDT rdt_send(data) 3.0? ... wait for wait for rdt_send udt_send(sndpkt0) ACK 0 ◆ Consider a 1 Gbps link with 15 ms end-to-end propagation delay start_timer rdt_rcv(rcvpkt) 0 && notcorrupt(rcvpkt) ◆ How busy is the network under RDT 3.0? && isACK(rcvpkt) wait for rdt_send(data) rdt_send ... 1 udt_send(sndpkt1) start_timer time network busy time to transmit a packet utilization = observation interval = packet generation time ◆ How fast can an end-system generate packets? » Packet transmission time = 8 µ s ◆ How long does it take to transmit a 1,000 byte packet? » Propagation delay to receiver = 15 ms 1 kB packet x 8 b / byte transmission » ACK generation/transmission time ≈ 8 µ s = = 8 µ s time 10 9 bps » Propagation time for ACK to return to sender = 15 ms ◆ Best case: 1 packet every 30.016 ms ◆ How fast can an end-system generate packets? 3 4
Transport Protocol Performance Improving Transport Protocol Performance Performance of RDT3.0 Pipelining data transmissions ◆ Performance can be improved by allowing the sender to have ◆ How busy is the network under RDT 3.0? multiple unacknowledged packets “ in flight ” time network busy time to transmit a packet utilization = observation interval = packet generation time 8 µ s data packets data packets = = 0.027% 30.016 ms ACK packets ACK packets ◆ 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) Stop-and-Wait protocol Pipelined protocol ◆ Issues? » The range of sequence numbers must be increased Network protocols limit the use of physical resources! » More packets must be buffered at sender and receiver 5 6
Pipelined Protocols Pipelined Protocols “ Go-Back- n ” protocols “ Go-Back- n ” protocols Sliding window Sliding window Sent and Sent and Unsent and Unsent and Sent and Sent and Unsent and Unsent and ACK ’ ed unACK ’ ed ACK ’ ed unACK ’ ed eligible ineligible eligible ineligible Packet Packet 1 st Last 1 st Last sequence sequence Packet Packet Packet Packet window base next sequence window base next sequence sequence number number sequence number number ◆ Receiver protocol ◆ Packet header contains a k -bit sequence number » Use cumulative ACKs —ACK packet n only if all packets numbered less than n ◆ A “ window ” of up to N ≤ 2 k consecutive, unacknowledged packets have been received allowed to be in-flight » If losses occur, sender may receive duplicate ACKs » Up to N packets may be buffered at the sender ◆ Sender protocol » Window advances as ACKs are received » A timer is set for each (or just the oldest) in-flight packet ◆ Receiver generates “ cumulative ACKs ” » On timeout for packet n , retransmit packet n and all higher number packets in the current window » ACKs contain the sequence number of the last in-order packet received 7 8
Go-Back -n Protocol Go-Back -n Protocol Sender extended FSM Receiver extended FSM rdt_rcv(rcvpkt) rdt_send(data) && notcorrupt(rcvpkt) if (nextseqnum < base+N) { && has_seqnum(rcvpkt,expectedSeqNum) default wait for compute chksum extract(rcvpkt,data) packet/ udt_send(sndpkt) make_pkt(sndpkt[nextseqnum],nextseqnum,data,chksum) timeout deliver_data(data) udt_send(sndpkt[nextseqnum]) make_pkt(sndpkt,ACK,expectedSeqNum) if (base == nextseqnum) start_timer expectedseqnum += 1 nextseqnum += 1 udt_send(sndpkt) } else wait for ◆ In-order packets processed, out-of-order packets discarded refuse_data(data) data/ACK/ » Sender will eventually timeout and retransmit out-of-order packets timeout timeout » Thus the receiver need not buffer any packets start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) udt_send(sndpkt[base]) ◆ Always send ACK for correctly-received packet with highest base := getacknum(rcvpkt) + 1 udt_send(sndpkt[base+1]) in-order sequence number if (base == nextseqnum) ... stop_timer » May generate duplicate ACKs udt_send(sndpkt[nextseqnum–1]) else » But minimal state — need only remember expectedseqnum start_timer 10 12
Transport Protocol Performance Go-Back -n Protocol Performance of Go-Back- n protocols Execution example send pkt0 ◆ Can an end-system make more efficient use of a network under ◆ Assume a window rcv pkt0 send pkt1 a Go-Back- n protocol? size of 4 packets send ACK0 send pkt2 rcv pkt1 ◆ Consider again transmitting 1,000 byte packets on a 1 Gbps link send ACK1 X send pkt3 with 15 ms end-to-end propagation delay ◆ Receiver ignores out- (wait) rcv pkt3, discard of-order packets Receiver Sender send ACK1 time to transmit a packet utilization = ◆ Sender retransmits rcv ACK0 packet generation time send pkt4 only on timeout rcv pkt4, discard rcv ACK1 » (Duplicate ACK s now 1 kB packet x 8 b / byte send ACK1 transmission send pkt5 have no effect) = = 8 µ s time 10 9 bps rcv pkt5, discard send ACK1 pkt2 timeout send pkt2 ◆ How fast can an end-system transmit packets? send pkt3 rcv pkt2 » Depends on the window size! send pkt4 send ACK2 send pkt5 rcv pkt3 send ACK3 13 14
Transport Protocol Performance Transport Protocol Performance Data packet with x sequence numbe r x Performance of Go-Back- n protocols Performance of Go-Back- n protocols ACK packet with x sequence numbe r x rdt_send(data) 0.000 ms if (nextseqnum < base+N) { Window 1 1 0.008 ms compute chksum Receiver 2 make_pkt(sndpkt[nextseqnum],nextseqnum,data,chksum) wait for 0.016 ms data/ACK/ udt_send(sndpkt[nextseqnum]) 3 timeout 0.024 ms if (base == nextseqnum) start_timer 15.000 ms nextseqnum += 1 4 0.032 ms 1 15.008 ms } Window 1 5 0.040 ms 2 1 15.016 ms 3 2 Sender 15.024 ms ◆ How fast can an end-system transmit packets? 4 3 15.032 ms » N packets can be sent before the sender must wait for an ACK 30.008 ms 5 4 15.040 ms ◆ N packets sent every 30.016 ms 1 30.016 ms 5 Window 2 » Packet generation/transmission time = 8 µ s 15.048 ms 2 6 30.024 ms » Round-trip-time to receiver = 30 ms 3 7 30.032 ms » ACK generation/transmission time ≈ 8 µ s 4 8 30.040 ms Window 45.016 ms 5 9 6 30.048 ms 2 45.024 ms 10 7 30.054 ms 45.032 ms 15 16
Transport Protocol Performance Pipelined Protocols “ Selective Repeat ” protocols Performance of Go-Back- n protocols ◆ Performance with a window size of N = 64 packets: ◆ Receiver individually acknowledges all correctly received packets time to transmit N packets » Buffers packets as needed for eventual in-order delivery to upper layer utilization = time to receipt of first ACK ◆ Sender only resends packets for which an ACK has not been 512 µ s received = = 1.7% 30.016 ms » Sender maintains a timer for each unACK ’ ed packet ◆ Sender window is the same as before A 64 x improvement! » N consecutive sequence numbers (Limits the sequence numbers of sent, unACK ’ ed packets) ◆ Is this good? » 64 1,000 byte packets every 30 ms results in (maximum) throughput of 17 Mbps over a 1 Gbps link! 17 18
Selective Repeat Protocols Selective Repeat Protocols Sender and receiver windows Sender state machine ◆ Sender ’ s view of sequence number space sendBase Sliding window Packet Sliding window 1 st Last sequence Packet Packet Packet 1 st Last sequence Packet Packet Unsent and Sent and Unsent and eligible ACK ’ ed ineligible Sent and Unsent and Sent and Unsent and unACK ’ ed Sent and ACK ’ ed eligible ACK ’ ed ineligible Sent and ACK ’ ed Sent and unACK ’ ed ◆ Call from above: » If next available sequence number is within window, send the packet and start a timer ◆ Receiver ’ s view of sequence number space for it ◆ Timeout for packet n : Sliding window » Resend packet n , restart timer for packet n Packet ◆ ACK received for packet with sequence number n : 1 st Last sequence Packet Packet » 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 Received Expected, Acceptabl e Not expected, move the window forward by that amount and not received not received ACK ’ ed Out-of-order but ACK ’ ed 19 20
Recommend
More recommend