TOMATOFAN 发表于 2011-12-22 08:53

ieee 802.11 -----ns

<div><span class="Apple-style-span" style="line-height: normal; "><font class="Apple-style-span" color="#f00000"><span class="Apple-style-span" style="line-height: 26px; "><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="short_text" style="font-family: Ubuntu, UbuntuBeta !important; ">http://www.ict.csiro.au/staff/ren.liu/ns-2/simulate-802_11.htm 的翻译</span></p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="short_text" style="font-family: Ubuntu, UbuntuBeta !important; ">当模拟 802.11无线连接,需要注意失真链路带来的问题:</span></p>Disable ad hoc routing:<p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><span class="Apple-style-span" style="color: rgb(51, 51, 51); ">在一个BSS中模拟的时候,可能要</span>禁止da hoc路由功能</p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; ">set val(rp) DumbAgent ;# ad-hoc routing protocol</p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; ">否则,周期性的路由数据包将会打断 数据的传输</p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><br></p><p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><strong style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; font-size: medium; ">在模拟之前建立好ARP</span></strong></p><p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><strong style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; font-size: medium; "><span class="Apple-style-span" style="font-size: 14px; line-height: 25px; color: rgb(0, 0, 0); font-weight: normal; ">ARP,即<a target="_blank" href="http://baike.baidu.com/view/149421.htm" style="font-family: Ubuntu, UbuntuBeta !important; text-decoration: underline; color: rgb(19, 110, 194); ">地址解析协议</a>,实现通过<a target="_blank" href="http://baike.baidu.com/view/3930.htm" style="font-family: Ubuntu, UbuntuBeta !important; text-decoration: underline; color: rgb(19, 110, 194); ">IP地址</a>得知其物理地址</span></span></strong></p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="medium_text" style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">任何数据传输之前,源和目的地址需要交换的ARP信息,以解决MAC的IP地址。</span>&nbsp;<span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">这可以是一个无线连接的问题:如果 你的链接是非常失真(例如,几乎100%),ARP协议无法解析的MAC - IP地址,将在整个模拟实验不间断的发送ARP请求。</span>&nbsp;<span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">这些ARP请求报文肯定会干扰你的 数据包。</span>&nbsp;此外,因为地址不解决,你的数据包不能正常传送的MAC层</span></p><p style="font-size: 14px; color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><br></p><p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="medium_text" style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">为了解决这个问题,在我的模拟初始化阶段</span>&nbsp;</span><span id="result_box" class="medium_text" style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">,设置了前10秒</span>&nbsp;</span><span id="result_box" class="medium_text" style="color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">。</span>&nbsp;<span style="font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">在此期间,所有节点的初始设置在近距离(通信范围内)与对方。</span>&nbsp;<span style="font-family: Ubuntu, UbuntuBeta !important; ">每个源传输一个或多个虚拟数据包接收到其指定设立的ARP。</span>&nbsp;<span style="font-family: Ubuntu, UbuntuBeta !important; ">然后,节点移动到他们的实验场所,交通流的实际数据开始从实际数据在10秒来源。</span></span></p><p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="medium_text" style="color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; "><br></span></span></p><p style="font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="short_text" style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; "><font class="Apple-style-span" size="4">802.11 xRetryLimit_实现不正确</font></span></span></p><p style="font-size: 14px; font-family: Ubuntu, UbuntuBeta !important; "><span id="result_box" class="long_text" style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; ">对ShortRetryLimit_ 802.11实现和LongRetryLimit_不正确<font class="Apple-style-span" color="#333333">:如果您设置ShortRetryLimit_至7,你会期望在STA为7次(8传输的重试总 数)。</font></span><font class="Apple-style-span" color="#333333">&nbsp;</font><span style="color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; ">然而,2.33 STA中只转发6次(总人数的7转播)。</span><font class="Apple-style-span" color="#333333">&nbsp;</font><span style="color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; ">同样的情况,以LongRetryLimit_。</span><font class="Apple-style-span" color="#333333">&nbsp;</font><span style="color: rgb(51, 51, 51); font-family: Ubuntu, UbuntuBeta !important; background-color: rgb(255, 255, 255); ">这不符合的IEEE 802.11标准规定STA中放弃“当SLRC达到aLongRetryLimit,或当达到dot11ShortRetryLim</span></span></p></span></font></span></div><div><span class="Apple-style-span" style="line-height: normal; font-size: medium; ">The problem is in mac-802_11.cc:
<font face="Courier New" size="2" style="font-family: Ubuntu, UbuntuBeta !important; ">Mac802_11::RetransmitRTS() {... if(ssrc_ &gt;= macmib_.getShortRetryLimit()) ...}
Mac802_11::RetransmitDATA() {... if(*rcount &gt;= thresh) ...}
</font>
Corrections: The conditions should be “&gt;” instead of “&gt;=”, as follows:
<font face="Courier New" size="2" style="font-family: Ubuntu, UbuntuBeta !important; ">Mac802_11::RetransmitRTS() {... if(ssrc_ &gt; macmib_.getShortRetryLimit()) ...}
Mac802_11::RetransmitDATA() {... if(*rcount &gt; thresh) ...}</font><font face="Courier New" size="2" style="font-family: Ubuntu, UbuntuBeta !important; "><font class="Apple-style-span" color="#f00000">Recompile error for ns-2 in cygwin</font><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; ">I use ns-2.33 in cygwin on Windows XP. After changing some c++ code in ns2.33/mac/mac-802_11.cc, I run "make" in ns2.33/ to recompile the code. However there is an error in make: proxytrace2any.cc:112: error ...</p><span class="Apple-style-span" style="white-space: normal; font-size: medium; ">Here is a solution suggested in <a href="http://sokoyo.csit.tw/~blog/2007-12-14/110" style="font-family: Ubuntu, UbuntuBeta !important; " target="_blank" target="_blank">http://sokoyo.csit.tw/~blog/2007-12-14/110</a>:
Modify file “ns-allinone-2.32/ns-2.32/indep-utils/webtrace-conv/dec/my-endian.h”:
<strong style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; color: rgb(0, 0, 255); ">//</span></strong><font color="#0000FF" style="font-family: Ubuntu, UbuntuBeta !important; ">#ifndef _ENDIAN_H_
</font><strong style="font-family: Ubuntu, UbuntuBeta !important; "><span style="font-family: Ubuntu, UbuntuBeta !important; color: rgb(0, 0, 255); ">//</span></strong><font color="#0000FF" style="font-family: Ubuntu, UbuntuBeta !important; ">#define _ENDIAN_H_</font></span></font></span><span class="Apple-style-span" style="line-height: normal; "><font face="Courier New" style="font-family: Ubuntu, UbuntuBeta !important; "><span class="Apple-style-span" style="white-space: normal; font-size: medium; ">
#ifndef _MY_ENDIAN_H_
#define _MY_ENDIAN_H_ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="Apple-style-span" style="white-space: normal; "><font class="Apple-style-span" size="5">&nbsp;</font></span></font><font face="Courier New" style="font-family: Ubuntu, UbuntuBeta !important; "><font class="Apple-style-span" color="#f00000" size="5">Understand 802.11 PHY code in ns-2</font><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><a href="http://www.joshuarobinson.net/docs/ns-802_11b.html" style="font-family: Ubuntu, UbuntuBeta !important; " target="_blank" target="_blank">802.11 MAC code in NS-2</a>&nbsp;is an excellent guide on MAC code. Here I will extend it further to 802.11 PHY code in "ns2.33/mac/":</p><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><b style="font-family: Ubuntu, UbuntuBeta !important; "><i style="font-family: Ubuntu, UbuntuBeta !important; ">PHY::recv()</i></b>&nbsp;- is the main handler of PHY interface. It can be called by Mac802_11::transmit() to send a packet via sendDown() with hdr-&gt;direction() DOWN. Or it can be scheduled by WirelessChannel::sendUP() to receive a packet via sendUP() with hdr-&gt;direction() UP.</p><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><b style="font-family: Ubuntu, UbuntuBeta !important; "><i style="font-family: Ubuntu, UbuntuBeta !important; ">WirelessPHY::sendDown()</i></b>&nbsp;- called by Mac802_11::transmit() to put the packet into the PHY. It first check if the node is off the packet is discarded. If energy management is enabled "em()", transmission energy is deducted for this transmission action. Some parameters, e.g. antenna, transmit power, wavelength&nbsp;<font face="Symbol" style="font-family: Ubuntu, UbuntuBeta !important; ">l,&nbsp;</font>are stamped onto the node (for the calculation of reception in the receiving node). Then the packet is put onto channel_-&gt;recv(p, this).</p><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><b style="font-family: Ubuntu, UbuntuBeta !important; "><i style="font-family: Ubuntu, UbuntuBeta !important; ">Channel::recv()</i></b>&nbsp;- simply calls Channel::sendUP(p, PhyHandler) to put the packet on the the channel.</p><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><b style="font-family: Ubuntu, UbuntuBeta !important; "><i style="font-family: Ubuntu, UbuntuBeta !important; ">WirelessChannel::sendUP()</i></b>&nbsp;- it first change the hdr-&gt;direction() to UP. Then it goes through the list of all nodes sortLists() and pick a subset of nodes within communication range: getAffectedNodes(). Then it send a copy of the current packet (newp=p-&gt;copy()) to each affected node (rnode) by schedule a reception event to the receiving interface (rifp) of the affected node after a propagation delay (propdelay).</p><p style="font-family: Ubuntu, UbuntuBeta !important; white-space: normal; font-size: medium; "><b style="font-family: Ubuntu, UbuntuBeta !important; "><i style="font-family: Ubuntu, UbuntuBeta !important; ">WirelessPHY::sendUP()</i></b>&nbsp;- It first check if the node is off, sleep, or zero energy level. In these cases, the incoming packet is dropped. The receiving power Pr is calculated, via propagation_-&gt;Pr(), according to specified propagation model: such as free space, two-ray ground, and shadowing models (in ns-2.33/mobile/). If Pr is less than CSThresh_, the packet is undetected. If Pr is less than RXThresh_, the packet is received with error. There is a modulation_-&gt;BitError(Pr) facility trying to handle bit errors for various modulation mechanisms. However looking at the modulation.cc, it turns out to be a dummy: Pe=0 always! Next, if energy management is enabled "em()" receiving energy is deducted from the reception activity. I couldn't find how it send the packet up to MAC though...</p></font><font face="Courier New" size="2" style="font-size: medium; font-family: Ubuntu, UbuntuBeta !important; "><br></font></span></div><div><span class="Apple-style-span" style="line-height: normal; font-size: medium; "><br></span></div><div><span class="Apple-style-span" style="line-height: normal; font-size: medium; "><br></span></div>
页: [1]
查看完整版本: ieee 802.11 -----ns