A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wimax-helper.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
8 */
9
10#include "wimax-helper.h"
11
12#include "ns3/bs-net-device.h"
13#include "ns3/config.h"
14#include "ns3/log.h"
15#include "ns3/packet.h"
16#include "ns3/pointer.h"
17#include "ns3/simple-ofdm-wimax-channel.h"
18#include "ns3/simple-ofdm-wimax-phy.h"
19#include "ns3/simulator.h"
20#include "ns3/ss-net-device.h"
21#include "ns3/wimax-channel.h"
22#include "ns3/wimax-mac-to-mac-header.h"
23#include "ns3/wimax-net-device.h"
24#include "ns3/wimax-phy.h"
25
26#include <string>
27
28namespace ns3
29{
30
31NS_LOG_COMPONENT_DEFINE("WimaxHelper");
32
34 : m_channel(nullptr)
35{
36}
37
41
42void
44 uint32_t nodeid,
45 uint32_t deviceid,
46 char* netdevice,
47 char* connection)
48{
49 std::ostringstream oss;
50 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::" << netdevice << "/"
51 << connection << "/TxQueue/Enqueue";
52 Config::Connect(oss.str(),
54
55 oss.str("");
56 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::" << netdevice << "/"
57 << connection << "/TxQueue/Dequeue";
58 Config::Connect(oss.str(),
60
61 oss.str("");
62 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::" << netdevice << "/"
63 << connection << "/TxQueue/Drop";
64 Config::Connect(oss.str(),
66}
67
70{
71 Ptr<WimaxPhy> phy;
72 switch (phyType)
73 {
76 if (!m_channel)
77 {
78 m_channel =
80 }
81 break;
82 default:
83 NS_FATAL_ERROR("Invalid physical type");
84 break;
85 }
86
87 return phy;
88}
89
90void
92{
93 if (!m_channel)
94 {
96 }
97 m_channel->GetObject<SimpleOfdmWimaxChannel>()->SetPropagationModel(propagationModel);
98}
99
101WimaxHelper::CreatePhy(PhyType phyType, char* SNRTraceFilePath, bool activateLoss)
102{
103 Ptr<WimaxPhy> phy;
105 switch (phyType)
106 {
109 phy = sphy;
110 sphy->SetSNRToBlockErrorRateTracesPath(SNRTraceFilePath);
111 sphy->ActivateLoss(activateLoss);
112 if (!m_channel)
113 {
114 m_channel =
116 }
117 break;
118 default:
119 NS_FATAL_ERROR("Invalid physical type");
120 break;
121 }
122
123 return phy;
124}
125
128{
129 Ptr<WimaxPhy> phy;
130 switch (phyType)
131 {
134 break;
135 default:
136 NS_FATAL_ERROR("Invalid physical type");
137 break;
138 }
139
140 return phy;
141}
142
144WimaxHelper::CreatePhyWithoutChannel(PhyType phyType, char* SNRTraceFilePath, bool activateLoss)
145{
146 Ptr<WimaxPhy> phy;
148 switch (phyType)
149 {
152 phy = sphy;
153 sphy->SetSNRToBlockErrorRateTracesPath(SNRTraceFilePath);
154 sphy->ActivateLoss(activateLoss);
155 break;
156 default:
157 NS_FATAL_ERROR("Invalid physical type");
158 break;
159 }
160
161 return phy;
162}
163
166{
167 Ptr<UplinkScheduler> uplinkScheduler;
168 switch (schedulerType)
169 {
171 uplinkScheduler = CreateObject<UplinkSchedulerSimple>();
172 break;
173 case SCHED_TYPE_RTPS:
174 uplinkScheduler = CreateObject<UplinkSchedulerRtps>();
175 break;
176 case SCHED_TYPE_MBQOS:
177 uplinkScheduler = CreateObject<UplinkSchedulerMBQoS>(Seconds(0.25));
178 break;
179 default:
180 NS_FATAL_ERROR("Invalid scheduling type");
181 break;
182 }
183 return uplinkScheduler;
184}
185
188{
189 Ptr<BSScheduler> bsScheduler;
190 switch (schedulerType)
191 {
193 bsScheduler = CreateObject<BSSchedulerSimple>();
194 break;
195 case SCHED_TYPE_RTPS:
196 bsScheduler = CreateObject<BSSchedulerRtps>();
197 break;
198 case SCHED_TYPE_MBQOS:
199 bsScheduler = CreateObject<BSSchedulerSimple>();
200 break;
201 default:
202 NS_FATAL_ERROR("Invalid scheduling type");
203 break;
204 }
205 return bsScheduler;
206}
207
210 NetDeviceType deviceType,
211 PhyType phyType,
212 SchedulerType schedulerType,
213 double frameDuration)
214{
215 NetDeviceContainer devices;
216 for (auto i = c.Begin(); i != c.End(); i++)
217 {
218 Ptr<Node> node = *i;
219 Ptr<WimaxPhy> phy = CreatePhy(phyType);
220
221 // Set SuperFrame Duration
222 phy->SetFrameDuration(Seconds(frameDuration));
223
224 Ptr<WimaxNetDevice> device;
225 Ptr<UplinkScheduler> uplinkScheduler = CreateUplinkScheduler(schedulerType);
226 Ptr<BSScheduler> bsScheduler = CreateBSScheduler(schedulerType);
227
228 if (deviceType == DEVICE_TYPE_BASE_STATION)
229 {
230 // attach phy
232 deviceBS = CreateObject<BaseStationNetDevice>(node, phy, uplinkScheduler, bsScheduler);
233 device = deviceBS;
234 uplinkScheduler->SetBs(deviceBS);
235 bsScheduler->SetBs(deviceBS);
236 }
237 else
238 {
240 }
241 device->SetAddress(Mac48Address::Allocate());
242 phy->SetDevice(device);
243 device->Start();
244 device->Attach(m_channel); // attach channel
245
246 node->AddDevice(device);
247
248 devices.Add(device);
249 }
250 return devices;
251}
252
255 NetDeviceType deviceType,
256 PhyType phyType,
257 SchedulerType schedulerType)
258{
259 NetDeviceContainer devices;
260 for (auto i = c.Begin(); i != c.End(); i++)
261 {
262 Ptr<Node> node = *i;
263 Ptr<WimaxPhy> phy = CreatePhy(phyType);
264 Ptr<WimaxNetDevice> device;
265 Ptr<UplinkScheduler> uplinkScheduler = CreateUplinkScheduler(schedulerType);
266 Ptr<BSScheduler> bsScheduler = CreateBSScheduler(schedulerType);
267
268 if (deviceType == DEVICE_TYPE_BASE_STATION)
269 {
270 // attach phy
272 deviceBS = CreateObject<BaseStationNetDevice>(node, phy, uplinkScheduler, bsScheduler);
273 device = deviceBS;
274 uplinkScheduler->SetBs(deviceBS);
275 bsScheduler->SetBs(deviceBS);
276 }
277 else
278 {
280 }
281 device->SetAddress(Mac48Address::Allocate());
282 phy->SetDevice(device);
283 device->Start();
284 device->Attach(m_channel); // attach channel
285
286 node->AddDevice(device);
287
288 devices.Add(device);
289 }
290 return devices;
291}
292
295 NetDeviceType deviceType,
296 PhyType phyType,
297 Ptr<WimaxChannel> channel,
298 SchedulerType schedulerType)
299{
300 NetDeviceContainer devices;
301 for (auto i = c.Begin(); i != c.End(); i++)
302 {
303 Ptr<Node> node = *i;
304
305 Ptr<WimaxPhy> phy = CreatePhyWithoutChannel(phyType, (char*)"dummy", false);
306 Ptr<WimaxNetDevice> device;
307 Ptr<UplinkScheduler> uplinkScheduler = CreateUplinkScheduler(schedulerType);
308 Ptr<BSScheduler> bsScheduler = CreateBSScheduler(schedulerType);
309
310 if (deviceType == DEVICE_TYPE_BASE_STATION)
311 {
313 deviceBS = CreateObject<BaseStationNetDevice>(node, phy, uplinkScheduler, bsScheduler);
314 device = deviceBS;
315 uplinkScheduler->SetBs(deviceBS);
316 bsScheduler->SetBs(deviceBS);
317 }
318 else
319 {
321 }
322 device->SetAddress(Mac48Address::Allocate());
323 phy->SetDevice(device);
324 device->Start();
325 device->Attach(channel);
326
327 node->AddDevice(device);
328 devices.Add(device);
329 }
330 return devices;
331}
332
335 NetDeviceType deviceType,
336 PhyType phyType,
337 Ptr<WimaxChannel> channel,
338 SchedulerType schedulerType)
339{
340 // Ptr<WimaxPhy> phy = CreatePhyWithoutChannel (phyType);
341 Ptr<WimaxPhy> phy = CreatePhyWithoutChannel(phyType, (char*)"dummy", false);
342 Ptr<WimaxNetDevice> device;
343 Ptr<UplinkScheduler> uplinkScheduler = CreateUplinkScheduler(schedulerType);
344 Ptr<BSScheduler> bsScheduler = CreateBSScheduler(schedulerType);
345
346 if (deviceType == DEVICE_TYPE_BASE_STATION)
347 {
349 deviceBS = CreateObject<BaseStationNetDevice>(node, phy, uplinkScheduler, bsScheduler);
350 device = deviceBS;
351 uplinkScheduler->SetBs(deviceBS);
352 bsScheduler->SetBs(deviceBS);
353 }
354 else
355 {
357 }
358 device->SetAddress(Mac48Address::Allocate());
359 phy->SetDevice(device);
360 device->Start();
361 device->Attach(channel);
362
363 node->AddDevice(device);
364
365 return device;
366}
367
368void
370{
371 LogComponentEnable("BandwidthManager", LOG_LEVEL_ALL);
372 LogComponentEnable("BSLinkManager", LOG_LEVEL_ALL);
373 LogComponentEnable("BaseStationNetDevice", LOG_LEVEL_ALL);
374 LogComponentEnable("BSSchedulerRtps", LOG_LEVEL_ALL);
375 LogComponentEnable("BSSchedulerSimple", LOG_LEVEL_ALL);
376 LogComponentEnable("BSScheduler", LOG_LEVEL_ALL);
377 LogComponentEnable("BsServiceFlowManager", LOG_LEVEL_ALL);
378 LogComponentEnable("UplinkSchedulerMBQoS", LOG_LEVEL_ALL);
379 LogComponentEnable("UplinkSchedulerRtps", LOG_LEVEL_ALL);
380 LogComponentEnable("UplinkSchedulerSimple", LOG_LEVEL_ALL);
381 LogComponentEnable("UplinkScheduler", LOG_LEVEL_ALL);
382 LogComponentEnable("BurstProfileManager", LOG_LEVEL_ALL);
383 LogComponentEnable("ConnectionManager", LOG_LEVEL_ALL);
384 LogComponentEnable("IpcsClassifierRecord", LOG_LEVEL_ALL);
385 LogComponentEnable("IpcsClassifier", LOG_LEVEL_ALL);
386 LogComponentEnable("MACMESSAGES", LOG_LEVEL_ALL);
387 LogComponentEnable("PacketBurst", LOG_LEVEL_ALL);
388 LogComponentEnable("ServiceFlowManager", LOG_LEVEL_ALL);
389 LogComponentEnable("simpleOfdmWimaxChannel", LOG_LEVEL_ALL);
390 LogComponentEnable("SimpleOfdmWimaxPhy", LOG_LEVEL_ALL);
391 LogComponentEnable("SNRToBlockErrorRateManager", LOG_LEVEL_ALL);
392 LogComponentEnable("SSLinkManager", LOG_LEVEL_ALL);
393 LogComponentEnable("SSManager", LOG_LEVEL_ALL);
394 LogComponentEnable("SubscriberStationNetDevice", LOG_LEVEL_ALL);
395 LogComponentEnable("SSScheduler", LOG_LEVEL_ALL);
396 LogComponentEnable("SsServiceFlowManager", LOG_LEVEL_ALL);
397 LogComponentEnable("WimaxChannel", LOG_LEVEL_ALL);
398 LogComponentEnable("WimaxMacQueue", LOG_LEVEL_ALL);
399 LogComponentEnable("WimaxNetDevice", LOG_LEVEL_ALL);
402 LogComponentEnable("BandwidthManager", LOG_LEVEL_ALL);
403 LogComponentEnable("BaseStationNetDevice", LOG_LEVEL_ALL);
404 LogComponentEnable("BSSchedulerRtps", LOG_LEVEL_ALL);
405 LogComponentEnable("BSSchedulerSimple", LOG_LEVEL_ALL);
406 LogComponentEnable("BSScheduler", LOG_LEVEL_ALL);
407 LogComponentEnable("SubscriberStationNetDevice", LOG_LEVEL_ALL);
408 LogComponentEnable("SSScheduler", LOG_LEVEL_ALL);
409 LogComponentEnable("WimaxMacQueue", LOG_LEVEL_ALL);
410}
411
412void
414 std::string path,
415 Ptr<const Packet> packet,
416 const Mac48Address& source)
417{
418 *stream->GetStream() << "r " << Simulator::Now().GetSeconds() << " from: " << source << " ";
419 *stream->GetStream() << path << std::endl;
420}
421
422void
424 std::string path,
425 Ptr<const Packet> packet,
426 const Mac48Address& dest)
427{
428 *stream->GetStream() << "t " << Simulator::Now().GetSeconds() << " to: " << dest << " ";
429 *stream->GetStream() << path << std::endl;
430}
431
434 ServiceFlow::SchedulingType schedulingType,
435 IpcsClassifierRecord classifier)
436{
437 CsParameters csParam(CsParameters::ADD, classifier);
438 ServiceFlow serviceFlow = ServiceFlow(direction);
439 serviceFlow.SetConvergenceSublayerParam(csParam);
441 serviceFlow.SetServiceSchedulingType(schedulingType);
442 serviceFlow.SetMaxSustainedTrafficRate(100);
443 serviceFlow.SetMinReservedTrafficRate(1000000);
444 serviceFlow.SetMinTolerableTrafficRate(1000000);
445 serviceFlow.SetMaximumLatency(100);
446 serviceFlow.SetMaxTrafficBurst(2000);
447 serviceFlow.SetTrafficPriority(1);
448 serviceFlow.SetUnsolicitedGrantInterval(1);
449 serviceFlow.SetMaxSustainedTrafficRate(70);
450 serviceFlow.SetToleratedJitter(10);
451 serviceFlow.SetSduSize(49);
452 serviceFlow.SetRequestTransmissionPolicy(0);
453 return serviceFlow;
454}
455
456void
458 std::string prefix,
460 bool explicitFilename)
461{
462 //
463 // All of the ascii enable functions vector through here including the ones
464 // that are wandering through all of devices on perhaps all of the nodes in
465 // the system. We can only deal with devices of type CsmaNetDevice.
466 //
467 Ptr<WimaxNetDevice> device = nd->GetObject<WimaxNetDevice>();
468 if (!device)
469 {
470 NS_LOG_INFO("WimaxHelper::EnableAsciiInternal(): Device "
471 << device << " not of type ns3::WimaxNetDevice");
472 return;
473 }
474
475 //
476 // Our default trace sinks are going to use packet printing, so we have to
477 // make sure that is turned on.
478 //
480
481 //
482 // If we are not provided an OutputStreamWrapper, we are expected to create
483 // one using the usual trace filename conventions and do a Hook*WithoutContext
484 // since there will be one file per context and therefore the context would
485 // be redundant.
486 //
487 if (!stream)
488 {
489 //
490 // Set up an output stream object to deal with private ofstream copy
491 // constructor and lifetime issues. Let the helper decide the actual
492 // name of the file given the prefix.
493 //
494 AsciiTraceHelper asciiTraceHelper;
495 std::string filename;
496 if (explicitFilename)
497 {
498 filename = prefix;
499 }
500 else
501 {
502 filename = asciiTraceHelper.GetFilenameFromDevice(prefix, device);
503 }
504 Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream(filename);
505
506 uint32_t nodeid = nd->GetNode()->GetId();
507 uint32_t deviceid = nd->GetIfIndex();
508 std::ostringstream oss;
509 //
510 // The MacRx trace source provides our "r" event.
511 //
512
513 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WimaxNetDevice/Rx";
515 oss.str("");
516 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WimaxNetDevice/Tx";
518 //
519 // The "+", '-', and 'd' events are driven by trace sources actually in the
520 // transmit queue.
521 //
522
523 EnableAsciiForConnection(theStream,
524 nodeid,
525 deviceid,
526 (char*)"WimaxNetDevice",
527 (char*)"InitialRangingConnection");
528 EnableAsciiForConnection(theStream,
529 nodeid,
530 deviceid,
531 (char*)"WimaxNetDevice",
532 (char*)"BroadcastConnection");
533
534 // The following connections can not be made right away because the BasicConnection and the
535 // PrimaryConnection are created later. We defer the creation to the
536 // SubscriberStationNetDevice
537
538 // EnableAsciiForConnection (theStream, nodeid, deviceid, (char*)
539 // "SubscriberStationNetDevice", (char*) "BasicConnection"); EnableAsciiForConnection
540 // (theStream, nodeid, deviceid, (char*) "SubscriberStationNetDevice", (char*)
541 // "PrimaryConnection");
542
544 if (ssNetDev)
545 {
548 ssNetDev->SetAsciiTxQueueEnqueueCallback(EnqueueCb);
549
552 ssNetDev->SetAsciiTxQueueDequeueCallback(DequeueCb);
553
556 ssNetDev->SetAsciiTxQueueDropCallback(DropCb);
557 }
558
559 return;
560 }
561
562 //
563 // If we are provided an OutputStreamWrapper, we are expected to use it, and
564 // to provide a context. We are free to come up with our own context if we
565 // want, and use the AsciiTraceHelper Hook*WithContext functions, but for
566 // compatibility and simplicity, we just use Config::Connect and let it deal
567 // with the context.
568 //
569 // Note that we are going to use the default trace sinks provided by the
570 // ascii trace helper. There is actually no AsciiTraceHelper in sight here,
571 // but the default trace sinks are actually publicly available static
572 // functions that are always there waiting for just such a case.
573 //
574 uint32_t nodeid = nd->GetNode()->GetId();
575 uint32_t deviceid = nd->GetIfIndex();
576 std::ostringstream oss;
577
578 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WimaxNetDevice/Rx";
580
581 oss.str("");
582 oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WimaxNetDevice/Tx";
584
586 nodeid,
587 deviceid,
588 (char*)"WimaxNetDevice",
589 (char*)"InitialRangingConnection");
591 nodeid,
592 deviceid,
593 (char*)"WimaxNetDevice",
594 (char*)"BroadcastConnection");
595
596 // The following connections can not be made right away because the BasicConnection and the
597 // PrimaryConnection are created later. We defer the creation to the SubscriberStationNetDevice
598
599 // EnableAsciiForConnection (stream, nodeid, deviceid, (char*) "SubscriberStationNetDevice",
600 // (char*) "BasicConnection"); EnableAsciiForConnection (stream, nodeid, deviceid, (char*)
601 // "SubscriberStationNetDevice", (char*) "PrimaryConnection");
602
604 if (ssNetDev)
605 {
608 ssNetDev->SetAsciiTxQueueEnqueueCallback(EnqueueCb);
609
612 ssNetDev->SetAsciiTxQueueDequeueCallback(DequeueCb);
613
616 ssNetDev->SetAsciiTxQueueDropCallback(DropCb);
617 }
618}
619
620/**
621 * \brief print pcap record
622 * \param file pcap file
623 * \param burst packet burst to print
624 */
625static void
627{
628 std::list<Ptr<Packet>> packets = burst->GetPackets();
629 for (auto iter = packets.begin(); iter != packets.end(); ++iter)
630 {
631 Ptr<Packet> p = (*iter)->Copy();
632 WimaxMacToMacHeader m2m(p->GetSize());
633 p->AddHeader(m2m);
634 file->Write(Simulator::Now(), p);
635 }
636}
637
638void
641 bool explicitFilename,
642 bool promiscuous)
643{
644 //
645 // All of the Pcap enable functions vector through here including the ones
646 // that are wandering through all of devices on perhaps all of the nodes in
647 // the system. We can only deal with devices of type WimaxNetDevice.
648 //
649 Ptr<WimaxNetDevice> device = nd->GetObject<WimaxNetDevice>();
650 if (!device)
651 {
652 NS_LOG_INFO("WimaxHelper::EnablePcapInternal(): Device "
653 << &device << " not of type ns3::WimaxNetDevice");
654 return;
655 }
656
657 Ptr<WimaxPhy> phy = device->GetPhy();
658 PcapHelper pcapHelper;
659 std::string filename;
660 if (explicitFilename)
661 {
662 filename = prefix;
663 }
664 else
665 {
666 filename = pcapHelper.GetFilenameFromDevice(prefix, device);
667 }
668
670 pcapHelper.CreateFile(filename, std::ios::out, PcapHelper::DLT_EN10MB);
671
672 phy->TraceConnectWithoutContext("Tx", MakeBoundCallback(&PcapSniffTxRxEvent, file));
673 phy->TraceConnectWithoutContext("Rx", MakeBoundCallback(&PcapSniffTxRxEvent, file));
674}
675
676int64_t
678{
679 NS_LOG_FUNCTION(this << stream);
680 return m_channel->AssignStreams(stream);
681}
682
683int64_t
685{
686 int64_t currentStream = stream;
687 Ptr<NetDevice> netDevice;
688 for (auto i = c.Begin(); i != c.End(); ++i)
689 {
690 netDevice = (*i);
692 if (wimax)
693 {
694 // Handle any random numbers in the PHY objects.
695 currentStream += wimax->GetPhy()->AssignStreams(currentStream);
696 }
697 }
698
699 // Handle any random numbers in the channel.
700 currentStream += m_channel->AssignStreams(currentStream);
701
702 return (currentStream - stream);
703}
704
705} // namespace ns3
Manage ASCII trace files for device models.
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the ascii trace helper figure out a reasonable filename to use for an ascii trace file associated...
static void DefaultDropSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Drop default trace sink.
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits.
static void DefaultEnqueueSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Enqueue default trace sink.
static void DefaultDequeueSinkWithContext(Ptr< OutputStreamWrapper > file, std::string context, Ptr< const Packet > p)
Basic Dequeue default trace sink.
CsParameters class.
IpcsClassifierRecord class.
an EUI-48 address
static Mac48Address Allocate()
Allocate a new Mac48Address.
holds a vector of ns3::NetDevice pointers
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
static void EnablePrinting()
Enable printing packets metadata.
Definition packet.cc:585
Manage pcap files for device models.
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the pcap helper figure out a reasonable filename to use for a pcap file associated with a device.
Ptr< PcapFileWrapper > CreateFile(std::string filename, std::ios::openmode filemode, DataLinkType dataLinkType, uint32_t snapLen=std::numeric_limits< uint32_t >::max(), int32_t tzCorrection=0)
Create and initialize a pcap file.
Smart pointer class similar to boost::intrusive_ptr.
This class implements service flows as described by the IEEE-802.16 standard.
void SetRequestTransmissionPolicy(uint32_t policy)
Set request transmission policy.
void SetCsSpecification(CsSpecification spec)
Set CS specification.
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
void SetServiceSchedulingType(ServiceFlow::SchedulingType schedType)
Set service scheduling type.
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
void SetSduSize(uint8_t sduSize)
Set SDU size.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
void SetToleratedJitter(uint32_t jitter)
Set tolerated jitter.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicited grant interval.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
Direction
Direction enumeration.
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
SimpleOfdmWimaxChannel class.
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:392
SchedulerType
Scheduler Type Different implementations of uplink/downlink scheduler.
@ SCHED_TYPE_RTPS
A simple scheduler - rtPS based scheduler.
@ SCHED_TYPE_MBQOS
An migration-based uplink scheduler.
@ SCHED_TYPE_SIMPLE
A simple priority-based FCFS scheduler.
NetDeviceType
Net Device Type Distinguish a subscriber station(SS) device from base station(BS) device.
@ DEVICE_TYPE_BASE_STATION
Base station(BS) device.
Ptr< WimaxChannel > m_channel
wifi channel
Ptr< WimaxPhy > CreatePhyWithoutChannel(PhyType phyType)
Ptr< UplinkScheduler > CreateUplinkScheduler(SchedulerType schedulerType)
void SetPropagationLossModel(SimpleOfdmWimaxChannel::PropModel propagationModel)
Set the propagation and loss model of the channel.
PhyType
WiMAX Physical layer WiMAX Physical layers with different levels of detail.
~WimaxHelper() override
Ptr< BSScheduler > CreateBSScheduler(SchedulerType schedulerType)
Ptr< WimaxPhy > CreatePhy(PhyType phyType)
WimaxHelper()
Create a Wimax helper in an empty state.
void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override
Enable ascii trace output on the indicated net device.
static void AsciiTxEvent(Ptr< OutputStreamWrapper > stream, std::string path, Ptr< const Packet > packet, const Mac48Address &dest)
ASCII trace transmit event.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static void EnableAsciiForConnection(Ptr< OutputStreamWrapper > oss, uint32_t nodeid, uint32_t deviceid, char *netdevice, char *connection)
Enable ascii trace output on the indicated net device for a given connection.
NetDeviceContainer Install(NodeContainer c, NetDeviceType type, PhyType phyType, SchedulerType schedulerType)
static void EnableLogComponents()
Helper to enable all WimaxNetDevice log components with one statement.
static void AsciiRxEvent(Ptr< OutputStreamWrapper > stream, std::string path, Ptr< const Packet > packet, const Mac48Address &source)
ASCII trace receive event.
ServiceFlow CreateServiceFlow(ServiceFlow::Direction direction, ServiceFlow::SchedulingType schedulingType, IpcsClassifierRecord classifier)
Creates a transport service flow.
void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool explicitFilename, bool promiscuous) override
Enable pcap output on the indicated net device.
this class implements the mac to mac header needed to dump a wimax pcap file The header format was re...
Hold together all WiMAX-related objects in a NetDevice.
void Connect(std::string path, const CallbackBase &cb)
Definition config.cc:967
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Definition callback.h:745
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Definition log.cc:291
static void PcapSniffTxRxEvent(Ptr< PcapFileWrapper > file, Ptr< const PacketBurst > burst)
print pcap record
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
@ LOG_LEVEL_ALL
Print everything.
Definition log.h:105