mac layer

116
1 The Medium Access Control Sublayer Chapter 4

Upload: shubham-kansal

Post on 18-Dec-2014

1.352 views

Category:

Education


15 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Mac  layer

1

The Medium Access Control Sublayer

Chapter 4

Page 2: Mac  layer

2

The Channel Allocation Problem• The MAC (Medium Access Control) sublayer is

between the physical layer and the data link layer. • The MAC sublayer is especially important in LANs,

nearly all of which use a multiaccess (or broadcast) channel as the basis of their networks.

• This chapter mainly deals with LANs, other broadcast networks and their protocols. The key issue: how to determine who gets to use the channel when there is competition for it ?

1. Static Channel Allocation in LANs and MANs

2. Dynamic Channel Allocation in LANs and MANs

Page 3: Mac  layer

3

Static Channel Allocation

• FDM (Frequency-Division Multiplexing): Divide the bandwidth into equal sized portions so that each user can be assigned one portion.

• Under what circumstances FDM is efficient ?

When there is only a small and fixed number of users, and each of which has a heavy (buffered) load of traffic (e.g., carriers' switching offices).

Page 4: Mac  layer

4

What's the problem with FDM ? 1. If fewer than N users are currently interested in communication, some portions of spectrum will be wasted. 2. If more than N users want to communicate, some of them will be denied permission even if some users with allocated frequency hardly ever transmit anything. 3. Even the number of users is N and constant, when some users are quiescent, no one else can use their bandwidth so it is simply wasted. 4. For bursty data traffic (peak traffic to mean traffic ratio of 1000:1), the allocated small subchannel will be idle most of the time but unable to handle the peak traffic.

Page 5: Mac  layer

5

Dynamic Channel Allocation in LANs and MANs1. Station Model.

• Independent stations for generating frames. • Once a frame has been generated, the station is blocked until

the frame has been transmitted.

2. Single Channel Assumption. A single channel for all communication (send and receive), and all stations are equivalent.

3. Collision Assumption. If the transmission of two frames overlap in time, a collision occurs. All stations can detect collisions. A collided frame must be retransmitted.

4. Time assumption. (a) Continuous Time. (b) Slotted Time.

5. Sense assumption. (a) Carrier sense. Stations can tell if the channel is in use before trying to use it.

(b) No carrier sense. Stations cannot sense the channel before trying to use it.

Page 6: Mac  layer

6

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 7: Mac  layer

7

PURE ALOHAThe ALOHA system was used for ground-based radio broadcasting, but the basic idea is applicable to any system in which uncoordinated users are competing for the use of a single shared channel. Basic idea:

Let users transmit whenever they have data to be sent. A sender can always find out whether or not its frame was destroyed by listening to the channel output (due to the feedback property of broadcasting). If the frame was destroyed, the sender just waits a random amount of time and sends it again.

Systems in which multiple users share a common channel in a way that can lead to conflicts are known as contention systems.

Page 8: Mac  layer

8

Pure ALOHA

In pure ALOHA, frames are transmitted at completely arbitrary times.

Page 9: Mac  layer

9

Pure ALOHA (2)

Vulnerable period for the shaded frame.

Page 10: Mac  layer

10

Analysis of Pure ALOHA protocol

a)Assume that there are a large number (N) of stations in the network

b)All stations transmit frames with a fixed (average) length of T seconds

c)Each station transmits with a fixed probability (p) in the time period (T)

d)Thus, the average number of frames transmitted in the system in the time period T will be Np

Page 11: Mac  layer

11

Analysis of Pure ALOHA protocola) “Danger” period for a station’s transmission

starts T seconds before it initiates its frame transmission and ends T seconds after it completes its frame

b)During this time period of 2T, the average number of frames transmitted will be E=2Np=2G

c) A Poisson probability distribution indicates the probability of k events occurring in a “unit time”

p kE e

k

k E

( )!

Page 12: Mac  layer

12

Analysis of Pure ALOHA protocol

a) For transmission to be successful, no other station should transmit during the unit time of interest (2T). Thus the probability of a successful transmission will be

p(k=0)=e-E=e-2G

a) Therefore, the system throughput for the time period T will be S=Number of transmission attempts in time period T x probability of successful transmission, or

S=Ge-2G

Page 13: Mac  layer

13

Pure Aloha Throughput

0 1 2 3 4 50

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

Average Number of frames per unit time (G)

Thr

oug

hput

(S

)

Page 14: Mac  layer

14

Operation of Protocola) Optimum Throughput occurs at G=0.5 or when

b)Average number of attempts to ensure successful transmission is

Np

1

2

N n e e e

N attempts

avG n

i

G G

avOptimum

( )

.

1

2 72

2 1

1

2 2

Page 15: Mac  layer

15

Slotted ALOHA protocola) Enhancement of pure ALOHA in that stations

can only start to transmit frame so that it arrives at the destination at the beginning of defined time slots of duration T

b)“Danger” period for this system is only the T seconds prior to the start of station’s frame and thus E=Np and S=Ge-G

