Multiple access layer - Rutgers Universitybadri/352dir/Spring04/... · Satellite system: long prop....

Preview:

Citation preview

1

Multiple access layer

2

Medium Access Sublayer (5.3)

Network Layer

Data Link Layer

Physical Layer

Medium Access Sublayer

3

Medium Access Sublayer (cont’d)

Medium access (MAC) sublayer is not important on point-to-point linksThe MAC sublayer is only used in broadcast or shared channel networksExamples: Satellite, Ethernet, Wireless, Cellular

4

Contents

Channel partitioning protocolsCellular networks

Random access protocolsIEEE 802 LANs, IEEE 802.11 Wireless LANS

5

Channel partitioning Protocols

Static and predetermined allocation of channel access: independent of user activityIdle users may be assigned to the channel, in which case channel capacity is wastedExamples: TDMA, FDMA, CDMA

6

Multiple Access Techniques TDMA/FDMA/CDMA

Allow multiple users to share a common transmission mediumTechniques

TDMA: Time division Multiple Access– The spectrum usage is divided in the time domain

People take turns using the spectrum (amount of time allocated is the slot time)

FDMA: Frequency division multiple access– The spectrum usage is divided in the frequency domain

People are assigned portions of the spectrum for their own use (portion of the spectrum is the channel)

CDMA: Code Division Multiple Access– The entire spectrum is used by everyone but in a coded format– The signal is spread and only the receiver who knows the code can recover the

signal– Analogy: people talking in different languages all at the same time

7

Spread Spectrum Techniques (Types of CDMA)

Two types of techniques existDS-CDMA and Frequency hopping CDMADirect sequence CDMA (DS-CDMA or DSSS)Each bit of the signal is replaced by a code (longer bit sequence)

A narrow band signal (R bps) is multiplied by a wideband signal (W bps)Receiver who knows the code will recover the signal; for the rest it appears as random noiseUsed in IEEE 802.11 Wavelan

8

Example

1

0

1010 1010

0101 1010

Data

Code

Output

Receiver uses the code and the received signal to recoverOriginal data

9

Frequency hopping

Frequency sequence CDMA (FS-CDMA or FSSS)A single user’s signal is spread out over a number of channels

(1011) is transmitted as f1, f9, f11, f13The receiver who tunes to f1, f9, f11 and f13 in sequence will be able to recover the bit streamUsed in Blue tooth wireless technology

10

Random access protocols (5.3.2)

Single channel shared by a large number of hostsNo coordination between hostsControl is completely distributedExamples: ALOHA, CSMA, CSMA/CD

11

Contention Access (cont’d)

Advantages:Short delay for bursty trafficSimple (due to distributed control)Flexible to fluctuations in the number of hostsFairness

12

Contention Access (cont’d)

Disadvantages:Low channel efficiency with a large number of hostsNot good for continuous traffic (e.g., voice)Cannot support priority trafficHigh variance in transmission delays

13

Contention Access Methods

Pure ALOHASlotted ALOHACSMA

1-Persistent CSMANon-Persistent CSMAP-Persistent CSMA

CSMA/CD

14

Pure ALOHA

Originally developed for ground-based packet radio communications in 1970Goal: let users transmit whenever they have something to send

15

The Pure ALOHA Algorithm

1. Transmit whenever you have data to send2. Listen to the broadcast

Because broadcast is fed back, the sending host can always find out if its packet was destroyed just by listening to the downward broadcast one round-trip time after sending the packet

3. If the packet was destroyed, wait a random amount of time and send it again

The waiting time must be random to prevent the same packets from colliding over and over again

16

Pure ALOHA (cont’d)

Note that if the first bit of a new packet overlaps with the last bit of a packet almost finished, both packets are totally destroyed.

t : one packet transmission timeVulnerable period: 2t

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

t

Vulnerable

17

Pure ALOHA (cont’d)

Due to collisions and idle periods, pure ALOHA is limited to approximately 18% throughput in the best caseCan we improve this?

18

Slotted ALOHA

Slotted ALOHA cuts the vulnerable period for packets from 2t to t.This doubles the best possible throughput from 18.4% to 36.8%How?

Time is slotted. Packets must be transmitted within a slot

19

The Slotted ALOHA Algorithm

1. If a host has a packet to transmit, it waits until the beginning of the next slot before sending

2. Listen to the broadcast and check if the packet was destroyed

3. If there was a collision, wait a random number of slots and try to send again

20

CSMA

We could achieve better throughput if we could listen to the channel before transmitting a packetThis way, we would stop avoidable collisions.To do this, we need “Carrier Sense Multiple Access,” or CSMA, protocols

21

Assumptions with CSMA Networks

1. Constant length packets2. No errors, except those caused by collisions3. No capture effect4. Each host can sense the transmissions of all

