Top Banner
Introduction to Computer Networks Tian Song (嵩天), Ph.D., Assoc. Prof. [email protected]
24

Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

Mar 10, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

Introduction to Computer Networks

Tian Song (嵩天), Ph.D., Assoc. [email protected]

Page 2: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

Introduction to Computer Networks

Tian Song (嵩天), Ph.D., Assoc. [email protected]

Data Link Protocol

Page 3: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian3

Outline

• Elementary Data Link Protocol

• Sliding Window Protocols

Page 4: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian4

Elementary Data Link Protocol

1: An Unrestricted Simplex Protocol

2: A Simplex Stop‐and‐Wait Protocol

3: A Simplex Protocol for a Noisy Channel

Page 5: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian5

Elementary Data Link Protocol

Some basic assumptions:–We have a machine A that wants to send data to machine B

– There is always enough data for A to send– There is a well‐defined interface to the network layer, and to the physical layer

– The receiver generally waits for an event to happen by calling wait_for_event

boolean, seq_nr, packet, frame_kind, frame

Page 6: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian6

Elementary Data Link Protocol1: An Unrestricted Simplex Protocol

sender receiver

packet = from_network()

packet ‐> frame

to_physical(frame)

wait_for_event()

frame =  from_physical()

frame ‐> packet

to_network(packet)

Page 7: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian7

Elementary Data Link Protocol

Issue of Protocol 1:

How to prevent the sender from flooding?

Solutions:

Control the pace of sending and receiving

Stop‐and‐Wait

Page 8: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian8

Elementary Data Link Protocol2: A Simple Stop‐and‐Wait Protocol

sender receiver

packet = from_network()

packet ‐> frame

to_physical(frame)

wait_for_event()

wait_for_event()

frame =  from_physical()

frame ‐> packet

to_network(packet)

receiver sender

Page 9: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian9

Elementary Data Link Protocol

Issue of Protocol 2:

How about we lost some frames?

Solutions:

(1) Lost a data frame  ‐>  Timer

(2) Lost a feedback frame  ‐>  Sequence Number

Page 10: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian10

Elementary Data Link Protocol3: A Simplex Protocol for a Noisy Channel

Page 11: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian11

Elementary Data Link Protocol3: A Simplex Protocol for a Noisy Channel

Page 12: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian12

Improvement

Motivation:

from Simplex (单工) to Duplex (双工)

Observation:

Feedback frame is very small compared to data. 

Solution:

Piggybacking (捎带确认)

Page 13: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian13

Sliding Window Protocols

Motivation:

Send more packets at one time

Page 14: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian14

a: Initially.                                   b: After sending frame #1. 

c: After receiving frame #1.     d: After receiving ack for frame #1.

Page 15: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian15

How to Understand?

Page 196, Q 23

Page 16: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian16

Sliding Window Protocols4: One‐Bit Sliding Window Protocol

maximum window size: 1 

stop and wait

piggybacking

Page 17: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian17

(a) Normal case.                       (b) Abnormal case. 

(序号, 确认, 包号)

Page 18: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian18

Sliding Window ProtocolsProblem:

What should the receiver do if a frame is damaged?

Solution:(1) Request retransmission starting from frame #N

5: Sliding Window Protocol Using Go Back N

(2) Request just retransmission of damaged frame 

6: Sliding Window Protocol Using Selective Repeat

Page 19: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian19

Sliding Window Protocols

否定确认

pipeline: 流水线

Page 20: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian20

Sliding Window Protocol Using Selective Repeat

• If the receiver delivers all frames in its window just after sending an ACK for the entire window, we may have a serious problem:

Page 21: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian21

Sliding Window Protocol Using Selective Repeat

• Solution

we must avoid overlapping send and receive windows, the 

highest sequence number must be at least twice the 

window size.

If window size: 0 – MAX_SEQ

Then,     protocol 6:

window size: (MAX_SEQ+1)/2.

Page 22: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian22

Link Utilization

2. Stop‐and‐Wait

5. Sliding Window, Go back N

6. Sliding Window, selective repeat

Q 32, page 197

Page 23: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian23

Conclusion

• Elementary Data Link Protocol

• Sliding Window Protocols

• Six Protocols

Page 24: Introduction to Computer Networks...Sliding Window Protocol Using Selective Repeat • If the receiver delivers all frames in its window just ...

School of Computer Science and Technology, BIT, http://cs.bit.edu.cn/~songtian24

End

This page is intended blank.