Top Banner
MAC & PHYSICAL LAYER
67

Mac & Physical Layer

May 15, 2017

Download

Documents

Thufail Agoesta
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mac & Physical Layer

MAC & PHYSICAL LAYER

Page 2: Mac & Physical Layer

SM241013 - Pengantar Sistem Telekomunikasi

Semester genap 2006-2007

Standar WLAN

Page 3: Mac & Physical Layer

6: Wireless and Mobile Networks 6-3

802.11 LAN architecture wireless host communicates

with base station base station = access point

(AP) Basic Service Set (BSS) (aka

“cell”) in infrastructure mode contains: wireless hosts access point (AP): base

station ad hoc mode: hosts only

BSS 1

BSS 2

Internet

hub, switchor routerAP

AP

Page 4: Mac & Physical Layer

6: Wireless and Mobile Networks 6-4

IEEE 802.11: multiple access• avoid collisions: 2+ nodes transmitting at same time• 802.11: CSMA - sense before transmitting

– don’t collide with ongoing transmission by other node• 802.11: no collision detection!

– difficult to receive (sense collisions) when transmitting due to weak received signals (fading)

– can’t sense all collisions in any case: hidden terminal, fading– goal: avoid collisions: CSMA/C(ollision)A(voidance)

AB

CA B C

A’s signalstrength

space

C’s signalstrength

Page 5: Mac & Physical Layer

6: Wireless and Mobile Networks 6-5

IEEE 802.11 MAC Protocol: CSMA/CA

802.11 sender1 if sense channel idle for DIFS then

transmit entire frame (no CD)2 if sense channel busy then

start random backoff timetimer counts down while channel idletransmit when timer expiresif no ACK, increase random backoff interval, repeat 2

802.11 receiver- if frame received OK return ACK after SIFS (ACK needed due to hidden

terminal problem)

sender receiver

DIFS

data

SIFS

ACK

Page 6: Mac & Physical Layer

6: Wireless and Mobile Networks 6-6

Avoiding collisions (more)idea: allow sender to “reserve” channel rather than random access of

data frames: avoid collisions of long data frames• sender first transmits small request-to-send (RTS) packets to BS using

CSMA– RTSs may still collide with each other (but they’re short)

• BS broadcasts clear-to-send CTS in response to RTS• CTS heard by all nodes

– sender transmits data frame– other stations defer transmissions

avoid data frame collisions completely using small reservation packets!

Page 7: Mac & Physical Layer

6: Wireless and Mobile Networks 6-7

Collision Avoidance: RTS-CTS exchange

APA B

time

RTS(A)RTS(B)

RTS(A)

CTS(A) CTS(A)

DATA (A)

ACK(A) ACK(A)

reservation collision

defer

Page 8: Mac & Physical Layer

6: Wireless and Mobile Networks 6-8

framecontrol duration address

1address

2address

4address

3 payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seqcontrol

802.11 frame: addressing

Address 2: MAC addressof wireless host or AP transmitting this frame

Address 1: MAC addressof wireless host or AP to receive this frame

Address 3: MAC addressof router interface to which AP is attached

Address 4: used only in ad hoc mode

Page 9: Mac & Physical Layer

6: Wireless and Mobile Networks 6-9

Internetrouter

AP

H1 R1

AP MAC addr H1 MAC addr R1 MAC addr

address 1 address 2 address 3

802.11 frame

R1 MAC addr H1 MAC addr dest. address source address

802.3 frame

802.11 frame: addressing

Page 10: Mac & Physical Layer

6: Wireless and Mobile Networks 6-10

framecontrol duration address

1address

2address

4address

3 payload CRC

2 2 6 6 6 2 6 0 - 2312 4seq

control

Type FromAPSubtype To

APMore frag WEPMore

dataPower

mgtRetry RsvdProtocolversion

2 2 4 1 1 1 1 1 11 1

802.11 frame: moreduration of reserved transmission time (RTS/CTS)

frame seq #(for RDT)

frame type(RTS, CTS, ACK, data)

Page 11: Mac & Physical Layer

6: Wireless and Mobile Networks 6-11

hub or switch

AP 2

AP 1

H1 BBS 2

BBS 1

802.11: mobility within same subnet

router• H1 remains in same IP

subnet: IP address can remain same

