diff --git a/src/lte/helper/epc-helper.h b/src/lte/helper/epc-helper.h index 9a4071944..2173d7be1 100644 --- a/src/lte/helper/epc-helper.h +++ b/src/lte/helper/epc-helper.h @@ -169,6 +169,13 @@ public: */ virtual Ipv6Address GetUeDefaultGatewayAddress6 () = 0; + /** + * Assign a fixed random variable stream number to the random variables used. + * + * \param stream first stream index to use + * \return the number of stream indices (possibly zero) that have been assigned + */ + virtual int64_t AssignStreams (int64_t stream) = 0; }; diff --git a/src/lte/helper/lte-helper.cc b/src/lte/helper/lte-helper.cc index 25e350361..ee435a374 100644 --- a/src/lte/helper/lte-helper.cc +++ b/src/lte/helper/lte-helper.cc @@ -1481,6 +1481,10 @@ LteHelper::AssignStreams (NetDeviceContainer c, int64_t stream) currentStream += ueMac->AssignStreams (currentStream); } } + if (m_epcHelper) + { + currentStream += m_epcHelper->AssignStreams (currentStream); + } return (currentStream - stream); } diff --git a/src/lte/helper/lte-helper.h b/src/lte/helper/lte-helper.h index c1363d2e5..c39edc6f0 100644 --- a/src/lte/helper/lte-helper.h +++ b/src/lte/helper/lte-helper.h @@ -652,6 +652,9 @@ public: * If TraceFadingLossModel has been set as the fading model type, this method * will also assign a stream number to it, if none has been assigned before. * + * If an EPC has been configured, streams will be assigned on the EPC + * nodes as well via EpcHelper::AssignStreams (). + * * \param c NetDeviceContainer of the set of net devices for which the * LteNetDevice should be modified to use a fixed stream * \param stream first stream index to use diff --git a/src/lte/helper/no-backhaul-epc-helper.cc b/src/lte/helper/no-backhaul-epc-helper.cc index 6205dc00d..523e0c295 100644 --- a/src/lte/helper/no-backhaul-epc-helper.cc +++ b/src/lte/helper/no-backhaul-epc-helper.cc @@ -568,4 +568,18 @@ NoBackhaulEpcHelper::AddS1Interface (Ptr enb, Ipv4Address enbAddress, Ipv4 enbApp->SetS1apSapMme (m_mmeApp->GetS1apSapMme ()); } +int64_t +NoBackhaulEpcHelper::AssignStreams (int64_t stream) +{ + int64_t currentStream = stream; + NS_ABORT_MSG_UNLESS (m_pgw && m_sgw && m_mme, "Running AssignStreams on empty node pointers"); + InternetStackHelper internet; + NodeContainer nc; + nc.Add (m_pgw); + nc.Add (m_sgw); + nc.Add (m_mme); + currentStream += internet.AssignStreams (nc, currentStream); + return (currentStream - stream); +} + } // namespace ns3 diff --git a/src/lte/helper/no-backhaul-epc-helper.h b/src/lte/helper/no-backhaul-epc-helper.h index 4a31cd43c..63b5003c0 100644 --- a/src/lte/helper/no-backhaul-epc-helper.h +++ b/src/lte/helper/no-backhaul-epc-helper.h @@ -77,6 +77,7 @@ public: virtual Ipv6InterfaceContainer AssignUeIpv6Address (NetDeviceContainer ueDevices); virtual Ipv4Address GetUeDefaultGatewayAddress (); virtual Ipv6Address GetUeDefaultGatewayAddress6 (); + virtual int64_t AssignStreams (int64_t stream) override; protected: /**