other hosts5. The propagation delay is small compared to

the transmission time

22

CSMA (cont’d)

There are several types of CSMA protocols:

1-Persistent CSMANon-Persistent CSMAP-Persistent CSMA

23

1-Persistent CSMA

Sense the channel.If busy, keep listening to the channel and transmit immediately when the channel becomes idle.If idle, transmit a packet immediately.

If collision occurs,Wait a random amount of time and start over again.

24

1-Persistent CSMA (cont’d)

The protocol is called 1-persistent because the host transmits with a

probability of 1 whenever it finds the channel idle.

25

The Effect of Propagation Delayon CSMA

A Bcarrier sense = idle

Transmit a packet

Collision

packet

26

Propagation Delay and CSMA

Contention (vulnerable) period in Pure ALOHA

two packet transmission timesContention period in Slotted ALOHA

one packet transmission timeContention period in CSMA

up to 2 x end-to-end propagation delay

Performance of CSMA > Performance of Slotted ALOHA >

Performance of Pure ALOHA

27

1-Persistent CSMA with Satellite Systems

Satellite system: long prop. delay (270 msec)

Carrier sense makes no sense

It takes 270 msecs to sense the channel, which is a really long time

Vulnerability time = 540 msec(1/2 a second is forever in a network!)

28

1-Persistent CSMA (cont’d)

Even if prop. delay is zero, there will be collisionsExample:

If stations B and C become ready in the middle of A’s transmission, B and C will wait until the end of A’s transmission and then both will begin transmitted simultaneously, resulting in a collision.

If B and C were not so greedy, there would be fewer collisions

29

Non-Persistent CSMA

Sense the channel.If busy, wait a random amount of time and sense the channel againIf idle, transmit a packet immediately

If collision occurswait a random amount of time and start all over again

30

Tradeoff between 1- and Non-Persistent CSMA

If B and C become ready in the middle of A’s transmission,

1-Persistent: B and C collideNon-Persistent: B and C probably do not collide

If only B becomes ready in the middle of A’s transmission,

1-Persistent: B succeeds as soon as A endsNon-Persistent: B may have to wait

31

P-Persistent CSMA

Optimal strategy: use P-Persistent CSMAAssume channels are slottedOne slot = contention period (i.e., one round trip propagation delay)

32

P-Persistent CSMA (cont’d)

1. Sense the channelIf channel is idle, transmit a packet with probability p

– if a packet was transmitted, go to step 2– if a packet was not transmitted, wait one slot and go to step 1

If channel is busy, wait one slot and go to step 1.

2. Detect collisionsIf a collision occurs, wait a random amount of time and go to step 1

33

P-Persistent CSMA (cont’d)

Consider p-persistent CSMA with p=0.5When a host senses an idle channel, it will only send a packet with 50% probabilityIf it does not send, it tries again in the next slot.The average number of tries is:

Σ i (1-p)i p = 1p

8

i=0- 1

34

Comparison of CSMA and ALOHA Protocols

(Number of Channel Contenders)

35

CSMA/CD

In CSMA protocolsIf two stations begin transmitting at the same time, each will transmit its complete packet, thus wasting the channel for an entire packet time

In CSMA/CD protocolsThe transmission is terminated immediately upon the detection of a collisionCD = Collision Detect

36

CSMA/CD

Sense the channelIf idle, transmit immediatelyIf busy, wait until the channel becomes idle

Collision detectionAbort a transmission immediately if a collision is detectedTry again later after waiting a random amount of time

37

CSMA/CD (cont’d)

Carrier sensereduces the number of collisions

Collision detectionreduces the effect of collisions, making the channel ready to use sooner

38

Collision detection time

How long does it take to realize there has been a collision?

Worst case: 2 x end-to-end prop. delay

A B

packet

39

5.5 Ethernet Physical Layer

TransceiverTransceiver Cable

4 Twisted Pairs15 Pin Connectors

Channel LogicManchester Phase Encoding64-bit preamble for synchronization

40

Ethernet Physical Configuration(for thick coaxial cable)

Segments of 500 meters maximumMaximum total cable length of 1500 meters between any two transceiversMaximum of 2 repeaters in any pathMaximum of 100 transceivers per segmentTransceivers placed only at 2.5 meter marks on cable

41

Manchester Encoding

1 bit = high/low voltage signal0 bit = low/high voltage signal

1 0 1 1 0 0Data stream

Encodedbit pattern

42

Ethernet Synchronization

64-bit frame preamble used to synchronize reception7 bytes of 10101010 followed by a byte containing 10101011Manchester encoded, the preamble appears like a sine wave

43

Ethernet: MAC Layer

Data encapsulationFrame FormatAddressingError Detection

