• 검색 결과가 없습니다.

Transport Layer

N/A
N/A
Protected

Academic year: 2022

Share "Transport Layer"

Copied!
23
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

Transport Layer

- Pipelining and ARQ -

Kyunghan Lee

Networked Computing Lab (NXC Lab)

Department of Electrical and Computer Engineering Seoul National University

https://nxc.snu.ac.kr kyunghanlee@snu.ac.kr

(2)

Pipelined protocols

v Pipelining: sender allows multiple, “in-flight”, yet- to-be-acknowledged pkts

§ range of sequence numbers must be increased

§ buffering at sender and/or receiver

v Two generic forms of pipelined protocols:

go-Back-N, selective repeat

(3)

Pipelining: Increased Utilization

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 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK

3-packet pipelining increases utilization by a factor of 3!

U sender = .0024

30.008 =

0.00081

3L / R

RTT + L / R =

(4)

Pipelined protocols: overview

Go-back-N:

□ sender can have up to N unacked packets in pipeline

□ receiver only sends cumulative ack

§ doesn’t ack packet if there’s a gap

□ sender has timer for oldest unacked packet

§ when timer expires, retransmit all unacked packets

Selective Repeat:

□ sender can have up to N unack’ed packets in pipeline

□ rcvr sends individual ack for each packet

□ sender maintains timer for each unacked packet

§ when timer expires, retransmit only that unacked packet

(5)

Go-Back-N: Sender

□ k-bit seq # in pkt header

□ “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 (see receiver)

§ timer for oldest in-flight pkt

§ timeout(n): retransmit packet n and all higher seq # pkts in window

(6)

GBN: Sender, extended FSM

Wait start_timer

udt_send(sndpkt[base]) udt_send(sndpkt[base+1])

udt_send(sndpkt[nextseqnum-1]) timeout

rdt_send(data)

if (nextseqnum < base+N) {

sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum])

if (base == nextseqnum) start_timer

nextseqnum++

else}

refuse_data(data)

base = getacknum(rcvpkt)+1 if (base == nextseqnum)

stop_timer elsestart_timer rdt_rcv(rcvpkt) &&

notcorrupt(rcvpkt) base=1

nextseqnum=1

rdt_rcv(rcvpkt)

&& corrupt(rcvpkt) L

L

(7)

GBN: Receiver, extended FSM

□ ACK-only: always send ACK for correctly-received pkt with highest in-order seq #

§ may generate duplicate ACKs

§ need only remember expectedseqnum

□ out-of-order pkt:

§ discard (don’t buffer): no receiver buffering!

§ re-ACK pkt with highest in-order seq #

Wait

udt_send(sndpkt) default

rdt_rcv(rcvpkt)

&& notcurrupt(rcvpkt)

&& hasseqnum(rcvpkt,expectedseqnum) extract(rcvpkt,data)

deliver_data(data)

sndpkt = make_pkt(expectedseqnum,ACK,chksum) udt_send(sndpkt)

expectedseqnum++

expectedseqnum=1 sndpkt =

make_pkt(expectedseqnum,ACK,chksum) L

(8)

GBN in action

send pkt0 send pkt1 send pkt2 send pkt3 (wait)

sender receiver

receive pkt0, send ack0 receive pkt1, send ack1 receive pkt3, discard,

(re)send ack1 rcv ack0, send pkt4

rcv ack1, send pkt5

pkt 2 timeout send pkt2 send pkt3 send pkt4 send pkt5

Xloss

receive pkt4, discard, (re)send ack1 receive pkt5, discard,

(re)send ack1

rcv pkt2, deliver, send ack2 rcv pkt3, deliver, send ack3 rcv pkt4, deliver, send ack4 rcv pkt5, deliver, send ack5

ignore duplicate ACK 0 1 2 3 4 5 6 7 8

sender window (N=4)

0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8

0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8

0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 12 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8

(9)

Selective Repeat

receiver individually acknowledges all correctly received pkts

§ buffers pkts, as needed, for eventual in-order delivery to upper layer

□ sender only resends pkts for which ACK not received

§ sender timer for each unACKed pkt

□ sender window

§ N consecutive seq #’s

§ limits seq #s of sent, unACKed pkts

(10)

Selective Repeat: sender, receiver windows

(11)

Selective Repeat

data from above:

§ if next available seq # in window, send pkt

timeout(n):

§ resend pkt n, restart timer

ACK(n)

in [sendbase,sendbase+N]:

§ mark pkt n as received

§ if n is smallest unACKed pkt, advance window base to

next unACKed seq #

sender

pkt n in

[rcvbase, rcvbase+N-1]

§ send ACK(n)

§ out-of-order: buffer

§ in-order: deliver (also deliver buffered, in-order pkts), advance window to next not- yet-received pkt

pkt n in

[rcvbase-N,rcvbase-1]

§ ACK(n)

otherwise:

§ ignore

receiver

(12)

Selective Repeat in action

send pkt0 send pkt1 send pkt2 send pkt3 (wait)

sender receiver

receive pkt0, send ack0 receive pkt1, send ack1 receive pkt3, buffer,

send ack3 rcv ack0, send pkt4

rcv ack1, send pkt5

pkt 2 timeout send pkt2

Xloss

receive pkt4, buffer, send ack4 receive pkt5, buffer,

send ack5

rcv pkt2; deliver pkt2,

pkt3, pkt4, pkt5; send ack2

record ack3 arrived 0 1 2 3 4 5 6 7 8

sender window (N=4)

0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8

0 1 2 3 4 5 6 7 8 0 1 2 3 4 56 7 8

