20
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

Embed Size (px)

Citation preview

Page 1: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 14

Introduction to Computer Networks

Page 2: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

2CMPE 150- Introduction to Computer Networks

Announcements

• Midterm moved to 11.04.– In class, closed books/notes.

• We will have lab this week.• Homework 1 is due today.• Homework 2 will be up soon.

Page 3: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

3CMPE 150- Introduction to Computer Networks

Today

• Finish Layer 2…

Page 4: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

4CMPE 150- Introduction to Computer Networks

Flow + Error Control

• Stop and Wait.– ACKs.

• ARQ.– Noisy channels.

– ACKs.

– Sequence numbers.

– Timers.

Page 5: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

5CMPE 150- Introduction to Computer Networks

Can we do better?

• Can we do better?– Piggybacking.

– Bi-directional transmission.

– Wait for data packet and use that to piggyback the ACK.

– Use ACK field: only a few additional bits in the header.

• But, how long should Layer 2 wait to send an ACK?– ACK timers!

Page 6: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

6CMPE 150- Introduction to Computer Networks

Can we do even better?

• In Stop and Wait, only 1 frame outstanding at any given point in time.

• What’s the problem with that?– “Loooong pipes”.

– “Fat pipes”.

S R

S R

Page 7: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

7CMPE 150- Introduction to Computer Networks

Sliding Window

• Window: number of “outstanding” frames at any given point in time.– So what’s the window size of Stop and Wait?

• Every ACK received, window slides.

Page 8: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

8CMPE 150- Introduction to Computer Networks

Sliding Window: Example

• A sliding window of size 1, with a 3-bit sequence number.(a) Initially; (b) After the first frame has been sent; (c) After the first frame has been received;(d) After the first acknowledgement has been received.

Page 9: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

9CMPE 150- Introduction to Computer Networks

Sliding Window: Basics

• Allows multiple frames to be in transit at the same time.

• Receiver allocates buffer space for n frames.

• Transmitter is allowed to send n (window size) frames without receiving ACK.

• Sequence number?

Page 10: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

10CMPE 150- Introduction to Computer Networks

Sliding Window: Receiver• Receiver maintains window corresponding with

frames it can receive.

• Receiver ack’s frame by including sequence number of next expected frame.–Cumulative ACK: ack’s multiple frames.

• Example: if receiver receives frames 2,3, and 4, it sends an ACK with sequence number 5, which ack’s receipt of 2, 3, and 4.

Page 11: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

11CMPE 150- Introduction to Computer Networks

Sliding Window: Sender• Sender maintains window corresponding to

frames (sequence numbers) it’s allowed to send.

• Sequence numbers are bounded; if frame reserves k-bit field for sequence numbers, then they can range from 0 … 2k -1.

• Transmission window shrinks each time frame is sent, and grows each time an ACK is received.

Page 12: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

12CMPE 150- Introduction to Computer Networks

Example: 3-bit sequence number and window size 7

01

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

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

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

3456ACK 40 1 2 3 4 5 6 7 0 1 2 3 4

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

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

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

A (Sender) B (Receiver)

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

Page 13: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

13CMPE 150- Introduction to Computer Networks

One-Bit Sliding Window Protocol

Two scenarios: (a) Normal case. (b) Abnormal case. Notation is (seq, ack, packet number). An * indicates where a network layer accepts packet. ACK indicates last sequence number received.

Page 14: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

14CMPE 150- Introduction to Computer Networks

Bandwidth-Delay Product

• How large should the sender’s window be?• Function of how “fat and long” the pipe is

S R

RTT

BW

W = BW*RTT/data size

Page 15: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

15CMPE 150- Introduction to Computer Networks

Pipelining

• Pipelining and error recovery. Effect on error when (a) Receiver’s window size is 1. (b) Receiver’s window size is large.

Receiver’swindow sizeis 1: discard frames after errorwith no ACK.

Receiver’swindow sizeis large: buffersall frames until errorrecovered.

Selective Repeat

Go Back N

Page 16: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

16CMPE 150- Introduction to Computer Networks

Medium Access Control

• MAC.• Tanenbaum, Chapter 4.

Page 17: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

17CMPE 150- Introduction to Computer Networks

Why MAC?

• Point-to-point versus shared-medium networks.

• Shared-medium networks use “broadcast” channels.– A.k.a. multi-access or random access

channels.

MAC layer protocols regulate access to medium in shared-medium networks.

Page 18: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

18CMPE 150- Introduction to Computer Networks

Where is the MAC Sub-Layer?

MAC

Page 19: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

19CMPE 150- Introduction to Computer Networks

Where is the MAC Sub-Layer?

MAC

PHY

DLL Link Control

Network

Transport

Application

Page 20: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks

20CMPE 150- Introduction to Computer Networks

MAC and LANs

• LANs typically use shared-medium.• Examples?• MAC layer critical!– BTW, in wireless networks also!

• WANs typically use point-to-point connections.