c) For this system, optimum throughput occurs if G=1

Page 16: Mac  layer

16

Slotted Aloha Throughput

0 1 2 3 4 50

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Average Number of frames per unit time (G)

Thr

oug

hput

(S

)

Page 17: Mac  layer

17

Efficiency of Slotted ALOHA

a)Successful throughput S read from graph (e.g. Soptimum=0.368 or 36.8% of timeslot contain successful transmissions)

b)Number of frames with no transmissions can be found from Poisson distribution p(k=0)=0.368 or 36.8% slots

c)Remaining time slots must contain collisions

Page 18: Mac  layer

18

Slotted ALOHASlotted ALOHA system: • Time is divided up into discrete intervals, each interval corresponding to one

frame. • A terminal is not permitted to send until the beginning of the next slot.

Slotted ALOHA peaks at G = 1, with S = 1/e 0.368, twice that of pure ALOHA. The main reason for poor channel utilization of ALOHA (pure or slotted) is that all stations can transmit at will, without paying attention to what the other stations are doing.

Page 19: Mac  layer

19

Multiple Access Protocols

• ALOHA

• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 20: Mac  layer

20

Carrier Sense Multiple Access protocols Protocols in which stations listen for a carrier (i.e., a transmission)

and act accordingly are called carrier sense protocols.

1-persistent CSMA (Carrier Sense Multiple Access): 1. To send data, a station first listens to the channel to see if anyone else is

transmitting. 2. If so, the station waits (keeps sensing it) until the channel becomes idle.

Otherwise, it transmits a frame. 3. If a collision occurs, the station waits a random amount of time and

starts all over again.

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle.

Page 21: Mac  layer

21

Collisions in CSMA How could collisions happen in CSMA ? Whenever more than one station detect an idle channel and their

transmission times overlap. Discussions:

1. What's the effect of signal propagation delay ? The longer the delay, the more the collisions, and the worse

the performance of the protocol.

2. How about zero propagation delay ? There still exist chances of collisions.

3. Is this protocol any better than ALOHA (both pure and slotted) ?

Yes, because both stations have the decency to desist from interfering with the third station's frame.

Page 22: Mac  layer

22

Non-persistent and P-persistent CSMANon-persistent CSMA 1. To send data, a station first listens to the channel to see if anyone else is transmitting. 2. If so, the station waits a random period of time (instead of keeping sensing until the end

of the transmission) and repeats the algorithm. Otherwise, it transmits a frame. 3. If a collision occurs, the station waits a random amount of time and starts all over again. This protocol has better channel utilization and longer delays than 1-persistent

CSMA.

P-persistent CSMA(applied to slotted channels): 1. To send data, a station first listens to the channel to see if anyone else is transmitting. 2. If the channel is idle, it transmits with a probability p. With a probability q = p – 1, it

defers until the next slot. If the next slot is also idle, it either transmits or defers again, with probabilities p and q. This process is repeated until either the frame has been transmitted or another station has begun transmitting. In the latter case, it waits a random time and starts again.

3. If a collision occurs, the station waits a random amount of time and starts all over again. 4. If the channel is (initially) busy, it waits until the next slot and apply the above

algorithm.

Page 23: Mac  layer

23

Persistent and Non-persistent CSMA

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

Page 24: Mac  layer

24

CSMA with Collision DetectionPersistent and nonpersistent CSMA protocols improve ALOHA by ensuring

that no station begins to transmit when it senses the channel busy.

CSMA/CD (Carrier Sense Multiple Access with Collision Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected.

The conceptual model: • To send data, a station first listens to the channel to see if anyone else

is transmitting. • If so, the station waits until the end of the transmission (1-persistent)

or wait a random period of time and repeats the algorithm (non-persistent). Otherwise, it transmits a frame.

• If a collision occurs, the station will detect the collision, abort its transmission, waits a random amount of time, and starts all over again.

Page 25: Mac  layer

25

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

• When two stations both begin transmitting at exactly the same time, how long will it take them to realize that there has been a collision ?

The minimum time to detect the collision is the time it takes the signal to propagate from one station to the other.

• How long could the transmitting station be sure it has seized the network ? ( or 2 ? where is time equal to the full cable propagation)

• It is worth noting that no MAC-sublayer protocol guarantees reliable delivery. Even in the absence of collisions, the receiver may not have copied the frame correctly due to various reasons (e.g., lack of buffer space or a missed interrupt).

Page 26: Mac  layer

26

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols

• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 27: Mac  layer

27

Collision-Free Protocols• Can we avoid collision all together, even during the

contention period ? Yes. But how ?

• One assumption: there are N stations, each with a unique address from 0 to N –1 ``wired'' into it.

Which station gets the channel after a successful transmission ?

A basic bit-map protocol: • Each contention period consists of exactly N slots, with one slot time

being at least 2. • If station i (0 i N -1) has a frame to send, it transmits 1 bit during

the ith slot; otherwise, it transmits 0 bit during the ith slot. • After all slots have passed by, stations begin transmitting in numerical

order. • After the last ready station has transmitted its frame, another N-bit

contention period is begun.

Page 28: Mac  layer

28

The basic bit-map protocol

• Protocols like this in which the desire to transmit is broadcast before the actual transmission are called reservation protocols.

• Low load situation: the bit map repeats over and over.

Page 29: Mac  layer

29

The binary countdown protocol

A problem with the basic bit-map protocol is that overhead is 1 contention bit slot per station. We can do better than that by using binary station addresses.

1. Each station has a binary address. All addresses are the same length.

2. To transmit, a station broadcasts its address as a binary bit string, starting with high-order bit.

3. The bits in each address position from different stations are BOOLEAN ORed together (so called Binary countdown).

4. As soon as a station sees that a high-order bit position that is 0 in its address has been overwritten with a 1, it gives up.

5. After the winning station has transmitted its frame, there is no information available telling how many other stations to send, so the algorithm begins all over with the next frame.

Page 30: Mac  layer

30

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols

• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 31: Mac  layer

31

Limited-Contention ProtocolsTwo basic channel acquisition strategies studied: a) Contention methods. E.g., ALOHA, CSMA. b) Collision-free methods. E.g., basic bit map. Two performance measures: a) Delay at low load. Contention methods are preferable. b) Channel efficiency at high load. Collision-free methods are