• switch: which AP is associated with H1?– self-learning (Ch. 5): switch

will see frame from H1 and “remember” which switch port can be used to reach H1

Page 12: Mac & Physical Layer

6: Wireless and Mobile Networks 6-12

802.11: advanced capabilitiesRate Adaptation

10 20 30 40SNR(dB)

BE

R

10-1

10-2

10-3

10-5

10-6

10-7

10-4

QAM256 (8 Mbps)QAM16 (4 Mbps)BPSK (1 Mbps)

operating point

1. SNR decreases, BER increase as node moves away from base station

2. When BER becomes too high, switch to lower transmission rate but with lower BER

Base station, mobile dynamically change transmission rate (physical layer modulation technique) as mobile moves, SNR varies

Page 13: Mac & Physical Layer

6: Wireless and Mobile Networks 6-13

802.11: advanced capabilitiesPower Management node-to-AP: “I am going to sleep until next beacon frame”

AP knows not to transmit frames to this node node wakes up before next beacon frame

beacon frame: contains list of mobiles with AP-to-mobile frames waiting to be sent node will stay awake if AP-to-mobile frames to be sent; otherwise

sleep again until next beacon frame

Page 14: Mac & Physical Layer

IEEE 802.11 Media Access Control (MAC)

DIFS: Distributed Inter-Frame SpacingSIFS: Short Inter-Frame Spacingack: Acknowledgement

Carrier-sense multiple access protocol with collision avoidance (CSMA/CS)

Page 15: Mac & Physical Layer

14.15

Figure 14.4 CSMA/CA flowchart

Page 16: Mac & Physical Layer

14.16

Figure 14.5 CSMA/CA and NAV

Page 17: Mac & Physical Layer

14.17

Figure 14.6 Example of repetition interval

Page 18: Mac & Physical Layer

14.18

Figure 14.7 Frame format

Page 19: Mac & Physical Layer

14.19

Table 14.1 Subfields in FC field

Page 20: Mac & Physical Layer

14.20

Figure 14.8 Control frames

Page 21: Mac & Physical Layer

14.21

Table 14.2 Values of subfields in control frames

Page 22: Mac & Physical Layer

14.22

Table 14.3 Addresses

Page 23: Mac & Physical Layer

14.23

Figure 14.9 Addressing mechanisms

Page 24: Mac & Physical Layer

14.24

Figure 14.10 Hidden station problem

Page 25: Mac & Physical Layer

14.25

The CTS frame in CSMA/CA handshake can prevent collision from a hidden station.

Note

Page 26: Mac & Physical Layer

14.26

Figure 14.11 Use of handshaking to prevent hidden station problem

Page 27: Mac & Physical Layer

14.27

Figure 14.12 Exposed station problem

Page 28: Mac & Physical Layer

14.28

Figure 14.13 Use of handshaking in exposed station problem

Page 29: Mac & Physical Layer

14.29

Table 14.4 Physical layers

Page 30: Mac & Physical Layer

14.30

Figure 14.14 Industrial, scientific, and medical (ISM) band

Page 31: Mac & Physical Layer

14.31

Figure 14.15 Physical layer of IEEE 802.11 FHSS

Page 32: Mac & Physical Layer

14.32

Figure 14.16 Physical layer of IEEE 802.11 DSSS

Page 33: Mac & Physical Layer

14.33

Figure 14.17 Physical layer of IEEE 802.11 infrared

Page 34: Mac & Physical Layer

14.34

Figure 14.18 Physical layer of IEEE 802.11b

Page 35: Mac & Physical Layer

Logical Link Control Layer (LLC)• Specified by ISO/IEC 8802-2 (ANSI/IEEE 802.2)• purpose: exchange data between users across LAN using 802-based MAC

controlled link• provides addressing and data link control, independent of topology,

medium, and chosen MAC access method

LLC’s protocol data unit (PDU)SAP: service address point

LLC’s functionalities

Data to higher level protocols

Info: carries user dataSupervisory: carries flow/error controlUnnumbered: carries protocol control data

SourceSAP

Page 36: Mac & Physical Layer

Logical Link Control Layer Services• A Unacknowledged connectionless service

– no error or flow control - no ack-signal usage– unicast (individual), multicast, broadcast addressing– higher levels take care or reliability - thus fast for instance for TCP

