• No results found

Principles of Reliable Data Transfer

N/A
N/A
Protected

Academic year: 2021

Share "Principles of Reliable Data Transfer"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

10/16/2003 CSC 257/457 - Fall 2003 1

Principles of Reliable Data

Transfer

Outline:

n

Overview of reliable data transfer

n

a correct protocol

n stop-and-wait

n

an efficient protocol

n sliding window

10/16/2003 CSC 257/457 - Fall 2003 2

Reliable Data Transfer

n

Our goal: end-to-end solution to achieve reliable

data transfer

n

What is reliable data transfer?

n guaranteed arrival n no error

n in order delivery

n

Why is it difficult?

n end-to-end solution has no control of underlying

communication channel, which can be error-prone and lossy

n

Where is it used in computer networks?

n reliable transport service on top of unreliable IP

n reliable data link service on top of unreliable physical layer

10/16/2003 CSC 257/457 - Fall 2003 3

Reliable Data Transfer: An

Illustration

n end-to-end protocol control over unreliable channel n consider only unidirectional data transfer for simplicity

n protocol control data may flow in either direction!

sender receiver reliable data transfer protocol (sending side) reliable data transfer protocol (receiving side)

unreliable channel (error-prone, lossy)

user data user data

user & protocol data user & protocol data

virtual reliable channel application layer transport layer network layer network layer data-link layer physical layer 10/16/2003 CSC 257/457 - Fall 2003 4

Principles of Reliable Data

Transfer

n

Characteristics of unreliable channel will determine

complexity of reliable data transfer protocol

n e.g., delay in the channel is bounded in physical layer, not so

for network layer

n

Other services may interact with RDT protocol

n e.g., flow control, congestion control

n

Here we study the principles of reliable data

transfer, so

n we don’t make assumptions about the unreliable channel n we don’t consider interaction with other services

n