preferable. Could we combine the best properties of both the contention and

collision-free protocols ? Yes. Such new protocols, called limited contention protocols,

use a contention method at low loads, but use a collision-free technique at high loads.

Page 32: Mac  layer

32

Page 33: Mac  layer

33

Basic idea of Limited-Contention Protocols

• Stations are divided into groups. • Each group is allocated a slot for transmission. • Members of one group compete for one slot only.

How to assign stations to slots (groups) ? Special cases:

1. Each group with only one member (e.g., basic bit-map). Collision-free.

2. Each group with two stations. The probability that both will try to transmit during a slot is p**2, which for small p is negligible.

3. A single group containing all stations (i.e., slotted ALOHA). Zero delay at low load but very high collisions at high load.

What we need is a way to assign stations to slots dynamically, with many stations per slot when the load is low and few station per slot when the load is high.

Page 34: Mac  layer

34

Adaptive Tree Walk Protocol

The algorithm devised by US Army for testing soldiers for syphilis during WW II: 1. The Army took a blood sample from N soldiers. 2. A portion of each sample was poured into a single test

tube. The mixed sample was then tested. 3. If no antibodies were found, all the solders in the

group were declared healthy. 4. Otherwise, two new mixed samples were prepared,

one for soldiers 1 through N/2 and one from the rest. 5. The process was repeated recursively until the

infected soldiers were determined. The computer version of this algorithm organizes the

stations in a binary tree, as illustrated below.

Page 35: Mac  layer

35

Adaptive Tree Walk Protocol

Page 36: Mac  layer

36

Adaptive Tree Walk Protocol

Each bit slot (group) is associated with a particular node in the tree, with the root node corresponding to slot 0 for all stations in one group. • Starting from the root node: all stations are

permitted to try to acquire the channel. • If a collision occurs, the search continues

recursively with the left and right children of that node.

• If a bit slot goes idle or if there is exactly one station that transmits into it, the searching of its node can stop.

Page 37: Mac  layer

37

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols

• Wavelength Division Multiple Access Protocols

• Wireless LAN Protocols

Page 38: Mac  layer

38

Wavelength Division Multiple Access Protocols

Wavelength division multiple access.

A different approach to channel allocation is to divide the channel into subchannels using FDM, TDM, or both, and dynamically allocate them as needed. This is commonly used on fiber optic LANs.

Page 39: Mac  layer

39

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols

• Wireless LAN Protocols

Page 40: Mac  layer

40

Wireless LAN Protocols

Wireless LANs have different properties than conventional wired LANs and require special MAC sublayer protocols.

All radio transmitters have some fixed range, so not all stations are necessarily within range of one another.

a) A transmitting. C is unable to detect A’s transmission, so it may falsely conclude that it may transmit to B, resulting in collision. This is called the hidden station problem)

b) B transmitting. C is able to detect A’s transmission, so it may falsely conclude that it may not send to D, which is called the exposed station problem.

A system of computers (e.g., notebook PCs) that communicate by radio can be regarded as a wireless LAN.

Page 41: Mac  layer

41

Wireless LAN Protocols (2)

The MACA (Multiple Access with Collision Avoidance) protocol. (a) A sending an RTS to B. (b) B responding with a CTS to A.

Page 42: Mac  layer

42

Multiple Access Protocols

• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols

Page 43: Mac  layer

43

IEEE 802 Standards

The 802 working groups. The important ones are marked with *. The ones marked with are hibernating. The one marked with † gave up.

Page 44: Mac  layer

44

Ethernet

IEEE standard 802.3 and Ethernet

This standard is for a 1-persistent CSMA/CD LAN: • When a station wants to transmit, it listens to the cable. • If the cable is busy, the station waits until it goes idle,