0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 12 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8

record ack4 arrived record ack5 arrived

Q: what happens when ack2 arrives?

(13)

Selective Repeat:

Dilemma

example:

□ seq #’s: 0, 1, 2, 3

□ window size=3

§ receiver sees no difference in two scenarios!

§ duplicate data accepted as new in (b)

Q: what relationship

between seq # size and window size to avoid problem in (b)?

(after receipt) (after receipt)

0 1 23 0 1 2 0 1 23 0 1 2 0 1 23 0 1 2

pkt0 pkt1 pkt2

0 1 23 0 1 2 pkt0 timeout

retransmit pkt0

01 2 30 1 2 0 12 3 01 2 0 1 2 3 0 12

X XX

will accept packet with seq number 0

(b) oops!

0 1 23 0 1 2 0 1 23 0 1 2 0 1 23 0 1 2

pkt0 pkt1 pkt2

0 12 3 01 2

pkt0

01 2 30 1 2 0 12 3 01 2 0 1 2 3 0 12

X

will accept packet with seq number 0 0 1 2 3 0 1 2 pkt3

(a) no problem

receiver cant see sender side.

receiver behavior identical in both cases!

somethings (very) wrong!

(14)

Automatic Repeat Request (ARQ) Schemes

Stop-and-Wait Go-Back-N

(with N=7) Selective Repeat

(with N=4)

(15)

Throughput Analysis of Stop-and-Wait

□ Definitions:

§ 𝑡! := transmission time of one frame

§ 𝑡" := propagation delay (one way)

§ 𝑡"#$% := processing time (at the receiver)

§ 𝑡& := transmission time of an ACK or NACK

§ Time out (must be larger than the delay to receive an Ack)

• 𝑡!"# ≥ 2𝑡$ + 𝑡$%!& + 𝑡'

§ Why 𝑡! not included here?

(16)

Throughput Analysis of Stop-and-Wait

□ Goal: Determine the maximum throughput 𝜆

!"#

when station A transmits to station B

§ Assume that transmitter A always has something to send

§ We need this assumption (saturated sender) to get 𝜆!"#

□ At station A:

where 𝑡$ is round-trip time (in many cases, 𝑡% ≪ 𝑡$)

New Frame New or retxed

Frame

time

t

out

tI

T out I

t = t + t

(17)

Throughput Analysis of Stop-and-Wait

□ If “no errors” were to take place, then

□ Further we define,

§ 𝑝 := probability that a frame has an error

§ 𝑡' := time between two successively received frames

§ 𝑁 := number of retransmissions

□ Expected time to transmit a frame successfully

(unit: frames/second)

(18)

Throughput Analysis of Stop-and-Wait

□ Note that and

□ Hence,

□ Finally,

(19)

Go-Back-N protocol: Max Throughput

□ Same assumption as “Stop-and-Wait” (i.e., no loss)

□ We are interested in the saturated case, because we want to know the maximum throughput 𝜆

&'(

□ If we have no error (and large enough N), we can transmit a frame at every 𝑡

)

With packet error (probability p),

New Frame𝑡 New Frame time

(

(20)

Go-Back-N protocol: Max Throughput

□ Therefore,

(21)

Selective Repeat Protocol: Max Throughput

□ Some assumptions as in Stop-and-Wait and Go-Back-N:

§ Infinite reordering buffer at receiver

§ 𝑝 = P{receiving a frame in error}

§ P{successful transmission in first attempt} = 1 − 𝑝

§ P{successful transmission in 𝑛-th attempt} = 𝑝()*(1 − 𝑝)

□ Define 𝑘 as the number of transmissions required for a

successful transmission

(22)

Selective Repeat Protocol: Max Throughput

□ Recall that 𝑡

)

is the transmission time of one frame

§ In other words, we can transmit at most 1/𝑡! frames per unit time

□ Max throughput can be written as

(23)

Compare the ARQ Schemes

□ Let

§ If a is small (i.e., 𝛼~1), all schemes are basically the same

è This means that transmission time dominates propagation delay

§ If 𝛼 is large but 𝑝 is very small such that 𝛼𝑝 ≪ 1

• Stop-and-Wait is bad

• Go-Back-N and Selective Repeat have comparable performance

§ If 𝛼𝑝~1 or 𝛼𝑝 > 1, then Selective Repeat is much better than Go- Back-N

□ Selective Repeat performs well, but it is most complicated.

Stop-and-Wait Go-Back-N Selective Repeat 𝜆)*+ + 𝑡(

참조

관련 문서

The Record Protocol requires an algorithm to generate keys required by the current connection state (see Appendix A.6) from the security parameters provided by

ㅇ 국내외 전문가와 실시간으로 소통하고 지원 받을 수 있는 화상 수업 시스템 구축 및 원격수업 콘텐츠 개발. ㅇ 해외 우수학교 및 타 지역 학교간의 협력적 탐구활동

여자고등학교 제벡 효과와 펠티에 효과에 대한 연구 및 비상용 랜턴 개발 51 대전 대전과학고등학교 사무공간용 이동성 최적화 저소음 바퀴의자 제작

[r]

present everything to the students, but they should instead let students find a problem and solve it through various methods on their own to suit the STEAM class structure..

모든 사항 숙지 후, 동의하고 수강신청 진행... 연수지명번호 입력

전문기관에서 개발한 초등학교, 중학교, 고등학교 별 STEAM 프로그램 교사용 지도서 및 학생 활동지를

Introduction to Data Communication Networks, M2608.001200, 2021 FALL SEOUL NATIONAL