資源簡介
網絡編碼機會路由,主要是在無線環境下對網絡編碼機會路由MORE的仿真,有助于網絡編碼機會路由的擴展,以及在該編碼的基礎上進行拓展實驗和新的算法的提出。

代碼片段和文件信息
#!/usr/bin/python
from?sys?import?exit?argv?stderr
from?os?import?system?popen
#?First?configure?the?device?in?raw/monitor?mode.?
madwifi?=?‘ng‘
if(madwifi?==?‘old‘):
????dev?=?‘ath0‘
????rawdev?=?dev?+?‘raw‘
????system(“““
/sbin/ifconfig?%(rawdev)s?down
/sbin/ifconfig?%(dev)s?down
/sbin/sysctl?-w?dev.%(dev)s.rxfilter=0xff?&>?/dev/null
/sbin/sysctl?-w?dev.%(dev)s.rawdev_type=2?&>?/dev/null
/sbin/sysctl?-w?dev.%(dev)s.rawdev=1?&>?/dev/null
/sbin/ifconfig?%(dev)s?up?txqueuelen?1
/sbin/ifconfig?%(rawdev)s?up?txqueuelen?1
“““?%?globals())
????decap?=?“Prism2Decap?->?ExtraDecap?->?RadiotapDecap“
????decapfbk?=?decap
????encap?=?“RadiotapEncap“
elif(madwifi?==?‘ng‘):
????dev?=?‘wifi0‘
????rawdev?=?‘ath0‘
????system(“““
ifconfig?%(rawdev)s?down
ifconfig?%(dev)s?down
wlanconfig?%(rawdev)s?destroy
wlanconfig?%(rawdev)s?create?wlandev?%(dev)s?wlanmode?monitor?2>?/dev/null?>?/dev/null
sysctl?-w?net.%(rawdev)s.dev_type=804?2>?/dev/null?>?/dev/null
ifconfig?%(dev)s?up?txqueuelen?1
ifconfig?%(rawdev)s?up?txqueuelen?1?mtu?1600
“““?%?globals())
????decap?=?decapfbk?=?‘AthdescDecap‘
????encap?=?‘AthdescEncap‘
#?obtain?MAC?address?from?device
p?=?popen(‘/sbin/ifconfig?%(dev)s?2>&1‘??%?globals())
ifconfig?=?p.readline().split()
if(‘not‘?in?ifconfig):
????print?>>?stderr?‘device?not?found?‘?‘?‘.join(ifconfig)
????exit(-1)
mac?=?ifconfig[4]
p.close()
mac?=?mac.split(‘:‘)
if(len(mac)?6):
????mac?=?mac[0].split(‘-‘)
if(len(mac)?6):
????print?>>?stderr?‘got?invalid?mac?address!‘?mac
????exit(-1)
#?take?only?6?bytes?for?MAC
mac?=?‘:‘.join(mac[0:6])
print?>>?stderr?“using?%(dev)s?/?%(rawdev)s?MAC?%(mac)s“?%?globals()
#?Actual?click?configuration
runDelay?=?‘5‘?#?seconds
runTime?=?‘65‘?#?seconds
proto?=?None
log?=?‘‘
from?getopt?import?getopt?GetoptError
try:
????opts?=?getopt(argv[1:]?‘t:d:l:‘)
????for?(od)?in?opts[0]:
????????if(o?==?‘-d‘):
????????????runDelay?=?d
????????if(o?==?‘-t‘):
????????????runTime?=?d
????????if(o?==?‘-l‘):
????????????log?=?“?LOG?%s“?%?d
????proto?=?opts[1][0]
????assert?proto?in?[‘spp‘?‘more‘]
except:
????print?>>?stderr?“““usage:?%s?[-d?]?[-t?]?[-l?]?(spp|more)
“““?%?argv[0]
????exit(-1)
#?proto?ethtypes
anytype?=?‘a5%ff‘
spptype?=?‘a501‘
datatype?=?‘a502‘
acktype?=?‘a503‘
#?COMMON?From/ToDevice?STACK
print?“““
ControlSocket(“TCP“?7777);
ChatterSocket(“TCP“?7778);
//?INPUT?PATH
FromDevice(%(rawdev)s?OUTBOUND?true)
->?ibreak?::?Switch(0)
->?%(decap)s?->?FilterPhyErr?
->?Classifier(0/08%%0c)?->?WifiDupeFilter()?->?WifiDecap()?
->?Classifier(12/%(anytype)s)
->?txf?::?FilterTX()[0]
->?Print(i0?TIMESTAMP?1?NBYTES?14)?->?IN?::?AverageCounter();
txf[1]?
->?TXF?::?PrintTXFeedback(x0);
//?OUTPUT?PATH
psout?::?PrioSched()
->?SetTXPower(POWER?1)
->?WifiEncap(0x0?00:00:00:00:00:00)?->?%(encap)s
->?obreak?::?PullSwitch(0)
->?to_dev?::?ToDevice(%(rawdev)s);
to_dev_ctl?::?SockControl(to_dev);
script(TYPE?ACTIVE
???write?to_dev_ctl.sndbuf?1000
);
OUT?::?AverageCounter()
->?Print(o0?T
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-30?12:07??Opportunistic?routing\
?????目錄???????????0??2009-07-17?02:52??Opportunistic?routing\more-release-one\
?????文件????????5585??2007-11-28?04:00??Opportunistic?routing\more-release-one\codedblock.cc
?????文件????????4154??2007-11-28?04:00??Opportunistic?routing\more-release-one\codedblock.hh
?????目錄???????????0??2008-07-25?17:19??Opportunistic?routing\more-release-one\conf\
?????文件????????4797??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\config.py
?????文件???????17169??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\eotx.py
?????文件????????1851??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\etx.py
?????文件?????????689??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\exec.py
?????文件???????11523??2007-11-28?04:30??Opportunistic?routing\more-release-one\conf\feed.py
?????文件????????2463??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\li
?????文件?????????187??2007-11-28?04:06??Opportunistic?routing\more-release-one\conf\myssh
?????文件????????5949??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\nodes.py
?????文件????????3620??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\quickrun.py
?????文件????????9410??2009-07-17?02:51??Opportunistic?routing\more-release-one\conf\README.html
?????文件?????????156??2007-11-28?04:00??Opportunistic?routing\more-release-one\conf\startup.sh
?????文件????????5046??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\wifi.py
?????文件????????1261??2007-11-28?04:57??Opportunistic?routing\more-release-one\conf\writeAll.py
?????文件????????2614??2007-11-28?04:00??Opportunistic?routing\more-release-one\galoisfield.hh
?????文件????????2539??2007-11-28?04:00??Opportunistic?routing\more-release-one\matrix.cc
?????文件????????2993??2007-11-28?04:00??Opportunistic?routing\more-release-one\matrix.hh
?????文件????????3023??2009-07-17?02:52??Opportunistic?routing\more-release-one\matrixmgr.cc
?????文件?????????686??2009-07-17?02:51??Opportunistic?routing\more-release-one\matrixmgr.hh
?????文件???????16400??2007-11-28?04:00??Opportunistic?routing\more-release-one\more.cc
?????文件????????2975??2007-11-28?04:00??Opportunistic?routing\more-release-one\more.hh
?????文件????????1888??2007-11-28?04:00??Opportunistic?routing\more-release-one\morebatch.cc
?????文件????????2738??2007-11-28?04:00??Opportunistic?routing\more-release-one\morebatch.hh
?????文件????????5635??2007-11-28?04:00??Opportunistic?routing\more-release-one\moreflow.cc
?????文件????????3608??2007-11-28?04:00??Opportunistic?routing\more-release-one\moreflow.hh
?????文件?????????891??2007-11-28?04:00??Opportunistic?routing\more-release-one\morepacket.hh
?????文件????????1586??2007-11-28?04:00??Opportunistic?routing\more-release-one\sockcontrol.cc
............此處省略1個文件信息
- 上一篇:cc1101 wor 無線喚醒 430程序
- 下一篇:k近鄰算法knn的c代碼
評論
共有 條評論