otherwise it transmits immediately. • If a collision occurs, all colliding stations terminate

their transmission, wait a random time, and repeat the whole process all over again.

Page 45: Mac  layer

45

Ethernet Cabling

The most common kinds of Ethernet cabling.

Three kinds of Ethernet cabling.

(a) 10Base5, (b) 10Base2, (c) 10Base-T.

Page 46: Mac  layer

46

Cable topologies

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

Repeaters are used to connect multiple cables together. It receives, amplifies, and retransmits signals in both directions. Repeaters are physical layer devices. No two transceivers may be more than 2.5 km apart, and no path between any two transceivers may traverse more than four repeaters.

Page 47: Mac  layer

47

Manchester Encoding

(a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding.

All Ethernet systems use Manchester encoding due to its simplicity. The high signal is volts and the low signal is volts, giving a DC value of 0 volts.

None of the Ethernet versions use straight binary encoding since it leads to ambiguities: it cannot tell the difference between an idle sender (0 volts) and a 0 bit (0 volts).

What is needed is a way for receivers to unambiguously determine the start, end, or middle of each bit without reference to an external clock.

Page 48: Mac  layer

48

Ethernet MAC Sublayer Protocol

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

Preamble of 8 bytes, each with the bit pattern 10101010. For synchronization between the sender and the receiver. Start of frame (SOF) byte contains 10101011 to denote the start of the frame.

Destination and source addresses, each with 2-6 bytes. • Ordinary address: the high-order bit value is 0. • Multicast address: the high-order bit value is 1. • Broadcast address: all bits have a value of 1. • Local address: assigned by local network administrator, distinguished by the second

high-order bit (46) value 0. • Global address (7 X 10**13): assigned by IEEE to ensure world wide uniqueness,

distinguished by the second high-order bit value 1. Type specifies which network-layer process to give the frame to (for supporting multi-

protocols at network-layer).

Page 49: Mac  layer

49

Collision detection can take as long as 2 Length: 0 (46) - 1500 bytes. To make it easier to distinguish valid frames from garbage, 802.3 states that valid frames must be at least 64 bytes.

Another more important reason for having a minimum length frame is to prevent a station from completing the transmission of a short frame before the first bit has even reached the far end of the cable, which it may collide with another frame, as illustrated below.

Page 50: Mac  layer

50

The binary exponential backoff algorithmAfter a collision, the station waits for a random time and try again. How the

randomization is done ? Time is divided into discrete slots whose length is equal to the worst case round

trip propagation time (2). 1. After the first collision, each station waits either 0 or 1 slot time at random. 2. After the second collision, each station waits either 0, 1, 2, or 3 slot times at

random. 3. After i collisions, a random number between 0 and 2**i – 1 is chosen, and that

number of slots is skipped. 4. After 10 collisions have been reached, the randomization interval is frozen at

1023 slots. 5. After 16 collisions, the controller gives up and reports failure.

What happens if the randomization interval for all collisions is always 1023?Think about the average delay when only a few stations collide. What happens if the randomization interval for all collisions is always 2? Think about the time needed to resolve the collision when 100 stations try to

send at once. This might take years to resolve. The mean number of times per transmission is e 2.72.

Page 51: Mac  layer

51

Ethernet Performance

Efficiency of Ethernet at 10 Mbps with 512-bit slot times.

Page 52: Mac  layer

52

Switched Ethernet

The heart of the system is a switch containing a high-speed (typically over 1 Gbps) backplane and room for multiple plug-in cards (typically 4 to 32), with one to eight connectors in each card.

• To transmit, a station outputs a standard 802.3 frame to a plug-in card in the switch.

• The plug-in card checks to see if the frame is destined for one of the other stations connected to the same card. If so, the frame is copied there. If not, the frame is sent over the high-speed backplane to the destination station's card.

Page 53: Mac  layer

53

Switched Ethernet (2)

What happens if two machines attached to the same plug-in card transmit frames at the same time ?

In case that all the ports on the card are wired together to form a local on-card LAN: • Collisions on this on-card LAN will be detected and handled the same as any other

collisions on a CSMA/CD network. • Only one transmission per card is possible at any instant, but all the cards can be

transmitting in parallel.

In case that each input port is buffered, so incoming frames are stored in the card's on-board RAM as they arrive:

• Once a frame has been completely received, the card checks to see if the frame is destined for another port on the same card, or for a distant port. In the former case it can be transmitted directly to the destination.

• In the latter case, it must be transmitted over the backplane to the proper card. • All input ports can receive (and transmit) frames at the same time, for parallel,

full-duplex operation.

Page 54: Mac  layer

54

Fast EthernetThe Fast Ethernet (IEEE 802.3u) is backward compatible with but faster than the existing 802.3 standard. All the 802.3 packet formats, interfaces, and procedural rules are kept, but the bit time is reduced from 100 (10 Mbps) nsec to 10 nsec (100 Mbps). Fast Ethernet is based entirely on twisted pair or fiber wiring, as shown below. 

1. 100Base-T4 uses four twisted pairs (three for traffic from the station to the hub, one for the reverse traffic). Each pair runs at a signaling speed of 25 MHz. 4 bits (by the 8B6T scheme) are transmitted per clock cycle via three twisted pairs (to give 100Mbps), and another twisted pair provides a reverse channel at 33.3 Mbps.

2. 100Base-TX uses two twisted pairs (one for each direction), each running at a signaling speed of 125 MHz. The 4B5B scheme is used to transmit 4 bits per 5 clock cycles via each twisted pair (to give a full-duplex 100 Mbps).

3. 100Base-F uses two strands of multimode fiber, one for each direction, to give full duplex 100 Mbps. The distance between the station and the hub can be up to 2 km.

Page 55: Mac  layer

55

Gigabit Ethernet

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

The Gigabit Ethernet (IEEE 802.3z) is backward compatible with but faster than the existing 802.3 and 802.3u standards, but goes 10 times faster than 802.3u.

All configurations of gigabit Ethernet are point-to-point.

Page 56: Mac  layer

56

Gigabit Ethernet cablingGigabit Ethernet supports both copper and fiber cabling.

Gigabit Ethernet uses new encoding schemes, rather than Manchester encoding.

Gigabit Ethernet supports flow control: one end can send a special control frame to the other end telling it to pause for some period of time. The time unit is 512 nsec, allowing for pause as long as 33.6 msec.

IEEE 802 committee has produced the 10-gigabit Ethernet standard 802.3ae in 2002.

Page 57: Mac  layer

57

FEATURES COMMON TO ALL ETHERNETS

•IEEE 802.3

•BROADCASTING

•CSMA/CD

•BASEBAND TRANSMISSION

•FRAME SIZE 64-1518 BYTES

•FRAME FORMAT

•BACKWARD COMPATIBILITY

Page 58: Mac  layer

58

FEATURES VARIATIONS IN ETHERNETS

•TOPOLOGY

•SPEED

•CABLE TYPE

Page 59: Mac  layer

59

Token RingOperation

Page 60: Mac  layer

60

Token Ring (802.5)a) MAC protocol

