Course on Computer Communication and Networks Lecture 4

  • Slides: 49
Download presentation
Course on Computer Communication and Networks Lecture 4 Chapter 3; Transport Layer, Part A

Course on Computer Communication and Networks Lecture 4 Chapter 3; Transport Layer, Part A EDA 344/DIT 423, CTH/GU Based on the book Computer Networking: A Top Down Approach, Jim Kurose, Keith Ross, Addison-Wesley. Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 1

Transport services and protocols Marina Papatriantafilou – Transport layer part 1: Addressing in Internet

Transport services and protocols Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT rt – rcv side: reassembles segments into messages, passes to app layer po ns tra – send side: breaks app messages into segments, passes to network layer nd -e nd le • transport protocols run in end systems ca gi lo • provide communication services to app-layer protocols application transport network data link physical 2

Parenthesis: On last week’s questions Q: Types of services that a transport layer may

Parenthesis: On last week’s questions Q: Types of services that a transport layer may need to provide. – Which of those are provided by in the Internet transport layer protocols? Services i. e. properties – No-loss – In-order delivery – Timeliness i. e. latency, bandwidth guarantees Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 3

Internet transport-layer protocols Reliable, in-order delivery: TCP • also provides network data link physical

Internet transport-layer protocols Reliable, in-order delivery: TCP • also provides network data link physical rt Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT network data link physical po ns tra Transport Layer services not available in the Internet: Delay/bandwidth guarantees. Why? When the (successful due to simplicity) TCP/IP protocol stack was defined, no foreseeable need for such applications in an inter-net. network data link physical nd Both support addressing (encapsulation), of course! network data link physical -e nd – no-frills extension of “best-effort” IP network data link physical le Best effort (can be unreliable, unordered) delivery: UDP network data link physical ca gi lo – connection setup – flow control – + care for the health of the network (aka TCP’s congestion control) Recall: best-effort datagram service application transport network data link physical 4

Roadmap s: l a o g : g n ices. Transport i v n

Roadmap s: l a o g : g n ices. Transport i v n r r e a s r e • layer services in Internet e L : ay r l e t r y o a p L s rt o tran p f s o n s a e ing • Addressing, multiplexing/demultiplexing l r x p T i e l c p i n i t l r u and p /dem t g s n r i e x e d l n p • u , multi g n i s s • Connectionless, unreliable transport: UDP e r e f s – addr n ata tra d e l b a i • Principles of reliable data transfer – rel sue -rol er is y a l t r o ransp it is T e c a n y i l s l a r (not re ransport laye l ffic) o a r r t t n e o t c m i o n estio tion t Real. T – cong tudy in connection with in co e some s r o m ; TCP rnet e t there in n I e h n in t • Next lecture: connection-oriented transport: TCP o i t a t n eme l p m i d – reliable transfer n an o i t a i t n • insta – flow control – connection management – TCP congestion control nt co – flow Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 5

Addressing: Multiplexing/demultiplexing (+ recall encapsulation) Multiplexing at send host: gathering data, enveloping data with

Addressing: Multiplexing/demultiplexing (+ recall encapsulation) Multiplexing at send host: gathering data, enveloping data with header (later used for demultiplexing) Demultiplexing at rcv host: delivering received segments to correct socket = socket application = process P 3 P 1 application transport network link physical host 1 P 2 P 4 application transport network link physical host 2 host 3 Recall: segment - unit of data exchanged between transport layer entities aka TPDU: transport protocol data unit Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 6

Addressing v Host receives IP datagrams § Datagram (i. e. IP packet) has source

Addressing v Host receives IP datagrams § Datagram (i. e. IP packet) has source IP address, destination IP address 32 bits source port # dest port # other header fields § datagram carries transport-layer segment § segment has source, destination port number application data (payload) v Host uses IP addresses & port numbers to direct segment to appropriate socket TCP/UDP segment format Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 7

UDP addressing – demultiplexing + example IP datagrams with same dest. port # (but

