??xml version="1.0" encoding="utf-8" standalone="yes"?>综合网日日天干夜夜久久,久久天天躁狠狠躁夜夜avapp,精品国产福利久久久http://www.shnenglu.com/ay19880703/category/20325.htmlzh-cnFri, 18 Jan 2013 17:03:20 GMTFri, 18 Jan 2013 17:03:20 GMT60[导入]Wireless Fundamental(2) -- 802.11 MAC头格式解?updating)http://www.shnenglu.com/ay19880703/archive/2011/03/05/155083.html__ay__aySat, 05 Mar 2011 08:55:00 GMThttp://www.shnenglu.com/ay19880703/archive/2011/03/05/155083.htmlhttp://www.shnenglu.com/ay19880703/comments/155083.htmlhttp://www.shnenglu.com/ay19880703/archive/2011/03/05/155083.html#Feedback0http://www.shnenglu.com/ay19880703/comments/commentRss/155083.htmlhttp://www.shnenglu.com/ay19880703/services/trackbacks/155083.html 

作者:__ay 

 


在上一中Q简要概qC无线|络的通信机制Q那么在下来得开始介l一下无U网l的通信l节了。说到这里,以后所说的内容会有?02.11 无线|络权威指南 W二版媄印版》这本书内容的媄子,q有内容中会加上通过wireshark抓包的分析以及IEEE关于wlan 80211协议的说明文档。虽然说q本书虽然讲得好Q但是很多数据包l节上的问题q是需要我们亲手去做实验去验证的,一向认为学习不能仅仅看书,亲手去验证一些你认ؓ疑惑的地方可能会比做几道译֐题的效果要好得多得多 ^_^


1 MAC802.11数据帧格?/span>

首先要说明的是mac802.11的格式很特别,它与TCP/IPq一cd议不同,它的长度是可变的。不同功能的数据帧长度会不一栗这一Ҏ说明mac802.11数据帧显得更加灵z,然而,也会更加复杂。mac 802.11的数据长度不定主要是由于以下几点决定的


1.1 mac地址数目不定Q根据cd不同Qmac 802.11的mac地址C不一栗比如说 ACK帧仅有一个mac地址Q而数据?个mac地址Q在WDS模式Q下面要提到Q下Q头竟然有4个mac地址?/span>


1.2 802.11的管理所携带的信息长度不定,在管理中,不仅仅只有一些类gmac地址Q分片标志之cȝq些信息Q而且另外q会包括一些其它的信息Q这些信息有关于安全讄的,有关于物理通信的,比如说我们的SSID名称是通过理帧获得的。AP会根据不同的情况发送包含有不同信息的管理。管理的细节问题我们会在后面的文章中讨论,q里暂时跌?/span>


1.3 加密Qwep,wpa{)信息QQOSQquality of serviceQ信息,若有加密的数据格式和没有加密的数据帧格式还不一P加密数据帧格式还多了个加密头Q用于解密用。然则QOS也是同样道理?/span>


竟然mac 802.11数据帧那么复杂,我们先从通用的格式开始说?/span>



帧控?2 bytes)Q?/span>

