1 data link layer two sublayer: –medium access sublayer (mac) –logical link control (llc)

90
1 Data Link Layer Two sublayer: Medium access sublayer (MAC) Logical link control (LLC)

Post on 20-Jan-2016

239 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

1

Data Link Layer

Two sublayer:

– Medium access sublayer (MAC)

– Logical link control (LLC)

Page 2: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

2

Data Link Layer• LANs -- Referred to as:

– Multiaccess channels

– Random access channels

• LANs Characterized by: – Data rate of at least several Mbps

– Low error rates

– A diameter of not more than a few kilometers

– Complete ownership by a single organization

Page 3: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

3

NetworksTwo types • Point-to-Point

e.g., WANs• Broadcast

e.g., Packet radio,

Satellite

LANs

Note: In between LANs and WANs are MANs.

Page 4: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

4

Channel Allocation in LANs and MANs

• Static

e.g., FDM• Dynamic

e.g., Slotted time,

Carrier sense

Note: MANs use LANs Technology.

Page 5: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

5

The 3 popular types of LCNs

Page 6: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

6

Basic packet radio architecture

(a) Centralized (b) Distributed

Centralcontroller

CentralResources

Page 7: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

7

ALOHAA medium access control technique for multiple access

transmission media.– Pure ALOHA -- a station transmits whenever it has data

to send. Unacknowledged transmissions are repeated.

Notation for analysis:– S: Throughput of the network – G: Total rate of data presented– I: Total Rate of data generated by the stations (input load)– D: Average delay between the time a packet is ready for

transmission and the completion of successful transmission.

Page 8: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

8

ALOHA (cont.)Assumptions:

1. All packets are of constant length2. The channel is noise-free3. Packets do not queue at individual stations

(i.e., I=S)4. G is Poisson distributed

Page 9: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

9

ALOHANET BroadcastChannel Multiplexing

GenerateACK

ACK queue 1

Data packet queue

2

Data packetto user nodes

Data packetfrom

user node

f1 channel

f2 channel

Page 10: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

10

ALOHA Protocols

t0 t0 + t t0 + 2t t0 + 3t

Collides withthe start ofthe shaded

frame

Collides withthe end ofthe shaded

frame

Vulnerable Time

Vulnerable period for the shaded frame

t

Page 11: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

11