Link ManagementCSMA/CDBackoff Algorithm

44

Frame Check Seq.(4 bytes)

MAC Layer Ethernet Frame Format

Destination(6 bytes)

Length (2 bytes)

Data(46-1500 bytes)

Pad

Source(6 bytes)

Multicast bit

45

Ethernet MAC Frame Address Field

Destination and Source Addresses:6 bytes each

Two types of destination addressesPhysical address: Unique for each userMulticast address: Group of usersFirst bit of address determines which type of address is being used

0 = physical address1 = multicast address

46

Ethernet MAC FrameOther Fields

Length Field2 bytes in lengthdetermines length of data payload

Data Field: between 0 and 1500 bytesPad: Filled when Length < 46Frame Check Sequence Field

4 bytesCyclic Redundancy Check (CRC-32)

47

Ethernet Backoff Algorithm:Binary Exponential Backoff

If collision,Choose one slot randomly from 2k slots, where k is the number of collisions the frame has suffered.One contention slot length = 2 x end-to-end propagation delay

This algorithm can adapt to changes in network load.

48

Binary Exponential Backoff (cont’d)

slot length = 2 x end-to-end delay = 50 µs

A B

t=0µs: Assume A and B collide (kA = kB = 1)A, B choose randomly from 21 slots: [0,1]Assume A chooses 1, B chooses 1

t=100µs: A and B collide (kA = kB = 2)A, B choose randomly from 22 slots: [0,3]Assume A chooses 2, B chooses 0

t=150µs: B transmits successfullyt=250µs: A transmits successfully

49

Binary Exponential Backoff (cont’d)

In Ethernet,Binary exponential backoff will allow a maximum of 15 retransmission attemptsIf 16 backoffs occur, the transmission of the frame is considered a failure.

50

Ethernet Performance

51

Ethernet Features and Advantages

1. Passive interface: No active element2. Broadcast: All users can listen3. Distributed control: Each user makes own

decision

SimpleReliable

Easy to reconfigure

52

Ethernet Disadvantages

Lack of priority levels

Cannot perform real-time communication

Security issues

53

Interconnecting LANS

Why not just one big LAN? Limited amount of supportable traffic: on single LAN, all stations must share bandwidth limited length: 802.3 specifies maximum cable length limited number of stations: 802.4/5 have token passing delays at each station

Physical layer extensionRepeaterscopies (amplifies, regenerates) bits between LAN segments

Link Layer extensionsBridgesreceives, stores, forward (when appropriate) packets between LANs has two layers of protocol stack: physical and link-level (media access)

54

Hubs

Acts as a physical layer repeaterFrame on a port broadcast on all other ports

All ports see the same traffic

Hubs used to connect many devices to extend a single ethernet tapSmart hub: can shut down misbehaving ports

55

Bridges (forwarding)

Techniques for forwarding packets flood packets (obvious drawbacks)

router-discovery-like protocol Bridge "observes" traffic and "learns" which stations are attached allows bridge to identify hosts on LAN segment

drawback?

56

Forwarding Algorithm

1. bridge receives every packet transmitted on every attached LAN 2. bridge stores for each packet

physical address of sender port (incoming LAN segment) on which packet was received

3. for each packet received on any port: lookup destination. physical address in table

if not found, flood onto all attached LANs if found, forward only out to specified LAN

4. forwarding table deleted if not refreshed

57

Limitations of Bridges

Do not scaleRequires careful placement of nodesbroadcast does not scale

Learning time Do not accommodate heterogeneity

Different networking technologies cannot be bridged

58

Ethernet Switching

Connect many Ethernet segments or subnets through an “Ethernet switch”Every port acts as a bridgeThe switch maintains a list of devices connected to its portsAllows simultaneous communication between non-overlapping portsMore expensive than hubs or routers (cost is proportional to number of ports)No collisions

to segment 1

to segment 2to segment 3

to segment 4

59

Why Ethernet switching?

LANs may grow very largeThe switch has a very fast backplaneIt can forward frames very quickly to the appropriate subnet

Cheaper than upgrading all host interfaces to use a faster network

60

A Brief Note: Fast Ethernet

IEEE 802.3u100 Mbps EthernetThe MAC sublayer for Fast Ethernet is the same as for normal EthernetPhysical layer is slightly different: no more Manchester encoding (4B5B, 8B6T coding are used instead)Gigabit ethernet already exists, 10 Gpbsethernet (coming)

61

802.11 Wireless Networking (Chapter 5.7.1)

Basically wireless EthernetConnects a number of computers in a wireless LANAd-hoc mode (AHM) as well as Access Point mode (APM) supportedAHM - Only direct communication, no routing functionalityAPM - Computers connected to the Internet via an AP

Typical mode of operationAccess point name refers to a channel; a host connected to an AP tunes to the same channel as the AP

