25 #include <ns3/boolean.h>
26 #include <ns3/callback.h>
27 #include <ns3/config.h>
28 #include <ns3/double.h>
31 #include <ns3/pointer.h>
32 #include <ns3/satellite-channel-estimation-error-container.h>
33 #include <ns3/satellite-channel.h>
34 #include <ns3/satellite-enums.h>
35 #include <ns3/satellite-net-device.h>
36 #include <ns3/satellite-phy-rx-carrier-conf.h>
37 #include <ns3/satellite-typedefs.h>
41 NS_LOG_COMPONENT_DEFINE(
"SatUtHelper");
46 NS_OBJECT_ENSURE_REGISTERED(SatUtHelper);
52 TypeId(
"ns3::SatUtHelper")
54 .AddAttribute(
"DaFwdLinkInterferenceModel",
55 "Forward link interference model for dedicated access",
57 MakeEnumAccessor<SatPhyRxCarrierConf::InterferenceModel>(
69 "Forward link error model",
78 .AddAttribute(
"FwdLinkConstantErrorRate",
79 "Constant error rate",
82 MakeDoubleChecker<double>())
83 .AddAttribute(
"LowerLayerServiceConf",
84 "Pointer to lower layer service configuration.",
87 MakePointerChecker<SatLowerLayerServiceConf>())
88 .AddAttribute(
"EnableChannelEstimationError",
89 "Enable channel estimation error in forward link receiver at UT.",
93 .AddAttribute(
"UseCrdsaOnlyForControlPackets",
94 "CRDSA utilized only for control packets or also for user data.",
98 .AddAttribute(
"AsynchronousReturnAccess",
99 "Use asynchronous access methods on the return channel.",
102 MakeBooleanChecker())
103 .AddTraceSource(
"Creation",
106 "ns3::SatTypedefs::CreationCallback");
113 NS_LOG_FUNCTION(
this);
119 : m_carrierBandwidthConverter(),
120 m_fwdLinkCarrierCount(),
124 m_daConstantErrorRate(0.0),
127 m_enableChannelEstimationError(false),
128 m_crdsaOnlyForControl(false),
129 m_asyncAccess(false),
132 NS_LOG_FUNCTION(
this);
135 NS_FATAL_ERROR(
"SatUtHelper::SatUtHelper - Constructor not in use");
139 uint32_t fwdLinkCarrierCount,
140 Ptr<SatSuperframeSeq> seq,
145 : m_carrierBandwidthConverter(carrierBandwidthConverter),
146 m_fwdLinkCarrierCount(fwdLinkCarrierCount),
147 m_superframeSeq(seq),
148 m_readCtrlCb(readCb),
149 m_reserveCtrlCb(reserveCb),
150 m_sendCtrlCb(sendCb),
153 m_daConstantErrorRate(0.0),
156 m_enableChannelEstimationError(false),
157 m_crdsaOnlyForControl(false),
158 m_raSettings(randomAccessSettings)
160 NS_LOG_FUNCTION(
this << fwdLinkCarrierCount << seq);
164 m_llsConf = CreateObject<SatLowerLayerServiceConf>();
170 NS_LOG_FUNCTION(
this);
183 NS_LOG_FUNCTION(
this << n1);
191 NS_LOG_FUNCTION(
this << n1);
199 NS_LOG_FUNCTION(
this << n1);
201 Config::SetDefault(
"ns3::SatUtPhy::" + n1, v1);
210 Ptr<SatNetDevice> gwNd,
212 Address satUserAddress,
216 NS_LOG_FUNCTION(
this << satId << beamId << fCh << rCh << gwNd << ncc << satUserAddress);
218 NetDeviceContainer devs;
220 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); i++)
223 Install(*i, satId, beamId, fCh, rCh, gwNd, ncc, satUserAddress, cbChannel, cbRouting));
232 NS_LOG_FUNCTION(
this);
234 TraceConnect(
"Creation",
"SatUtHelper", cb);
Callback< uint32_t, Ptr< SatControlMessage > > ReserveCtrlMsgCallback
Callback to reserve an id and initially store the control message.
Callback< void, Address, Address > RoutingUpdateCallback
Callback to update routing and ARP tables after handover.
Callback< uint32_t, uint32_t > SendCtrlMsgCallback
Callback to send a control message and allocate a recv ID for it.
Callback< Ptr< SatControlMessage >, uint32_t > ReadCtrlMsgCallback
Callback to read control messages from container storing control messages.
Callback< SatChannelPair::ChannelPair_t, uint32_t, uint32_t > ChannelPairGetterCallback
Callback for retrieving a pair of SatChannel associated to a beam.
Information of beam users liken UTs and their users.
Callback< double, SatEnums::ChannelType_t, uint32_t, SatEnums::CarrierBandwidthType_t > CarrierBandwidthConverter_t
Callback for carrier bandwidths.
void EnableCreationTraces(Ptr< OutputStreamWrapper > stream, CallbackBase &cb)
Enables creation traces to be written in given file.
SatPhy::ErrorModel m_errorModel
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
SatPhy::InterferenceModel m_daInterferenceModel
bool m_enableChannelEstimationError
Enable channel estimation error modeling at forward link receiver (= UT).
TracedCallback< std::string > m_creationTrace
Trace callback for creation traces.
void SetPhyAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Phy created by the helper.
void Initialize(Ptr< SatLinkResultsFwd > lrFwd)
ObjectFactory m_channelFactory
NetDeviceContainer Install(NodeContainer c, uint32_t satId, uint32_t beamId, Ptr< SatChannel > fCh, Ptr< SatChannel > rCh, Ptr< SatNetDevice > gwNd, Ptr< SatNcc > ncc, Address satUserAddress, SatPhy::ChannelPairGetterCallback cbChannel, SatMac::RoutingUpdateCallback cbRouting)
double m_daConstantErrorRate
Ptr< SatLinkResults > m_linkResults
Ptr< SatLowerLayerServiceConf > m_llsConf
Configured lower layer service configuration.
SatUtHelper()
Default constructor.
ObjectFactory m_deviceFactory
bool m_crdsaOnlyForControl
Planned CRDSA usage:
static TypeId GetTypeId(void)
Derived from Object.
TypeId GetInstanceTypeId(void) const
Derived from Object.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Define RandomAccessSettings as a struct.