没有合适的资源?快使用搜索试试~ 我知道了~
首页ns2平台下802.11模块详细分析和仿真
ns2平台下802.11模块详细分析和仿真
5星 · 超过95%的资源 需积分: 45 50 下载量 168 浏览量
更新于2023-03-16
评论 4
收藏 279KB PDF 举报
ns2是被广泛使用的网络平台。本文详细分析在该平台下802.11模块 物理层mac层设计结构,分析源程序。 并带基础仿真历程。
资源详情
资源评论
资源推荐
A Tutorial of 802.11 Implementation in ns-2
Yue Wang
MobiTec Lab, CUHK
1. Introduction to ns-2
1.1 ns-2
Ns-2 [1] is a packet-level simulator and essentially a centric discrete event scheduler to schedule
the events such as packet and timer expiration. Centric event scheduler cannot accurately emulate
“events handled at the same time” in real world, that is, events are handled one by one. However,
this is not a serious problem in most network simulations, because the events here are often
transitory. Beyond the event scheduler, ns-2 implements a variety of network components and
protocols. Notably, the wireless extension, derived from CMU Monarch Project [2], has 2
assumptions simplifying the physical world:
(1) Nodes do not move significantly over the length of time they transmit or receive a packet.
This assumption holds only for mobile nodes of high-rate and low-speed. Consider a node with the
sending rate of 10Kbps and moving speed of 10m/s, during its receiving a packet of 1500B, the
node moves 12m. Thus, the surrounding can change significantly and cause reception failure.
(2) Node velocity is insignificant compared to the speed of light. In particular, none of the
provided propagation models include Doppler effects, although they could.
1.2 GloMoSim
GloMoSim [3] is another open-source network simulator based on a parallel discrete event
scheduler. Hopefully, it can emulate the real world more accurately. However, it is hard to debug
parallel programs. Although GloMoSim currently only supports pure wireless networks, it
provides more physical-layer models than ns-2, as shown in Table 1 [4].
Table 1. Physical layer and propagation models available in GloMoSim, ns-2 and OPNET
1.3 Ns-2 Basics
Ns-2 directory structure
As shown in Figure 1, the C++ classes of ns-2 network components or protocols are implemented
in the subdirectory “ns-2”, and the TCL library (corresponding to configurations of these C++
instances) in the subdirectory of “tcl”.
Figure 1. Ns-2 directory structure
Network Components
Network components are Node, Link, Queue, etc. Some of them are simple components, that is,
they are created from the corresponding C++ classes; The other are compound components, that is,
they are composed multiple simple C++ classes, e.g. Link are composed of Delay (emulating
propagation delay) and Queue. In general, in ns-2, all network components are created, plugged
and configured from TCL.
Example: Plug MAC into NetIF (Network Interface)
Class MAC {
void send (Packet* p);
void recv(Packet*, Handler* h);
NsObject* target_ //an instance of NetIF
}
Event Scheduling
Events are something associated with time. class Event is defined by {time, uid, next, handler},
where time is the scheduling time of the event, uid is the unique id of the event, next is the next
scheduling event in the event queue that is a linklist, and handler points to the function to handle
the event when the event is scheduled. Events are put into the event queue sorted by their time,
and scheduled one by one by the event scheduler. Note that class Packet is subclass of class Event
as packets are received and transmitted at some time. And all network components are subclass of
class Handler as they need to handle events such as packets.
The scheduling procedure (void Scheduler::schedule(Handler* h, Event* e, double delay)) is
shown in Figure 2. The event at the head of the event queue is delivered to its hander of some
network object. Then, this network object may call other network object, and finally some new
events are inserted into the event queue.
Figure 2. Discrete Event Scheduler
Example: A and B are two mobile nodes. And A sends packet p to B (suppose they are within the
tx range).
A::send (Packet* p) {target_->recv(p)} //target_ is B; call B::recv
B::recv(Packet*, Handler* h = 0) {
…
Scheduler::instance().schedule(target_, p, tx_time) //target_ is B; schedule the packet at the
// time of (current_time + tx_time)
…
}
Example: Timer is another kind of Event that is handled by TimerHandler
class TimerHandler: public Handler
剩余12页未读,继续阅读
chwoop
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 27页智慧街道信息化建设综合解决方案.pptx
- 计算机二级Ms-Office选择题汇总.doc
- 单链表的插入和删除实验报告 (2).docx
- 单链表的插入和删除实验报告.pdf
- 物联网智能终端项目设备管理方案.pdf
- 如何打造品牌的模式.doc
- 样式控制与页面布局.pdf
- 武汉理工Java实验报告(二).docx
- 2021线上新品消费趋势报告.pdf
- 第3章 Matlab中的矩阵及其运算.docx
- 基于Web的人力资源管理系统的必要性和可行性.doc
- 基于一阶倒立摆的matlab仿真实验.doc
- 速运公司物流管理模式研究教材
- 大数据与管理.pptx
- 单片机课程设计之步进电机.doc
- 大数据与数据挖掘.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论5