Pure ALOHA (cont.)G = S + (# of retransmitted packets per unit time)

Now, express rate of retransmission as: G Pr(individual packet suffers a collision)

For a Poisson process with rate , The Pr of

transmission in a period of time t is 1 - e-t. Thus the Pr of transmission during the vulnerable period

is 1 - e-2G. ThereforeG = S + G(1 - e-2G)

So ALOHA: S = G e-2G

Page 12: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

12

Pure ALOHA (cont.)Note: If we differentiate S = Ge-2G with respect to G

and set it equal to 0, we find the max occurs at G = 0.5 and that S = 1 / 2e = 0.18. So, the maximum thru put is only 18% of capacity.

ALOHANET uses a data rate of 9600bps max total throughput (sum of data arriving from all user nodes) is only 0.18 9600 = 1728bps.

Page 13: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

13

Slotted ALOHAChannel is organized into uniform slots whose size

equals the packet transmission time. Transmission is permitted only to begin at a slot boundary.

Note: Since the vulnerable period is now reduced in half, the Pr of transmission during this period is 1 - e-G; thus we have

S-ALOHA: S = Ge-G

Now, differentiating with respect to G, we have the max possible value for S is 1 / e = 0.37 or 37%.

Page 14: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

14

Slotted ALOHA (cont.)

Throughput versus offered traffic for ALOHA system

Page 15: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

15

Delay (approx)Time interval from when a user is ready to transmit a

packet until when it is successfully received by the central node. Simply the sum of queuing delay, propagation delay, and transmission time.

Note: ALOHA has queueing delay = 0.

So, we need to view queueing time in the context of above definition for delay.

Page 16: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

16

Delay (approx) (cont.)Expected # of transmissions per packet G / S Expected # of retransmissions per packet G / S -1

G / S - 1 = e2G - 1

so D = (e2G - 1) + a + 1,

where is the average delay for one retransmission

ALOHA:

D = (e2G - 1)(1 + 2a + w + (K+1)/2) + a + 1

Note: Assume no collision for w

Page 17: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

17

IEEE 802 Standards For LANs Include: CSMA/CD

Token bus Token ring

Standards parts:

802.1 -- Introduction to set of standards and define the interface primitives

802.2 -- Describes upper part of data link layer which uses LLC protocol

802.3 - 802.5 -- Describe the three LAN standards

Page 18: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

18

IEEE Standards For LANs

(a) Position of the transiver and interface(b) Connecting two cable segments with a repeater

Page 19: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

19

Cable topology

A B

C

D

Tap

(a) Linear (a) Spine

Page 20: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

20

Cable topology (cont.)

(c) Tree (d) Segmented

Selectiverepeater

A B C D E

F

Page 21: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

21

Carrier Sense Multiple Access (CSMA)

Non-persistent: Transmit if idle Otherwise, delay, try againConstant or variable

Delay

Channel busy

Ready

1-persistent: Transmit as soon as channel goes idleIf collision, back off and try again

Time

P-persistent: Transmit as soon as channel goes idle with probability POtherwise, delay one slot, repeat process

CSMA persistence and backoff

•Nonpersistent •1-persistent•P-persistent

Page 22: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

22

CSMA/CD Physical Layer

Current Standard

Baseband coaxial cable (50)

500 M segments, 100 Taps/segment

Maximum 4 repeaters in path

10 Mbps

Similar to Ethernet

Page 23: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

23

For Baseband CSMA/CD, packet length should be at least twice the propagation delay (a 0.5)

Page 24: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

24

For Broadband CSMA/CD, packet length should be at least quadruple the propagation delay (a 0.5)

Page 25: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

25

Comparison of the channelutilization versus load for various random accessprotocols.

Page 26: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

26

The 802.3 Frame Format

• Destination address– High-order bits (bit 47)

• 0 ordinary addresses

• 1 group addresses (multicast)

Preamble

Start of framedelimiter

Dest.address

Sourceaddress

Length ofData field

Data Pad Checksum

Byte 7 1 2 or 6 2 or 6 2 0 - 1500 0-46 4

Page 27: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

27

The 802.3 Frame Format (cont.)• Destination address

– All 1 bits broadcasting

Note: Such frame is propagated by all bridges

– Bit 46 designated for:• Local address, assigned by network adm.

• Global (address, assigned by IEEE) 7 1013 global addresses.

• Data length and data Frame must be at least 64 bits long from the destination address to the checksum.

• Pad: Used to fill out the minimum size frame

Page 28: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

28

IEEE STD 802.4: Token Bus• Example: GM (MAP)• Logically, all stations are organized into a ring• Note: 802.4

MAC protocol is very complex, with each station having to maintain 10 different times and more than 2 dozen state variables. More than 200 pages.

• Token A special control frame, and only the token holder is permitted to transmit frames.

Page 29: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

29

IEEE STD 802.4: Token Bus (cont.)

A token bus

Page 30: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

30

Token Bus MAC Sublayer Protocol

• Stations are inserted into ring in order of station address, from highest to lowest.

• Token passing is also done from high to low addresses.

• Four priority classes: (0, 2, 4, 6) for traffic, with 0 the lowest and 6 the highest. When the token comes into the station, it passes to priority 6 substation, which may begin transmitting frames, if it has any. When it is done, (or when its timer expires), the token is passed to the priority 4 substations, etc.

Page 31: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

31

Token Bus Priority Scheme

Class 6to send?

TimerExpired?

YesSendframe

No

No

Yes

Use Token

Class 4to send?

TimerExpired?

YesSendframe

No

No

Yes

Class 2to send?

TimerExpired?

YesSendframe

No

No

Yes

Class 0to send?

TimerExpired?

YesSendframe

No

No

Yes

More datato send?

Want tostay in ring

Yes

Send set-successorframe to

predecessor

NoNo

YesPasstoken

Page 32: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

32

Ring Maintenance Framecontrol field Name Meaning

00000000 Claim_token Claim token during ring

initialization00000001 Solicit_successor_1 Allows stations to enter the ring00000010 Solicit_successor_2 Allows stations to enter the ring 00000011 Who_follows Recover from lost token00000100 Resolve_contention Used when multiple stations want

to enter the ring00001000 Token Pass the token00001100 Set_successor Allows stations to leave the ring

The token bus control frames

Page 33: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

33

Logical Ring MaintenanceAdding a station• Each station's interface must maintain address of

predecessor and successor stations.• Periodically, the token holder solicits bids from

stations not currently in the ring and wish to join.• Resolve contention -- token holder runs an

arbitration algorithm when 2 or more stations bid to enter. All station interfaces maintain 2 random bits which are used to delay all bids by 0, 1, 2, or 3 slot times.

Page 34: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

34

Logical Ring Maintenance (cont.)Deleting a station• A station, X, with successor S, and predecessor P,

leaves the ring by sending P a set_successor frame.

Initialization• Special case of adding new station. When first

station comes on line, it notices that there is no traffic for a certain time period. Then it sends a claim_token frame, and later solicit bids from stations to join.

Page 35: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

35

Failure (Stations)If a station tries to pass the token to a failed station, it

listens to see if the station either transmits a frame or passes the token. If it does neither, the token is passed a second time. If that also fails, the station transmits a who_follows, specifying the address of its successor. If this fails, the station sends a solicit_successor_2 frame, etc.

Page 36: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

36

Failure (Stations) (cont.)Token failure• Use the ring initialization algorithm. Each station

has a timer that is reset whenever a frame appears on the network. When timer hits a threshold value, the station issues a claim_token.

Multiple tokens• If a station holding the token notices a

transmission from another station, it discards its token.

Page 37: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

37

Sender looks for free token

Changes free token to busytoken and appends data

Receiver copies dataaddressed to it

Sender generates free tokenupon receipt of physicaltransmission header(from addressee)

Page 38: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

38

(a) A ring network (b) Listen mode (c) Transmission mode

Ring interface Ring interface

1 bit delay

Page 39: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

39

Four stations connected via a wire center

Station

Wire center

Cable

Bypass relay

Connector

Page 40: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

40

When the sending station drains the frame from the ring, it examines the A and C bits:

1. A = 0 and C = 0: destination not present or not powered up.2. A = 1 and C = 0: destination present but frame not accepted.3. A = 1 and C = 1: destination present and frame copied.

Ring Maintenance (cont.)

Page 41: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

41

Ring Maintenance• Monitor station oversees the ring • Every station has the capability of becoming the

monitor• Monitor station responsibility

– Lost token – Ring breaks – Cleaning up ring

• Orphan frame• Garbled frame

• 802.4 committee interested in fractory issues, 802.5 committee interested in office automation

Page 42: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

42

IEEE token ring priority scheme

1. A is sending to B, D reserves at higher level2. A generates higher priority token and remembers lower priority3. D uses higher priority token to send data to C4. D generates token at higher level5. A sees the high priority token and captures it.6. A generates token at the pre-empted, lower priority level

1

2

3

4

5

6

Page 43: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

43

Ring Maintenance (cont.)Framecontrol field Name Meaning

00000000

00000010

000000110000010000000101

00000110

Duplicate address test

Beacon

Claim tokenPurgeActive monitor present

Stand by monitor present

Test if two stations havesame addressUsed to locate breaks in the ringAttempt to become monitorReinitialize the ringIssued periodicallyby the monitorAnnounces the presence of potential monitors

Token ring control frames

Page 44: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

44

FDDI (Fiber Distributed Data Interface)

• 100 Mbps over distances up to 200km up to 1000 stations.

• Distance between 2 successive nodes cannot exceed 2km.

• Uses multimode fiber.• Uses LEDs rather than lasers.• Design consists of 2 fiber rings.

Page 45: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

45

An FDDI ring being used as a backbone to connect LANs and computers

Page 46: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

46

(a) FDDI consists of two counterrotating rings.(b) In the event of failure of both rings at one point, the two rings can be joined together to form a single long ring.

Page 47: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

47

FDDI (cont.)

• 2 classes of stations, A and B. – Class A stations connect to both rings.

– Class B stations only connect to 1 ring.

• Traffic (2 types) – Synchronous (e.g., audio, video info)

– Asynchronous (e.g., data traffic)

– Uses 4 out of 5 encoding schemes to save bandwidth

Page 48: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

48

FDDI token ring operation

1. A seizes token and begins transmitting frame F1 to C

2. A appends token to end of transmission

3. B seizes token transmits F2 to D

4. B emits token. D copies F2. A absorbs F1.

5. A lets F2 and token pass. B absorbs F2.

6. B lets token pass

1

2

3 6

5

4

Page 49: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

49

LAN standard MAC frame formats

Preamble SFD DA SA Length Data Pad FCS

7 1 2, 6 2, 6 2 0 - 1500 4(a) CSMA/CD

Preamble SD FC DA SA Data FCS ED

1 1 1 2, 6 2, 6 >= 0 4 1(a) Token Bus

SD AC FC DA SA Data FCS ED FS

(a) Token Ring

Preamble

8 1 1 2, 6 2, 6 >= 0 4 1 1(a) FDDI

AC: Access ControlDA: Destination AddressED: Ending Delimiter

FC: Frame ControlFCS: Frame Check SequenceFS: Frame Status

SA: Source AddressSD: Starting DelimiterSFD: Start Frame Delimiter

1 1 1 2, 6 2, 6 >= 0 4 1 1

SD FC DA SA Data FCS ED FS

Octets

Page 50: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

50

Physical Layer Specificationsfor LAN standards

Name Cable Max. segment Nodes/seg. Advantages

10BASE5

10BASE2

10BASE-T

10BASE-F

Thick coax

Thin coax

Twisted pair

Fiber optics

500 m

200 m

100 m

2000 m

100

30

1024

1024

Good for backbones

Cheapest system

Easy maintenance

Best between buildings

The most common kinds of baseband 802.3 LANS

Page 51: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

51

Physical Layer Specificationsfor LAN standards (cont.)

Broadband

Carrierband

Optical fiber

Coaxial Cable(75 ohm)Coaxial Cable(75 ohm)

Optical fiber

Broadband(AM/PSK)Broadband(FSK)ASK-Manchester

1, 5, 10

1, 5, 10

5, 10, 20

Not specified

7600

Not specified

TransmissionMedium

SignalingTechnique

Data Rate(Mbps)

Max. SegmentLength(m)

(b) IEEE 802.4 (Token Bus)

Page 52: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

52

Physical Layer Specificationsfor LAN standards (cont.)

ShieldedTwisted Pair

DifferentialManchester

1, 4Not

specified

TransmissionMedium

SignalingTechnique

Data Rate(Mbps)

Max. # ofRepeaters

(c) IEEE 802.5 (Token Ring)

Max. distancebetween repeater

250

Optical fiber ASK-NRZI 100 2000 (m)

TransmissionMedium

SignalingTechnique

Data Rate(Mbps)

Max. # ofRepeaters

(d) Fiber Distributed Data Interface (FDDI)

Max. distancebetween repeater

1000

Page 53: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

53

ActualRate(Mbps)

Token ring

Token bus

CSMA/CD bus

24.0

20.0

4.0

Data Rate (Mbps)4.0 20.0

Maximum potential data rate for LAN protocols; 2000 bits per packet;100 stations active out of 100 stations total

Page 54: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

54

ActualRate(Mbps)

Token ring

Token bus

CSMA/CD bus

24.0

20.0

4.0

Data Rate (Mbps)4.0 20.0

500 bits per packet; 100 stations active out of 100 stations total

Page 55: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

55

ActualRate(Mbps)

Token ring

Token bus

CSMA/CD bus

24.0

20.0

4.0

Data Rate (Mbps)4.0 20.0

2000 bits per packet; 1 station active out of 100 stations total

Page 56: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

56

ActualRate(Mbps)

Token ring

Token bus

CSMA/CD bus

24.0

20.0

4.0

Data Rate (Mbps)4.0 20.0

500 bits per packet; 1 station active out of 100 stations total

Page 57: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

57

Throughput

0.2

0.6

0.8

1.0

Throughput as a function of N for token passing and CSMA/CD

5 20 25Number of Stations

CSMA/CD a = 1.0

CSMA/CD a = 0.1

Token a = 1.0

Token a = 0.1

Page 58: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

58

Slotted Ring

Page 59: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Medium Access Control Protocols in Wireless Networks

• CSMA

• 802.11

Page 60: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

MAC Protocols: Issues in Wireless Networks

• Hidden Terminal Problem

• Reliability

• Collision avoidance

• Congestion control

• Fairness

• Energy efficiency

Page 61: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Hidden Terminal Problem

• Node B can communicate with both A and C• A and C cannot hear each other• When A transmits to B, C cannot detect the

transmission using the carrier sense mechanism• If C transmits, collision will occur at node B

B C DA

Radio Range

Page 62: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Exposed Station Problem

• Node B is transmitting to node A• Assume node C wishes to transmit to node D:

• it will first senses the channel,

• assumes falsely that it cannot transmit to node D

• delays transmission until idle channel is detected

• this is not true, collisions only occur at receiver, node A

A C DB

Page 63: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

MACA Solution for Hidden Terminal/Exposed Station Problem [Karn90]

• When node A wants to send a packet to node B, node A first sends a Request-to-Send (RTS) to B.

• On receiving RTS, node B responds by sending Clear-to-Send (CTS), provided node A is able to receive the packet

• When a node (such as C) overhears a CTS, it keeps quiet for the duration of the transfer– Transfer duration is included in both RTS and CTS.

Range of A’s Transmitter

Range of B’s Transmitter

A BC D

E

RTS A BC D

E

CTS

Page 64: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Reliability

• Wireless links are prone to errors. High packet loss rate detrimental to transport-layer performance.

• Mechanisms needed to reduce packet loss rate experienced by upper layers

A B C D

Page 65: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

A Simple Solution to Improve Reliability

• When node B receives a data packet from node A, node B sends an Acknowledgement (Ack). This approach adopted in many protocols [Bharghavan94,IEEE 802.11]

• If node A fails to receive an Ack, it will retransmit the packet

A B C D

Page 66: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

IEEE 802.11 Wireless MAC

• Distributed and centralized MAC components– Distributed Coordination Function (DCF)– Point Coordination Function (PCF)

• DCF suitable for multi-hop ad hoc networking

Page 67: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

IEEE 802.11 DCF • Uses RTS-CTS exchange to avoid hidden terminal

problem– Any node overhearing a CTS cannot transmit for the

duration of the transfer

• Uses ACK to achieve reliability• Any node receiving the RTS cannot transmit for

the duration of the transfer– To prevent collision with ACK when it arrives at the

sender– When B is sending data to C, node A will keep quiet

A B C D

Page 68: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Congestion Avoidance:IEEE 802.1 DCF

• When transmitting a packet, choose a backoff interval in the range [0,cw]– cw is contention window

• Count down the backoff interval when medium is idle– Count-down is suspended if medium becomes busy

• When backoff interval reaches 0, transmit RTS

Page 69: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

Congestion Avoidance

• The time spent counting down backoff intervals is a part of MAC overhead

• Choosing a large cw leads to large backoff intervals and can result in larger overhead

• Choosing a small cw leads to a larger number of collisions (when two nodes count down to 0 simultaneously)

Page 70: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

GSM (Global System for Mobile Communications)

Combination of ALOHA, TDM, FDM intertwined in complex ways

• Has a max of 200 full duplex channels per cell.• Each channel has an uplink and a downlink• Each frequency band has 200kHz wide• Uses 124 channels and supports 8 separate

connections, using TDM • Note: Europe GSM is fully digital

Page 71: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

CDMA (Code Division Multiple Access)

Channel allocation scheme

• Each station to transmit over the entire frequency spectrum all the time

• Multiple simultaneous transmissions are separated using coding theory

Page 72: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

72

Multiple LANs connected by a backbone to handle a total loadhigher than the capacity of a single LAN.

Clusteron a single LAN

The internal structureof the network layer (cont.)

Page 73: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

73

Operationof a LANbridge from 802.3 to802.4.

Network

LLC

MAC

Physical

Bridge

The internal structureof the network layer (cont.)

Page 74: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

74

IEEE 802 frame formats

802.3

802.4

802.5

Preamble

Startdelimiter

AccessControl

Dest. &source

addressesData Checksum Frame

status

FrameControl

LengthPad

Enddelimeter

Page 75: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

75

Problems encountered in building bridges from 802.x to 802.y

802.3(CSMA/CD)

1,5,8,9,101,2,5,6,7,10

802.4(Token Bus)1,49,1,2,3,6,7

802.5(Token Ring)1,2,4,81,2,3,8,9,106,7

802.3802.4802.5

Destination LAN

SourceLAN

Action1. Reformate the frame and compute new checksum2. Reverse the bit order3. Copy the priority, meaningful or not4. Generate a ficticious priority5. Discard priority6. Drain the ring (somehow)7. Set A and C bits (by lying)8. Worry about congestion (fast LAN to slow LAN)9. Worry about token handoff ACK being delayed or impossible10. Panic if frame is too long for destination LAN

Parameters assumed:<802.3> 1518-byte frames, 10Mbps (minus collisions)<802.4> 8191-byte frames, 10Mbps<802.5> 5000-byte frames, 4Mbps

Page 76: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

76

Bridges From 802.x to 802.yProblems:

• Different Frame Format Among LANs

• Interconnected LANs Do Not Run at The Same Data Rate

• LANs Have Different Max Frame Length

• Value of Timers in The Higher Layer May Time Out too Early When Sending a Long Frame

Page 77: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

77

Bridges From 802.x to 802.y (cont.)

802.3--802.3Fairly straightforward. • If destination LAN is heavily loaded, then frames

must be buffered; otherwise, they are discarded.

802.4--802.3Two problems: priority bits in 802.4 frames. 802.4 frames may request an ACK from the

destination. What should the bridge do?

Page 78: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

78

Bridges From 802.x to 802.y (cont.)

802.5--802.3Similar problem as before:• 802.5 has frame status byte with A and C bits

which are set by the destination to tell sender whether the frame was copied. What should the bridge do?

802.3--802.4 What to put in the priority bits? Assuming enough

delay has already, bridge may transmit all frames at highest priority.

Page 79: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

79

Bridges From 802.x to 802.y (cont.)

802.4--802.4• What to do with the temporary token handoff?

802.5--802.4 Same problem as before with the A and C bits.

Note: priority bits are different in the two LANs.

802.3--802.5 Bridge must generate priority bits.

Page 80: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

80

Bridges From 802.x to 802.y (cont.)

802.4--802.5• Frames may be too long.• Token handoff problem.

802.5--802.5 What to do with the A and C bits?

Page 81: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

81

Transparent Bridges or Spanning Tree (802)

• There Should be No Hardware Changes Required, No Software Changes Required, etc. Just Plug in The Cable & Walk Away

• Each Bridge Has a Hash Table for Looking up Destination Addresses

• Initially, All Bridges Hash Tables Are Empty. Flooding is Used to Have Bridges Learn Destination Addresses

• To Handle Dynamic Topologies, The Arrival Time is Noted in Every Hash Table Entry

• Periodically, The Hash Table is Scanned & All Old Entries Are Purged

Page 82: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

82

LANs and Bridges

Bridge 1 Bridge 2

A B C D

LAN1

LAN2

LAN3

LAN4

A Configuration with 4 LANs and 2 Bridges

Connectivity:

• Bridge 1: Connected to LAN 1 & LAN 2.• Bridge 2: Connected to LANs ___, ___ and ___.

Note: A frame arriving at Bridge 1 on LAN 1 destined for A can be discarded immediately because it is already on the right LAN.

Page 83: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

83

LANs and Bridges (cont.)However, a frame arriving on LAN 1 destined for

___, ___, or ___ must be forwarded.Hash Table (located inside bridge) ==> look up

destination address. Example: Bridge 2's table would list A as belonging

to ___.Note: Bridges learn destinations after the initial

flooding. By looking at the source address, they can tell which machine is accessible on which LAN.

Page 84: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

84

LANs and Bridges (cont.)Example: If Bridge 1 sees a frame on LAN 2 coming

from C, it knows that C must be reachable via ___, so it makes an entry in its hash table noting this. A subsequent frame addressed to C coming in on LAN 2 will be ______; whereas if this same frame comes in on LAN 1, it will be ______.

Note: Whenever a frame that is already in the table arrives, its entry is updated with the current time. Periodically, a process in the bridge scans the hash table and purges all entries more than a few minutes old.

Page 85: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

85

Routing Procedure For An Incoming Frame

• If Destination & Source LANs Are The Same, Discard Frame

• If Destination & Source LANs Are Different, Forward Frame

• If The Destination LAN is Unknown, Use Flooding

Page 86: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

86

Source Routing BridgesNote: CSMA/CD & Token Bus Chose Transparent

Bridges. The Token Ring Group Chose Source Routing

Source Routing --- Assumes That The Sender of Each Frame Knows Whether or Not The Destination is on Its Own LAN

The Frame Header Contains The Exact Path That Frame is To Follow: A Route is A Seq. of Bridge, LAN, Bridge, LAN, .....

Page 87: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

87

Source Routing Bridges (cont.)When sending a frame to a different LAN, the source

machine sets the high order bit of the destination address to 1 to mark it. Also, it includes in the frame header the exact path that frame is to follow.

A route is just a sequence of Bridges, LAN, Bridge, ...

Example: Route from A to C in previous figure:(B1, L2, B2, L3)B1--4bitsL2--12 bits

Page 88: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

88

Source Routing Bridges (cont.)This algorithm lends itself to three possible

implementations:1. Software: the bridge runs in promiscuous mode,

copying all frames to its memory to see if they have the high-order destination bit set to 1. If so, the frame is inspected further, otherwise, it is not.

2. Hybrid: the bridge's LAN interface inspects the high-order destination bit and only gives its frames with the bit set. This interface is easy to build into hardware and greatly reduces the number of frames the bridge must inspect.

Page 89: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

89

Source Routing Bridges (cont.)3. Hardware: the bridge's LAN interface not only

checks the high-order destination bit, but it also scans the route to see if this bridge must do forwarding. Only frames that must actually be forwarded are given to the bridge. This implementation require the most complex hardware, but wastes no bridge CPU cycles because all irrelevant frames are screened out.

Page 90: 1 Data Link Layer Two sublayer: –Medium access sublayer (MAC) –Logical link control (LLC)

90

Discovering Routes: If destination address is unknown, the source issues a

broadcast frame (copied by every bridge) asking where it is. When the reply comes back, the bridges record their identity in it, so that the sender can observe routes taken, and choose the best route.