LTE Module User Documentation(翻译8)——核心网(EPC)
LTE用户文档
(如有不当的地方,欢迎指正!)
14 Evolved Packet Core (EPC)
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
Ptr<Node> pgw = epcHelper->GetPgwNode ();
// 创建一个远程主机
NodeContainer remoteHostContainer;
remoteHostContainer.Create ();
Ptr<Node> remoteHost = remoteHostContainer.Get ();
InternetStackHelper internet;
internet.Install (remoteHostContainer); // 创建 internet
PointToPointHelper p2ph;
p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
p2ph.SetDeviceAttribute ("Mtu", UintegerValue ());
p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
Ipv4AddressHelper ipv4h;
ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
// 接口 0 为本地主机,1 为 p2p 设备
Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress ();
Ipv4StaticRoutingHelper ipv4RoutingHelper;
Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), );
NodeContainer ueNodes;
NodeContainer enbNodes;
NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);
lteHelper->Attach (ueLteDevs, enbLteDevs.Get ());
// 在用户上安装 IP 协议栈
InternetStackHelper internet;
internet.Install (ueNodes); // 给用户分配 IP 地址
for (uint32_t u = ; u < ueNodes.GetN (); ++u)
{
Ptr<Node> ue = ueNodes.Get (u);
Ptr<NetDevice> ueLteDevice = ueLteDevs.Get (u);
Ipv4InterfaceContainer ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevice));
// 为用户设置默认网关
Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ue->GetObject<Ipv4> ());
ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), );
}
Ptr<EpcTft> tft = Create<EpcTft> ();
EpcTft::PacketFilter pf;
pf.localPortStart = ;
pf.localPortEnd = ;
tft->Add (pf);
lteHelper->ActivateDedicatedEpsBearer (ueLteDevs, EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), tft);
uint16_t dlPort = ;
PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), dlPort));
ApplicationContainer serverApps = packetSinkHelper.Install (ue);
serverApps.Start (Seconds (0.01));
UdpClientHelper client (ueIpIface.GetAddress (), dlPort);
ApplicationContainer clientApps = client.Install (remoteHost);
clientApps.Start (Seconds (0.01));
Simulator::Stop (Seconds (10.0));
Simulator::Run ();
参考文献
https://www.nsnam.org/docs/models/html/lte-user.html
LTE Module User Documentation(翻译8)——核心网(EPC)的更多相关文章
- LTE Module User Documentation(翻译1)——背景、使用概述、基本的仿真程序和配置LTE模型参数
LTE用户文档 (如有不当的地方,欢迎指正!) 1.背景 假定读者已经熟悉 ns-3 simulator ,能运行一般的仿真程序.如果不是的话,强烈推荐读者参考 [ns3tutorial]. 2. ...
- LTE Module User Documentation(翻译15)——示例程序、参考场景以及故障检测和调试技巧
LTE用户文档 (如有不当的地方,欢迎指正!) 21 Examples Programs(示例程序) 路径 src/lte/examples/ 包含一些示例仿真程序,这些例子表明如何仿真不 ...
- LTE Module User Documentation(翻译14)——Uplink Power Control(上行功率控制)
LTE用户文档 (如有不当的地方,欢迎指正!) 20 Uplink Power Control(上行功率控制) 上行功率控制功能默认是开启的.用户可以通过设置布尔属性 ns3::LteUePhy: ...
- LTE Module User Documentation(翻译13)——频率复用算法(Frequency Reuse Algorithms)
LTE用户文档 (如有不当的地方,欢迎指正!) 19 Frequency Reuse Algorithms(频率复用算法) 本节我们将描述如何在 LTE 仿真中使用频率复用(FR)算法.共有两 ...
- LTE Module User Documentation(翻译12)——X2切换(X2-based handover)
LTE用户文档 (如有不当的地方,欢迎指正!) 18 X2-based handover 正如 3GPP 定义的,切换是改变用户服务小区的连接方式的过程.这一过程中涉及的两个基站通常称为源基站和目 ...
- LTE Module User Documentation(翻译11)——配置用户测量
LTE用户文档 (如有不当的地方,欢迎指正!) 17 Configure UE measurements 仿真中激活的用户测量配置取决于所选的 “consumers”,例如切换算法.用户可能需要添 ...
- LTE Module User Documentation(翻译10)——网络连接(Network Attachment)
LTE用户文档 (如有不当的地方,欢迎指正!) 16 Network Attachment(网络连接) 正如前面章节 Basic simulation program 所述,连接用户到基站时通过调 ...
- LTE Module User Documentation(翻译9)——Using the EPC with emulation mode
LTE用户文档 (如有不当的地方,欢迎指正!) 15 Using the EPC with emulation mode(使用仿真方式的 EPC) 在上一节中,我们使用点对点链路连接基站和服务 ...
- LTE Module User Documentation(翻译7)——无线环境地图(REM)、AMC 模型 和 CQI 计算
LTE用户文档 (如有不当的地方,欢迎指正!) 12 Radio Environment Maps 通过使用类 RadioEnvironmentMapHelper 是可能输出文件 Radio E ...
随机推荐
- <script>元素的位置
脚本元素会组织下载网页内容,浏览器可以同时下载多个组件,但一旦遇到一个外部脚本文本后,浏览器会停止进一步下载,知道这个脚本文件下载,解析并执行完毕.这会严重影响网页载入的总时间,特别是在网页在入时会发 ...
- FastDFS connect timed out
java.net.SocketTimeoutException: connect timed outUpload file "1003.png"fails:connect time ...
- Android Studio编译运行project报错:····· finished with non-zero exit value 1
错误代码: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.ide.c ...
- php对二维数组进行相关操作(排序、转换、去空白等)
php对二维数组进行相关操作(排序.转换.去空白等) 投稿:lijiao 字体:[增加 减小] 类型:转载 时间:2015-11-04 这篇文章主要介绍了php对二维数组进行相关操作,包括php对 ...
- ExtJS笔记 Ext.data.Model
A Model represents some object that your application manages. For example, one might define a Model ...
- awk脚本
$0,意即所有域. 有两种方式保存shell提示符下awk脚本的输出.最简单的方式是使用输出重定向符号>文件名,下面的例子重定向输出到文件wow. #awk '{print $0}' grade ...
- Android Glide数据更新及内存缓存、硬盘缓存清理
[转] 原文 Android Glide数据更新及内存缓存.硬盘缓存清理 Android的Glide在加载图片时候内部默 ...
- 一个ICMP单元
unit ICMPUtils; interface {$IFDEF VER80} { This source file is *NOT* compatible with Delphi 1 becaus ...
- ansible使用笔记
ansible使用笔记 介绍 ansible 是一个模型驱动的配置管理器,支持多节点发布.远程任务执行.默认使用 SSH 进行远程连接.无需在被管理节点上安装附加软件,可使用各种编程语言进行扩展.an ...
- python 多线程就这么简单(续)
之前讲了多线程的一篇博客,感觉讲的意犹未尽,其实,多线程非常有意思.因为我们在使用电脑的过程中无时无刻都在多进程和多线程.我们可以接着之前的例子继续讲.请先看我的上一篇博客. python 多线程就这 ...