写在最前
本文承接前一篇博客。前一篇博客主要是对ALOHA的Server和host的源代码注释,并根据手册介绍了些OMNeT++的相关函数。本文主要简要介绍仿真的配置文件,和整个网络的.ned文件。
网络拓扑结构
Aloha.ned
network Aloha
{
parameters:
int numHosts; // number of hosts
double txRate @unit(bps); // transmission rate
double slotTime @unit(ms); // zero means no slots (pure Aloha)
@display("bgi=background/terrain,s");
submodules:
server: Server;
host[numHosts]: Host {
txRate = txRate;
slotTime = slotTime;
}
}
Aloha.ned文件可以看作描述整个网络拓扑结构的文件。主要定义了Host的数量,传输速率及slotTime(显然)。然后submodules中定义了一个server和一个主机array。
仿真配置文件
比较长,分段解释。
[General]
network = Aloha
#debug-on-errors = true