高级计算机网络-zqfchapter4mac_第1页
高级计算机网络-zqfchapter4mac_第2页
高级计算机网络-zqfchapter4mac_第3页
高级计算机网络-zqfchapter4mac_第4页
高级计算机网络-zqfchapter4mac_第5页
免费预览已结束,剩余116页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Chapter

4The

Medium

Access

Control

Sublayer(介质

子层)21:55:0614.1

The

Medium

Access

Control

SublayerThe

categories

of

networks(based

on

Transmission

Technology)Point-to-point

connections(点到点连接)Broadcast

channels(广播信道)Broadcast

channels(广播信道网络),也称:Multiaccess

Channel(多路

信道)信道)控制,MAC)–

or:

Random

Access

Channel(随机Medium

Access

Control(介质–

The

bottom

part

of

the

data

link

layer21:55:0624.2

ALOHAALOHA(Additive

Link

On-Line

Hawaii

system)Pure

ALOHASlotted

ALOHAPure

ALOHA-[see

fig

4-1]The

basic

idea:let

users

transmit

whenever

they

have

data

to

be

sent.Assumed:Fixed

frame

length。基本思想:只要有待发数据,就让他们发After

collision,waiting

for

random

time,then

retransmitVulnerable

period

for

the

shaded

frame-[see

fig

4-2]The

throughput

of

system:

S=G*e-2GG---Load,total

generated

mean

fra mbers(old

and

new)per

frame

time,每帧时内传送的帧数S---successfully

transmitted

frames

per

frame

time,

S1The um

throughput

occurs

at

G=0.5,with

S=1/(2e),which

isabout

0.184.In

other

words

,the

best

we

can

hope

for

is

a

channel

utilization

of

18percent.21:55:06321:55:074Fig.

4-2.

Vulnerable

period

for

the

shaded

frameFig.

4-1.

In

pure

ALOHA,

frames

are

transmittedat

comple y

arbitrary

times21:55:085ALOHASlotted

ALOHAThe

basic

idea:divide

time

up

into

discrete

intervals

,eachinterval

corresponding

to

one

frame基本思想:把时间分为离散的时间片(slot),每段对应一帧The

approach

requires

the

users

to

agree

of

slot

boundaries.Danger

of

collision

reduce

a

halfThe

throughput

:

S=Ge-GSlotted

ALOHA

at

G=1,with

a

throughput

s=1/e

or

about0.368,twice

that

of

pure

ALOHA.The

best

we

can

hope

for

using

slotted

ALOHA

is

37

percent

ofthe

slots.The

relation

between

the

offered

traffic

and

the

throughput

isshown

in

[Figure

4-3]ALOHAFig.4-3.Throughput

versus

offered

traffic

for

ALOHA

systems21:55:0864.2.2Carrier

Sense

Multiple

Access

Protocols协议)ng,adapt

their

behavior

accordingly,(载波侦听多路Basic

Idea:detect

what

other

stations

areachieve

a

much

better

utilization基本思想:检测其它站点,调整自己的动作,大大提高利用率Carrier

Sense

Protocols:

protocols

in

which

stations

listen

for

a

carrier(i.e.,

atransmission)

and

act

accordinglyBandwidth-delay

product:the

number

offrames

that

fit

on

thechannel.–

The

larger

the

bandwidth-delay

product,

the

more

important

thiseffect es,

and

the

worse

the

performance

of

the

protocol.Persistent

and

Nonpersistent

CSMA1-persistent

CSMAlisten

to

the

channel,

if

the

channel

is

busy,

the

station

waits

untilites

idle,

then

transmits

the

frame.

If

idle,

the

station

transmit

itimmedia

y.If

a

collision

occurs

,the

station

waits

a

random

amount

of

time

and

startsall

over

again.Nonpersistent

CSMAlistening,

if

the

channel

is

busy,waits

a

random

amount

of

timeand

startslistening.

If

idle,the

station

transmit

it

immedia

y.Better

Channel

utilizationthan

1-persistent

CSMA,

but

longer

delays.21:55:087p-persistent

CSMAApplies

to

slotted

channelslistening,if

it

is

idle,it

transmits

with

a

probability

p

,

and

deferswith

a

probability

1-p.If

busy,Continue

listening.Comparison

of

various

protocol-[see

fig

4-4]parison

of

the

channel

utilization

versus

loadfor

various

random

access

protocols21:55:0884.2.2

Carrier

Sense

Multiple

Access

ProtocolsCSMA

with

Collision

Detection(带

检测的CSMA

)Improvement:abort

their

transmissions

as

soon

as

they

detectacollision.Carrier

Sense

Multiple

Access

with

Collision

Detection(CSMA/CD)The

conceptual

model-[see

fig

4-5]Three

states:contention,transmission,or

idleCSMA/CD

is

an

important

protocol.

One

version

of

it:IEEE802.3(Ethernet),whichis

an

internationalstandard.21:55:089(补充)21:55:08104.2.3 Wireless

LAN

ProtocolsUnlike

cellular

ephone

systems,each

cell

has

only

onechannel,covering

the

entire

available

band

width,usually

itsbandwidth

is

11-54Mb/sHidden

station

problem-[see

fig

4-11(a)]–

A->B,

C

will

not

hear

A,thus

falsely

conclude

that

C

cantransmit,collision

occur.Exposed

station

problem-[see

fig

4-11(b)]–

B->A,

C

is

listening,falsely

conclude

that

it

may

no d

toDFig.4-11.A

wireless

LAN.(a)

A

transmitting.(b)

B

transmitting.21:55:0811Wireless

LAN

Protocols

(2)Multiple

Access

with

Collision

Avoidance(MACA)

-[see

fig

4-12]–

IEEE

802.11–

The

basic

idea:the

sender

stimulate

the

receiver(RTS),make

i d

a

frame(CTS),all

stations

nearby

can

detect

thistransmission

,avoid

collision.21:55:0812Fig.4-12.The

MACA

protocol.(a)

A

sending

an

RTS

to

B(b)

B

responding

with

a

CTS

to

AConclusion

CSMA/CA

Rule):If

station

X

received

RTS,but

did

not

receive

CTS,then

X

cantransmit

its

data

and

will

not

interfere

with

other

stations.。If

station

X

has

not

received

RTS,

but

received

CTS,then

X

maynot

transmit

itsdata.If

station

X

has

received

both

RTS

and

CTS,then

X

may

nottransmit

its

data.Although

the

use

of

RTS

and

CTS

will

decrease

the

efficiency

ofnetwork,but

the

influence

is

little

because

they

are

very

short.e.g,frame

length

of

RTS

is

30

byte

while

the al

length

of

data

frameis

2346

bytes.MACA

can

not

prevent

collision

from

happening.

e.g,

A

and

C

transmitRTS

to

B

in

the

same

time,

their

RTS

frame

will

collision.MACAW:

tune

MACA

to

improve

its

performance.MAC

for

Wirelessintroducing

an

ACK

after

each

successful

data

frame,

avoidlosing

the

frame21:55:0813WLANProtocolsIEEE

802.11–

1/2M2.4GHz,

1997IEEE

802.11b

2.4GHz,

1999–

11MIEEE

802.11a–

54MIEEE

802.11g–

11M/54M5GHz,

19992.4GHz,

July

2003IEEE802.11i(WLAN的802.1x)新一代WLAN安全标准IEEE802.11p智能交通ITS,用于车载通讯,Jul.2010IEEE802.11n2.4G/5GHz,

Sept.11,2009–

300,

600MbpsIEEE

802.11ac 5GHz,

Feb.

2012–

理论速率1G

bps21:55:08144.3

EthernetPhysical

layerMAC

sublayer

protocolEthernet

performanceSwitched

EthernetFast

EthernetGigabit

Ethernet10

Gigabit

EthernetIEEE

802.2:

Logical

Link

ControlRetrospective

on

Ethernet21:55:08154.3.1

Classic

Ethernet

Physical

LayerFigure

4-13.

Architecture

of

classic

EthernetClassic

EthernetSwitched

EthernetDIX

standardThick

EthernetThin

EthernetRepeaterFour

types

of

cabling

are

commonly

used:

(Figure

4-13,14,15)Figure

4-xx.

The

most

common

kinds

of

Ethernet

cabling.21:55:0817Figure

4-xxThree

kinds

of

Ethernet

cabling.

(a)

10Base5,

(b)

10Base2,

(c)

10Base-T.21:55:08184.3.2

Classic

Ethernet

MAC

SublayerProtocolFigure

4-14.

Frame

formats.

(a)

Ethernet

(DIX).

(b)

IEEE

80.2

Manchester

EncodingProblem:

bit

0--0

volts

,

bit

1--5

volts,

then

ambiguities

arise:

an

idlesender(0

volts)ora

0

bit

(0

volts).Method:

using

+1

voltsfor

a

1

and

–1

volts

for

a

0,

but

there

is

still

aproblem:

different

clock

speedskey

issue:

to

unambiguously

determine

the

start,

end,

or

middle

ofeach

bit

without

reference

to

an

external

clock.

Two

such

approaches:Manchester

encoding

and

differential

Manchester

encoding.Manchester

encoding:

Each

bit

period

is

divided

into

two

equalinterval

and

low

in

the

second

ervals(1—high

during

the0—just

the

reverse).Advantage:

easy

for

the

receiver

to

synchronize

with

the

senderDisadvantage:

twice

as

much

bandwidth

as

straight

binary

encoding21:55:08204.3.2

Manchester

EncodingDifferential

Manchester

encoding:1—absence

of

a

transition(跳变)

atthestart

of

the

interval,

0—presence

of

a

transition

at

the

start

of

the

interval–

The

differential

scheme

requires

more

complex

equipment

but

offers

betternoise

immunityAll

Ethernetsystems

use

Manchester

encoding

due

to

its

simplicity21:55:08

21Figure

4-16.

(a)

Binary

encoding,

(b)

Manchester

encoding,

(c)

DifferentialManchesterencoding.4.3.2

Classic

Ethernet

MAC

SublayerProtocolOriginal

DIX

framestructure-[see

fig

4-14(a)]Preamble

of

8

bytes,

containing

bit

pattern

10101010high-order

bit

of

destination

address:

0-ordinary,

1-groupminimum

frame

length:

64

bytes

(512bits)to

distinguish

valid

frames

from

garbagecollision

detection

-[see

fig

4-15]–

CRC

checktwo

changes

IEEE

made:

[seefig

4-14(b)]Preamble

of

7

bytes,

last

byte

for

a

Start

of

Frame(SOF)delimiter

(7+1=8)to

change

Type

field

into

Length

fieldMulticasting: Sending

to

a

groupBroadcasting:

Special

address,

all

1OUI(Organizationally

Unique

Identifier,

MAC)LLCDEC,

In ,

Xerox21:55:0822Figure

4-14.

Frame

formats.

(a)

DIX

Ethernet,

(b)

IEEE

802.3.Collision

detection

can

take

as

long

as

2.21:55:0823CSMA/CD

with

Binary

Exponential

Backoffdelay=k*2slot

time(round-trip

delay):

2=51.2

safter

i

collisions,

a

random

number

k

between

0

and

2i-1

is

chosen.After

10

collisions

have

been

reached,

therandomization

interval

is

frozen

at

a um

of

1023slots.

After

16

collisions,

the

controller

throws

in

thetowel

and

reports

failure

back

to

the

computer.21:55:08Goto

4.3.3CSMA/CD

协议最初的以太网是将许多计算机都连接到一根总线上。当初认为这样的连接方法既简单又可靠,因为总线上没有有源器件。D匹配电阻(用来吸收总线上的信号)匹配电阻E不接受C不接受A不接受BB向D发送数据接受只有D

接受B

发送的数据Optional21:55:082521:55:0826两个标准DIX

Ethernet

V2

是世界上第一个局域网产品(以太网)的规约。IEEE

的802.3

标准。DIX

Ethernet

V2

标准与IEEE

的802.3

标准只有很小的差别,因此可以将802.3

局域网简称为“以太网”。严格说来,“以太网”应当是指符合DIXEthernet

V2

标准的局域网1kmABt碰撞t

=

2

A

检测到发生碰撞B

发送数据B

检测到发生碰撞t

=

t

=

单程端到端时延记为t

=

021:55:0827争用期的长度以太网取

51.2

s

为争用期的长度。对于10

Mb/s

以太网,在争用期内可发送512bit,即64字节。以太网在发送数据时,若前

64

字节没有发生

,则后续的数据就不会发生

。21:55:0828最短有效帧长如果发生,就一定是在发送的前64

字节之内。由于一检测到

就立即中止发送,这时已经发送出去的数据一定小于

64

字节。以太网规定了最短有效帧长为

64

字节,凡长度小于

64字节的帧都是由于

而异常中止的无效帧。21:55:082921:55:0830强化碰撞当发送数据的站一旦发现发生了碰撞时,除了立即停止发送数据外,还要再继续发送若干比特的人为干扰信号(jammingsignal),以便让所有用户都知道现在已经发生了碰撞。人为干扰信号TJABTBtB

发送数据A

检测到开始信道占用时间A

发送数据B

也能够检测到,并立即停止发送数据帧,接着就发送干扰信号。这里为了简单起见,只画出A发送干扰信号的情况。21:55:0831网卡上的硬件地址路由器1A-24-F6-54-1B-0E00-00-A2-A4-2C-0220-60-8C-C7-75-2A08-00-20-47-1F-E420-60-8C-11-D2-F6路由器由于同时连接到两个网络上,因此它有两块网卡和两个硬件地址。21:55:08324.3.3

Ethernet

PerformanceFigure

4-16.

Efficiency

of

Ethernet

at

10

Mbps

with

512-bit

slot

times.21:55:08334.3.4

Switched

EthernetFigure

4-17.

(a)

Hub.

(b)

Switch.21:55:0834Switched

Ethernet

(2)Figure

4-18.

An

Ethernet

switch.SwitchSwitch

portsTwisted

pairHubCollisioncollision.:In

a

hub,

all

stations

are

in

the

same;

while

in

a

switch,

each

port

is

a

collision4.3.5

Fast

EthernetFDDI

(Fiber

Distributed

Data

Interface)Fibre

Channel

(note:

Fibre,

not

Fiber,

as

British

editor)Disadvantage

of

optical

LANs(such

as

FDDI)

make

IEEE

come

up

withFast

Ethernet.

[802.3(1980)

based

on

Ethernet]The

basic

idea:

all

802.3u

(1995)

use

hubs

and

switchesWire

types

to

support:Category

3

twisted

pair:100Base-T4

(4

twisted

pairs)Advantage

and

disadvantageCategory

5

twisted

pair:100Base-TX

(2

twisted

pairs)Often

100Base-T4

and

100Base-TX

are

called

100Base-TFiber:100Base-FX21:55:093621:55:09374.3.5

Fast

Ethernet(2)Category

3

UTP

scheme:100Base-T4

(4

twistedpairs)25MHz

signaling

speedTransmitting

4

bits

in

each

of

the

25MHz

to

give

100Mbps10Base-T

Ethernet20MHz

signaling

speed,Manchester

encoding,Two

clock

periods

for

each

bit

of

the

10MbpsCategory

5

UTP

scheme:100Base-TX

(2

twistedpairs)125MHz

signaling

speed4B/5B:5

clock

periods,each

contain

one

of

twovalues,yields

32combinations16

of

thesecombinations

are

usedto

transmit

thefour

bit

groups0000,0001,…,1111Full

duplexAutonegotiation

(10

or

100Mbps,

half

or

full

duplex)4.3.6

Gigabit

EthernetGigabit

Ethernet

------802.3z

(1998)Goals(the

same

as

802.3u):

make

Ethernet

go

10

times

faster

yet

remain

backwardcompatible

with

existing

Ethernet

standards.All

configurations

of

gigabit

Ethernet

are

point-to-point

rather

than

multidropas

in

the

original

10Mbps

standard

(see

Fig.4-20)21:55:0938Fig4-20

(a)

A

two-station

Ethernet.(b)

A

multistation

Ethernet.4.3.6

Gigabit

Ethernet(3)Gigabit

Ethernet

supports

both

copper

and

fiber

cabling,

as

listed

in

Fig.4-21.21:55:0939Figure

4-21.

GigabitEthernet

cabling.Three

fiber

diameters

are

permitted:

10µm,50µm

and62.5µm

(microns).4.3.7 10

Gigabit

Ethernet10-Gigabit

Ethernet-----802.3ae

(2002)10

Gigabit以太网与10

Mb/s,100

Mb/s

和1

Gb/s以太网的帧格式完全相同。10Gigabit以太网还保留了802.3

标准规定的以太网最小和最大帧长,便于升级。10Gigabit以太网不再使用铜线而只使用光纤作为传输

。10Gigabit以太网只工作在全双工方式,因此没有争用问题,也不使用CSMA/CD

协议。Coming

on

new

standard

for

40Gbps

and

100Gbps4.3.7 10

GigabitEthernet(2)Figure

4-22.

10-Gigabit

Ethernet

cabling4.3.8 40/100

Gigabit

EthernetTHE

IEEE

Standards

Association

has

ratifiedthe

IEEE

Standard

802.3ba

that

covers

40gigabit

and

100

gigabit

Ethernet

(40GbE

and100GbE).It

was

ratified

in

June

17,2010.21:55:094240GB/100GB

以太网的物理层标准物理层40GB

以太网100GB

以太网在背板上传输至少超过1

m40GBASE-KR4在铜缆上传输至少超过7

m40GBASE-CR4100GBASE-CR10多模光纤上传输至少100

m40GBASE-SR4100GBASE-SR10单模光纤上传输至少10

km40GBASE-LR4100GBASE-LR4单模光纤上传输至少40

km100GBASE-ER4以太网从10

Mb/s

到100

Gb/s

的演进、全/半双工、共享/以太网从10

Mb/s到100Gb/s

的演进证明了以太网是:可扩展的(从10

Mb/s

到100

Gb/s)。灵活的(多种传输交换)。易于安装。稳健性好。局域网对LLC

子层是透明的局域网站点1逻辑链路控制接入控制网络层LLCMAC物理层网络层LLCMAC物理层数据链路层站点2LLC

子层看不见下面的局域网21:55:0945以后一般不考虑LLC子层由于TCP/IP

体系经常使用的局域网是DIX

Ethernet

V2

而不是

802.3标准中的几种局域网,因此现在

802

制定的逻辑链路控制子层

LLC(即

802.2标准)的作用已经不大了。很多厂商生产的网卡上就仅装有MAC协议而没有LLC

协议。21:55:094621:55:09474.3.8

Retrospective

on

EthernetSimple

and

flexiblecheapeasy

to

maintaininternetworking

easily

with

TCP/IP4.4

Wireless

LANs,

Linksys,The

802.11

Protocol

StackThe

802.11

Physical

LayerThe

802.11

MAC

Sublayer

ProtocolThe

802.11

Frame

StructureServicesProducts:

Cisco,

Aruba,

H3C,D-Link,

Netgear…21:55:09484.4.1 802.11

Architecture

and

ProtocolStack

(1)Figure4-23

802.11

architecture

(a)

infrastructure

modeTo

NetworkAccessPointClient4.4.1 802.11

Architecture

and

ProtocolStack

(2)Figure4-23

Figure4-23

802.11

architecture

(b)

ad-hoc

mode4.4.1

The

802.11

Architecture

andProtocol

Stack(3)Protocol

stack

structure

[see

fig.4-24]MAC

sublayer

determines

how

the

channel

is

allocatedLLC

sublayer

hide

the

difference

between

802

variantsFigure

4-24

Part

of

the

802.11protocol

stack.21:55:0951FHSS(FrequencyHop

Spread

Spectrum,跳频扩频技术)DSSS

(Direct

Sequence

Spread

Spectrum,直接序列扩频技术)OFDM

(Orthogonal

Frequency

Division

Multiplexing,正交频分复用)HR-DSSS

(High

Rate

Direct

Sequence

Spread

Spectrum,高速直接序列扩频技术)MIMO

OFDM

(Multiple

Input

Multiple

Output

OFDM)

,

802.11n,ratifed

in

Oct.

2009,

use

4

antennas, rates

up

to

600Mbps21:55:09524.4.2

The

802.11

Physical

LayerInfrared:

diffused

transmission,

two

speeds:1

Mbps:

takes

2

bits

and

produces

a

16-bit

codeword

containing

fifteen

0sand

a

single

1,

Gray

code2

Mbps:

takes

2

bits

and

produces

a

4-bit

codeword,

alsoonly

a

single

1FHSS(Frequency

Hop Spread

Spectrum,跳频扩频技术):uses

79

channels,

each

1

MHz

wide,

starting

at

the

low

end

of

the

2.4-GHz

ISM

band.

(ISM:

Industrial,

Scientific,Medical)Pseudorandom

number

generator,dwell

timeDSSS(Direct

Sequence

Spread

Spectrum,直接序列扩频技术):Each

bit

as

11

chips,

Barker

sequence,

phase

shift

modulationSimilar

to

the

CDMA

technology1

or

2Mbps21:55:095321:55:09544.4.2

The

802.11

Physical

LayerOFDM(Orthogonal

Frequency

Division

Multiplexing,正交频分复用):–

IEEE

802.11aSplitting

signal

into

many

narrow

bands,

better

immunity

to

narrowbandinterference

and

possibility

of

using

noncontiguous

bandsUp

to

54Mbps

in

the

wider

5

GHz

ISM

band216

data

bits

are

encoded

into

288-bit

symbolsHR-DSSS(High

Rate

Direct

Sequence

Spread

Spectrum,高速直接序列扩频技术):IEEE

802.11bUses

11

million

chips/sec

to

achieve11

Mbps

in

the

2.4-GHz

bandData

rates

supported:

1,

2,

5.5,

and

11

Mbps.For

1

and

2Mbps,

run

at

1M

baud

with

1

and

2

bits

perbaudFor

5.5

and

11Mbps,

run

at

1.375M

baud

with

4

and

8

bits

per

baud21:55:09554.4.2

The

802.11

Physical

LayerIEEE

802.11g,

usesOFDM

modulation

method

of

802.11a

butoperates

in

thenarrow

2.4-GHz

ISM

band

along

with

802.11bOFDM

modulation

method

but

run

at

2.4GHz

ISM

bandAn

enhanced

version

of

802.11b,

compatible

with

802.11bIn

theory

it

can

operate

at

up

to

54

Mbps54Mbps,

11Mbps

…MIMO

(Multiple

Input

Multiple

Output)802.11n,

ratifed

in

Oct.

2009use

4

antennas,

40MHz4.4.3

The

802.11

MAC

Sublayer

ProtocolFigure

4-25

Sending

a

frame

with

CSMA/CA.21:55:09574.4.3

The

802.11

MAC

Sublayer

ProtocolTwo

modes

of

opertion

to

deal

with

hidden/

exposed

stationproblem

:DCF(Distributed

Coordination

Function分布式协调功能):not

usecentral

controlPCF(Point

Coordination

Function点协调功能):uses

the

base

station

tocontrol

all

activity

in

its

cell.All

must

support

DCF

but

PCF

is

optional.CSMA/CA(CSMA

with

Collision

Avoidence):

employs

DCF,

uses

bothphysical

and

virtual

channel

sensingmethod

1:

senses

channel,

if

idle,

just

starts

transmitting.

Does

notsense

channel

while

transmitting.

If

collision

occurs,

wait

random

time,using

Ethernet

binary

exponetial

backoff

algorithmmethod

2:

based

on

MACAW,

ues

virtual

channel

sensing[see

Fig.4-27]situation:A

wants

to

send

to

B.

C

is

a

station

within

range

of

A.

D

is

astation

within

range

of

B

but

not

within

rangeof

A.4.4.3

The

802.11

MAC

Sublayer

ProtocolA

sendsRTS

frame

to

B

to

request

permission,B

sendsCTS

frame

back

togrant

permission.Then

A

sends

data,

and

starts

an

ACK

timer.(假定:C在A附近,D在B附近)C

receives

RTS

frame

----->assert

NAV(Network

Allocation

Vector)D

hears

CTS----->assert

NAV(NAV

是大致估计的时间)Figure

4-27.

The

use

of

virtual

channel

sensing

using

CSMA/CA.21:55:09584.4.3

The

802.11

MAC

Sublayer

ProtocolWireless

networks

are

noisy

and

unreliable.

If

a

frame

is

too

long,

itis

very

difficult

to

getting

through

undamaged.Fragment:

individually

numbered

and

acknowledged

using

stop-and-wait

protocol.Fragment

burst.

[see

Fig.

4-xx.]Fragment

increases

the

throughput

by

restricting

retransmissionsto

bad

fragments

rather

than

the

entire

frame21:55:0959Figure

4-xx.

A

fragmentburst.4.4.3

The

802.11

MAC

Sublayer

ProtocolPCF

mode:

polling,

nocollisionsbase

station

broadcast

a

beacon

frame

periodicallypower

management: ls

a

station

to

go

to

sleepcoexistence

of

PCF

and

DCF:[see

Fig.

4-28](优先等级)SIFS(Short

InterFrame

Spacing):

allow

the

parties

in

a

single

dialogthe

chance

to

goPIFS(PCF

InterFrame

Spacing):

the

base

station

may

send

a

beaconframe

or

poll

frame.

sends

data

frame

or

fragment

sequence

tofinish,

gives

base

station

a

chance

to

grab

the

channel

when

done.DICF(DCF

InterFrame

Spacing):

apply

usual

contension

rules,

binaryexponential

backoff

if

needed.EIFS(Extended

InterFrame

Spacing):

report

the

bad

frame21:55:09604.4.3

The

802.11

MAC

Sublayer

ProtocolFigure

4-28.

Interframe

spacing

in

802.11.21:55:0961802.11

的MAC

层MAC

层无争用服务(选用)争用服务(必须实现)分布协调功能DCF(Distributed

Coordination

Function)(CSMA/CA)点协调功能(Point

CPCooFrdination

Function)MAC

层通过协调功能来确定在基本服务集BSS

中的移动站在什么时间能发送数据或接收数据。物理层MAC

层无争用服务争用服务分布协调功能DCF(Distributed

Coordination

Function)(CSMA/CA)点协调功能(Point

CPCooFrdination

Function)DCF

子层在每一个结点使用CSMA

机制的分布式接入算法,让各个站通过争用信道来获取发送权。因此DCF

向上提供争用服务。物理层MAC

层无争用服务争用服务分布协调功能DCF(Distributed

Coordination

Function)(CSMA/CA)点协调功能(Point

CPCooFrdination

Function)PCF子层使用集中控制的接入算法把发送数据权轮流交给各个站从而避免了碰撞的产生物理层帧间间隔IFS所有的站在完成发送后,必须再等待一段很短的时间(继续

)才能发送下一帧。这段时间的通称是帧间间隔IFS

(InterFrame

Space)。帧间间隔长度取决于该站欲发送的帧的类型。高优先级帧需要等待的时间较短,因此可优先获得发送权。若低优先级帧还没来得及发送而其他站的高优先级帧已发送到,则变为忙态因而低优先级帧就只能再推迟发送了。这样就减少了发生碰撞的机会。时间DIFS空闲SIFS时间争用窗口NAV(

忙)发送下一帧推迟接入等待重试时间有帧要发送源站时间目的站ACKDIFSSIFS其他站有帧要发送SIFS,即短(Short)帧间间隔,是最短的帧间间隔,用来分隔开属于一次 的各帧。一个站应当能够在这段时间内从发送方式切换到接收方式。使用SIFS

的帧类型有:ACK

帧、CTS

帧、由过长的MAC

帧分片后的数据帧,以及所有回答AP

探询的帧和在PCF

方式中接入点

AP

发送出的任何帧。发送第1

帧课件制作人:谢CSMA/CA

协议的原理欲发送数据的站先检测信道。在

802.11

标准中规定了在物理层的空中接口进行物理层的载波

。通过收到的相对信号强度是否超过一定的门限数值就可判定是否有其他的移动站在信道上发送数据。当源站发送它的第一个MAC

帧时,若检测到信道空闲,则在等待一段时间DIFS

后就可发送。为什么信道空闲还要再等待这是考虑到可能有其他的站有高优先级的帧要发送。,就要让高优先级帧先发送。假定没有高优先级帧要发送源站发送了自己的数据帧。目的站若正确收到此帧,则经过时间间隔SIFS

后,向源站发送确认帧ACK。若源站在规定时间内没有收到确认帧ACK(由重传计时器控制这段时间),就必须重传此帧,直到收到确认为止,或者经过若干次的重传失败后放弃发送。虚拟载波虚拟载波

(VirtualCarrierSense)的机制是让源站将它要占用信道的时间(包括目的站发回确认帧所需的时间)通知给所有其他站,以便使其他所有站在这一段时间都停止发送数据。这样就大大减少了碰撞的机会。“虚拟载波”是表示其他站并没有监听信道,而是由于其他站收到了“源站的通知”才不发送数据。虚拟载波的效果这种效果好像是其他站都

了信道。所谓“源站

”就是源站在其

MAC帧首部中的第二个字段“持续时间”中填入了在本帧结束后还要占用信道多少时间(以微秒为单位),包括目的站发送确认帧所需的时间。网络分配向量当一个站检测到正在信道中传送的MAC

帧首部的“持续时间”字段时,就调整自己的网络分配向量

NAV(Network

AllocationVector)。NAV

了必须经过多少时间才能完成数据帧的这次传输,才能使信道转入到空闲状态。争用窗口信道从忙态变为空闲时,任何一个站要发送数据帧时,不仅都必须等待一个

DIFS

的间隔,而且还要进入争用窗口,并计算随机退避时间以便再次重新试图接入到信道。在信道从忙态转为空闲时,各站就要执行退避算法。这样做就减少了发生碰撞的概率。802.11

使用二进制指数退避算法。图例

冻结剩余的退避时间帧帧帧帧帧DIFSDIFSDIFSDIFS争用窗口争用窗口争用窗口争用窗口退避退避退避退避ABCDEttttt冻结冻结冻结冻结冻结802.11的退避机制二进制指数退避算法第i

次退避就在22+i

个时隙中随机地选择一个,即:第I

次退避是在时隙{0,1,…,22+i

–1}中随机地选择一个。。第1

次退避是在8

个时隙(而不是2

个)中随机选择一个。第2

次退避是在16个时隙(而不是4个)中随机选择一个。退避计时器(backoff

timer)站点每经历一个时隙的时间就检测一次信道。这可能发生两种情况。若检测到信道空闲,退避计时器就继续倒计时。若检测到信道忙,就冻结退避计时器的剩余时间,重新等待信道变为空闲并再经过时间

DIFS

后,从剩余时间开始继续倒计时。如果退避计时器的时间减小到零时,就开始发送整个数据帧。退避算法的使用情况仅在下面的情况下才不使用退避算法:检测到信道是空闲的,并且这个数据帧是要发送的第一个数据帧。除此以外的所有情况,都必须使用退避算法。即:在发送第一个帧之前检测到信道处于忙态。在每一次的重传后。在每一次的成功发送后。2.对信道进行预约tDIFSSIFStNAV推迟接入源站t目的站其他站数据帧SIFSSIFSt802.11

局域网的MAC

帧字节

2266

6260

~

2312帧控制持续期地址1地址2地址3序号控制地址4帧主体FCS协议版本类型子类型去往AP来自AP分片重试功率管理数据顺序位2241111111MAC

首部802.11

帧共有三种类型,即控制帧、数据帧和管理帧。下面是数据帧的主要字段。MAC尾部4802.11

数据帧的三大部分MAC

首部,共30字节。帧的复杂性都在帧的首部。帧主体,也就是帧的数据部分,不超过2312

字节。这个数值比以太网的最大长度长很多。不过802.11

帧的长度通常都是小于1500

字节。帧检验序列FCS

是尾部,共4

字节1.关于802.11

数据帧的地址802.11数据帧最特殊的地方就是有四个地址字段。地址

4

用于自组网络。

在这里只前三种地址。去往AP来自AP地址1地址2地址3地址401目的地址AP

地址源地址——10AP

地址源地址目的地址——AP1BSS1AB去往AP=1来自AP=0因特网RBSS2AP2C012站点A

向B发送数据帧但数据帧必须经过AP

转发2.

序号控制字段、持续期字段和帧控制字段序号控制字段占16

位,其中序号子字段占12位,分片子字段占4

位。持续期字段占16

位。帧控制字段共分为11

个子字段。协议版本字段现在是0。类型字段和子类型字段用来区分帧的功能。

分片字段置为1时表明这个帧属于一个帧的多个分片之一。–

有线等效

字段=1,就表明采用了占1

位。若加密算法。分片的发送举例ttt源站目的站其他站RTSCTS分片0ACK0分片1ACK1分片

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论