用于指示数据帧的cdQ是否分片等{信息,说白了,q个字段是记录了mac 802.11的属性?/span>

    *Protocol versionQ表明版本类型,现在所有里面q个字段都是0x00

    *TypeQ指明数据cdQ是理帧,数据帧还是控制

    *SubtypeQ指明数据的子cdQ因为就是控制帧,控制帧还分RTS帧,CTS帧,ACK帧等{,通过q个域判断出该数据的具体类?/span>

    *To DS/From DSQ这两个数据帧表明数据包的发送方向,分四U可能情况讨?/span>

        **若数据包To DS?QFrom DS?Q表明该数据包在|络L间传?/span>

 

        **若数据包To DS?QFrom DS?Q表明该数据帧来自AP

        **若数据包To DS?QFrom DS?Q表明该数据帧发送往AP

        **若数据包To DS?QFrom DS?Q表明该数据帧是从AP发送自AP的,也就是说q个是个WDS(Wireless Distribution System)数据帧,至于什么是WDSQ可以参考下q里的介l?#传送门

    *MoreflagQ分片标志,若数据被分片了Q那么这个标志ؓ1Q否则ؓ0

    *RetryQ表明是否是重发的Q若是ؓ1Q不是ؓ0

    *PowerManageQ当|络L处于省电模式Ӟ该标志ؓ1Q否则ؓ0.

    *MoredataQ当AP~存了处于省甉|式下的网l主机的数据包时QAPl该省电模式下的|络L的数据中该位ؓ1Q否则ؓ0

    *WepQ加密标志,若ؓ1表示数据内容加密Q否则ؓ0

    *Order q个表示用于PCF模式下,q里不予讨论


生存周期/Associate ID (2 bytes):

先前不是讲过虚拟载L监听的一个机制么Q他的Network Allocation VectorQNAVQ就存在q里Q这里叫durationQ即生存周期。当然不是所有时候这个字D存攄NAV倹{在特定cd数据帧中Q它也可能表CAssociate ID。一旦有L兌到AP了,AP都会Z机分配一个Associate ID。比如在|络L通知AP自己要进入省甉|式(power savingQ的时候,|络L发给AP的通知数据帧里面,q个域就表示的是Associate ID而不是NAV了。当然还可以通过最高位来判断这个域的含义:

    *?5bit?的时候,该域表示duration

    *?5bit?Q?4bit?的时候,表示Associate ID?/span>


序列控制(2 bytesQ? bits/12 bits)Q这个域?部分Q一个是分片序列号和标识帧列受分片序列号是记录分片序号的。比如一个A被分片成a1Qa2Qa3Q那么a1Qa2Qa3q三个分片的分片序列分别是0,1,2。这个和IP分段原理一LQ该域占4个比特位。剩下的12个比特位q于标识的序Pq个跟IP头里面的序列号一栗?/span>


MAC地址 1-4 

q四个地址在不同中有不同含义。这些以后会讨论?/span>

以后我们可能会碰C下类型的mac地址

RA(receiver address)Q无U网l中Q该数据帧的接收?/span>

TA(transmitter address)Q无U网l中Q该数据帧的发送?/span>

BSSID(Basic Service Set ID)Q在infrastructure BBS中,BSSID是AP的mac地址。但是在IBBS中,它是一个随机即生成?6位二q制序列Q还有最高两位分别是Universal/Local标志位和Individual/Group标志位。IBBS的BSSID中,Universal/Local标志位ؓ1Q表C本地MACQIndividual/Group标志位ؓ0Q表C是个hMAC。也是说在IBBS中,BSSID地址应该cd 10xxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxxQx表示随机数要?要么1, 2q制表示Q?/span>

DA(destine address)Q该帧的目的mac地址

SA(source address)Q该帧的源mac地址

q里的DA和SA含义和普通以太网中的含义一P在无U网l中可能我们需要通过AP把数据发送到其它|络内的某台L中。但是有的h会奇怪,直接在RA中填q台L的mac地址不就久好了么。但是请注意RA的含义,说的是无U网l中的接收者,不是|络中的接收者,也就是说q台目的L不再无线|络范围内。在q种情况下我们的RA只是一个中转,所以需要多Z个DA字段来指明该帧的最l目的地Q当Ӟ如果有了DA那必LSAQ因目的L要回应的话,SA字段是必不可的?假设没有SA字段Q那么目的主机回应的数据包就只能发送到源主机所属的AP上了~)


最典型的一个例子就是在WDS模式下,数据帧会?个地址QRAQTA表示接收端和发送端Q这两个地址用于无线传输的时候。还?个地址是DA和SAQ分别跟以太|中一栯C源地址和目的地址。WDS帧的格式如下图:


打个比方_AP1有主机AQAP2有主机B。如果A要和B同学Q那么A会首先发送数据lAP1Q然?/span>AP1发送lAP2 。这个时候里面会有4个地址Q分别是RA=mac(AP2)QTA=mac(AP1)QDA=mac(B)QSA=mac(A)?/span>




__ay 2011-03-05 16:55 发表评论
]]>
[导入]Wireless Fundamental(1) -- 802.11MAC入门U普?/title><link>http://www.shnenglu.com/ay19880703/archive/2011/02/05/155084.html</link><dc:creator>__ay</dc:creator><author>__ay</author><pubDate>Sat, 05 Feb 2011 10:20:00 GMT</pubDate><guid>http://www.shnenglu.com/ay19880703/archive/2011/02/05/155084.html</guid><wfw:comment>http://www.shnenglu.com/ay19880703/comments/155084.html</wfw:comment><comments>http://www.shnenglu.com/ay19880703/archive/2011/02/05/155084.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ay19880703/comments/commentRss/155084.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ay19880703/services/trackbacks/155084.html</trackback:ping><description><![CDATA[<p><span id="kcwi4ie" class="Apple-style-span" style="line-height: 27px; font-size: 20px; ">作者:__ay </span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">参考书目是 ?02.11 无线|络权威指南 W二版媄印版? 中文版翻译的太恶心了?/span></p><p><span id="scwa46m" class="Apple-style-span" style="font-size: 20px; line-height: 27px; "><br /></span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">在无U网l通信中,MAC层的工作l节和有U网l差的实在是太大?#8230;…</span></p><p><span style="line-height: 22px; font-size: 18px; ">q里仅仅谈论无线MAC层的通信机制QMAC以上的有U无UK一样~~</span></p><p><span style="line-height: 22px; font-size: 18px; "><br /></span></p><p><strong><span style="font-size: 18px; line-height: 22px; ">1. 马是RTS/CTSQ?</span></strong></p><p><strong><span style="font-size: 18px; line-height: 22px; "><br /></span></strong></p><p><span id="2so4sic" class="Apple-style-span" style="line-height: 22px; font-size: 18px; ">那么说v无线|\Q我们其实最最首先考虑通信的可靠性问题,要知道有U网l的传输环境比无U网l封闭多了,但是其可靠性也比无U网l高多了Q最最L有线|络不要考虑可能的微波,手机信号{因素的q扰。正?/span><span id="ega2oyg" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">׃考虑到其它电子设备比如手机,微L炉等有发微波功能电子品,我们I气中的无线信号受到的干扰远q比有线信号的要强的多。所以在无线通信Ӟ要考虑到可能的q扰性,所以需要对每一个发送出ȝ帧进行确认。过E就如下图所C?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; "> <img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/9fa67d502353f27543a75b07.jpg" border="0" alt="" width="851" height="304" /></span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">但是Q出C个问题一个棘手的问题。就是说如何处理所谓的隐藏节点的问题,那啥是隐藏节点咧Q?/span></p><p><img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/693fe2e8fbd8dc6eb90e2d39.jpg" border="0" alt="" width="905" height="234" /><br /></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">在上一个图中我们可以yy一U特D情况: 2h可以接收?号和3L信号Q但?h无法发现3h?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">那么?Q?号同时发送l?h的时候,2h没法回应q?个Q因为冲突了。在无线|络里,所有主机都公用一个空气媒介,也就是说在一个主机发送数据的时候其它主机必M持沉默。那么上q这U情冉|然违背了q个规则Q造成的结果就?hҎ没法收到数据?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">所以这里就又引Z个以太网cM的另一个问题:冲突避免</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">那么对于q种情况我们则需要有个协调机Ӟ协调谁先发,谁后?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">q就引出?个功能 </span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">RTS: Request to Send</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">CTS: Clear to Send</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">?h传送数据之前,首先发送一个RTS帧给2hQ那么所有接收到RST帧的机器则会保持沉默</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">但是3h收不C~~</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">所?h会回?h一个CTS帧,3h收到CTSQ则保持沉默Q这h以可能干扰到1/2h通信的主机都沉默了)Q然后整个无U网l媒介就可以被空出来l?h用来传送数据l?h?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">q就是RTS/CTS机制 发送过E大致如?/span></p><p><img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/ecd5b23c5e6fa4bf3c6d9718.jpg" border="0" alt="" width="902" height="389" /><br /></p><p><span id="2awiusi" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">但是对于q个机制的用会消耗额外的计算资源Q那么有一个折中的做法是讄一个RTS的阀|当网l数据包长度过q个阀值的时候就启用RTS/CTS机制Q否则保持自由发送模式。(我发现老外很喜Ƣ中怹道~Q。当然这个机制可能有些h说无法保证没有冲H,应ؓ可能1,3L可能同时发?个RTS包给2h。这里会有个冲突回避问题Q原理和以太|类|都是遇到发送冲H,那么随机选择回避。这个就是下面要讨论的一个问题了?/span></p><p><span id="4w444sm" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><strong><span id="qqmquk2" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">2 WLAN的冲H回?/span></strong></p><p><strong><span id="42iwg44" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></strong></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">无线|络通信另一个主要的问题是协调问题Q就是如何协调区域内的各个主行通信Q当然RTS/CTS是一U解xӞ但是q只是个部分,到底如何让无U区域内的主?#8220;畅”的通信Q就得涉及到一pd冲突回避{略{问题上了?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">首先说一下协调模式:</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">在以太网中用的是CSMA/DA的方法,所有主由发送报文,若冲H了退避一D|间在发就是了?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">而在无线|中则有3U协调模?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">DCF (</span><span id="gy244ik" class="Apple-style-span" style="font-size: 18px; font-family: Arial, 宋体; ">Distribution Coordination Function)</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">区域内的L传输Q但是跟以太|的冲突避免一P在检到冲突后则q行退ѝ不q需要提的是有时候DCF会采用RTS/CTS机制来减冲H。这个机制自由性比较强?/span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">PCF (</span><span id="wos22ee" class="Apple-style-span" style="font-size: 18px; font-family: Arial, 宋体; ">Point Coordination Function)</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">q个机制依赖于ACCESS POINTSQ既需要通过一台指定的无线L来协调通信。所以这个机制可以ؓL提供无竞争服务,因ؓAP可以指定谁先发数据谁后发数据Q没有传输冲H,真和谐,是开销要高一些?nbsp;</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">HCF (</span><span id="e42ug4s" class="Apple-style-span" style="font-size: 18px; font-family: Arial, 宋体; ">Hybird Coordination Function)</span></p><p><span style="font-size: 18px; font-family: Arial, 宋体; ">q个机制是以上两个机制的折中Q一斚w提供一个尽力而ؓ的服务,但是又对于通信的步骤要求又不如PCF?span style="font-size: 18px; font-family: Arial, 宋体; ">么严根{这个模式通过l护多个服务队列Q然后再军_为怎样的主机提供怎样的服务?/span></span></p><p><span id="424qeka" class="Apple-style-span" style="font-size: 19px; line-height: 27px;"><br /></span></p><p> </p><p><span style="font-size:18px">我们以后的讨论情景是ZDCF下的。特别在DCFq程中,他的退避算法和以太|的法很相伹{也是随即退避,随着发送失败的ơ数增加Q退避时间的选择范围会进行指数增ѝ当到信道I闲后,要发送数据的L需要等待DIFS旉间隔后然后进入竞争状态下Q所谓的竞争状态就是说所有主Z在自q竞争H口中随即选择一个等待时_q个{待旉q后则开始发送数据?/span></p><p><span style="font-size:18px">首先来说几个定义Q?/span></p><p><span style="font-size:18px">1.旉(原文是slotQ我们暂且称之ؓ旉?Q这个是退避时间的最单位,在以太网中退避时间单位是毫秒q是微秒来着我忘了,q个旉是无线|络中的旉单位Q这个时隙是Ҏ情况而定的。在高速网l?|卡处理性能好)中时隙会短。时隙可能是2微秒Q也可能?毫秒Q反正是在不同网l中旉可能不同Q这个可以看成退避时间的最单位?/span></p><p><span style="font-size:18px">2.竞争H口Q就是在发送失败后选择退避时间的集合。比如说初始的窗口大是0-31 slots。这p明在L需要在0-31 slots里面随即抽取Z个值来q行{待。打个比Ҏ们的slot设ؓ2微秒Q那么在上一ơ传输数据完毕后l过DIFSQ下面会介绍刎ͼ间隙Q我们在自己的竞争窗?范围Q?-31 slots)随即选取C24q个|那么我们需要等待的旉是24 slots == 24*2 微秒 == 48 微秒。当然竞争窗口的大小会随着发送失败的ơ数而增加,因ؓ发送失败次数越多表C网l负载越大,那么所有无U网L在检到自己发送失败了以后都要自q竞争H口乘以2Q然后再l箋{待发送。不q当p|ơ数辑ֈ阀值的时候竞争窗口大就不会增加了。当发送成功以后竞争窗口就会恢复初始倹{?/span></p><p><span style="font-size:18px">有图有真相,贴个囄l分析:</span></p><p><span style="font-size: 18px; "><img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/ecd5b23c66756cbc3c6d9702.jpg" border="0" alt="" width="869" height="568" />看到初始H口范围?-31Q随着重传ơ数增加Q窗口也是呈指数增长。当增长到阀?024大小时就停止增长了,接下来如果还是重传失败的话就一直随机在0-1023 slots中挑Z个值来q行{待?/span></p><div><span style="font-size: 18px; "><br /></span></div><p> </p><p><strong><span style="font-size: 18px; font-family: Arial, 宋体; ">3 时序</span></strong></p><p><span id="ca44ksa" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">再者就是时序问题了Q简单来说就是如何规定无U主Z么时候该</span><span id="y4i24oe" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">做什么?/span><span id="omae2go" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">那首先先得说一下无U网l监听机Ӟq个和有U网l里面不太一栗?/span><span id="wmic2om" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">有线|络里面若物理信道有数据传输的话是肯定可以监听的到的Q?/span><span id="4eyimek" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">但无U网l里面却不一定。就拿之前那个隐藏节点的例子来说Q?/span><span id="uquya4y" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">3h可能无法通过监听物理信道来得知一二号机正在传输?/span><span id="4i4waao" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">所以无U网l通信中,要确定信道是否被占用Q引入了虚拟载L监听?/span></p><p><span id="4g2kowe" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><span id="woq224e" class="Apple-style-span" style="line-height: 27px; color: #ff0000; font-size: 18px; ">注:载L监听和虚拟蝲波监听是同时在运行的Q只有当q两个模块显C空闲时才表CZ道空Ԍ若其中的一个模块显CZ道繁忙都表示信道正在被占用?/span></p><p><span id="ywi2yai" class="Apple-style-span" style="line-height: 27px; color: #ff0000; font-size: 18px; "><br /></span></p><p><span id="ygcoqgw" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><span style="font-size: 18px; ">关于虚拟载L监听</span><span style="font-size: 18px; ">的原理,那么得先介绍</span></span><span id="s24cyem" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">一个叫Network Allocation VectorQNAVQ这个变量。这个变量会附在无线数据包内的?/span><span id="i24s4iy" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">准备发送数据的L通过NAVq个值通知其它沉默的主Z道要被占用多长时间来用于传输数据?/span><span id="wu42qq2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">每个L都会l护一个自qNAV|然而这个NAV值每?微秒会递减1Q直到递减?的时候就表示虚拟载L监听的信道空闌Ӏ?/span></p><p><span id="gs2q2yq" class="Apple-style-span" style="line-height: 27px; font-size: 15.8333px; "><br /></span></p><p><span id="gysuowm" class="Apple-style-span" style="line-height: 27px; font-size: 15.8333px; ">说白了NAV是个定时器Q但是是个动态定时器Q当L沉默时会不断的收到来自无U网l中的含有NAV值的数据包,只有当数据包中的NAV值大于自qNAV值时Q主机才会更新自qNAV倹{?/span></p><p><span id="a444aa2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">比如?1号主机的NAV值是100Q那么收C个A包,它的NAV值是99Q那?号主机的NAV值就q是100不变。过?0微秒Q?号主机又收到一个B包,它的NAVD?9Q但是这个时?号主机的NAV值是90?每隔1微秒会递减1的嘛)Q所?号主Z把自qNAV值更Cؓ99。直到这个NAV值递减?才说明信道可用?/span></p><p><span id="iyseqgw" class="Apple-style-span" style="font-size: 19px; line-height: 27px;"><br /></span></p><p><span id="a4424kc" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">接下来又回到时序问题上,在每帧发送结束后Q这里指的是所有主机,特别是沉默的LQ当沉默L到NAV值是0pCZ送完毕了Q都会有个等待间隙。但q等待间隙类型分4U:</span></p><p><span id="2wg2s2e" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">SIFS (short interframe space)</span></p><p><span id="sc2q4q2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">该类型时间间隔最短,q个cd的时间间隔主要用于高优先U别的操作。要发送RTS,CTS,ACK或者是被分片的?假设一个被分成了3块,W一部分传送完毕,{待SIFS间隔l箋发送第二块Q而其他要发送完整的主机则需要等待DIFS间隔Q这样就能够保q被分片的能够一ơ性发送完毕,也就是被分片的享受更高的传输优先)的时候?/span></p><p><span id="2q2444g" class="Apple-style-span" style="font-size: 19px; line-height: 27px;"><br /></span></p><p><span id="2oq4ek4" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">PIFS (PCF interframe space)</span></p><p><span id="o26i2qw" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">PIFS旉间隔其次Q在传输PCF相关的管理的时候采用这cd的时间间隔。这U情况就是一般我们用路由器,路由器的理帧只要等待PIFS可以发送了?/span></p><p><span id="cs242u2" class="Apple-style-span" style="font-size: 19px; line-height: 27px;"><br /></span></p><p><span id="oga2224" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">DIFS (DCF interframe space)</span></p><p><span id="ee2u4co" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">DIFS旉间隔最长,所有主传输数据的话必须在上一ơ传输完毕后l一{待DIFS旉后才能尝试发送。当Ӟq里说的是尝试发送,因ؓ后面q得q入一个竞争间隔?/span></p><p><span id="2gkoigq" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="ukwycks" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">EIFS (extended interframe space)</span></p><p><span id="siu2yq2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">q类帧的旉间隔不确定,在传输错误的时候才会用到?/span></p><p><span id="4a4ec44" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="4qkuewu" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">所以除去EIFSQ他们仨的时间关pd? SIFS<PIFS<DIFSQSIFS{待旉最短,DIFS最长,PIFS居中</span></p><p><span id="q4eoci6" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">。可以发玎ͼ旉短Q发送成功率高Q这也就说明优先U越高。显而易见,RTS/CTS帧,也叫控制帧的发送间隔都是SIFSQ因cd的优先要高于^常的数据传输。所以当你要发送RTS之类的时就采用SIFS旉间隔Q这样就能够保证RTS帧能够更快比使用其它旉间隔的发送出去,其它帧接收到RTS报文后就开始保持沉默将不试囑֏送了?/span></p><p><span id="qakys22" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">整个q程串v来就如下图所C:</span></p><p><span id="wm22ss4" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/5cb64a00668359541c95836b.jpg" border="0" alt="" width="886" height="306" /><br />先分析上面的那个旉_RTS发送出去,收到CTS。然后间隔SIFS开始发送数据了Q这里的帧是分片的,分片的需要一ơ性传输完Q所以每个的等待发送时间是SIFS。里面还可以看到ACK的回复时间也是需要等待SIFS的,因ؓq几个类型的帧对保证数据传输非常重要Q所以n有更高的发送优先Q在q种情况下,其它的无U主机发送数据干扰这ơ传输是不可能的Q因Z们需要等待DIFS旉间隔。在他们{待没完的时候RTS,CTS,ACKQ分片的传输早都开始传输了Q这些主机接收到数据传输信息后只能进入沉默?/span></p><p><span id="gw4e2uc" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="igcg2qa" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">那么下面的那个时间u更清晰了,q个旉轴其实可以看成是其它沉默无线LNAV值的情况?/span></p><p><span id="cm2s6e2" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">在刚发送第一个RTS帧的时候,其它L收到了RTS帧中附带的NAV|{到0号传送结束后各个L开始等待DISF旉准备传输Q但是这个时候发送主机由于在发送分片Q所以只要等待SIFS旉发送了Q结果是其它L的DISF旉q没{待完就收到?号l他们的NAV|然后再一号传送的q段旉他们又得只能沉默。这个时间u上面部分表示SENDER通告l其它主机的NAV值的有效期,下面表示Reveiver通告l其它主机的NAV值有效期?/span></p><p><span id="4u4om2q" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><strong><span id="4kmwk2e" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">4 无线L发送过E?/span></strong></p><p><span id="c2oik22" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">l合上面的所有概念,下面贴个图来全盘分析下单个无U主机发送数据包的过E?/span></p><p><span id="ique24u" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><img src="http://www.shnenglu.com/images/cppblog_com/ay19880703/20324/0d7fd62ba8be256a5243c102.jpg" border="0" alt="" width="812" height="185" /><br /><span style="font-size:18px"><br /></span></span></p><p><span id="2kei4iq" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><span style="font-size:18px">1. 前面的busyD表CZ机A监听到网l数据繁忙(q里LA判断信号斚w可能是NAV值没递减?Q也可能是物理蝲波监听那块检到有数据传送,q可能是2者兼有)</span><br /><span style="font-size:18px"><br /></span></span></p><p><span id="w24aac2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">2. OK,busyD늻束后q入{待阶段Q当然这里要发送数据而且不用RTS/CTS机制的话Q那么等待时间应该是DIFS间隔?/span></p><p><span id="oc24s4w" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><span id="u4q24iy" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">3. q入竞争发送阶D,所有主机在自己H口中随机选一个时间来{待</span></p><p><span id="2my2ag4" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><span id="42qc4ka" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">4. 假设LA随机到的{待旉最短,那么他就开始发送数据了Q其它主机发现有数据传输了则会进入沉默状态,{待下一ơ数据传输完毕后q行竞争?/span></p><p><span id="q4acyw2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><strong><span id="csu22i4" class="Apple-style-span" style="line-height: 27px; font-size: 20px; ">5 重传</span></strong></p><p><span id="y24guk6" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">刚才说到了分片,那么q带重传一赯了吧</span></p><p><span id="s244c4s" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="a4wi24s" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">先说说ؓ什么要分片Q什么时候分片的问题</span></p><p><span id="swq22ms" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">在无U网l通信中,要知道传输时受到的干扰是多种多样的,也就是说无线|络在MAC层的E_性是q远不如以太|般E_的。所以在长数据传输的时候很Ҏ中间被中断。ؓ了提高稳定性,把q个帧分片,然后再传输,昄短传输成功率要高于长。这栯计的目的是ؓ了提高无UMAC层的可靠性。这个就跟你拿IE下一?G的东西(一ơ性传长Q和拿迅雷下同样一?G的东襉K理是一LQ显然拿q雷下更E_些,因ؓ有断点箋传。那么分片传输充光是把以前的普通IE下蝲升优化成了断点l传|了?/span></p><p><span id="u424ecy" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="2a44yga" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">当数据包到指定的分片阀值的时候就Ҏ据包q行分片Q同一个被分片的部分也会带有一L帧序P也会有自q分片~号Q也会有个表CZؓ表示q个帧是不是分片帧。这个跟IP分片设计原则是一LQ这个就不具体说了?/span></p><p><span id="424qe4o" class="Apple-style-span" style="font-size: 20px; line-height: 27px;"><br /></span></p><p><span id="au2s2ig" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">再者就是重传问题了Q神马时候重传?</span></p><p><span id="imguo2c" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">以上幅提到q,只有在收到ACK认后主机才会认己发送是成功的。同PRTS只有在收到CTS后才认ؓ自己的RTS发送成功了?/span></p><p><span id="iwa4ima" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">所以这里涉及到一个问题就是发送失败如何处理?重传Q对~是重传,但是一直发送失败呢Q所以对于每个都有个重传计数器Q注Q竞争窗口大就是根据这个重传计数器来决定的Q,p|一ơ就递增一Q但p|到指定的上限的时候就攑ּ发送该帧然后向上层协议报告?/span></p><p><span id="e26244s" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">然而重传计数器?个,分别是长帧重传计数器和短帧重传计数器。某帧当长度大于指定阀值的时候,该发送失败则长重传计数器递增1Q反之亦然。这个阀值是可以讑֮的,重传上限也可以设定。这么设计是因ؓ长会占用更多资源(内存I间Q传输时间等Q以便让理员通过调整阀值和各个计数器的重传上限来优化无U网l。那么我们来YY一下(U属YY……我比较没做过|络优化q方面的l验Q只是假设下可能的场景~Q,比如说我希望用来传输300字节一下的帧的旉多一些,那么我就讑֮阀gؓ300Q然后长帧重传计数器的上限设|低一些,短重传计数器上限设|高一些?/span></p><p><span id="22g4c44" class="Apple-style-span" style="line-height: 27px; font-size: 18px; "><br /></span></p><p><span id="e4yky24" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">重传计数器要清零很简单,有几U情?/span></p><p><span id="2g4kogy" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">1 RTS帧发送出去若收到CTS帧则清零重传技术器Q当然这个只可能发生在短帧计数器情况下,因ؓRTS数据帧一般情况下不属于长?#8230;…当然你要把阀D成RTS帧大我也没话说~Q?/span></p><p><span id="ko244q4" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">2 帧数据发送出去,收到ACK认</span></p><p><span id="kc2gmk2" class="Apple-style-span" style="line-height: 27px; font-size: 18px; ">3 收到q播或者多播(<span style="color: #ff0000; font-size: 18px; ">whyQ书里面q么写的Q但没写Z么,q里的多播和q播帧是不是值通告NAV值的q播帧咧Q如果是q样Q那么就说得通了。待高手解释~</span>)</span></p><p><span id="gos2a44" class="Apple-style-span" style="font-size: 20px; line-height: 27px;">OKQ这一结?br /><br /><br /><br /><br /><br /></span></p><img src ="http://www.shnenglu.com/ay19880703/aggbug/155084.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ay19880703/" target="_blank">__ay</a> 2011-02-05 18:20 <a href="http://www.shnenglu.com/ay19880703/archive/2011/02/05/155084.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.yuyoo.com.cn" target="_blank">ƷžžþƵ </a>| <a href="http://www.ezftdhwp.cn" target="_blank">99þ99þþƷѿ</a>| <a href="http://www.tzcn86.cn" target="_blank">ɫۺϾþþþר</a>| <a href="http://www.gaguni.cn" target="_blank">þùƷƬ</a>| <a href="http://www.bestorgazm.cn" target="_blank">2021ٸþþþþþþþ</a>| <a href="http://www.chengruo.cn" target="_blank">ƷžžþùھƷ</a>| <a href="http://www.vgqk.cn" target="_blank">þþþֻоƷ </a>| <a href="http://www.dliif.cn" target="_blank">þþAVɫۺ</a>| <a href="http://www.dengbilong6.com.cn" target="_blank">VVþþ</a>| <a href="http://www.shanghuangzb.cn" target="_blank">ɫ͵͵888ŷƷþþ</a>| <a href="http://www.sgcx.net.cn" target="_blank">պľþ</a>| <a href="http://www.zjhongfeng.cn" target="_blank">97þþƷһ </a>| <a href="http://www.pandingo.cn" target="_blank">vĻþ</a>| <a href="http://www.mlbj.net.cn" target="_blank">޾ƷƬþ</a>| <a href="http://www.daami.cn" target="_blank">99þۺϾƷ</a>| <a href="http://www.97youbei.cn" target="_blank">ۺϳ˾þС˵ </a>| <a href="http://www.telaviv.com.cn" target="_blank">þó鱬Ļ</a>| <a href="http://www.qhcl233.cn" target="_blank">þҹӰ</a>| <a href="http://www.mingqingrong.cn" target="_blank">þ޾ƷAV</a>| <a href="http://www.37eee.cn" target="_blank">ɫþþþۺ </a>| <a href="http://www.jzqyc.com.cn" target="_blank">þֻǾƷ66</a>| <a href="http://www.huanpou.cn" target="_blank">ƷŷþþþӰ</a>| <a href="http://www.shamba.com.cn" target="_blank">þùɫavѿ</a>| <a href="http://www.znkt.net.cn" target="_blank">þ¶Ʒ</a>| <a href="http://www.05xx.cn" target="_blank">þѹƵ</a>| <a href="http://www.take-art.cn" target="_blank">þþƷһԡ</a>| <a href="http://www.boyayali.cn" target="_blank">þþ</a>| <a href="http://www.kbqst.cn" target="_blank">ҹƷþþþþ˳</a>| <a href="http://www.dpzxj.cn" target="_blank">Ʒþ</a>| <a href="http://www.airesou.cn" target="_blank">պŷۺϾþӰԺd3</a>| <a href="http://www.bo2.com.cn" target="_blank">þ㽶߿ۿƷyw </a>| <a href="http://www.sgcam.com.cn" target="_blank">鶹wwwþ</a>| <a href="http://www.force-equipment.com.cn" target="_blank">޹Ʒþ</a>| <a href="http://www.sjz10086.cn" target="_blank">þAV</a>| <a href="http://www.xhcedu.cn" target="_blank">ŷɫۺϾþþþþ</a>| <a href="http://www.shairproperty.cn" target="_blank">þþƷƷ</a>| <a href="http://www.dszixun.cn" target="_blank">һ㽶þֻ</a>| <a href="http://www.js157.cn" target="_blank">Ʒһþ</a>| <a href="http://www.njglqw.org.cn" target="_blank">Ʒþþþþ</a>| <a href="http://www.wnpigs.cn" target="_blank">91Ʒþþþþ91 </a>| <a href="http://www.zhaoyang-db.com.cn" target="_blank">þþþŮAAƬ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>