这与NS2
MAC
图层模拟有关。
假设Ns2
频道带宽为1 Mbps
。
然后,默认情况下,通道划分为多少个插槽?
如果分开,每个插槽多少钱?
这一行mac->phymib_.getSlotTime()
给出了什么?
答案 0 :(得分:0)
mac->phymib_.getSlotTime()
返回slot
的持续时间,它是802.11 MAC协议的Distributed Coordination Function(DCF)的参数。
回复:how many slots is the channel divided into.
我认为您将802.11 MAC
与TDMA
混为一谈。
如果您有兴趣在TDMA
中模拟ns2
,则应查看文件mac/mac-tdma.cc
和mac/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