NS3(Network Simulator)

NS3 部分类简单说明

2017-06-25  本文已影响364人  shawn168

1.class DcaTxop : public Dcf

/**
 * \brief handle packet fragmentation and retransmissions.
 * \ingroup wifi
 *
 * This class implements the packet fragmentation and
 * retransmission policy. It uses the ns3::MacLow and ns3::DcfManager
 * helper classes to respectively send packets and decide when
 * to send them. Packets are stored in a ns3::WifiMacQueue until
 * they can be sent.
 *
 * The policy currently implemented uses a simple fragmentation
 * threshold: any packet bigger than this threshold is fragmented
 * in fragments whose size is smaller than the threshold.
 *
 * The retransmission policy is also very simple: every packet is
 * retransmitted until it is either successfully transmitted or
 * it has been retransmitted up until the ssrc or slrc thresholds.
 *
 * The rts/cts policy is similar to the fragmentation policy: when
 * a packet is bigger than a threshold, the rts/cts protocol is used.
 */

简要说明:处理包的分组和重传
该类继承包分组和重传策略。它使用ns3::MacLow and ns3::DcfManager帮助类分别完成发送包和决定何时发送包。包被存储在ns3::WifiMacQueue中,止到发送出去。
当前使用的策略使用一个简单的分组阈值:任何大于该阈值的片将被分成小于该阈值的分组。
重传策略也非常简单:每一个包竟被重传止到被成功传输或者已经被重传达到了ssrc or slrc阈值。
rts/cts策略与分组碎片策略相似:当一个包大于阈值时,将使用rts/cts协议。

2.class MacRxMiddle

/**
 * \ingroup wifi
 *
 * This class handles duplicate detection and recomposition of fragments.
 */

该类处理重复探测和分组片的重排。

3. class MacTxMiddle

/**
 * \ingroup wifi
 *
 * Handles sequence numbering of IEEE 802.11 data frames
 */

处理802.11数据帧的序列号

4. class MacLow : public Object

/**
 * \ingroup wifi
 * \brief handle RTS/CTS/DATA/ACK transactions.
 */

处理RTS/CTS/DATA/ACK交互

5. class DcfManager

/**
 * \brief Manage a set of ns3::DcfState
 * \ingroup wifi
 *
 * Handle a set of independent ns3::DcfState, each of which represents
 * a single DCF within a MAC stack. Each ns3::DcfState has a priority
 * implicitely associated with it (the priority is determined when the
 * ns3::DcfState is added to the DcfManager: the first DcfState to be
 * added gets the highest priority, the second, the second highest
 * priority, and so on.) which is used to handle "internal" collisions.
 * i.e., when two local DcfState are expected to get access to the
 * medium at the same time, the highest priority local DcfState wins
 * access to the medium and the other DcfState suffers a "internal"
 * collision.
 */

简要说明:处理一系列ns3::DcfState
处理一系列独立的ns3::DcfState,每一个都代表一个在MAC栈中的单独的DCF。每一个ns3::DcfState都有一个隐式关联与他的优先级(当ns3::DcfState被添加到DcfManager,这个优先级被决定:第一个添加的DcfState具有最高优先级,第二个具有第二高优先级,以此类推)。这个优先级被用于处理“内部的”的碰撞。例如,当两个本地DcfState期望在同一时间访问介质,最高优先级本地DcfState赢得访问介质权限,其他DcfState遭遇一个“内部的”碰撞。

6. class WifiRemoteStationManager : public Object

/**
 * \ingroup wifi
 * \brief hold a list of per-remote-station state.
 *
 * \sa ns3::WifiRemoteStation.
 */

保存一系列per-remote-station state

7. class EdcaTxopN : public Dcf

/**
 * \ingroup wifi
 * This queue contains packets for a particular access class.
 * possibles access classes are:
 *
 *   -AC_VO : voice, tid = 6,7         ^
 *   -AC_VI : video, tid = 4,5         |
 *   -AC_BE : best-effort, tid = 0,3   |  priority
 *   -AC_BK : background, tid = 1,2    |
 *
 * For more details see section 9.1.3.1 in 802.11 standard.
 */

这个队列包含了一个具体的访问类的包。可能的访问类是:
-AC_VO : voice, tid = 6,7 ^
-AC_VI : video, tid = 4,5 |
-AC_BE : best-effort, tid = 0,3 | priority
-AC_BK : background, tid = 1,2 |
获取更多细节,请看802.11标准的9.1.3.1节

8. enum TypeOfStation

/**
 * Enumeration for type of station
 */

枚举station的类型:
STA,
AP,
ADHOC_STA,
MESH,
HT_STA,
HT_AP,
HT_ADHOC_STA,
OCB

9. class WifiMode

