NS2:如何知道通道插槽的数量?

时间:2013-02-13 20:48:30

标签: channel ns2 timeslots

这与NS2 MAC图层模拟有关。

假设Ns2频道带宽为1 Mbps

然后,默认情况下,通道划分为多少个插槽?

如果分开,每个插槽多少钱?

这一行mac->phymib_.getSlotTime()给出了什么?

2 个答案:

答案 0 :(得分:0)

mac->phymib_.getSlotTime()返回slot的持续时间,它是802.11 MAC协议的Distributed Coordination Function(DCF)的参数。

回复:how many slots is the channel divided into.

我认为您将802.11 MACTDMA混为一谈。

如果您有兴趣在TDMA中模拟ns2,则应查看文件mac/mac-tdma.ccmac/mac-tdma.h。不幸的是,没有为allinone-package提供TDMA的示例脚本。

答案 1 :(得分:0)

谈论频道插槽我假设你问的是Mac / Tdma无线协议(另有说明):

弯曲源代码:

来自tdma-mac.cc的

//Get the parameters of the link (which in bound in mac.cc, 2M by default),
//the packet length within one TDMA slot (1500 byte by default), 
//and the max number of nodes (64) in the simulations.

// Max data length allowed in one slot (byte)
#define MAC_TDMA_MAX_DATA_LEN 1500        

// How many time slots in one frame.
#define MAC_TDMA_SLOT_NUM       32           

此外,无线链路的默认带宽在ns-default.tcl中定义,并带有其他一些值:

Phy/WirelessPhy set bandwidth_ 2e6

Mac/Tdma set slot_packet_len_   1500
Mac/Tdma set max_node_num_  64