UDP addressing – demultiplexing + example IP datagrams with same dest. port # (but perhaps different source IP addresses or source port numbers will be directed) to the same socket when host receives UDP segment: § directs UDP segment to socket with that port # Datagram. Socket my. Socket 2 = new Datagram. Socket (9157); Datagram. Socket server. Socket = new Datagram. Socket (6428); Datagram. Socket my. Socket 1 = new Datagram. Socket (5775); application P 1 P 3 P 4 transport network link physical source port: 6428 dest port: 9157 source port: 9157 dest port: 6428 source port: ? dest port: ? Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 8

TCPConnection-oriented (TCP) addressing/demux + example TCP socket identified by 4 -tuple: § source IP

TCPConnection-oriented (TCP) addressing/demux + example TCP socket identified by 4 -tuple: § source IP address, source port number § dest IP address, dest port number application (Demux) Receiver uses all 4 values to direct segment to appropriate socket application P 4 P 3 P 5 application P 6 P 3 P 2 transport network link physical server: IP address B server m simulta ay support m ne an • one ous TCP sockety s: s • eac ocket per conne h id cti tuple entified by its on own 4 • E. g. we differenb servers have connect t sockets for e ing clien ach t physical client: IP address C client: IP address A source IP, port: B, 80 dest IP, port: A, 9157 source IP, port: A, 9157 dest IP, port: B, 80 source IP, port: C, 5775 dest IP, port: B, 80 source IP, port: C, 9157 dest IP, port: B, 80 dress: B, d a P I to d e n ts, all desti t sockets n e r fe if d to three segmen d e e demultiplex r a 0 8 t: r o p t des 9 Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT

TCP demux: Threaded web server threaded server application P 4 P 3 P 2

TCP demux: Threaded web server threaded server application P 4 P 3 P 2 P 3 transport network link physical host: IP address A server: IP address B source IP, port: B, 80 dest IP, port: A, 9157 source IP, port: A, 9157 dest IP, port: B, 80 physical source IP, port: C, 5775 dest IP, port: B, 80 host: IP address C source IP, port: C, 9157 dest IP, port: B, 80 Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 10

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of reliable data transfer • Next lecture: connection-oriented transport: TCP – reliable transfer – flow control – connection management – TCP congestion control Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 11

UDP: User Datagram Protocol [RFC 768] “best effort” service, UDP segments may be: –

UDP: User Datagram Protocol [RFC 768] “best effort” service, UDP segments may be: – lost – delivered out-of-order • connectionless: – no handshaking between UDP sender, receiver – each UDP segment handled independently of others Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 12

UDP: segment header 32 bits source port # dest port # length checksum UDP

UDP: segment header 32 bits source port # dest port # length checksum UDP us ed by: • length, in bytes of UDP datagram, including header DNS • SNM P • More d later… iscussion why is there a UDP? application data (payload) UDP datagram format • Must do the addressing job • no connection establishment (which could add delay) • simple: no connection state at sender, receiver • small header size • no congestion control: UDP can blast away segments faster (than TCP) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 13

UDP Checksum[RFC 1071]: check bit flips Sender: Receiver: r treat segment contents as sequence

UDP Checksum[RFC 1071]: check bit flips Sender: Receiver: r treat segment contents as sequence of 16 -bit r compute checksum of received segment integers r checksum: addition (1’s complement sum) of segment contents r sender puts checksum value into UDP checksum field r check if computed checksum == checksum field value: m m NO - error detected (report error to app or discard) YES - no error detected. • But maybe (rarely) errors nonetheless? More later …. 1 1 0 0 1 1 1 0 1 0 1 Wraparound: 1 1 0 1 1 Add to final sum checksum 1 1 0 1 1 0 0 0 1 0 0 1 1 Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 14

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of reliable data transfer • Next lecture: connection-oriented transport: TCP – reliable transfer – flow control – connection management – TCP congestion control Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 15

Principles of reliable data transfer top-10 list of important networking topics! characteristics of unreliable

Principles of reliable data transfer top-10 list of important networking topics! characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 16