/**    
 * \brief represent a single transmission mode
 * \ingroup wifi 
 *
 * A WifiMode is implemented by a single integer which is used
 * to lookup in a global array the characteristics of the
 * associated transmission mode. It is thus extremely cheap to
 * keep a WifiMode variable around.
 *
 * \see attribute_WifiMode
 */  

简要说明:代表一个单独的传输模式
一个WiFi模式是由用于在一个全局数组来查找相关的传输模式的特性的单个整数来实现的。这是极其因此便宜*保持无线模式变量左右。

10. enum WifiModulationClass

/**
 * This enumeration defines the modulation classes per
 * (Table 9-4 "Modulation classes"; IEEE 802.11-2012).
 */

该枚举类定义了每个调制类

11. class WifiModeFactory

/**
 * \brief create WifiMode class instances and keep track of them.
 *
 * This factory ensures that each WifiMode created has a unique name
 * and assigns to each of them a unique integer.
 */

简要说明:创建WifiMode类实例,并对他们保持跟踪。
这个工厂类保证每一个被创建的WifiMode有一个唯一的名字,并给每一个分配一个唯一的整数。

12. class MacLowDcfListener

/**
 * \brief listen to NAV events
 * \ingroup wifi
 *
 * This class is typically connected to an instance of ns3::Dcf
 * and calls to its methods are forwards to the corresponding
 * ns3::Dcf methods.
 */

简要说明:监听NAV事件
该来一般与一个ns3::Dcf实例关联在一起,它的方法调用是转发到相应的ns3::Dcf方法。

13. class MacLowAggregationCapableTransmissionListener

/**
 * \ingroup wifi
 * \brief listen for block ack events.
 */

监听块ACK事件

14. class MacLowTransmissionParameters

/**
 * \brief control how a packet is transmitted.
 * \ingroup wifi
 *
 * The ns3::MacLow::StartTransmission method expects
 * an instance of this class to describe how the packet
 * should be transmitted.
 */

简要说明:控制一个包如何传输
ns3::MacLow::StartTransmission方法预料该来的实例,描述一个包如何被传输的。

15. class WifiTxVector

/**
 * This class mimics(模仿) the TXVECTOR which is to be
 * passed to the PHY in order to define the parameters which are to be
 * used for a transmission. See IEEE 802.11-2007 15.2.6 "Transmit PLCP",
 * and also 15.4.4.2 "PMD_SAP peer-to-peer service primitive(原始的)
 * parameters".
 *
 * If this class is constructed with the constructor that takes no
 * arguments, then the client must explicitly(明确的) set the mode and
 * transmit power level parameters before using them.  Default
 * member initializers(初始化) are provided for the other parameters, to
 * conform to a non-MIMO/long guard configuration, although these
 * may also be explicitly set after object construction.
 *
 * When used in a infrastructure context, WifiTxVector values should be
 * drawn from WifiRemoteStationManager parameters since rate adaptation
 * is responsible for picking the mode, number of streams, etc., but in
 * the case in which there is no such manager (e.g. mesh), the client
 * still needs to initialize at least the mode and transmit power level
 * appropriately.
 *
 * \note the above reference is valid for the DSSS PHY only (clause
 * 15). TXVECTOR is defined also for the other PHYs, however they
 * don't include the TXPWRLVL explicitly in the TXVECTOR. This is
 * somewhat strange, since all PHYs actually have a
 * PMD_TXPWRLVL.request primitive. We decide to include the power
 * level in WifiTxVector for all PHYs, since it serves better our
 * purposes, and furthermore it seems close to the way real devices
 * work (e.g., madwifi).
 */

该类模仿了TXVECTOR,它将被传递到PHY,这是为了定义一次传输所用的参数。请看IEEE 802.11-2007 15.2.6 "Transmit PLCP"和 15.4.4.2 "PMD_SAP peer-to-peer service primitive(原始的)parameters".
如果该类使用没有参数的构造器构建,则客户端必须在使用它们之前明确的设置模式和传输能量水平参数。提供了其他参数来完成默认的成员初始化,确保一个non-MIMO /long guard configuration,尽管这些可能在对象创建之后来明确的设置。

16. struct Item

 /**
   * A struct that holds information about a packet for putting
   * in a packet queue.
   */
    结构体包含三个元素:
     * \param packet
     * \param hdr
     * \param tstamp

结构体,保存了一个包的信号,该包存放在包队列中。

 /**
   * typedef for packet (struct Item) queue.
   */
  typedef std::list<struct Item> PacketQueue;包队列

17. class InterferenceHelper

/**
 * \ingroup wifi
 * \brief handles interference calculations
 */

简要说明:处理干扰计算

上一篇下一篇

猜你喜欢

热点阅读