62

802.11 Physical Layer

Operates in the ISM bandLBand 915 to 928 MHz and the SBand 2.4 to 2.4835 Ghz band are used for 802.11

Uses Direct Sequence Spread Spectrum (DSSS)Signal is sent in a “coded”form

Topic of a course in communications

Initial versions were 1 to 2 Mbps. Now 11 Mbps (802.11b) availableFuture 802.11a can provide up to 50 Mbps

Expected to operate in 5.7 Ghz band

63

802.11 DSSS

83 MHz divided into eleven 22 MHz wide stationary channelsAt any point only 3 non-overlapping channels available

Spreading sequence is 11 bit barker word1 is mapped to 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -10 is mapped to -1, 1, -1, -1, 1, -1, -1, -1, 1, 1,1Same sequence is used by all hostsMultiple access problem needs to be solved

Input signal is spread to 22 MHz wide spectrumDifferent modulation schemes used to obtain different rates

BPSK (gives 1 Mbps), QPSK (gives 2 Mbps), QPSK with CCK (gives 11 Mbps at 8 bits per symbol and chip rate of 1.375 Mcps)

64

802.11 Access Control

Carrier sensingIs the medium idle? Wait for an amount of time (IFS), if still idle transmit

IFS = inter frame spacingIs the medium busy? Wait until current txmends, wait (IFS), if idle wait for random amount of time, else wait until current txmends and repeat

(exponential backoff for collisions)

ACKs and immediate response actions can be sent after SIFS (Short IFS) < IFS value used in multiple access control

Idle?

Wait IFS

Idle?

Txmt Data

Have Data

Wait EOTY

Y

Y

Y

N

N Wait IFS

Idle?

decr backoff

N

65

ZX

Problems with Carrier Sensing

Hidden terminal problemZ does not hear X; hence transmits to Y and collides with transmission from XNo carrier does not imply send

Exposed terminal problemW hears Y but can safely transmit to XCarrier may not imply don’t send

Y

Hidden Terminal Problem

ZX Y

Exposed Terminal Problem

W

66

Use of RTS, CTS

Sender sends a small packet RTS (request to send) before sending dataReceiver sends CTS (clear to send)All potential senders hearing RTS waits until a CTS is heard from some receiverIf no CTS, transmitIf CTS, wait for a time for sender to send dataHear RTS, but no CTS, then send

Exposed terminal caseDon’t hear RTS, but CTS receiver is close, don’t send

Hidden terminal case

67

802.11 Issues

Very popular in buildings, public spacesTremendous opportunitiesFree/unlicensed spectrum interference issuesSecurity, privacy, authentication being addedNice features to have

Roaming across networksRemote authenticationMobile access

68

Bluetooth

A cable replacement technologyOperates in the ISM band (2.4Ghz to 2.8 Ghz)Range is 10 cm to 10 meters can be extended to 100 meters by use of power controlData rates up to 1 Mbps (721Kbps)Supposed to be low cost, single chip radioIdeal for connecting devices in close proximity (piconet)

Phone and earpieceComputer and printerCamera and printer/fax etc

Can form personal area networks (piconet and scatternet)

69

Personal area networks

PiconetMaster/slave nodesMaster and up to 7 slavesMaster allocates channels

ScatternetNode may be master in one network and slave in another networkAllows devices to be shared in different networks

70

Bluetooth Radio Link

IEEE 802.11 operates in the same band using DSSSBluetooth uses Frequency Hopping83.5 MHz channel is divided into 79 1-MHz channels

1600 hops per second (stays at one frequency for 625 microsecs)Hopping sequence is 16 or 32Selected by the master based on its MAC addressMaster can connect up to seven slaves to form a piconet

All members of the piconet use the same hopping sequence

71

Bluetooth Packet Format

Access code identifies control packet typeChannel access code, device access code, inquiry access code

Header contains address (3 bits) and packet types (4 bits)Voice packets with different FEC ratesData packets with low bit rate and high bit rate (with varying FEC as well)

AccessCode Header Payload (2744 bits)

54 bits72 bits

72

Connection establishment

Inquiry scan

Inquiry response

Page scan

Slave response

Connection

Inquiry

Page

Master response

Connection

broadcast

Response-FHS

Unicast-DAC

ACK-DAC

FHS-sender

ACK-DAC

73

piconet

A set of bluetooth devices connected to a masterScatternet: a set of piconets

74

Bluetooth Link Formation

Master inquires who is aroundActive slaves respond and the master learns who is around

Master pages slaves and informs them of hopping sequence, active member address

Active slaves get packets when header matches active member addressA link is formed between master and each slave

Inactive slaves can go into “park” state and give up address

Master

SlaveParked slave

Recommended