• B Connection oriented service– supports unicast only– error and flow control for lost/damaged data packets by cyclic

redundancy check (CRC)• C Acknowledged connectionless service

– ack-signal used– error and flow control by stop-and-wait ARQ– faster setup than for B

Page 37: Mac & Physical Layer

TPC/IP send data packet

LLC constructs PDU by adding a control header

Controlheader

MAC lines up packets using carriersense multiple access (CSMA)

SAP (service access point)

MAC frame withnew control fields

PHY layer transmits packetusing a modulation method(DSSS, OFDM, IR, FHSS)

A TCP/IP packet in 802.11

Traffic to thetarget BSS / ESS

*BDU: protocol data unit

Page 38: Mac & Physical Layer
Page 39: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.39

IEEE standard 802.11mobile terminal

access point

server

fixed terminal

application

TCP

802.11 PHY

802.11 MAC

IP

802.3 MAC

802.3 PHY

application

TCP

802.3 PHY

802.3 MAC

IP

802.11 MAC

802.11 PHY

LLC

infrastructure network

LLC LLC

Page 40: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.40

802.11 - Layers and functions•PLCP Physical Layer Convergence Protocol

– clear channel assessment signal (carrier sense)

•PMD Physical Medium Dependent

– modulation, coding•PHY Management

– channel selection, MIB•Station Management

– coordination of all management functions

PMD

PLCP

MAC

LLC

MAC Management

PHY Management

•MAC– access mechanisms,

fragmentation, encryption •MAC Management

– synchronization, roaming, MIB, power management

PHY

DLC

Stati

on M

anag

emen

t

Page 41: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.41

802.11 - Physical layer• 3 versions: 2 radio (typ. 2.4 GHz), 1 IR

– data rates 1 or 2 Mbit/s• FHSS (Frequency Hopping Spread Spectrum)

– spreading, despreading, signal strength, typ. 1 Mbit/s– min. 2.5 frequency hops/s (USA), two-level GFSK modulation

• DSSS (Direct Sequence Spread Spectrum)– DBPSK modulation for 1 Mbit/s (Differential Binary Phase Shift Keying),

DQPSK for 2 Mbit/s (Differential Quadrature PSK)– preamble and header of a frame is always transmitted with 1 Mbit/s,

rest of transmission 1 or 2 Mbit/s– chipping sequence: +1, -1, +1, +1, -1, +1, +1, +1, -1, -1, -1 (Barker code)– max. radiated power 1 W (USA), 100 mW (EU), min. 1mW

• Infrared– 850-950 nm, diffuse light, typ. 10 m range– carrier detection, energy detection, synchonization

Page 42: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.42

FHSS PHY packet format

synchronization SFD PLW PSF HEC payload

PLCP preamble PLCP header

80 16 12 4 16 variable bits

• Synchronization– synch with 010101... pattern

• SFD (Start Frame Delimiter)– 0000110010111101 start pattern

• PLW (PLCP_PDU Length Word)– length of payload incl. 32 bit CRC of payload, PLW < 4096

• PSF (PLCP Signaling Field)– data of payload (1 or 2 Mbit/s)

• HEC (Header Error Check)– CRC with x16+x12+x5+1

Page 43: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.43

DSSS PHY packet format

synchronization SFD signal service HEC payload

PLCP preamble PLCP header

128 16 8 8 16 variable bitslength

16

• Synchronization– synch., gain setting, energy detection, frequency offset compensation

• SFD (Start Frame Delimiter)– 1111001110100000

• Signal– data rate of the payload (0A: 1 Mbit/s DBPSK; 14: 2 Mbit/s DQPSK)

• Service Length– future use, 00: 802.11 compliant length of the payload

• HEC (Header Error Check)– protection of signal, service and length, x16+x12+x5+1

Page 44: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.44

802.11 - MAC layer I - DFWMAC• Traffic services

– Asynchronous Data Service (mandatory)• exchange of data packets based on “best-effort”• support of broadcast and multicast

– Time-Bounded Service (optional)• implemented using PCF (Point Coordination Function)

• Access methods– DFWMAC-DCF CSMA/CA (mandatory)

• collision avoidance via randomized „back-off“ mechanism• minimum distance between consecutive packets• ACK packet for acknowledgements (not for broadcasts)

