39
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 17 Introduction to Computer Networks

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

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

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

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 17

Introduction to Computer Networks

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

2CMPE 150- Introduction to Computer Networks

Announcements

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

• Homework 3 is up.– Due on 11.07.05.

• Lab this week: discussion/review sessions for midterm.

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

3CMPE 150- Introduction to Computer Networks

Today

• MAC (cont’d).

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

4CMPE 150- Introduction to Computer Networks

Types of MAC

• Control:– Distributed.

– Centralized.

• How they coordinate medium access:– Round-robin.

– Scheduled-access.

– Contention-based.

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

5CMPE 150- Introduction to Computer Networks

Round-Robin MAC

• Centralized: polling.• Distributed: token passing.

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

6CMPE 150- Introduction to Computer Networks

Scheduled Access MAC

• Time divided into slots.

• Station reserves slots in the future.

• Multiple slots for extended transmissions.

• Suited to stream traffic.

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

7CMPE 150- Introduction to Computer Networks

Scheduled-Access MAC: Example

• The basic bit-map protocol.

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

8CMPE 150- Introduction to Computer Networks

Contention-Based MAC

• No control.• Stations try to acquire the medium.• Distributed in nature.

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

9CMPE 150- Introduction to Computer Networks

MAC Protocols

• Contention-based– ALOHA and Slotted ALOHA.

– CSMA.

– CSMA/CD.

• Round-robin : token-based protocols.– Token bus.

– Token ring.

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

10CMPE 150- Introduction to Computer Networks

Contention-Based MACs

• ALOHA family.• CSMA family.

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

11CMPE 150- Introduction to Computer Networks

ALOHA Protocols: Performance

• Throughput versus offered traffic for ALOHA systems.

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

12CMPE 150- Introduction to Computer Networks

ALOHA Protocols: Summary

• Simple.• But, poor utilization…

– When?

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

13CMPE 150- Introduction to Computer Networks

CSMA Protocols

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

14CMPE 150- Introduction to Computer Networks

Carrier Sense Multiple Access

• The capacity of ALOHA or slotted ALOHA is limited by the large vulnerability period of a packet.

• By listening before transmitting, stations try to reduce the vulnerability period to one propagation delay.

• This is the basis of CSMA (Kleinrock and Tobagi, UCLA, 1975).

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

15CMPE 150- Introduction to Computer Networks

CSMA

• Station that wants to transmit first listens to check if another transmission is in progress (carrier sense).

• If medium is in use, station waits; else, it transmits.

• Collisions can still occur.• Transmitter waits for ACK; if no ACKs,

retransmits.

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

16CMPE 150- Introduction to Computer Networks

Collisions

• Can collisions still occur?

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

17CMPE 150- Introduction to Computer Networks

CSMA Flavors

• 1-persistent CSMA (IEEE 802.3)– If medium idle, transmit; if medium busy, wait until idle;

then transmit with p=1.– If collision, waits random period and starts again.

• Non-persistent CSMA: if medium idle, transmit; otherwise wait a random time before re-trying.– Thus, station does not continuously sense channel when it is

in use.

• P-persistent: when channel idle detected, transmits packet in the first slot with p.

– Slotted channel, i.e., with probability q = p-1, defers to next slot.

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

18CMPE 150- Introduction to Computer Networks

CSMA vesrsus Aloha

• Comparison of the channel utilization versus load for various random access protocols.

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

19CMPE 150- Introduction to Computer Networks

CSMA/CD

• CSMA with collision detection.• Problem: when frames collide, medium is

unusable for duration of both (damaged) frames.

• For long frames (when compared to propagation time), considerable waste.

• What if station listens while transmitting?

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

20CMPE 150- Introduction to Computer Networks

CSMA/CD Protocol

1. If medium idle, transmit; otherwise 2.

2. If medium busy, wait until idle, then transmit with p=1.

3. If collision detected, transmit brief jamming signal and abort transmission.

4. After aborting, wait random time, try again.

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

21CMPE 150- Introduction to Computer Networks

CSMA/CD Performance

• Wasted capacity restricted to time to detect collision.

• Time to detect collision < 2*maximum propagation delay.

• Rule in CSMA/CD protocols: frames long enough to allow collision detection prior to end of transmission.

• Thus frames need to be at least “2*RTT” long.

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

22CMPE 150- Introduction to Computer Networks

CSMA with Collision Detection

• CSMA/CD can be in one of three states: contention, transmission, or idle.

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

23CMPE 150- Introduction to Computer Networks

Ethernet

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

24CMPE 150- Introduction to Computer Networks

Ethernet

• IEEE 802. family.• Standards for LANs and MANs.

• Ethernet defined in the IEEE 802.3 standard.• PHY, MAC, and LLC.

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

25CMPE 150- Introduction to Computer Networks

Where in the Stack?

• (a) Position of LLC. (b) Protocol formats.

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

26CMPE 150- Introduction to Computer Networks

Ethernet MAC

• CSMA/CD.• Binary exponential back-off.

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

27CMPE 150- Introduction to Computer Networks

Ethernet MAC (Cont’d)

Collision detection can take as long as 2 .

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

28CMPE 150- Introduction to Computer Networks

Ethernet Frame Length

• At 10Mbps with 2,500 m maximum distance:– RTT ~ 50 microsec.

– Thus, at least 500-bit frames.

– It is actually 512 bits.

– If fewer bits than that, add “padding”.

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

29CMPE 150- Introduction to Computer Networks

Ethernet Frame

• Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.

Destination address: “1” for “group” addresses.Type: mux/demux of network layer protocols.Data:max. of 1500 bytes.

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

30CMPE 150- Introduction to Computer Networks

Binary Exponential Backoff

• Randomization after collision.

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

31CMPE 150- Introduction to Computer Networks

BEB (Cont’d)

• After first collision, each station waits for 0 or 1 slot before trying again.

• After second collision, they pick either 0, 1, 2, or 3 slots at random to wait.

• After 3rd. collision, number of slots to wait is between 0 and 23 -1.

• In general, after I collisions, wait is between 0 and 2i – 1.

• After 10 collisions, randomization interval frozen at 1023 slots.

• After 16 collisions, error!

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

32CMPE 150- Introduction to Computer Networks

Ethernet Performance

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

33CMPE 150- Introduction to Computer Networks

Ethernet Cabling

• The most common kinds of Ethernet cabling.

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

34CMPE 150- Introduction to Computer Networks

Ethernet Cabling (Cont’d)

• Three kinds of Ethernet cabling. • (a) 10Base5, (b) 10Base2, (c) 10Base-T.

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

35CMPE 150- Introduction to Computer Networks

Ethernet Topologies

• Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented.

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

36CMPE 150- Introduction to Computer Networks

Switched Ethernet

• A simple example of switched Ethernet.

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

37CMPE 150- Introduction to Computer Networks

Fast Ethernet

• The original fast Ethernet cabling.

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

38CMPE 150- Introduction to Computer Networks

Gigabit Ethernet

• (a) A two-station Ethernet. (b) A multistation Ethernet.

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

39CMPE 150- Introduction to Computer Networks

Gigabit Ethernet (Cont’d)

• Gigabit Ethernet cabling.