47 NS_LOG_FUNCTION_NOARGS();
49 TypeId(
"ns3::NrPointToPointEpcHelper")
53 .AddAttribute(
"S1uLinkDataRate",
54 "The data rate to be used for the next S1-U link to be created",
55 DataRateValue(DataRate(
"10Gb/s")),
56 MakeDataRateAccessor(&NrPointToPointEpcHelper::m_s1uLinkDataRate),
57 MakeDataRateChecker())
58 .AddAttribute(
"S1uLinkDelay",
59 "The delay to be used for the next S1-U link to be created",
60 TimeValue(Seconds(0)),
61 MakeTimeAccessor(&NrPointToPointEpcHelper::m_s1uLinkDelay),
63 .AddAttribute(
"S1uLinkMtu",
64 "The MTU of the next S1-U link to be created. Note that, because of the "
65 "additional GTP/UDP/IP tunneling overhead, you need a MTU larger than "
66 "the end-to-end MTU that you want to support.",
68 MakeUintegerAccessor(&NrPointToPointEpcHelper::m_s1uLinkMtu),
69 MakeUintegerChecker<uint16_t>())
70 .AddAttribute(
"S1uLinkPcapPrefix",
71 "Prefix for Pcap generated by S1-U link",
73 MakeStringAccessor(&NrPointToPointEpcHelper::m_s1uLinkPcapPrefix),
75 .AddAttribute(
"S1uLinkEnablePcap",
76 "Enable Pcap for X2 link",
78 MakeBooleanAccessor(&NrPointToPointEpcHelper::m_s1uLinkEnablePcap),
79 MakeBooleanChecker());
98 Ptr<NetDevice> nrGnbNetDevice,
99 std::vector<uint16_t> cellIds)
101 NS_LOG_FUNCTION(
this << gnb << nrGnbNetDevice << cellIds.size());
109 PointToPointHelper p2ph;
110 p2ph.SetDeviceAttribute(
"DataRate", DataRateValue(m_s1uLinkDataRate));
111 p2ph.SetDeviceAttribute(
"Mtu", UintegerValue(m_s1uLinkMtu));
112 p2ph.SetChannelAttribute(
"Delay", TimeValue(m_s1uLinkDelay));
113 NetDeviceContainer gnbSgwDevices = p2ph.Install(gnb, sgw);
114 NS_LOG_LOGIC(
"Ipv4 ifaces of the gNB after installing p2p dev: "
115 << gnb->GetObject<Ipv4>()->GetNInterfaces());
117 if (m_s1uLinkEnablePcap)
119 p2ph.EnablePcapAll(m_s1uLinkPcapPrefix);
122 m_s1uIpv4AddressHelper.NewNetwork();
123 Ipv4InterfaceContainer gnbSgwIpIfaces = m_s1uIpv4AddressHelper.Assign(gnbSgwDevices);
124 NS_LOG_LOGIC(
"number of Ipv4 ifaces of the gNB after assigning Ipv4 addr to S1 dev: "
125 << gnb->GetObject<Ipv4>()->GetNInterfaces());
127 Ipv4Address gnbS1uAddress = gnbSgwIpIfaces.GetAddress(0);
128 Ipv4Address sgwS1uAddress = gnbSgwIpIfaces.GetAddress(1);