– DFWMAC-DCF w/ RTS/CTS (optional)• Distributed Foundation Wireless MAC• avoids hidden terminal problem

– DFWMAC- PCF (optional)• access point polls terminals according to a list

Page 45: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.45

802.11 - MAC layer II• Priorities

– defined through different inter frame spaces– no guaranteed, hard priorities– SIFS (Short Inter Frame Spacing)

• highest priority, for ACK, CTS, polling response– PIFS (PCF IFS)

• medium priority, for time-bounded service using PCF– DIFS (DCF, Distributed Coordination Function IFS)

• lowest priority, for asynchronous data service

t

medium busy SIFSPIFSDIFSDIFS

next framecontention

direct access if medium is free DIFS

Page 46: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.46

t

medium busy

DIFSDIFS

next frame

contention window(randomized back-offmechanism)

802.11 - CSMA/CA access method I

– station ready to send starts sensing the medium (Carrier Sense based on CCA, Clear Channel Assessment)

– if the medium is free for the duration of an Inter-Frame Space (IFS), the station can start sending (IFS depends on service type)

– if the medium is busy, the station has to wait for a free IFS, then the station must additionally wait a random back-off time (collision avoidance, multiple of slot-time)

– if another station occupies the medium during the back-off time of the station, the back-off timer stops (fairness)

slot timedirect access if medium is free DIFS

Page 47: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.47

802.11 - competing stations - simple version

t

busy

boe

station1

station2

station3

station4

station5

packet arrival at MAC

DIFSboe

boe

boe

busy

elapsed backoff time

bor residual backoff time

busy medium not idle (frame, ack etc.)

bor

bor

DIFS

boe

boe

boe bor

DIFS

busy

busy

DIFSboe busy

boe

boe

bor

bor

Page 48: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.48

802.11 - CSMA/CA access method II• Sending unicast packets

– station has to wait for DIFS before sending data– receivers acknowledge at once (after waiting for SIFS) if the packet

was received correctly (CRC)– automatic retransmission of data packets in case of transmission

errors

t

SIFS

DIFS

data

ACK

waiting time

otherstations

receiver

sender data

DIFS

contention

Page 49: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.49

802.11 - DFWMAC• Sending unicast packets

– station can send RTS with reservation parameter after waiting for DIFS (reservation determines amount of time the data packet needs the medium)

– acknowledgement via CTS after SIFS by receiver (if ready to receive)– sender can now send data at once, acknowledgement via ACK– other stations store medium reservations distributed via RTS and CTS

t

SIFS

DIFS

data

ACK

defer access

otherstations

receiver

sender data

DIFS

contention

RTS

CTSSIFS SIFS

NAV (RTS)NAV (CTS)

Page 50: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.50

Fragmentation

t

SIFS

DIFS

data

ACK1

otherstations

receiver

senderfrag1

DIFS

contention

RTS

CTSSIFS SIFS

NAV (RTS)NAV (CTS)

NAV (frag1)NAV (ACK1)

SIFS ACK2

frag2

SIFS

Page 51: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.51

DFWMAC-PCF I

PIFS

stations‘NAV

wirelessstations

point coordinator

D1

U1

SIFS

NAV

SIFS D2

U2

SIFS

SIFS

SuperFramet0

medium busy

t1

Page 52: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.52

DFWMAC-PCF II

tstations‘NAV

wirelessstations

point coordinator

D3

NAV

PIFS D4

U4

SIFS

SIFS CFend

contentionperiod

contention free period

t2 t3 t4

Page 53: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.53

802.11 - Frame format• Types

– control frames, management frames, data frames• Sequence numbers

– important against duplicated frames due to lost ACKs • Addresses

– receiver, transmitter (physical), BSS identifier, sender (logical)• Miscellaneous

– sending time, checksum, frame control, data

FrameControl

DurationID

Address1

Address2

Address3

SequenceControl

Address4 Data CRC

2 2 6 6 6 62 40-2312bytes

version, type, fragmentation, security, ...

Page 54: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.54

MAC address formatscenario to DS from

DSaddress 1 address 2 address 3 address 4

ad-hoc network 0 0 DA SA BSSID -infrastructurenetwork, from AP

0 1 DA BSSID SA -

infrastructurenetwork, to AP