Later we see what RDT is like in practice (in a

(2)

10/16/2003 CSC 257/457 - Fall 2003 5

Outline

n

Overview of reliable data transfer

n

a

correct protocol

correct

n

stop-and-wait

n

an

efficient protocol

efficient

n

sliding window

10/16/2003 CSC 257/457 - Fall 2003 6

Deal with Errors

n

First deal with errors, later deal with packet loss.

n

ACK-based solution: receiver check errors

n if correct, send back positive ACK n otherwise, send back negative NAK Sender Receiver packet1 packet2 ACK ACK packet3 correct correct Sender Receiver packet1 packet1 NAK ACK packet2 error! correct resend

What if ACK or NAK is corrupted?

Time

What if ACK or NAK is

corrupted?

n Solution 1: creating special acknowledgments for ACK and NAK.

What if they get corrupted too??

n Solution 2: treat a corrupted acknowledgements as NAK.

Duplicated packets!!

n To solve duplicated packets: sequence number for each packet. Sender Receiver packet #0 packet #0 ACK ACK packet #1 correct duplicate ⇒discard corrupted ⇒resend

Deal with Packet Loss: Timeouts

n Early timeout ⇒duplicated packet ⇒sequence number.

(not likely for data link protocol)

Sender Receiver packet #0 packet #0 ACK ACK timeout resend timeout Sender Receiver packet #0 packet #0 ACK ACK timeout resend timeout duplicate ⇒discard

(3)

10/16/2003 CSC 257/457 - Fall 2003 9

Deal with Duplicated ACKs

n Solution: each ACK carries sequence number. n With timeout, NAK is not necessary any more.

Sender Receiver packet #0 packet #0 ACK ACK timeout resend timeout duplicate ⇒discard packet #1 10/16/2003 CSC 257/457 - Fall 2003 10

Stop-and-Wait

Now we have a

correct protocol:

correct

Sender Receiver packet #0 packet #1 ACK #0 ACK #1 correct correct Time

n

Allow one outstanding (un-ACKed) packet.

n

You see why it is called

stop-

stop

-and

and-

-wait

wait?

10/16/2003 CSC 257/457 - Fall 2003 11

Efficiency of Stop-and-Wait

first packet bit transmitted, t = 0

sender receiver

RTT last packet bit transmitted, t = L / R

first packet bit arrives last packet bit arrives, send ACK

ACK arrives, send next packet, t = RTT + L / R

Channel utilization efficiency = RTT + L / RL / R

10/16/2003 CSC 257/457 - Fall 2003 12

Efficiency of Stop-and-Wait (An

Example)

n It works, but performance stinks!

n Example: 1 Gbps link, 30ms roundtrip prop. delay, 1KB (8kbits)

packet.

Ttransmit = 1 gb/sec8 kb = 8 microsec

n 266Kps throughput over 1 Gbps link ⇒0.027% efficiency! n network protocol limits use of physical resources!

L (packet length) R (transmission rate) = Throughput = L = 266Kbps Ttransmit + RTT = 8kb 0.03008sec

(4)

10/16/2003 CSC 257/457 - Fall 2003 13

Pipelined Protocols

Pipelining: sender allows multiple, “in-flight”,

yet-to-be-acknowledged packets

10/16/2003 CSC 257/457 - Fall 2003 14

Pipelining: Increased Efficiency

first packet bit transmitted, t = 0

sender receiver

RTT last bit transmitted, t = L / R

first packet bit arrives last packet bit arrives, send ACK

ACK arrives, send next packet, t = RTT + L / R

last bit of 2ndpacket arrives, send ACK last bit of 3rdpacket arrives, send ACK

Increase utilization by a factor of 3! Channel util efficiency = 3*L / R .000024.030024 = 0.08%

RTT + 3*L / R=

A pipelined protocol:

Sliding Window

n

Allow multiple outstanding (un-ACKed) packets

n

Upper bound on un-ACKed packets, called window

Sender Receiver

Time

Two variations: go-back-N, and selective repeat.

Go-Back-N: Sender

n “window” of up to N consecutive un-ACKed packets allowed; limit

send buffer space

n cumulative ACK – ACK with seq #n stands for ACKs all packets up

to, including seq #n

n recv ACKs in send window ⇒slidingsliding send window n timer for each in-flight packet

(5)

10/16/2003 CSC 257/457 - Fall 2003 17

Go-Back-N: Receiver

n

Send ACK for correctly-received packet with highest

in

in

-

-

order

order seq #

n

n SlidingSliding receive window n

n

Out

Out

-

-

of

of

-

-

order packet:

order

n Discard (don’t buffer) -> no receiver buffering! n Optional: Re-ACK packet with highest in-order seq #

n alert sender something is wrong through duplicated ACKs n not critical for protocol correctness; but may improve

performance

10/16/2003 CSC 257/457 - Fall 2003 18

GBN in Action

10/16/2003 CSC 257/457 - Fall 2003 19

Selective Repeat

n

receiver individually acknowledges all correctly

received packets. How to deal with out-of-order

packets?

n buffer out-of-order packets for eventual in-order

delivery to upper layer

n

sender timer for each un-ACKed packet

n sender only resends packets whose timers expire

before ACKs are received

10/16/2003 CSC 257/457 - Fall 2003 20

Selective Repeat: Sender,

(6)

10/16/2003 CSC 257/457 - Fall 2003 21

Selective Repeat

data from above:

n if next available seq # in

window, send pkt

timeout(n):

n resend pkt n, restart timer

ACK(n)

in

[sendbase, sendbase+N-1]:

n mark pkt n as received n if n smallest unACKed pkt,

advance window base to next unACKed seq # (slidingsliding!)

sender

pkt n

in [rcvbase, rcvbase+N-1] n send ACK(n)

n out-of-order: buffer n in-order: deliver (also

deliver buffered, in-order pkts), advance window to next not-yet-received pkt (slidingsliding!)

pkt n

in [rcvbase-N, rcvbase-1] n ACK(n)

otherwise:

n ignore

receiver

10/16/2003 CSC 257/457 - Fall 2003 22

Selective Repeat in Action

Sequence Number Space

n

SeqNum field is finite; sequence numbers wrap

around

n 0, 1, …, S-1, 0, 1, …, S-1, 0, 1, …

n

Sequence number space must be at least as big as

the window size

S = N

n

Is this enough?

Disclaimer

n

Parts of the lecture slides contain original work of

James Kurose, Larry Peterson, and Keith Ross. The

slides are intended for the sole purpose of

instruction of computer networks at the

University of Rochester. All copyrighted materials

belong to their original owner(s).

References

Related documents

happened, and as such was an act of self-definition. Du Fu’s poetics of historical memory refers to these transformations enacted in and through poems on the identities of place

Findings did not indicate a significant difference in the proportion of the variance in terrorist incidents that was predictable from political stability in the DRC and

o Students may be awarded up to $800 per semester (fall and spring), not to exceed the cost of the number of credit hours for which the student is actually enrolled. Recruiting

Well, we look forward to a very busy fall in the company, both in advancing Cerro Prieto to the start of construction and in the commencement of exploration at Xochipala, so, I

• Unique Identity Theft Challenges and Solutions for Internet Sales • The Interplay between Red Flags and Safeguards For Data Security.. To hear the audio portion of this Webinar,

A calculation note given the process conditions (pressure, temperature, flow rate, molecular weight, etc.) in recycle mode and start-up taking into account the specified

• After a few moments, the student can try to bring the hands to the floor beside the legs; • Try not to lean away from the knees … keep the heart open, arching the back forward;

Overall, the ROAD traffic light approach promotes transparency and provides the flexibility to adjust the monitoring plan based on data and modelling results becoming available as