– Small frame (token) circulates when idle– Station waits for token– Changes one bit in token to make it SOF for data

frame– Append rest of data frame– Frame makes round trip and is absorbed by

transmitting station– Station then inserts new token when transmission has

finished and leading edge of returning frame arrives– Under light loads, some inefficiency– Under heavy loads, round robin

Page 61: Mac  layer

61

802.5 Physical Layera)Data Rate 4 16 100

b)Medium UTP,STP,Fiber

c) Signaling Differential Manchester

d)Max Frame 4550 18200 18200

Note: 1Gbit in development

Page 62: Mac  layer

62

IEEE 802.2: Logical Link Control

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

LLC hides the differences between the various kinds of 802 networks by providing a single format and interface to the network layer.

LLC provides three service options: unreliable datagram service, acknowledged datagram service, and reliable connection-oriented service.

Page 63: Mac  layer

63

Wireless LANs

Part of the 802.11 protocol stack.

• Wireless LANs are increasingly popular and deployed in office buildings, airports and other public places.

• Wireless LANs can operate with or without a base station.

• IEEE 802.11 LAN standard makes provision for both arrangements.

Page 64: Mac  layer

64

The 802.11 physical layer• In 1997, three transmission techniques were allowed in the

physical layer: 1. The infrared method uses the same technology as television remote controls do.2. The other two techniques, called FHSS (Frequency Hopping Spread Spectrum)

and DSSS (Direct Sequence Spread Spectrum, similar to CDMA), use short-range radio spectrum (a part of the 2.4 GHz ISM band).

All techniques operate at 1 or 2 Mbps(a major disadvantage)

• In 1999, two new techniques, called OFDM (Orthogonal Frequency Division Multiplexing, used by 802.11a) and HR-DSSS (High Rate Direct Sequence Spread Spectrum, used by 802.11b), were introduced to achieve higher bandwidth, 54 Mbps (narrow range) and 11 Mbps (wider range), respectively.

• In 2001, a second OFDM modulation (like 802.11a) but at the narrow 2.4 GHz ISM band (like 802.11b) was introduced and can operate at up to 54 Mbps (802.11g).

Page 65: Mac  layer

65

The 802.11 MAC Sublayer Protocol

(a) The hidden station problem.(b) The exposed station problem.

Page 66: Mac  layer

66

DCF (Distributed Coordination Function) mode

The DCF mode uses the CSMA/CA (Collision Avoidance) protocol, in which, there is no central control, and stations compete for air time, just as they do with Ethernet:

• When a station wants to transmit, it senses the channel. If it is idle, it just starts transmitting. It does not sense the channel while transmitting but emits its entire frame, which may well be destroyed at the receiver due to interference there.

• If the channel is busy, the sender defers until it goes idle and then starts transmitting.

• If a collision occurs, the colliding stations wait a random time, using Ethernet binary exponential backoff algorithm, and then try again later.