1 0 BSSID SA DA -

infrastructurenetwork, within DS

1 1 RA TA DA SA

DS: Distribution SystemAP: Access PointDA: Destination AddressSA: Source AddressBSSID: Basic Service Set IdentifierRA: Receiver AddressTA: Transmitter Address

Page 55: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.55

802.11 - MAC management• Synchronization

– try to find a LAN, try to stay within a LAN– timer etc.

• Power management– sleep-mode without missing a message– periodic sleep, frame buffering, traffic measurements

• Association/Reassociation– integration into a LAN– roaming, i.e. change networks by changing access points – scanning, i.e. active search for a network

• MIB - Management Information Base– managing, read, write

Page 56: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.56

Synchronization using a Beacon (infrastructure)

beacon interval

tmedium

Access Point

busy

B

busy busy busy

B B B

value of the timestamp B beacon frame

Page 57: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.57

Synchronization using a Beacon (ad-hoc)

tmedium

station1

busy

B1

beacon interval

busy busy busy

B1

value of the timestamp B beacon frame

station2

B2 B2

random delay

Page 58: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.58

Power management• Idea: switch the transceiver off if not needed• States of a station: sleep and awake• Timing Synchronization Function (TSF)

– stations wake up at the same time• Infrastructure

– Traffic Indication Map (TIM)• list of unicast receivers transmitted by AP

– Delivery Traffic Indication Map (DTIM)• list of broadcast/multicast receivers transmitted by AP

• Ad-hoc– Ad-hoc Traffic Indication Map (ATIM)

• announcement of receivers by stations buffering frames• more complicated - no central AP• collision of ATIMs possible (scalability?)

Page 59: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.59

Power saving with wake-up patterns (infrastructure)

TIM interval

t

medium

accesspoint

busy

D

busy busy busy

T T D

T TIM D DTIM

DTIM interval

BB

B broadcast/multicast

station

awake

p PS poll

p

d

d

d data transmissionto/from the station

Page 60: Mac & Physical Layer

ICS 243E - Ch 5 Wireless LansWinter 2001 5.60

Power saving with wake-up patterns (ad-hoc)

awake

A transmit ATIM D transmit datat

station1

B1 B1

B beacon frame

station2

B2 B2

random delay

A

a

D

d

ATIMwindow beacon interval

a acknowledge ATIM d acknowledge data

Page 61: Mac & Physical Layer
Page 62: Mac & Physical Layer

Spread Spectrum

• Unlicensed usage (ISM band - 915 MHz, 2.4 GHz, 5.8 GHz))

• No line of sight requirement (indoor)• High link reliability• Built-in transmission

security• Two techniques used:

– Direct Sequence– Frequency Hopping

Page 63: Mac & Physical Layer

Multiple Access Methods

FREQUENCY

TIME

User 3

User 2

User 1

• Multiple users share the same frequency channel sequentially

• Time slot sequence repeats over and over

TDMA

TIME

FREQUENCY

CODE

CDMAalso known as “Spread Spectrum”

User 3

User 2

User 1

• Channel is “spread” over wide frequency band

• Many users share the same frequency band at the same time

• Each user is assigned a unique “code” to identify and separatethem

FREQUENCY

TIME

FDMA

1 2 3

Each user assigned a different frequency - like ordinary radio

Page 64: Mac & Physical Layer

Spread Spectrum Concept

Page 65: Mac & Physical Layer

Frequency Hopping Spread Spectrum

• A narrowband carrier is shifted in discrete increments of frequency

• The frequency remains constant for a specified time duration, then signal changes or hops to a different frequency

Page 66: Mac & Physical Layer

Direct Sequence Spread Spectrum (DSSS)

• Each bit is represented by multiple bits using the spreading code

• Spreading code spreads signal across wider frequency band

• Performance similar to FHSS

Page 67: Mac & Physical Layer

• Spreading: Information signal (i.e. a “symbol”) is multiplied by a unique, high rate digital code before transmission.

• Code bits are called “Chips”. • Sequence is called “Barker Code”

Source andChannelCoding

RFModulator

CodeGenerator

X

Multiplier

Code Bits (Chips)

Digital Signal (Bits)

FrequencySpectrum

f

“Spread” FrequencySpectrum

f

Spread Spectrum – Direct Sequence Transmitter