A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-net-device.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008,2009 INRIA, UDcast
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 * <amine.ismail@UDcast.com>
20 */
21
22#include "bs-net-device.h"
23
24#include "bandwidth-manager.h"
25#include "bs-link-manager.h"
26#include "bs-scheduler.h"
27#include "bs-uplink-scheduler.h"
29#include "connection-manager.h"
31#include "service-flow.h"
32#include "ss-manager.h"
33#include "ss-record.h"
34#include "wimax-mac-queue.h"
35#include "wimax-phy.h"
36
37#include "ns3/enum.h"
38#include "ns3/ipv4-address.h"
39#include "ns3/llc-snap-header.h"
40#include "ns3/node.h"
41#include "ns3/packet-burst.h"
42#include "ns3/pointer.h"
43#include "ns3/simulator.h"
44#include "ns3/trace-source-accessor.h"
45#include "ns3/uinteger.h"
46
47#include <cmath>
48
49namespace ns3
50{
51
52NS_LOG_COMPONENT_DEFINE("BaseStationNetDevice");
53
54NS_OBJECT_ENSURE_REGISTERED(BaseStationNetDevice);
55
56TypeId
58{
59 static TypeId tid =
60 TypeId("ns3::BaseStationNetDevice")
61
63
64 .SetGroupName("Wimax")
65
66 .AddConstructor<BaseStationNetDevice>()
67
68 .AddAttribute("BSScheduler",
69 "Downlink Scheduler for BS",
72 MakePointerChecker<BSScheduler>())
73
74 .AddAttribute("InitialRangInterval",
75 "Time between Initial Ranging regions assigned by the BS. Maximum is 2s",
76 TimeValue(Seconds(0.05)),
80
81 .AddAttribute("DcdInterval",
82 "Time between transmission of DCD messages. Maximum value is 10s.",
87
88 .AddAttribute("UcdInterval",
89 "Time between transmission of UCD messages. Maximum value is 10s.",
94
95 .AddAttribute("IntervalT8",
96 "Wait for DSA/DSC Acknowledge timeout. Maximum 300ms.",
97 TimeValue(Seconds(0.05)),
101
102 .AddAttribute("RangReqOppSize",
103 "The ranging opportunity size in symbols",
104 UintegerValue(8),
107 MakeUintegerChecker<uint8_t>(1, 256))
108
109 .AddAttribute("BwReqOppSize",
110 "The bandwidth request opportunity size in symbols",
111 UintegerValue(2),
114 MakeUintegerChecker<uint8_t>(1, 256))
115
116 .AddAttribute(
117 "MaxRangCorrectionRetries",
118 "Number of retries on contention Ranging Requests",
119 UintegerValue(16),
122 MakeUintegerChecker<uint8_t>(1, 16))
123
124 .AddAttribute("SSManager",
125 "The ss manager attached to this device.",
126 PointerValue(),
129 MakePointerChecker<SSManager>())
130
131 .AddAttribute("Scheduler",
132 "The BS scheduler attached to this device.",
133 PointerValue(),
136 MakePointerChecker<BSScheduler>())
137
138 .AddAttribute("LinkManager",
139 "The link manager attached to this device.",
140 PointerValue(),
143 MakePointerChecker<BSLinkManager>())
144
145 .AddAttribute("UplinkScheduler",
146 "The uplink scheduler attached to this device.",
147 PointerValue(),
150 MakePointerChecker<UplinkScheduler>())
151
152 .AddAttribute("BsIpcsPacketClassifier",
153 "The uplink IP packet classifier attached to this device.",
154 PointerValue(),
157 MakePointerChecker<IpcsClassifier>())
158
159 .AddAttribute("ServiceFlowManager",
160 "The service flow manager attached to this device.",
161 PointerValue(),
164 MakePointerChecker<ServiceFlowManager>())
165
166 .AddTraceSource("BSTx",
167 "A packet has been received from higher layers "
168 "and is being processed in preparation "
169 "for queueing for transmission.",
171 "ns3::Packet::TracedCallback")
172
173 .AddTraceSource("BSTxDrop",
174 "A packet has been dropped in the MAC layer "
175 "before being queued for transmission.",
177 "ns3::Packet::TracedCallback")
178
179 .AddTraceSource("BSPromiscRx",
180 "A packet has been received by this device, "
181 "has been passed up from the physical layer "
182 "and is being forwarded up the local protocol stack. "
183 "This is a promiscuous trace,",
185 "ns3::Packet::TracedCallback")
186
187 .AddTraceSource("BSRx",
188 "A packet has been received by this device, "
189 "has been passed up from the physical layer "
190 "and is being forwarded up the local protocol stack. "
191 "This is a non-promiscuous trace,",
193 "ns3::Packet::TracedCallback")
194
195 .AddTraceSource("BSRxDrop",
196 "A packet has been dropped in the MAC layer "
197 "after it has been passed up from the physical layer.",
199 "ns3::Packet::TracedCallback");
200 return tid;
201}
202
204{
206}
207
208void
210{
211 m_initialRangInterval = Seconds(0.05); // maximum is 2
212 m_dcdInterval = Seconds(3); // maximum is 10
213 m_ucdInterval = Seconds(3); // maximum is 10
214 m_intervalT8 = MilliSeconds(50); // maximum is 300 milliseconds
218 8; // 8 symbols = 2 (preamble) + 2 (RNG-REQ) + 4 (round-trip propagation time)
219 m_bwReqOppSize = 2; // 2 symbols = 1 (preamble) + 1 (bandwidth request header)
220 m_nrDlSymbols = 0;
221 m_nrUlSymbols = 0;
222 m_nrDlMapSent = 0;
223 m_nrUlMapSent = 0;
224 m_nrDcdSent = 0;
225 m_nrUcdSent = 0;
230 m_nrDlFrames = 0;
231 m_nrUlFrames = 0;
242 m_linkManager = CreateObject<BSLinkManager>(this);
243 m_cidFactory = new CidFactory();
244 m_ssManager = CreateObject<SSManager>();
245 m_bsClassifier = CreateObject<IpcsClassifier>();
246 m_serviceFlowManager = CreateObject<BsServiceFlowManager>(this);
247}
248
250{
252 this->SetNode(node);
253 this->SetPhy(phy);
254}
255
257 Ptr<WimaxPhy> phy,
258 Ptr<UplinkScheduler> uplinkScheduler,
259 Ptr<BSScheduler> bsScheduler)
260{
262 this->SetNode(node);
263 this->SetPhy(phy);
264 m_uplinkScheduler = uplinkScheduler;
265 m_scheduler = bsScheduler;
266}
267
269{
270}
271
272void
274{
275 delete m_cidFactory;
276
277 m_linkManager = nullptr;
278 m_ssManager = nullptr;
279 m_bsClassifier = nullptr;
280 m_serviceFlowManager = nullptr;
281 m_uplinkScheduler = nullptr;
282 m_cidFactory = nullptr;
283 m_ssManager = nullptr;
284 m_uplinkScheduler = nullptr;
285 m_scheduler = nullptr;
286
288}
289
290void
292{
293 m_bsClassifier = bsc;
294}
295
298{
299 return m_bsClassifier;
300}
301
302void
304{
305 m_initialRangInterval = initialRangInterval;
306}
307
308Time
310{
312}
313
314void
316{
317 m_dcdInterval = dcdInterval;
318}
319
320Time
322{
323 return m_dcdInterval;
324}
325
326void
328{
329 m_ucdInterval = ucdInterval;
330}
331
332Time
334{
335 return m_ucdInterval;
336}
337
338void
340{
341 m_intervalT8 = interval;
342}
343
344Time
346{
347 return m_intervalT8;
348}
349
350void
352{
353 m_maxRangCorrectionRetries = maxRangCorrectionRetries;
354}
355
356uint8_t
358{
360}
361
362void
364{
365 m_maxInvitedRangRetries = maxInvitedRangRetries;
366}
367
368uint8_t
370{
372}
373
374void
376{
377 m_rangReqOppSize = rangReqOppSize;
378}
379
380uint8_t
382{
383 return m_rangReqOppSize;
384}
385
386void
388{
389 m_bwReqOppSize = bwReqOppSize;
390}
391
392uint8_t
394{
395 return m_bwReqOppSize;
396}
397
398void
400{
401 m_nrDlSymbols = nrDlSymbols;
402}
403
406{
407 return m_nrDlSymbols;
408}
409
410void
412{
413 m_nrUlSymbols = nrUlSymbols;
414}
415
418{
419 return m_nrUlSymbols;
420}
421
424{
425 return m_nrDcdSent;
426}
427
430{
431 return m_nrUcdSent;
432}
433
434Time
436{
438}
439
440Time
442{
444}
445
446uint8_t
448{
449 return m_rangingOppNumber;
450}
451
454{
455 return m_ssManager;
456}
457
458void
460{
461 m_ssManager = ssm;
462}
463
466{
468}
469
470void
472{
474}
475
478{
479 return m_uplinkScheduler;
480}
481
482void
484{
485 m_uplinkScheduler = uls;
486}
487
490{
491 return m_linkManager;
492}
493
494void
496{
497 m_linkManager = lm;
498}
499
500void
502{
503 m_scheduler = bss;
504}
505
508{
509 return m_scheduler;
510}
511
512Time
514{
515 return m_psDuration;
516}
517
518Time
520{
521 return m_symbolDuration;
522}
523
524void
526{
528 GetConnectionManager()->SetCidFactory(m_cidFactory);
529 GetPhy()->SetPhyParameters();
530 GetPhy()->SetDataRates();
531 SetTtg(GetPhy()->GetTtg());
532 SetRtg(GetPhy()->GetRtg());
533 m_psDuration = GetPhy()->GetPsDuration();
534 m_symbolDuration = GetPhy()->GetSymbolDuration();
535 GetBandwidthManager()->SetSubframeRatio();
536
538 GetPhy()->SetSimplex(m_linkManager->SelectDlChannel());
540
541 /* shall actually be 2 symbols = 1 (preamble) + 1 (bandwidth request header)*/
542 m_bwReqOppSize = 6;
543 m_uplinkScheduler->InitOnce();
544}
545
546void
548{
549}
550
551void
553{
554 // setting DL/UL subframe allocation for this frame
555 uint32_t symbolsPerFrame = GetPhy()->GetSymbolsPerFrame();
556 SetNrDlSymbols((symbolsPerFrame / 2) -
557 static_cast<uint32_t>(std::ceil(GetTtg() * m_psDuration.GetSeconds() /
559 SetNrUlSymbols((symbolsPerFrame / 2) -
560 static_cast<uint32_t>(std::ceil(GetRtg() * m_psDuration.GetSeconds() /
562
564
565 NS_LOG_INFO("----------------------frame" << GetNrFrames() + 1 << "----------------------");
566
568}
569
570void
572{
573 m_dlSubframeStartTime = Simulator::Now(); // same as m_frameStartTime
574
575 NS_LOG_DEBUG("DL frame started : " << m_frameStartTime.As(Time::S));
576
580 m_uplinkScheduler->Schedule();
582 m_scheduler->Schedule();
583 SendBursts();
586 this);
587}
588
589void
591{
592 m_nrDlFrames++;
596 this);
597}
598
599void
601{
603
604 NS_LOG_INFO("UL frame started : " << m_ulSubframeStartTime.As(Time::S));
605
611 this);
612}
613
614void
616{
617 m_nrUlFrames++;
621 this);
622}
623
624void
626{
627 StartFrame();
628}
629
630bool
632 const Mac48Address& source,
633 const Mac48Address& dest,
634 uint16_t protocolNumber)
635{
636 Ptr<PacketBurst> burst = Create<PacketBurst>();
637 ServiceFlow* serviceFlow = nullptr;
638
639 NS_LOG_INFO("BS (" << source << "):");
640 NS_LOG_INFO("\tSending packet...");
641 NS_LOG_INFO("\t\tDestination: " << dest);
642 NS_LOG_INFO("\t\tPacket Size: " << packet->GetSize());
643 NS_LOG_INFO("\t\tProtocol: " << protocolNumber);
644
645 if (protocolNumber == 2048)
646 {
647 serviceFlow = m_bsClassifier->Classify(packet,
650 }
651
652 if (protocolNumber != 2048 || serviceFlow == nullptr)
653 {
654 serviceFlow = *GetServiceFlowManager()->GetServiceFlows(ServiceFlow::SF_TYPE_ALL).begin();
655 }
656
657 if (serviceFlow == nullptr)
658 {
659 NS_LOG_INFO("No Service Flow!!");
660 m_bsTxDropTrace(packet);
661 return false;
662 }
663 if (serviceFlow->GetIsEnabled())
664 {
665 if (!Enqueue(packet, MacHeaderType(), serviceFlow->GetConnection()))
666 {
667 NS_LOG_INFO("Enqueue Error!!");
668 m_bsTxDropTrace(packet);
669 return false;
670 }
671 }
672 else
673 {
674 m_bsTxDropTrace(packet);
675 NS_LOG_INFO("Service Flow is not enabled");
676 return false;
677 }
678 m_bsTxTrace(packet);
679
680 return true;
681}
682
683bool
685 const MacHeaderType& hdrType,
686 Ptr<WimaxConnection> connection)
687{
689 connection,
690 "BS: Can not enqueue packet on the selected connection: the connection is not initialized");
691
693 hdr.SetLen(packet->GetSize() + hdr.GetSerializedSize());
694
695 hdr.SetCid(connection->GetCid());
696
697 return connection->Enqueue(packet, hdrType, hdr);
698}
699
700void
702{
703 GenericMacHeader gnrcMacHdr;
704 BandwidthRequestHeader bwRequestHdr;
705 ManagementMessageType msgType;
706 RngReq rngReq;
707 Cid cid;
708 uint8_t type = 0;
709 GrantManagementSubheader grantMgmntSubhdr;
710 Mac48Address source;
711 LlcSnapHeader llc;
712 Ptr<WimaxConnection> connection = nullptr;
713 FragmentationSubheader fragSubhdr;
714 bool fragmentation = false; // it becomes true when there is a fragmentation subheader
715
716 packet->RemoveHeader(gnrcMacHdr);
717 if (gnrcMacHdr.GetHt() == MacHeaderType::HEADER_TYPE_GENERIC)
718 {
719 if (!gnrcMacHdr.check_hcs())
720 {
721 // The header is noisy
722 m_bsRxDropTrace(packet);
723 NS_LOG_INFO("Header HCS ERROR");
724 return;
725 }
726
727 cid = gnrcMacHdr.GetCid();
728
729 // checking for subheaders (only grant management subheader is implemented)
730 type = gnrcMacHdr.GetType();
731 if (type)
732 {
733 // checking 1st bit, see Table 6
734 if (type & 1)
735 {
736 packet->RemoveHeader(grantMgmntSubhdr);
737 }
738 // Check if there is a fragmentation Subheader
739 uint8_t tmpType = type;
740 if (((tmpType >> 2) & 1) == 1)
741 {
742 // a TRANSPORT packet with fragmentation subheader has been received!
743 NS_LOG_INFO("FRAG_DEBUG: DoReceive -> the packet is a fragment" << std::endl);
744 fragmentation = true;
745 }
746 }
747
748 if (cid.IsInitialRanging()) // initial ranging connection
749 {
750 packet->RemoveHeader(msgType);
751 switch (msgType.GetType())
752 {
754 packet->RemoveHeader(rngReq);
755 m_linkManager->ProcessRangingRequest(cid, rngReq);
756 break;
757 }
759 // from other base station, ignore
760 break;
761 default:
762 NS_FATAL_ERROR("Invalid message type");
763 }
764 }
765 else if (m_cidFactory->IsBasic(cid)) // basic management connection
766 {
767 source = m_ssManager->GetMacAddress(cid);
768 m_traceBSRx(packet, source, cid);
769 packet->RemoveHeader(msgType);
770 switch (msgType.GetType())
771 {
773 packet->RemoveHeader(rngReq);
774 m_linkManager->ProcessRangingRequest(cid, rngReq);
775 break;
776 }
778 // from other base station, ignore
779 break;
780 default:
781 NS_FATAL_ERROR("Invalid message type");
782 }
783 }
784 else if (m_cidFactory->IsPrimary(cid)) // primary management connection
785 {
786 source = m_ssManager->GetMacAddress(cid);
787 m_traceBSRx(packet, source, cid);
788 packet->RemoveHeader(msgType);
789 switch (msgType.GetType())
790 {
792 // not yet implemented
794 // from other base station, ignore
795 break;
797 DsaReq dsaReq;
798 packet->RemoveHeader(dsaReq);
799 GetServiceFlowManager()->AllocateServiceFlows(dsaReq, cid);
800 break;
801 }
803
804 /*from other base station, as DSA initiated
805 from BS is not supported, ignore*/
806 break;
808 Simulator::Cancel(GetServiceFlowManager()->GetDsaAckTimeoutEvent());
809 DsaAck dsaAck;
810 packet->RemoveHeader(dsaAck);
811 GetServiceFlowManager()->ProcessDsaAck(dsaAck, cid);
812 break;
813 }
814 default:
815 NS_FATAL_ERROR("Invalid message type");
816 }
817 }
818 else if (cid.IsBroadcast()) // broadcast connection
819 {
820 // from other base station, ignore
821 // or perhaps data packet (using other protocol) for BS, handle later
822 return;
823 }
824 else // transport connection
825 {
826 // If fragmentation is true, the packet is a fragment.
827 Ptr<Packet> C_Packet = packet->Copy();
828 if (!fragmentation)
829 {
830 C_Packet->RemoveHeader(llc);
831 source = m_ssManager->GetMacAddress(cid);
832 m_bsRxTrace(packet);
833 ForwardUp(packet->Copy(), source, Mac48Address::GetBroadcast());
834 }
835 else
836 {
837 NS_LOG_INFO("FRAG_DEBUG: BS DoReceive, the Packet is a fragment" << std::endl);
838 packet->RemoveHeader(fragSubhdr);
839 uint32_t fc = fragSubhdr.GetFc();
840 NS_LOG_INFO("\t fragment size = " << packet->GetSize() << std::endl);
841 if (fc == 2)
842 {
843 // This is the latest fragment.
844 // Take the fragment queue, defragment a packet and send it to the upper layer
845 NS_LOG_INFO("\t Received the latest fragment" << std::endl);
846 GetConnectionManager()->GetConnection(cid)->FragmentEnqueue(packet);
847 WimaxConnection::FragmentsQueue fragmentsQueue =
848 GetConnectionManager()->GetConnection(cid)->GetFragmentsQueue();
849 Ptr<Packet> fullPacket = Create<Packet>();
850
851 // DEFRAGMENTATION
852 NS_LOG_INFO("\t BS PACKET DEFRAGMENTATION" << std::endl);
853 for (auto iter = fragmentsQueue.begin(); iter != fragmentsQueue.end(); ++iter)
854 {
855 // Create the whole Packet
856 fullPacket->AddAtEnd(*iter);
857 }
858 GetConnectionManager()->GetConnection(cid)->ClearFragmentsQueue();
859
860 NS_LOG_INFO("\t fullPacket size = " << fullPacket->GetSize() << std::endl);
861 source = m_ssManager->GetMacAddress(cid);
862 m_bsRxTrace(fullPacket);
863 ForwardUp(fullPacket->Copy(), source, Mac48Address::GetBroadcast());
864 }
865 else
866 {
867 // This is the first or middle fragment.
868 // Take the fragment queue, store the fragment into the queue
869 NS_LOG_INFO("\t Received the first or the middle fragment" << std::endl);
870 GetConnectionManager()->GetConnection(cid)->FragmentEnqueue(packet);
871 }
872 }
873 }
874 }
875 else
876 {
877 // bandwidth request header
878 packet->AddHeader(gnrcMacHdr);
879 packet->RemoveHeader(bwRequestHdr);
881 "A bandwidth request should be carried by a bandwidth header type");
882 if (!bwRequestHdr.check_hcs())
883 {
884 // The header is noisy
885 NS_LOG_INFO("BS:Header HCS ERROR");
886 return;
887 }
888 cid = bwRequestHdr.GetCid();
889 source = m_ssManager->GetMacAddress(cid);
890 m_traceBSRx(packet, source, cid);
891 GetBandwidthManager()->ProcessBandwidthRequest(bwRequestHdr);
892 }
893}
894
895void
897{
898 Ptr<Packet> dlmap;
899 Ptr<Packet> ulmap;
900 bool sendDcd = false;
901 bool sendUcd = false;
902 bool updateDcd = false;
903 bool updateUcd = false;
904
905 uint16_t currentNrSsRegistered = m_ssManager->GetNRegisteredSSs();
906
907 if (m_nrSsRegistered == currentNrSsRegistered)
908 {
909 m_uplinkScheduler->GetChannelDescriptorsToUpdate(updateDcd, updateUcd, sendDcd, sendUcd);
910 }
911 else
912 {
913 sendDcd = sendUcd = true;
914 }
915
916 m_nrSsRegistered = currentNrSsRegistered;
917
918 /*either DCD and UCD must be created first because CCC is set during their
919 creation, or CCC must be calculated first so that it could be set during
920 creation of DL-MAP and UL-MAP and then set during creation of DCD and UCD*/
921
922 if (sendDcd)
923 {
924 m_dcdConfigChangeCount += 1 % 256;
925 }
926
927 if (sendUcd)
928 {
929 m_ucdConfigChangeCount += 1 % 256;
930 }
931
932 dlmap = CreateDlMap();
935
936 ulmap = CreateUlMap();
939
940 CreateDescriptorMessages(sendDcd, sendUcd);
941}
942
943void
945{
946 Ptr<Packet> dcd;
947 Ptr<Packet> ucd;
948
949 if (sendDcd)
950 {
951 dcd = CreateDcd();
953 m_nrDcdSent++;
955 }
956 else
957 {
959 }
960
961 if (sendUcd)
962 {
963 ucd = CreateUcd();
965 m_nrUcdSent++;
967 }
968 else
969 {
971 }
972}
973
974/*
975 Sends bursts in the downlink subframe. i.e., creates the downlink subframe. The first burst
976 is broadcast burst with MAC management messages. The rest of the bursts contain data packets.
977 */
978void
980{
981 Time txTime = Seconds(0);
982 std::pair<OfdmDlMapIe*, Ptr<PacketBurst>> pair;
984 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
985 m_scheduler->GetDownlinkBursts();
986 Ptr<PacketBurst> burst;
987 OfdmDlMapIe* dlMapIe;
988 Cid cid;
989
990 while (!downlinkBursts->empty())
991 {
992 pair = downlinkBursts->front();
993 burst = pair.second;
994 dlMapIe = pair.first;
995 cid = dlMapIe->GetCid();
996 uint8_t diuc = dlMapIe->GetDiuc();
997
998 if (cid != GetInitialRangingConnection()->GetCid() &&
999 cid != GetBroadcastConnection()->GetCid())
1000 {
1001 modulationType =
1002 GetBurstProfileManager()->GetModulationType(diuc,
1004 }
1005 else
1006 {
1007 modulationType = WimaxPhy::MODULATION_TYPE_BPSK_12;
1008 }
1009
1010 Simulator::Schedule(txTime, &WimaxNetDevice::ForwardDown, this, burst, modulationType);
1011 txTime += GetPhy()->GetTransmissionTime(burst->GetSize(), modulationType);
1012 downlinkBursts->pop_front();
1013 delete dlMapIe;
1014 }
1015}
1016
1019{
1021
1022 DlMap dlmap;
1025
1026 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
1027 m_scheduler->GetDownlinkBursts();
1028
1029 for (auto iter = downlinkBursts->begin(); iter != downlinkBursts->end(); ++iter)
1030 {
1031 iter->first->SetPreamblePresent(0);
1032 iter->first->SetStartTime(0);
1033 dlmap.AddDlMapElement(*(iter->first));
1034 }
1035
1036 OfdmDlMapIe dlMapIeEnd;
1037
1038 dlMapIeEnd.SetCid(Cid::InitialRanging());
1040 dlMapIeEnd.SetPreamblePresent(0);
1041 dlMapIeEnd.SetStartTime(0);
1042
1043 dlmap.AddDlMapElement(dlMapIeEnd);
1044 m_nrDlAllocations = downlinkBursts->size();
1045
1046 Ptr<Packet> p = Create<Packet>();
1047 p->AddHeader(dlmap);
1049 return p;
1050}
1051
1054{
1055 Dcd dcd;
1056 OfdmDcdChannelEncodings chnlEncodings;
1057
1058 chnlEncodings.SetBsEirp(0);
1059 chnlEncodings.SetEirxPIrMax(0);
1060 chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1061 chnlEncodings.SetChannelNr(0);
1062 chnlEncodings.SetTtg(GetTtg());
1063 chnlEncodings.SetRtg(GetRtg());
1064 chnlEncodings.SetBaseStationId(GetMacAddress());
1065 chnlEncodings.SetFrameDurationCode(GetPhy()->GetFrameDurationCode());
1066 chnlEncodings.SetFrameNumber(GetNrFrames());
1067
1069 dcd.SetChannelEncodings(chnlEncodings);
1070
1071 SetDlBurstProfiles(&dcd);
1072 SetCurrentDcd(dcd);
1073
1074 Ptr<Packet> p = Create<Packet>();
1075 p->AddHeader(dcd);
1077 return p;
1078}
1079
1082{
1086
1087 UlMap ulmap;
1089 ulmap.SetAllocationStartTime(m_uplinkScheduler->CalculateAllocationStartTime());
1090
1091 std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1092
1093 for (auto iter = uplinkAllocations.begin(); iter != uplinkAllocations.end(); ++iter)
1094 {
1095 ulmap.AddUlMapElement(*iter);
1096 }
1097
1098 m_nrUlAllocations = uplinkAllocations.size();
1099
1100 Ptr<Packet> p = Create<Packet>();
1101 p->AddHeader(ulmap);
1103 return p;
1104}
1105
1108{
1109 Ucd ucd;
1111 ucd.SetRangingBackoffStart(3); // setting to 7. i.e., 2^3 = 8 -> 0-7
1112 ucd.SetRangingBackoffEnd(6); // setting to 63. i.e., 2^6 = 64 -> 0-63
1114 ucd.SetRequestBackoffEnd(6);
1115
1116 OfdmUcdChannelEncodings chnlEncodings;
1117
1118 chnlEncodings.SetBwReqOppSize(m_bwReqOppSize * GetPhy()->GetPsPerSymbol());
1119 chnlEncodings.SetRangReqOppSize(m_rangReqOppSize * GetPhy()->GetPsPerSymbol());
1120
1121 chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1122 chnlEncodings.SetSbchnlReqRegionFullParams(0);
1123 chnlEncodings.SetSbchnlFocContCodes(0);
1124
1125 ucd.SetChannelEncodings(chnlEncodings);
1126
1127 SetUlBurstProfiles(&ucd);
1128 SetCurrentUcd(ucd);
1129
1130 Ptr<Packet> p = Create<Packet>();
1131 p->AddHeader(ucd);
1133 return p;
1134}
1135
1136void
1138{
1139 for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1140 {
1141 OfdmDlBurstProfile brstProfile;
1142 brstProfile.SetType(0);
1143 brstProfile.SetLength(0);
1144 brstProfile.SetDiuc(i + 1); // DIUC will be between 1-11, see Table 237
1145 brstProfile.SetFecCodeType(i);
1146 dcd->AddDlBurstProfile(brstProfile);
1147 }
1148}
1149
1150void
1152{
1153 for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1154 {
1155 OfdmUlBurstProfile brstProfile;
1156 brstProfile.SetType(0);
1157 brstProfile.SetLength(0);
1158 // UIUC will be between 5-12, see Table 246. UIUC 1 (initial ranging) is not included
1159 brstProfile.SetUiuc(i + 5);
1160 brstProfile.SetFecCodeType(i);
1161
1162 ucd->AddUlBurstProfile(brstProfile);
1163 }
1164}
1165
1168{
1169 Ptr<WimaxConnection> connection = nullptr;
1170 if (cid.IsInitialRanging())
1171 {
1173 }
1174 else if (cid.IsBroadcast())
1175 {
1176 connection = GetBroadcastConnection();
1177 }
1178 else
1179 {
1180 connection = GetConnectionManager()->GetConnection(cid);
1181 }
1182
1183 NS_ASSERT_MSG(connection, "BS: Invalid connection=0");
1184 return connection;
1185}
1186
1187void
1189{
1190 uint16_t symbolsToAllocation = 0;
1191 std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1192 for (auto iter = uplinkAllocations.begin(); iter != uplinkAllocations.end(); ++iter)
1193 {
1194 OfdmUlMapIe uplinkAllocation = *iter;
1195
1196 if (uplinkAllocation.GetUiuc() == OfdmUlBurstProfile::UIUC_END_OF_MAP)
1197 {
1198 break;
1199 }
1200
1201 symbolsToAllocation = uplinkAllocation.GetStartTime();
1202 MarkUplinkAllocationStart(symbolsToAllocation * m_symbolDuration);
1203 MarkUplinkAllocationEnd((symbolsToAllocation + uplinkAllocation.GetDuration()) *
1205 uplinkAllocation.GetCid(),
1206 uplinkAllocation.GetUiuc());
1207 }
1208}
1209
1210void
1212{
1214}
1215
1216void
1217BaseStationNetDevice::MarkUplinkAllocationEnd(Time allocationEndTime, Cid cid, uint8_t uiuc)
1218{
1219 Simulator::Schedule(allocationEndTime,
1221 this,
1222 cid,
1223 uiuc);
1224}
1225
1226void
1228{
1230
1231 NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1232 << " started : " << Simulator::Now().As(Time::S));
1233}
1234
1235void
1237{
1238 NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1239 << " ended : " << Simulator::Now().As(Time::S));
1240
1241 if (m_cidFactory->IsBasic(cid))
1242 {
1243 m_linkManager->VerifyInvitedRanging(cid, uiuc);
1244 }
1245}
1246
1247void
1249{
1251}
1252
1253void
1255{
1257
1258 NS_LOG_DEBUG("Ranging TO " << (uint32_t)m_rangingOppNumber << ": "
1259 << Simulator::Now().As(Time::S));
1260}
1261
1262} // namespace ns3
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
uint8_t GetHt() const
Get HT field.
bool check_hcs() const
Check HCS.
Cid GetCid() const
Get CID field.
BaseStation NetDevice.
Definition: bs-net-device.h:54
uint32_t m_nrUlMapSent
number UL map sent
uint8_t GetBwReqOppSize() const
void SetDcdInterval(Time dcdInterval)
Ptr< BSScheduler > GetBSScheduler() const
TracedCallback< Ptr< const Packet >, Mac48Address, Cid > m_traceBSRx
the base station receive trace callback
Time m_dcdInterval
in seconds
void SetBsClassifier(Ptr< IpcsClassifier > classifier)
Ptr< UplinkScheduler > m_uplinkScheduler
the uplink scheduler
uint8_t m_bwReqOppSize
in symbols
void SetBwReqOppSize(uint8_t bwReqOppSize)
void SetUcdInterval(Time ucdInterval)
void SetRangReqOppSize(uint8_t rangReqOppSize)
void RangingOppStart()
Ranging opp start.
Time m_ulSubframeStartTime
UL subframe start time.
void SetDlBurstProfiles(Dcd *dcd)
Send DL burst profiles.
void UplinkAllocationStart()
Uplink allocation start.
uint32_t GetNrDlSymbols() const
Ptr< SSManager > m_ssManager
the SS manager
void Stop() override
Stop device.
Ptr< IpcsClassifier > GetBsClassifier() const
uint8_t GetRangReqOppSize() const
Ptr< Packet > CreateUcd()
Create UCD.
Time GetDlSubframeStartTime() const
uint8_t GetMaxRangingCorrectionRetries() const
CidFactory * m_cidFactory
the CID factory
uint32_t m_framesSinceLastDcd
frames since last DCD
uint32_t m_ucdConfigChangeCount
UCD config change count.
uint8_t m_rangingOppNumber
current ranging TO number
uint32_t m_allocationStartTime
allocation start time
void SetNrDlSymbols(uint32_t dlSymbols)
TracedCallback< Ptr< const Packet > > m_bsTxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
TracedCallback< Ptr< const Packet > > m_bsRxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
void MarkRangingOppStart(Time rangingOppStartTime)
Mark ranging opp start.
void SetMaxRangingCorrectionRetries(uint8_t maxRangCorrectionRetries)
uint32_t m_nrDlSymbols
number of DL symbols
uint32_t GetNrUcdSent() const
uint32_t m_nrUlSymbols
number of UL symbols
Ptr< WimaxConnection > GetConnection(Cid cid)
uint8_t m_maxRangCorrectionRetries
maximum range correction retries
void MarkUplinkAllocationStart(Time allocationStartTime)
Mark uplink allocation start.
uint32_t m_nrDlFrames
number DL frames
void SetBSScheduler(Ptr< BSScheduler > bsSchedule)
static TypeId GetTypeId()
Get the type ID.
void Start() override
Start device.
uint16_t m_nrUlAllocations
number UL allocations
uint32_t m_nrDcdSent
number DCD sent
void StartFrame()
Start frame function.
Ptr< IpcsClassifier > m_bsClassifier
the base station classifier
void SetIntervalT8(Time interval)
Ptr< Packet > CreateUlMap()
Create UL map.
void EndFrame()
End frame function.
void DoDispose() override
Destructor implementation.
Ptr< BsServiceFlowManager > m_serviceFlowManager
the service flow manager
void SetInitialRangingInterval(Time initialRangInterval)
uint16_t m_nrSsRegistered
number SS registered
Time m_psDuration
ps duration
uint8_t m_maxInvitedRangRetries
maximum invited range retries
uint8_t m_ulAllocationNumber
to see UL burst number
Time GetInitialRangingInterval() const
void MarkUplinkAllocationEnd(Time allocationEndTime, Cid cid, uint8_t uiuc)
Mark uplink allocation end.
void SetNrUlSymbols(uint32_t ulSymbols)
void SetSSManager(Ptr< SSManager > ssManager)
void StartDlSubFrame()
Start DL subframe function.
Ptr< SSManager > GetSSManager() const
Time m_ucdInterval
in seconds
Ptr< Packet > CreateDlMap()
Create DL map.
void SetLinkManager(Ptr< BSLinkManager > linkManager)
void SetMaxInvitedRangRetries(uint8_t maxInvitedRangRetries)
Time m_symbolDuration
symbol duration
Time m_initialRangInterval
in seconds
void CreateDescriptorMessages(bool sendDcd, bool sendUcd)
creates the channel descriptor MAC management messages DCD and UCD
void SetUplinkScheduler(Ptr< UplinkScheduler > ulScheduler)
void UplinkAllocationEnd(Cid cid, uint8_t uiuc)
Uplink allocation end.
uint32_t m_nrUcdSent
number UCD sent
void StartUlSubFrame()
Start UL subframe function.
uint32_t m_nrUlFrames
number UL frames
void EndUlSubFrame()
End UL subframe function.
uint32_t GetNrUlSymbols() const
uint32_t m_dcdConfigChangeCount
DCD config change count.
uint32_t m_framesSinceLastUcd
frames since last UCD
void InitBaseStationNetDevice()
initializes the BS net device and sets its parameters to the default values
uint8_t m_rangReqOppSize
in symbols
Ptr< BSLinkManager > GetLinkManager() const
void CreateMapMessages()
creates the MAC management messages DL-MAP and UL-MAP
uint8_t GetMaxInvitedRangRetries() const
void DoReceive(Ptr< Packet > packet) override
Receive packet.
bool Enqueue(Ptr< Packet > packet, const MacHeaderType &hdrType, Ptr< WimaxConnection > connection) override
Enqueue a packet into a connection queue.
void SetServiceFlowManager(Ptr< BsServiceFlowManager > sfm)
Set service flow manager.
Ptr< Packet > CreateDcd()
Create DCD.
Ptr< BSScheduler > m_scheduler
the base station scheduler
Time m_intervalT8
in milliseconds, wait for DSA/DSC Acknowledge timeout
bool DoSend(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest, uint16_t protocolNumber) override
Send packet.
void SendBursts()
Send burst function.
uint32_t m_nrDlMapSent
number DL map sent
Ptr< UplinkScheduler > GetUplinkScheduler() const
Time m_dlSubframeStartTime
DL subframe start time.
Time GetUlSubframeStartTime() const
uint16_t m_nrDlAllocations
number DL allocations
void EndDlSubFrame()
End DL subframe function.
TracedCallback< Ptr< const Packet > > m_bsTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
Ptr< BsServiceFlowManager > GetServiceFlowManager() const
Ptr< BSLinkManager > m_linkManager
the link manager
TracedCallback< Ptr< const Packet > > m_bsPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
uint8_t GetRangingOppNumber() const
void MarkUplinkAllocations()
Mark uplink allocations.
void SetUlBurstProfiles(Ucd *ucd)
Send UL burst profiles.
TracedCallback< Ptr< const Packet > > m_bsRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
uint32_t GetNrDcdSent() const
This class is used exclusively by the BS to allocate CIDs to new connections.
Definition: cid-factory.h:46
bool IsBasic(Cid cid) const
This function determines if the CID is basic.
Definition: cid-factory.cc:113
bool IsPrimary(Cid cid) const
This function determines if the CID is primary.
Definition: cid-factory.cc:106
Cid class.
Definition: cid.h:37
bool IsInitialRanging() const
Definition: cid.cc:69
static Cid InitialRanging()
Definition: cid.cc:87
bool IsBroadcast() const
Definition: cid.cc:57
void SetBsEirp(uint16_t bs_eirp)
Set BS EIRP field.
void SetFrequency(uint32_t frequency)
Set frequency field.
void SetEirxPIrMax(uint16_t rss_ir_max)
Set EIRX IR MAX field.
This class implements Downlink channel descriptor as described by "IEEE Standard for Local and metrop...
void SetConfigurationChangeCount(uint8_t configurationChangeCount)
Set configuration change count field.
void AddDlBurstProfile(OfdmDlBurstProfile dlBurstProfile)
Add DL burst profile field.
void SetChannelEncodings(OfdmDcdChannelEncodings channelEncodings)
Set channel encodings field.
This class implements DL-MAP as described by "IEEE Standard for Local and metropolitan area networks ...
void SetDcdCount(uint8_t dcdCount)
Set DCD count field.
void AddDlMapElement(OfdmDlMapIe dlMapElement)
Add DL Map element field.
void SetBaseStationId(Mac48Address baseStationID)
Set base station ID field.
This class implements the DSA-ACK message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:590
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:386
This class implements the fragmentation sub-header as described by IEEE Standard for Local and metrop...
uint8_t GetFc() const
Get FC field.
This class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
uint8_t GetType() const
Get type field.
bool check_hcs() const
Check HCS.
uint8_t GetHt() const
Get HT field.
uint32_t GetSerializedSize() const override
void SetLen(uint16_t len)
Set length field.
void SetCid(Cid cid)
Set CID field.
Cid GetCid() const
Get CID field.
This class implements the grant management sub-header as described by IEEE Standard for Local and met...
Header for the LLC/SNAP encapsulation.
an EUI-48 address
Definition: mac48-address.h:46
static Mac48Address GetBroadcast()
This class Represents the HT (Header Type) field of generic MAC and bandwidth request headers.
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43.
Definition: mac-messages.h:44
uint8_t GetType() const
Get type field.
Definition: mac-messages.cc:58
This class implements the OFDM DCD channel encodings as described by "IEEE Standard for Local and met...
void SetChannelNr(uint8_t channelNr)
Set channel number field.
void SetTtg(uint8_t ttg)
Set TTG field.
void SetFrameDurationCode(uint8_t frameDurationCode)
Set frame duration code field.
void SetRtg(uint8_t rtg)
Set RTG field.
void SetFrameNumber(uint32_t frameNumber)
Set frame number field.
void SetBaseStationId(Mac48Address baseStationId)
Set base station ID field.
This class implements the OFDM Downlink burst profile descriptor as described by "IEEE Standard for L...
void SetFecCodeType(uint8_t fecCodeType)
Set FEC code type.
void SetLength(uint8_t length)
Set length field.
void SetType(uint8_t type)
Set type field.
void SetDiuc(uint8_t diuc)
Set DIUC field.
This class implements the OFDM DL-MAP information element as described by "IEEE Standard for Local an...
void SetStartTime(uint16_t startTime)
Set start time field.
uint8_t GetDiuc() const
Get DIUC field.
void SetCid(Cid cid)
Set CID function.
Cid GetCid() const
Set CID field.
void SetDiuc(uint8_t diuc)
Set DIUC field.
void SetPreamblePresent(uint8_t preamblePresent)
Set preamble present field.
This class implements the OFDM UCD channel encodings as described by "IEEE Standard for Local and met...
void SetSbchnlReqRegionFullParams(uint8_t sbchnlReqRegionFullParams)
Set SB channel reguest region full parameters.
void SetSbchnlFocContCodes(uint8_t sbchnlFocContCodes)
Set SB channel for control codes.
This class implements the UL burst profile as described by "IEEE Standard for Local and metropolitan ...
void SetLength(uint8_t length)
Set length.
void SetUiuc(uint8_t uiuc)
Set UIUC.
void SetFecCodeType(uint8_t fecCodeType)
Set FEC code type.
void SetType(uint8_t type)
Set type.
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
uint16_t GetDuration() const
Get duration.
Cid GetCid() const
Get CID.
uint8_t GetUiuc() const
Get UIUC.
uint16_t GetStartTime() const
Get start time.
AttributeValue implementation for Pointer.
Definition: pointer.h:48
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
Definition: mac-messages.h:664
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
bool GetIsEnabled() const
Get is enabled flag.
Ptr< WimaxConnection > GetConnection() const
Can return a null connection is this service flow has not been associated yet to a connection.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:571
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Definition: simulator.cc:285
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:605
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:415
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:403
@ S
second
Definition: nstime.h:116
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
void SetRangReqOppSize(uint16_t rangReqOppSize)
Set range request opp size.
void SetFrequency(uint32_t frequency)
Set frequency.
void SetBwReqOppSize(uint16_t bwReqOppSize)
Set BW request opp size.
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
void AddUlBurstProfile(OfdmUlBurstProfile ulBurstProfile)
Add UL burst profile.
void SetChannelEncodings(OfdmUcdChannelEncodings channelEncodings)
Set channel encodings.
void SetConfigurationChangeCount(uint8_t ucdCount)
Set configuration change count.
void SetRangingBackoffStart(uint8_t rangingBackoffStart)
Set ranging backoff start.
void SetRangingBackoffEnd(uint8_t rangingBackoffEnd)
Set ranging backoff end.
void SetRequestBackoffEnd(uint8_t requestBackoffEnd)
Set request backoff end.
void SetRequestBackoffStart(uint8_t requestBackoffStart)
Set request backoff start.
Hold an unsigned integer type.
Definition: uinteger.h:45
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
void SetAllocationStartTime(uint32_t allocationStartTime)
Set allocation start time.
void AddUlMapElement(OfdmUlMapIe ulMapElement)
Add UL map element.
void SetUcdCount(uint8_t ucdCount)
Set UCD count.
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
Hold together all WiMAX-related objects in a NetDevice.
void DoDispose() override
Destructor implementation.
uint16_t GetRtg() const
Get receive/transmit transition gap.
void SetRtg(uint16_t rtg)
Set receive/transmit transition gap.
static uint8_t m_direction
downlink or uplink
Ptr< ConnectionManager > GetConnectionManager() const
Get the connection manager of the device.
void SetPhy(Ptr< WimaxPhy > phy)
Set the physical layer object.
void SetCurrentUcd(Ucd ucd)
Set the current UCD.
uint32_t GetNrFrames() const
Get the number of frames.
static Time m_frameStartTime
temp, to determine the frame start time at SS side, shall actually be determined by frame start pream...
void SetState(uint8_t state)
Set the device state.
Ptr< WimaxConnection > GetInitialRangingConnection() const
Get the initial ranging connection.
Ptr< WimaxPhy > GetPhy() const
Get the physical layer object.
Ptr< BandwidthManager > GetBandwidthManager() const
Get the bandwidth manager on the device.
Ptr< WimaxConnection > GetBroadcastConnection() const
Get the broadcast connection.
void SetTtg(uint16_t ttg)
Set transmission/receive transition gap.
void CreateDefaultConnections()
Creates the initial ranging and broadcast connections.
void SetNrFrames(uint32_t nrFrames)
Set the number of frames.
void SetCurrentDcd(Dcd dcd)
Set the current DCD.
void SetReceiveCallback()
Set receive callback function.
uint16_t GetTtg() const
Get transmission/receive transition gap.
Mac48Address GetMacAddress() const
Get the MAC address.
void SetNode(Ptr< Node > node) override
Set node pointer.
void ForwardUp(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest)
Forward a packet to the next layer above the device.
Ptr< BurstProfileManager > GetBurstProfileManager() const
Get the burst profile manager.
void ForwardDown(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType)
Forward a packet down the stack.
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
@ MODULATION_TYPE_BPSK_12
Definition: wimax-phy.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:259
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1319
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1331
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1407
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1427