Reliable data transfer (RDT): getting started rdt_send(): called from above, (e. g. , by

Reliable data transfer (RDT): getting started rdt_send(): called from above, (e. g. , by app. ). Passed data to deliver to receiver upper layer deliver_data(): called by rdt to deliver data to upper send side udt_send(): called by rdt, to transfer packet over unreliable channel to receiver receive side rdt_rcv(): called when packet arrives on rcv-side of channel Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 17

RDT: S application: Author Writes and Sends pages S transport: secretary Alice Must send

RDT: S application: Author Writes and Sends pages S transport: secretary Alice Must send pages on behalf of author R application: publisher Receives & publishes written pages S transport: secretary Bob Receives pages; Must pass on to publisher in-order Bidirectional 1 -page-at-a-time-MMS connection A sends one page at a time; How do A & B do their job if MMS connection… • …is reliable? • …might introduce errors? • …might lose MMSs? Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 18

Reliable data transfer: getting started We will: • incrementally develop sender, receiver sides of

Reliable data transfer: getting started We will: • incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) • use finite state machines (FSM) to specify sender, receiver behaviour event causing state transition actions taken on state transition state: when in this “state” next state uniquely determined by next event state 1 event actions Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT state 2 19

rdt 1. 0: reliable transfer & reliable channel v underlying channel perfectly reliable §

rdt 1. 0: reliable transfer & reliable channel v underlying channel perfectly reliable § no bit errors, no loss of packets v separate FSMs for sender, receiver: Wait for call from above rdt_send(data) packet = make_pkt(data) udt_send(packet) sender Wait for call from below rdt_rcv(packet) extract (packet, data) deliver_data(data) receiver Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 20

rdt 2. 0: channel with bit errors • underlying channel may flip bits in

rdt 2. 0: channel with bit errors • underlying channel may flip bits in packet • checksum to detect bit errors • how to recover from errors: • acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK • negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors • sender retransmits pkt on receipt of NAK New mechanisms in rdt 2. 0 (beyond rdt 1. 0): • error detection • feedback: control msgs (ACK, NAK) from receiver to sender Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 21

rdt 2. 0: FSM specification rdt_send(data) sndpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && is.

rdt 2. 0: FSM specification rdt_send(data) sndpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && is. NAK(rcvpkt) Wait for call from ACK or udt_send(sndpkt) above NAK rdt_rcv(rcvpkt) && is. ACK(rcvpkt) L sender receiver rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt, data) deliver_data(data) udt_send(ACK) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 22

rdt 2. 0: operation with no errors rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt)

rdt 2. 0: operation with no errors rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && is. NAK(rcvpkt) Wait for call from ACK or udt_send(sndpkt) above NAK rdt_rcv(rcvpkt) && is. ACK(rcvpkt) L rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt, data) deliver_data(data) udt_send(ACK) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 23

rdt 2. 0: error scenario rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && is.

rdt 2. 0: error scenario rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && is. NAK(rcvpkt) Wait for call from ACK or udt_send(sndpkt) above NAK rdt_rcv(rcvpkt) && is. ACK(rcvpkt) L rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt, data) deliver_data(data) udt_send(ACK) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 24

Recall: RDT (Reliable Data Transfer, aka error control) S application: Author Writes and Sends

Recall: RDT (Reliable Data Transfer, aka error control) S application: Author Writes and Sends pages S transport: secretary Alice Must send pages on behalf of author R application: publisher Receives & publishes written pages S transport: secretary Bob Receives pages; Must pass on to publisher in-order Bidirectional 1 -page-at-a-time-MMS connection A sends one page at a time; How do A & B do their job if MMS connection… • …is reliable? • …might introduce errors? • …might lose MMSs? Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 25

rdt 3. 0: channels with errors and loss We saw: how ack+retransmit can solve

rdt 3. 0: channels with errors and loss We saw: how ack+retransmit can solve problems with errors New assumption: underlying channel can also lose packets (data, ACKs) approach: sender waits “reasonable” amount of time for ACK • retransmits if no ACK received in this time – requires countdown timer Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 26

Recall: RDT (Reliable Data Transfer, aka error control) S application: Author Writes and Sends

Recall: RDT (Reliable Data Transfer, aka error control) S application: Author Writes and Sends pages S transport: secretary Alice Must send pages on behalf of author R application: publisher Receives & publishes written pages S transport: secretary Bob Receives pages; Must pass on to publisher in-order Bidirectional 1 -page-at-a-time-MMS connection A sends one page at a time; How do A & B do their job if MMS connection… • …is reliable? • …might introduce errors? • …might lose MMSs? – (lost vs too late MMS? ) Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 27

