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 ...
随机推荐
- UrlRewriteFilter
UrlRewriteFilter是一个改写URL的Java Web过滤器,可见将动态URL静态化.适用于任何Java Web服务器(Resin,Jetty,JBoss,Tomcat,Orion等).与 ...
- Ubuntu 常用工具、指令安装
修改source list,使用阿里云的软件源 sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list sed - ...
- PHP- 数字转汉字
//数字转汉字 function number2Chinese($num, $m = 1) { switch($m) { case 0: $CNum = array( array('零','壹','贰 ...
- P1079 Vigenère 密码
#include <bits/stdc++.h> using namespace std; const int maxn = 1005; int main() { freopen(&quo ...
- Java Debug调试简单方法--static使用
Public class Debug { public Debug() { } static void debugPrint(String src) { //System.out.print(src) ...
- 通过 Chrome Workspace 调试本地项目(修改样式时及时保存)
打开 DevTools 开发者工具[F12]中的 Sources 面板,在面板左侧右键选择「Add folder to workspace」,选择添加的文件夹. 添加好后,右键一个文件,选择「Map ...
- centos7下更改java环境
1.上传下载的java包,如http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jre-8u77-linux-x64.rpm,目录可以自己定义一个 ...
- tesseract ocr文字识别Android实例程序和训练工具全部源代码
tesseract ocr是一个开源的文字识别引擎,Android系统中也可以使用.可以识别50多种语言,通过自己训练识别库的方式,可以大大提高识别的准确率. 为了节省大家的学习时间,现将自己近期的学 ...
- python - 文件迭代
>>> f=open('passwd','r')>>> for lines in f:... print lines >>> f=open('pa ...
- PRML读书笔记——Mathematical notation
x, a vector, and all vectors are assumed to be column vectors. M, denote matrices. xT, a row vcetor, ...