Page 67: Mac  layer

67

The use of virtual channel sensing using CSMA/CA

A wants to send to B. C is within range of A. D is within range of B but not within range of A.RTS: Request To SendCTS: Clear To Send.NAV: Network Allocation Vector

Page 68: Mac  layer

68

A fragment burst

To deal with the problem of noisy channels, 802.11 allows frames to be fragmented into smaller pieces, each with its own checksum.

Fragments are individually numbered and acknowledged using a stop-and-wait protocol.

Page 69: Mac  layer

69

PCF (Point Coordination Function) mode

Interframe spacing in 802.11.

In the PCF mode, the base station pools the other stations, asking them if they have any frames to send. No collisions ever occur.

PCF and DCF can coexist within one cell, which works by carefully defining the interframe time interval. Four different intervals are defined, as depicted below.

Page 70: Mac  layer

70

The 802.11 Frame Structure

The 802.11 data frame.Version: two versions of the protocol can operate at the same time in the same cell.

Type: data, control, or management.

Subtype: RTS or CTS.

To/from DS: the frame is going to or coming from intercell distribution system.

MF: more fragments will follow.

Retry marks a retransmission of a frame sent earlier.

Power is used by the base station to put/take the receiver into/outof sleep state.

More indicates the sender has additional frames for the receiver.

W specifies that the frame has been encrypted by Wired Equivalent Privacy algorithm.

O tells that a sequence of frames with this bit on must be processed strictly in order.

Page 71: Mac  layer

71

The 802.11 Frame Structure (2)

Duration: tells how long the frame and its ack will occupy the channel, which is used to manage NAV mechanism.

Addresses: Two addresses are used for source and destination, and other two used for the source and destination base stations for intercell traffic.

Sequence: 12 bits for identifying frame and 4 bits for fragment.Data: payload up to 2312 bytes.

Management frames are similar to data frames, without one of the base station addresses because management frames are restricted to a single cell.

Control frames are even shorter, having only one or two addresses, no Data field, and no Sequence field. Key information is in the Subtype field.

Page 72: Mac  layer

72

802.11 Services

• Association: used by mobile stations to connect themselves to base stations.

• Disassociation: used by both mobile stations and the base station to break up their association relationship.

• Re-association: used by a mobile station to change its preferred base station.

• Distribution: determine how to route frames sent to the base station.

• Integration: handle the translation from the 802.11 format to the format required by the non-802.11 destination network.

Distribution Services:

Page 73: Mac  layer

73

802.11 Services

• Authentication: used by a mobile station to authenticate itself (proving it possesses a secret key).

• De-authentication: used by a mobile station when leaving the network

• Privacy: manage the encryption and decryption.

• Data Delivery: data transmission over 802.11 is not 100% reliable (the same as Ethernet). Higher layers must deal with detecting and correcting errors.

Intracell Services (used after association has taken place):

Page 74: Mac  layer

74

Broadband WirelessThis section is about wireless local loop or wireless MAN.Comparison of 802.11 and 802.16: • They were all designed in providing high-bandwidth wireless communication.• 802.16 provides service to buildings. Buildings are not mobile (a

simplification). Building can have more than one computer in them (a complication). Building owners are willing to spend more money for communication gear than individual notebook owners, so 802.16 can use full-duplex communication.

• 802.16 runs over part of a city, covering distance of several kilometers, which means the perceived power at the base station can vary widely, which affects signal-to-noise ratio, which, dictates multiple modulation schemes. Open communication over a city means that security and privacy are essential and mandatory.

• Each 802.16 cell has many more users than an 802.11 cell, forcing 802.16 to operate in 10-to-66 GHz frequency range, which has different physical properties and thus requires a different physical layer. Also, error handling is more important.

• 802.16 is expected to support telephony and multimedia usage for both residential and business use.

• In short, 802.11 was designed to be mobile Ethernet, whereas 802.16 was designed to be wireless, but stationary, cable television.

Page 75: Mac  layer

75

The 802.16 Protocol Stack

The 802.16 MAC sublayer uses the base station to manage the channel allocation. It is connection-oriented in order to provide quality-of-service guarantees for telephony and multimedia communication.

Page 76: Mac  layer

76

The 802.16 Physical Layer

The 802.16 transmission environment.

Page 77: Mac  layer

77

The 802.16 Physical Layer (2)

Frames and time slots for time division duplexing.

Page 78: Mac  layer

78

The 802.16 MAC Sublayer Protocol

Service Classes

• Constant bit rate service

• Real-time variable bit rate service

• Non-real-time variable bit rate service

• Best efforts service

Page 79: Mac  layer

79

The 802.16 Frame Structure

(a) A generic frame. (b) A bandwidth request frame.

Page 80: Mac  layer

80

Bluetooth• In 1994, Ericsson, IBM, Intel, Nokia, and Toshiba formed SIG