rdt 3. 0 (cont) : channels with errors and loss We saw: how ack+retransmit

rdt 3. 0 (cont) : channels with errors and loss We saw: how ack+retransmit can solve problems with errors New assumption: underlying channel can also lose packets (data, ACKs) approach: sender waits “reasonable” handling d u p licates: amount of time for ACK • sen der adds s equence n • receive • retransmits if no ACK received in this time umber to r discards each pkt ( d oesn’t de duplicate – requires countdown timer liver upwa pkt rds) • F o r s t o • if pkt (or ACK) just delayed (not lost): p&wait 01 (ie 1 bit sequence ) enough nr. for – Must handle duplicates -> Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 3 -28

rdt 3. 0 in action receiver send pkt 0 rcv ack 0 send pkt

rdt 3. 0 in action receiver send pkt 0 rcv ack 0 send pkt 1 rcv ack 1 send pkt 0 ack 0 pkt 1 ack 1 pkt 0 ack 0 send pkt 0 rcv pkt 0 send ack 0 rcv ack 0 send pkt 1 rcv pkt 1 send ack 1 rcv pkt 0 send ack 0 pkt 0 ack 0 rcv pkt 0 send ack 0 pkt 1 X loss timeout resend pkt 1 rcv ack 1 send pkt 0 (a) no loss receiver sender pkt 1 ack 1 pkt 0 ack 0 rcv pkt 1 send ack 1 rcv pkt 0 send ack 0 (b) packet loss Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 29

rdt 3. 0 in action receiver send pkt 0 rcv ack 0 send pkt

rdt 3. 0 in action receiver send pkt 0 rcv ack 0 send pkt 1 ack 0 pkt 1 ack 1 X rcv pkt 0 send ack 0 timeout resend pkt 1 rcv ack 1 send pkt 0 pkt 1 ack 1 pkt 0 ack 0 (c) ACK loss send pkt 0 rcv ack 0 send pkt 1 rcv pkt 1 send ack 1 rcv pkt 1 (detect duplicate) send ack 1 rcv pkt 0 send ack 0 pkt 0 ack 0 pkt 1 ack 1 timeout loss receiver sender resend pkt 1 rcv ack 1 send pkt 0 pkt 1 rcv pkt 0 send ack 0 rcv pkt 1 send ack 1 rcv pkt 1 pkt 0 ack 1 ack 0 pkt 0 (detect duplicate) ack 0 (detect duplicate) send ack 1 rcv pkt 0 send ack 0 (d) premature timeout/ delayed ACK Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 30

Roadmap • • Transport layer services in Internet Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP

Roadmap • • Transport layer services in Internet Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of reliable data transfer – Efficiency perspective • Next lecture: connection-oriented transport: TCP – reliable transfer – flow control – connection management – TCP congestion control Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 31

Performance of rdt 3. 0 (stop&wait) • rdt 3. 0 is correct, but performance

Performance of rdt 3. 0 (stop&wait) • rdt 3. 0 is correct, but performance stinks • e. g. : 1 Gbps channel, 15 ms prop. delay, 8000 (1 KB) bit packet: L 8000 bits Dtrans = R = 9 10 bits/sec sender RTT = 8 microsecs receiver first packet bit arrives last packet bit arrives, send ACK arrives, send next packet, t = RTT + L / R Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 32

