29
Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport) You saw the need in the most recent assignment. Data packets can be damaged, but it’s not only data that can be changed. If the sequence number is changed how do you know what packet was damaged? What if the acknowledgment is damaged?

Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

  • Upload
    abra

  • View
    33

  • Download
    3

Embed Size (px)

DESCRIPTION

Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport). You saw the need in the most recent assignment. Data packets can be damaged, but it’s not only data that can be changed. If the sequence number is changed how do you know what packet was damaged? - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

You saw the need in the most recent assignment. Data packets can be damaged, but it’s not only data

that can be changed. If the sequence number is changed how do you know

what packet was damaged? What if the acknowledgment is damaged?

Page 2: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

What if a data packet is lost? What if an acknowledgment is lost? How many data packets can we acknowledge with

one acknowledgment packet? Book does some calculation of bit rates; you can

skip that stuff. We’ll focus on the protocols. Main thing is that the download speed is a function

of not only the raw bit rate, but the flow control protocol used.

Page 3: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Recall the layering of protocols Frame – layer 2 unit of transmission Packet – layer 3 unit of transmission Text uses layer 2 context for flow control, but it

does occur at layer 4 (TCP) as well

Page 4: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

2.4

Figure 2.4 An exchange using the OSI model

Page 5: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Byte oriented Frame interpreted as a sequence of bytes Each byte means something Old protocol typical of transferring text files Flags (e.g. 01111110) delimit start and end of

frame

Page 6: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

What if flag was part of the data (non-text files)?

Page 7: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Bit oriented More typical of streaming, binary files, graphics,

etc Frame interpreted as a bit stream Start and end of frame marked with a

flag=01111110

Page 8: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Again, what if flag is part of the data? Stuff a bogus 0 after 5 consecutive 1s.

Page 9: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Flow control

Flow control refers to a set of procedures used to restrict the amount of datathat the sender can send before

waiting for acknowledgment.

Page 10: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.10

Figure 11.5 Taxonomy of protocols discussed in this chapter

Page 11: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Acronyms ARQ – Automatic Repeat reQuest ACK – acknowledgment NAK – negative acknowledgment (indicates a

problem with a frame – damaged or never arrived)

Page 12: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.12

Figure 11.6 The design of the simplest protocol with no flow or error control

Has similarities to a streaming protocol

Page 13: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.13

Algorithm 11.1 Sender-site algorithm for the simplest protocol

Page 14: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.14

Algorithm 11.2 Receiver-site algorithm for the simplest protocol

Page 15: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.15

Figure 11.7 Flow diagram for Example 11.1

Page 16: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

No mechanism for error control or acknowledgments

Page 17: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.17

Figure 11.8 Design of Stop-and-Wait Protocol

Page 18: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.18

Algorithm 11.3 Sender-site algorithm for Stop-and-Wait Protocol

Page 19: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.19

Algorithm 11.4 Receiver-site algorithm for Stop-and-Wait Protocol

Page 20: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.20

Figure 11.9 Flow diagram for Example 11.2

Page 21: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Assumes no errors in frames Assumes frames are not lost Assumes Acks are not lost

Page 22: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

Each frame has a sequence number Sequence nos range from 0 to 2m-1, where m is the

number of bits used to represent the sequence number

If m=3, sequence nos are as follows0,….7, 0,….7, 0,….7, etc

Page 23: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

ARQ: adds simple error control Distinguish Ack frames from NAK frames Implement a timer if neither of the above does not

arrive in timely fashion

Page 24: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.24

Figure 11.10 Design of the Stop-and-Wait ARQ Protocol

Page 25: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.25

Algorithm 11.5 Sender-site algorithm for Stop-and-Wait ARQ

(continued)

Page 26: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.26

Algorithm 11.5 Sender-site algorithm for Stop-and-Wait ARQ(continued)

Option: If a NAK frame arrives, proceed as in the timeout

Page 27: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.27

Algorithm 11.6 Receiver-site algorithm for Stop-and-Wait ARQ Protocol

Option: Do an error check and send either an Ack or NAK frame

Page 28: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

11.28

Figure 11.11 Flow diagram for Example 11.3

Page 29: Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)

What if an ack is not lost but just delayed past when the timer expires?