to develop a wireless standard for interconnecting computing and communication devices and accessories using short-range, low-power, inexpensive wireless radios. This project was named Bluetooth, after Harald Blaatand (Bluetooth) II (940-981), a Viking king who unified Denmark and Norway, also without cables.

• The original idea was just to get rid of the cables between devices, but it soon began to expand in scope and encroach on the area of wireless LANs. It creates competition with 802.11 and even interferes with 802.11 electronically (using the same 2.4-GHz ISM band).

• In 1999, Bluetooth SIG issued a 1500-page specification V1.0 (from physical to application layers), part of which (physical and data-link layers) was adopted by IEEE as the basis for a wireless PAN (Personal Area Network) standard, 802.15.1 (2002).

Page 81: Mac  layer

81

Bluetooth Architecture

a) The basic unit of a Bluetooth system is a piconet, which consists of a master node and up to seven active slave nodes within a distance of 10 meters.

b) There can be up to 255 parked nodes in a piconet, which are devices that the master has switched to a low-power state to reduce the drain on their batteries.

c) All communication is between the master and a slave, using TDM; no direct slave-slave communication is possible.

d) Multiple piconets can exist in the same room and be connected via a bridge node. An interconnected collection of piconet is called a scatternet.

Page 82: Mac  layer

82

Bluetooth Applications

The Bluetooth profiles.

Conway’s law: if you assign n people to write a compiler, you will get an n-pass compiler, or more generally, the software structure mirrors the structure of the group that produced it.

Page 83: Mac  layer

83

The Bluetooth Protocol Stack

The 802.15 version of the Bluetooth protocol architecture.

Page 84: Mac  layer

84

The Bluetooth Frame Structure

A typical Bluetooth data frame.

Page 85: Mac  layer

85

Data Link Layer Switching

• Bridges from 802.x to 802.y• Local Internetworking• Spanning Tree Bridges• Remote Bridges• Repeaters, Hubs, Bridges, Switches, Routers, Gateways• Virtual LANs

Page 86: Mac  layer

86

Data Link Layer Switching

LANs can be connected by devices called bridges, which operate in the data link layer. This means that bridges do not examine the network layer header and can thus copy IPv4, IPv6, AppleTalk, ATM, IPX, and OSI packets equally well.

Most bridges connect 802 LANs, so we will concentrate primarily on 802 bridges.

Reasons why a single organization may end up with multiple LANs and bridges are needed: 1. Different goals of different departments. 2. Geographical distance (cheaper and shorter delay). 3. Accommodation of the heavy load. 4. The matter of reliability and security.

Page 87: Mac  layer

87

Data Link Layer Switching

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

Page 88: Mac  layer

88

Hubs and Switches

Page 89: Mac  layer

89

Bridgesa) Ability to expand beyond single LAN

b) Provide interconnection to other LANs/WANs

c) Use Bridge or router

d) Bridge is simpler

– Connects similar LANs– Identical protocols for physical and link layers– Minimal processing

e) Router more general purpose

– Interconnect various LANs and WANs– see later

Page 90: Mac  layer

90

Why Bridge?

a)Reliability

b)Performance

c)Security

d)Geography

e)Org Structure

f)To accommodate load

Page 91: Mac  layer

91

Functions of a Bridgea) Read all frames transmitted on one LAN and accept those

addressed to any station on the other LAN

b) Using MAC protocol for second LAN, retransmit each frame

c) Do the same the other way round

Page 92: Mac  layer

92

Bridge Operation

Page 93: Mac  layer

93

Bridge Design Aspectsa) No modification to content or format of frame

b) No encapsulation

c) Exact bitwise copy of frame

d) Minimal buffering to meet peak demand

e) Contains routing and address intelligence

– Must be able to tell which frames to pass– May be more than one bridge to cross

f) May connect more than two LANs

g) Bridging is transparent to stations

– Appears to all stations on multiple LANs as if they are on one single LAN

Page 94: Mac  layer

94

Bridge Protocol Architecturea) IEEE 802.1D

b) MAC level

– Station address is at this levelc) Bridge does not need LLC layer

– It is relaying MAC framesd) Can pass frame over external comms system

– e.g. WAN link– Capture frame– Encapsulate it– Forward it across link– Remove encapsulation and forward over LAN link

Page 95: Mac  layer

95

Connection of Two LANs

Page 96: Mac  layer

96

Fixed Routinga) Complex large LANs need alternative routes

– Load balancing– Fault tolerance

b) Bridge must decide whether to forward frame

c) Bridge must decide which LAN to forward frame on

d) Routing selected for each source-destination pair of LANs

– Done in configuration– Usually least hop route– Only changed when topology changes

Page 97: Mac  layer

97

Multiple LANs

Page 98: Mac  layer

98

Spanning Tree

a)Bridge automatically develops routing table

b)Automatically update in response to changes

c)Frame forwarding

d)Address learning

e)Loop resolution

Page 99: Mac  layer

99

Frame forwardinga) Maintain forwarding database for each port

– List station addresses reached through each portb) For a frame arriving on port X:

– Search forwarding database to see if MAC address is listed for any port except X– If address not found, forward to all ports except X– If address listed for port Y, check port Y for blocking or forwarding state

• Blocking prevents port from receiving or transmitting

– If not blocked, transmit frame through port Y

Page 100: Mac  layer

100

Address Learninga) Can preload forwarding database

b) Can be learned

c) When frame arrives at port X, it has come form the LAN attached to port X

d) Use the source address to update forwarding database for port X to include that address

e) Timer on each entry in database

f) Each time frame arrives, source address checked against forwarding database

Page 101: Mac  layer

101

Spanning Tree Algorithma) Address learning works for tree layout

– i.e. no closed loopsb) For any connected graph there is a spanning tree that maintains connectivity but contains no closed loops

c) Each bridge assigned unique identifier

d) Exchange between bridges to establish spanning tree

Page 102: Mac  layer

102

Loop of Bridges

Page 103: Mac  layer

103

Bridges from 802.x to 802.y

Operation of a LAN bridge from 802.11 to 802.3.

Page 104: Mac  layer

104

Bridges from 802.x to 802.y (2)

The IEEE 802 frame formats. The drawing is not to scale.

General problems: 1. Different frame formats. Solution: reformatting. 2. Different data rates (802.3z 1Gbps and 802.11b 11Mbps). Solution:

buffering. 3. Different maximum frame length (e.g., 802.3 1518 bytes, 802.11 2312 bytes,

802.16 1000 (?) bytes, and 802.15.1 2744 bytes). No solution.4. Security: 802.11 and 802.16 support encryption but 802.3 does not. 5. Quality of service: 802.11 and 802.16 have but 802.3 does not.

Page 105: Mac  layer

105

Local Internetworking

A configuration with four LANs and two bridges.

When a frame arrives, a bridge must decide whether to discard or forward it, and if the latter, on which LAN to put the frame. This decision is made by looking up the destination address in a big (hash) table inside the bridge.

Multiple LANs connected by transparent bridges do not need any change on their hardware and software. Transparent bridges operate in promiscuous mode, accepting every frame transmitted on all the LANs to which it is attached.

Page 106: Mac  layer

106

Local Internetworking (2)A bridge maintains a table of destination addresses as follows: 1. Initially all the hash tables are empty. 2. Every incoming frame for an unknown destination is output on all the LANs to

which the bridge is connected except the one it arrived on (flooding). 3. By looking at the incoming frame's source address (backward learning), a

bridge is able to know which machine is accessible on which LAN, so it make an entry in its hash table linking the source machine with the incoming LAN.

4. To handle dynamic topologies, whenever a hash table entry is made, the arrival time of the frame is noted in the entry. The entry time is updated whenever a frame from the address in that entry arrives.

5. Periodically, a process in the bridge scans the hash table and purges all entries more than a few minutes old.

Routing procedure: 1. If destination and source LANs are the same, discard the frame. 2. If the destination and source LANs are different, forward the frame. 3. If the destination LAN is unknown, use flooding. Special purpose VLSI chips exist to do the lookup and update the table entry, all

in a few microsecond.

Page 107: Mac  layer

107

Spanning Tree BridgesTo increase reliability, some sites use two or more bridges in parallel between pairs of LANs. This arrangement creates loops in the topology. What happens if a frame with an unknown destination arrives ?

The solution is for the bridges to communicate with each other and overlay the actual topology with a spanning tree that reaches every LAN. Large networks can be partitioned into multiple communicating spanning trees.

Page 108: Mac  layer

108

Spanning Tree Bridges (2)

(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree.

Page 109: Mac  layer

109

Remote Bridges

Remote bridges can be used to interconnect distant LANs.

Page 110: Mac  layer

110

Repeaters, Hubs, Bridges, Switches, Routers and Gateways

(a) Which device is in which layer.

(b) Frames, packets, and headers.

Page 111: Mac  layer

111

Hubs, Bridges, and Switches

(a) A hub. Different from repeater, hubs do not amplify the incoming signals and are designed to hold multiple line cards each with multiple inputs (one collision domain). Like repeater, hubs do not examine the 802 addresses or use them in any way.

(b) A bridge. A bridge has line cards (like a hub) for different network types and speeds. However, each line is its own collision domain, in contrast to a hub.

(c) A switch. A switch is similar to bridge in its routing on frame addresses, but is often used to connect individual computers (no collision).

Page 112: Mac  layer

112

Configure LANs logically rather than physically

A building with centralized wiring using hubs and a switch.

Page 113: Mac  layer

113

Virtual LANs

a) Four physical LANs organized into two VLANs, gray and white, by two VLAN-aware bridges. A VLAN-aware bridge maintains configuration tables which tell which VLANs are accessible via which lines.

b) The same 15 machines organized into two VLANs by VLAN-aware switches.

Page 114: Mac  layer

114

The IEEE 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.

Page 115: Mac  layer

115

The IEEE 802.1Q Standard (2)

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Page 116: Mac  layer

116

Summary

Channel allocation methods and systems for a common channel.