Performance of rdt 3. 0 (cont) Utilization (fraction of time sender busy sending, or

Performance of rdt 3. 0 (cont) Utilization (fraction of time sender busy sending, or fraction of utilized bandwidth ): § Ie approx. 300 kbps effective throughput over a 1 Gbps channel v network protocol limits use of physical resources! Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 33

Is RDT necessarily that slow/inefficient? Marina Papatriantafilou – Transport layer part 1: Addressing in

Is RDT necessarily that slow/inefficient? Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 34

Pipelined protocols pipelining: sender allows multiple, “in-flight”, yet-to-be-acknowledged pkts – range of sequence numbers

Pipelined protocols pipelining: sender allows multiple, “in-flight”, yet-to-be-acknowledged pkts – range of sequence numbers must be increased – buffering at sender and/or receiver Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 35

Pipelining: increased utilization sender receiver first packet bit transmitted, t = 0 last bit

Pipelining: increased utilization sender receiver first packet bit transmitted, t = 0 last bit transmitted, t = L / R RTT first packet bit arrives last packet bit arrives, send ACK last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK arrives, send next packet, t = RTT + L / R 3 -packet pipelining increases utilization by a factor of 3! Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 36

Pipelined protocols: ack-based error control if data is lost, two generic forms of pipelined

Pipelined protocols: ack-based error control if data is lost, two generic forms of pipelined protocols: go -Back-n, selective repeat Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 37

Go-Back-n: sender • “window” of up to N, consecutive unack’ed pkts allowed • •

Go-Back-n: sender • “window” of up to N, consecutive unack’ed pkts allowed • • • ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” • may receive duplicate ACKs timer for oldest in-flight pkt timeout(n): retransmit packet n and all higher seq # pkts in window Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 38

GBn in action sender window (N=4) 012345678 012345678 sender send pkt 0 send pkt

GBn in action sender window (N=4) 012345678 012345678 sender send pkt 0 send pkt 1 send pkt 2 send pkt 3 (wait) rcv ack 0, send pkt 4 rcv ack 1, send pkt 5 ignore duplicate ACK pkt 2 timeout 012345678 https: //media. pearsoncmg. com/aw/ecs_kurose_compnetwork_7/cw /content/interactiveanimations/go-back-n-protocol/index. html send pkt 2 pkt 3 pkt 4 pkt 5 receiver Xloss receive pkt 0, send ack 0 receive pkt 1, send ack 1 receive pkt 3, discard, (re)send ack 1 receive pkt 4, discard, (re)send ack 1 receive pkt 5, discard, (re)send ack 1 rcv rcv pkt 2, pkt 3, pkt 4, pkt 5, Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT deliver, send ack 2 ack 3 ack 4 ack 5 39

Selective repeat: sender, receiver windows • receiver individually acknowledges received pkts – buffers pkts

Selective repeat: sender, receiver windows • receiver individually acknowledges received pkts – buffers pkts for eventual inorder delivery to upper layer • sender only resends pkts for which ACK not received – Requires timer for each un. ACKed pkt Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 40

Selective repeat Sender: upon… …data from above: v if next_pkt_seq # in window, send

Selective repeat Sender: upon… …data from above: v if next_pkt_seq # in window, send pkt …timeout(n): Receiver: upon receiving… … pkt n in [rcvbase, rcvbase+N-1] v v resend pkt n, restart timer send ACK(n) If out-of-order: buffer If in-order: deliver (also deliver buffered, inorder pkts), advance window to next notyet-received pkt …ACK(n) in [sendbase, sendbase+N]: …pkt n in [rcvbase-N, rcvbase-1] v mark pkt n as received v if n smallest un. ACKed pkt, advance window base to next un. ACKed seq # v ACK(n) otherwise: v ignore Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 41

Selective repeat in action sender window (N=4) 012345678 012345678 https: //media. pearsoncmg. com/aw/ecs_kurose_compnetwork_7/cw/content /interactiveanimations/selective-repeat-protocol/index.

Selective repeat in action sender window (N=4) 012345678 012345678 https: //media. pearsoncmg. com/aw/ecs_kurose_compnetwork_7/cw/content /interactiveanimations/selective-repeat-protocol/index. html sender send pkt 0 send pkt 1 send pkt 2 send pkt 3 (wait) receiver Xloss rcv ack 0, send pkt 4 rcv ack 1, send pkt 5 record ack 3 arrived pkt 2 timeout receive pkt 0, send ack 0 receive pkt 1, send ack 1 receive pkt 3, buffer, send ack 3 receive pkt 4, buffer, send ack 4 receive pkt 5, buffer, send ack 5 send pkt 2 012345678 record ack 4 arrived record ack 5 arrived rcv pkt 2; deliver pkt 2, pkt 3, pkt 4, pkt 5; send ack 2 Q: what happens when ack 2 arrives? Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 42

Roadmap • • Transport layer services in Internet Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP

Roadmap • • Transport layer services in Internet Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of reliable data transfer – Efficiency perspective: pipelined protocols & error control through go-back-n, selective-repeat • Sequence numbers • Next: connection-oriented transport: TCP – reliable transfer – flow control – connection management – TCP congestion control Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 43

Selective repeat: Sequence numbers 0123012 example: • seq #’s: 0, 1, 2, 3 •

Selective repeat: Sequence numbers 0123012 example: • seq #’s: 0, 1, 2, 3 • window size=3 v duplicate data accepted as new in (b) Q: what relationship between seq # size and window size to avoid problem in (b)? receiver window (after receipt) sender window (after receipt) pkt 0 0123012 pkt 1 0123012 pkt 2 0123012 pkt 3 0123012 pkt 0 (a) no problem 0123012 X will accept packet with seq number 0 receiver can’t see sender side. receiver behavior identical in both cases! something’s (very) wrong! 0123012 pkt 0 0123012 pkt 1 0123012 pkt 2 0123012 X X timeout retransmit pkt 0 X 0123012 (b) oops! Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT pkt 0 will accept packet with seq number 0 44

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of

Roadmap • • Transport layer services Addressing, multiplexing/demultiplexing Connectionless, unreliable transport: UDP principles of reliable data transfer • Next: connection-oriented transport: TCP – reliable transfer – flow control – connection management – TCP congestion control Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 45

Reading instructions chapter 3 • • Kurose. Ross book Careful Quick 3. 1, 3.

Reading instructions chapter 3 • • Kurose. Ross book Careful Quick 3. 1, 3. 2, 3. 4 -3. 7 3. 3 Other resources (further, optional study) – Lakshman, T. V. , Upamanyu Madhow, and Bernhard Suter. "Window-based error recovery and flow control with a slow acknowledgement channel: a study of TCP/IP performance. " INFOCOM'97. Sixteenth Annual Joint Conference of the IEEE Computer and Communications Societies. Proceedings IEEE. Vol. 3. IEEE, 1997. – Rizzo, Luigi. "Effective erasure codes for reliable computer communication protocols. " ACM SIGCOMM Computer Communication Review 27. 2 (1997): 24 -36. – A. Agarwal and M. Charikar, “On the advantage of network coding for improving network throughput, ” in Proceedings of the IEEE Information Theory Workshop, Oct. 2004 Harvey, N. J. , Kleinberg, R. , & Lehman, A. R. (2006). On the capacity of information networks. IEEE/ACM Transactions on Networking (TON), 14(SI), 2345 -2364. – Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 46

Some review questions on this part • Why do we need an extra protocol,

Some review questions on this part • Why do we need an extra protocol, i. e. UDP, to deliver the datagram service of Internets IP to the applications? • Draw space-time diagrams without errors and with errors, for the following, for a pair of senderreceive S-R: (assume only 1 link between them) – Stop-and-wait: transmission delay < propagation delay and transmission delay > propagation delay – Sliding window aka pipelined protocol, with window’s transmission delay < propagation delay and window’s transmission delay > propagation delay; illustrate both go-back-n and selective repeat when there are errors – Show to compute the effective throughput between S-R in the above cases, when there are no errors • What are the goals of reliable data transfer? • Reliable data transfer: show why we need sequence numbers when the sender may retransmit due to timeouts. • Show there can be wraparound in a reliable data transfer session if the sequence-numbers range is not large enough. • Describe the go-back-N and selective repeat methods for reliable data transfer Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 47

Extra slides, for further study 3: Transport Marina Papatriantafilou – Transport layer part 1:

Extra slides, for further study 3: Transport Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDTLayer 3 a-48

Bounding sequence numbers for stop-and-wait… … s. t. no wraparound, i. e. we do

Bounding sequence numbers for stop-and-wait… … s. t. no wraparound, i. e. we do not run out of numbers: binary value suffices for stop-and-wait: Proof sketch: assume towards a contradiction that there is wraparound when we use binary seq. nums. – R expects segment #f, receives segment #(f+2): R rec. f+2 => S sent f+2 => S rec. ack for f+1 => R ack f+1=> R ack f => contradiction – R expects f+2, receives f: R exp. f+2 => R ack f+1 => S sent f+1 => S rec. ack for f => contradiction Marina Papatriantafilou – Transport layer part 1: Addressing in Internet Transport layer ; RDT 49