LTE Module User Documentation(翻译9)——Using the EPC with emulation mode

 LTE用户文档

(如有不当的地方,欢迎指正!)

15 Using the EPC with emulation mode(使用仿真方式的 EPC)

 
 
在上一节中,我们使用点对点链路连接基站和服务网关 (S1-U 接口) 以及在基站间连接 (X2-U 和 X2-C 接口)。 LTE 模块支持使用仿真(emulation )链路而不是点对点链路。这只是通过下列代码将创建 LteHelper 替换为 EpcHelper 来实现的:
 
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
Ptr<EmuEpcHelper>  epcHelper = CreateObject<EmuEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
epcHelper->Initialize ();
 
属性 ns3::EmuEpcHelper::sgwDeviceName 和 ns3::EmuEpcHelper::enbDeviceName 分别用于在服务网关和基站设置传输 S1-U、 X2-U 和 X2-C 接口的设备名称。现在我们将讲解这个是如何在一个例子中实现的,我们使用虚拟以太网接口来执行程序 lena-simple-epc-emu 。
 
首先,我们正确地编译 ns-3 :
 
# configure
./waf configure --enable-sudo --enable-modules=lte,fd-net-device --enable-examples

# build
./waf
 
然后,我们设置两个虚拟以太网接口,打开 wireshark 观察业务流的走向:
 
# note: you need to be root

# create two paired veth devices
ip link add name veth0 type veth peer name veth1
ip link show

# enable promiscuous mode
ip link set veth0 promisc on
ip link set veth1 promisc on

# bring interfaces up
ip link set veth0 up
ip link set veth1 up

# start wireshark and capture on veth0
wireshark &

 

现在使用模拟时钟运行实例程序:
 
./waf --run lena-simple-epc-emu --command="%s --ns3::EmuEpcHelper::sgwDeviceName=veth0 --ns3::EmuEpcHelper::enbDeviceName=veth1"

 

使用wireshark,你应该会先看到 ARP 协议,然后看到上行和下行链路有一些 GTP 数据包交换。
 
示例程序的默认设置为 1 个基站和 1 个用户。你可以通过命令行参数来修改它,例如:
 
./waf --run lena-simple-epc-emu --command="%s --ns3::EmuEpcHelper::sgwDeviceName=veth0 --ns3::EmuEpcHelper::enbDeviceName=veth1 --nEnbs=2 --nUesPerEnb=2"
 
获取一系列可用的参数:
 
./waf --run lena-simple-epc-emu --command="%s --PrintHelp"

 

为了运行实时时钟:事实证明默认的调试版本对于实时来说太慢。使用 BestEffort 方式软化实时约束并不是一个好主意:一些东西可能出错(例如,ARP 失败),如果这样的话, 你将得不到任何数据包输出。因此,你需要一个良好的硬件和具有静态链接的优化编译模块(optimized build with statically linked modules)。
 
./waf configure -d optimized --enable-static --enable-modules=lte --enable-examples --enable-sudo
 
然后运行实例程序:
 
./waf --run lena-simple-epc-emu --command="%s --ns3::EmuEpcHelper::sgwDeviceName=veth0 --ns3::EmuEpcHelper::enbDeviceName=veth1 --simulatorImplementationType=ns3::RealtimeSimulatorImpl --ns3::RealtimeSimulatorImpl::SynchronizationMode=HardLimit"
 
注意 HardLimit 设置,如果不能实时跟上,会造成程序终止。
 
本节描述的方法可以用于任何类型的网络设备。例如,  [Baldo2014] 描述了它是如何在一个真正的多层次 packet-optical 传输网络运行仿真 LTE-EPC 网络。
 
 
 

参考文献

https://www.nsnam.org/docs/models/html/lte-user.html

posted @ 2016-05-17 17:25  小花开  阅读(930)  评论(0编辑  收藏  举报