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
793 break;
795 // from other base station, ignore
796 break;
798 DsaReq dsaReq;
799 packet->RemoveHeader(dsaReq);
800 GetServiceFlowManager()->AllocateServiceFlows(dsaReq, cid);
801 break;
802 }
804
805 /*from other base station, as DSA initiated
806 from BS is not supported, ignore*/
807 break;
809 Simulator::Cancel(GetServiceFlowManager()->GetDsaAckTimeoutEvent());
810 DsaAck dsaAck;
811 packet->RemoveHeader(dsaAck);
812 GetServiceFlowManager()->ProcessDsaAck(dsaAck, cid);
813 break;
814 }
815 default:
816 NS_FATAL_ERROR("Invalid message type");
817 }
818 }
819 else if (cid.IsBroadcast()) // broadcast connection
820 {
821 // from other base station, ignore
822 // or perhaps data packet (using other protocol) for BS, handle later
823 return;
824 }
825 else // transport connection
826 {
827 // If fragmentation is true, the packet is a fragment.
828 Ptr<Packet> C_Packet = packet->Copy();
829 if (!fragmentation)
830 {
831 C_Packet->RemoveHeader(llc);
832 source = m_ssManager->GetMacAddress(cid);
833 m_bsRxTrace(packet);
834 ForwardUp(packet->Copy(), source, Mac48Address::GetBroadcast());
835 }
836 else
837 {
838 NS_LOG_INFO("FRAG_DEBUG: BS DoReceive, the Packet is a fragment" << std::endl);
839 packet->RemoveHeader(fragSubhdr);
840 uint32_t fc = fragSubhdr.GetFc();
841 NS_LOG_INFO("\t fragment size = " << packet->GetSize() << std::endl);
842 if (fc == 2)
843 {
844 // This is the latest fragment.
845 // Take the fragment queue, defragment a packet and send it to the upper layer
846 NS_LOG_INFO("\t Received the latest fragment" << std::endl);
847 GetConnectionManager()->GetConnection(cid)->FragmentEnqueue(packet);
848 WimaxConnection::FragmentsQueue fragmentsQueue =
849 GetConnectionManager()->GetConnection(cid)->GetFragmentsQueue();
850 Ptr<Packet> fullPacket = Create<Packet>();
851
852 // DEFRAGMENTATION
853 NS_LOG_INFO("\t BS PACKET DEFRAGMENTATION" << std::endl);
854 for (auto iter = fragmentsQueue.begin(); iter != fragmentsQueue.end(); ++iter)
855 {
856 // Create the whole Packet
857 fullPacket->AddAtEnd(*iter);
858 }
859 GetConnectionManager()->GetConnection(cid)->ClearFragmentsQueue();
860
861 NS_LOG_INFO("\t fullPacket size = " << fullPacket->GetSize() << std::endl);
862 source = m_ssManager->GetMacAddress(cid);
863 m_bsRxTrace(fullPacket);
864 ForwardUp(fullPacket->Copy(), source, Mac48Address::GetBroadcast());
865 }
866 else
867 {
868 // This is the first or middle fragment.
869 // Take the fragment queue, store the fragment into the queue
870 NS_LOG_INFO("\t Received the first or the middle fragment" << std::endl);
871 GetConnectionManager()->GetConnection(cid)->FragmentEnqueue(packet);
872 }
873 }
874 }
875 }
876 else
877 {
878 // bandwidth request header
879 packet->AddHeader(gnrcMacHdr);
880 packet->RemoveHeader(bwRequestHdr);
882 "A bandwidth request should be carried by a bandwidth header type");
883 if (!bwRequestHdr.check_hcs())
884 {
885 // The header is noisy
886 NS_LOG_INFO("BS:Header HCS ERROR");
887 return;
888 }
889 cid = bwRequestHdr.GetCid();
890 source = m_ssManager->GetMacAddress(cid);
891 m_traceBSRx(packet, source, cid);
892 GetBandwidthManager()->ProcessBandwidthRequest(bwRequestHdr);
893 }
894}
895
896void
898{
899 Ptr<Packet> dlmap;
900 Ptr<Packet> ulmap;
901 bool sendDcd = false;
902 bool sendUcd = false;
903 bool updateDcd = false;
904 bool updateUcd = false;
905
906 uint16_t currentNrSsRegistered = m_ssManager->GetNRegisteredSSs();
907
908 if (m_nrSsRegistered == currentNrSsRegistered)
909 {
910 m_uplinkScheduler->GetChannelDescriptorsToUpdate(updateDcd, updateUcd, sendDcd, sendUcd);
911 }
912 else
913 {
914 sendDcd = sendUcd = true;
915 }
916
917 m_nrSsRegistered = currentNrSsRegistered;
918
919 /*either DCD and UCD must be created first because CCC is set during their
920 creation, or CCC must be calculated first so that it could be set during
921 creation of DL-MAP and UL-MAP and then set during creation of DCD and UCD*/
922
923 if (sendDcd)
924 {
925 m_dcdConfigChangeCount += 1 % 256;
926 }
927
928 if (sendUcd)
929 {
930 m_ucdConfigChangeCount += 1 % 256;
931 }
932
933 dlmap = CreateDlMap();
936
937 ulmap = CreateUlMap();
940
941 CreateDescriptorMessages(sendDcd, sendUcd);
942}
943
944void
946{
947 Ptr<Packet> dcd;
948 Ptr<Packet> ucd;
949
950 if (sendDcd)
951 {
952 dcd = CreateDcd();
954 m_nrDcdSent++;
956 }
957 else
958 {
960 }
961
962 if (sendUcd)
963 {
964 ucd = CreateUcd();
966 m_nrUcdSent++;
968 }
969 else
970 {
972 }
973}
974
975/*
976 Sends bursts in the downlink subframe. i.e., creates the downlink subframe. The first burst
977 is broadcast burst with MAC management messages. The rest of the bursts contain data packets.
978 */
979void
981{
982 Time txTime = Seconds(0);
983 std::pair<OfdmDlMapIe*, Ptr<PacketBurst>> pair;
985 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
986 m_scheduler->GetDownlinkBursts();
987 Ptr<PacketBurst> burst;
988 OfdmDlMapIe* dlMapIe;
989 Cid cid;
990
991 while (!downlinkBursts->empty())
992 {
993 pair = downlinkBursts->front();
994 burst = pair.second;
995 dlMapIe = pair.first;
996 cid = dlMapIe->GetCid();
997 uint8_t diuc = dlMapIe->GetDiuc();
998
999 if (cid != GetInitialRangingConnection()->GetCid() &&
1000 cid != GetBroadcastConnection()->GetCid())
1001 {
1002 modulationType =
1003 GetBurstProfileManager()->GetModulationType(diuc,
1005 }
1006 else
1007 {
1008 modulationType = WimaxPhy::MODULATION_TYPE_BPSK_12;
1009 }
1010
1011 Simulator::Schedule(txTime, &WimaxNetDevice::ForwardDown, this, burst, modulationType);
1012 txTime += GetPhy()->GetTransmissionTime(burst->GetSize(), modulationType);
1013 downlinkBursts->pop_front();
1014 delete dlMapIe;
1015 }
1016}
1017
1020{
1022
1023 DlMap dlmap;
1026
1027 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
1028 m_scheduler->GetDownlinkBursts();
1029
1030 for (auto iter = downlinkBursts->begin(); iter != downlinkBursts->end(); ++iter)
1031 {
1032 iter->first->SetPreamblePresent(0);
1033 iter->first->SetStartTime(0);
1034 dlmap.AddDlMapElement(*(iter->first));
1035 }
1036
1037 OfdmDlMapIe dlMapIeEnd;
1038
1039 dlMapIeEnd.SetCid(Cid::InitialRanging());
1041 dlMapIeEnd.SetPreamblePresent(0);
1042 dlMapIeEnd.SetStartTime(0);
1043
1044 dlmap.AddDlMapElement(dlMapIeEnd);
1045 m_nrDlAllocations = downlinkBursts->size();
1046
1047 Ptr<Packet> p = Create<Packet>();
1048 p->AddHeader(dlmap);
1050 return p;
1051}
1052
1055{
1056 Dcd dcd;
1057 OfdmDcdChannelEncodings chnlEncodings;
1058
1059 chnlEncodings.SetBsEirp(0);
1060 chnlEncodings.SetEirxPIrMax(0);
1061 chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1062 chnlEncodings.SetChannelNr(0);
1063 chnlEncodings.SetTtg(GetTtg());
1064 chnlEncodings.SetRtg(GetRtg());
1065 chnlEncodings.SetBaseStationId(GetMacAddress());
1066 chnlEncodings.SetFrameDurationCode(GetPhy()->GetFrameDurationCode());
1067 chnlEncodings.SetFrameNumber(GetNrFrames());
1068
1070 dcd.SetChannelEncodings(chnlEncodings);
1071
1072 SetDlBurstProfiles(&dcd);
1073 SetCurrentDcd(dcd);
1074
1075 Ptr<Packet> p = Create<Packet>();
1076 p->AddHeader(dcd);
1078 return p;
1079}
1080
1083{
1087
1088 UlMap ulmap;
1090 ulmap.SetAllocationStartTime(m_uplinkScheduler->CalculateAllocationStartTime());
1091
1092 std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1093
1094 for (auto iter = uplinkAllocations.begin(); iter != uplinkAllocations.end(); ++iter)
1095 {
1096 ulmap.AddUlMapElement(*iter);
1097 }
1098
1099 m_nrUlAllocations = uplinkAllocations.size();
1100
1101 Ptr<Packet> p = Create<Packet>();
1102 p->AddHeader(ulmap);
1104 return p;
1105}
1106
1109{
1110 Ucd ucd;
1112 ucd.SetRangingBackoffStart(3); // setting to 7. i.e., 2^3 = 8 -> 0-7
1113 ucd.SetRangingBackoffEnd(6); // setting to 63. i.e., 2^6 = 64 -> 0-63
1115 ucd.SetRequestBackoffEnd(6);
1116
1117 OfdmUcdChannelEncodings chnlEncodings;
1118
1119 chnlEncodings.SetBwReqOppSize(m_bwReqOppSize * GetPhy()->GetPsPerSymbol());
1120 chnlEncodings.SetRangReqOppSize(m_rangReqOppSize * GetPhy()->GetPsPerSymbol());
1121
1122 chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1123 chnlEncodings.SetSbchnlReqRegionFullParams(0);
1124 chnlEncodings.SetSbchnlFocContCodes(0);
1125
1126 ucd.SetChannelEncodings(chnlEncodings);
1127
1128 SetUlBurstProfiles(&ucd);
1129 SetCurrentUcd(ucd);
1130
1131 Ptr<Packet> p = Create<Packet>();
1132 p->AddHeader(ucd);
1134 return p;
1135}
1136
1137void
1139{
1140 for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1141 {
1142 OfdmDlBurstProfile brstProfile;
1143 brstProfile.SetType(0);
1144 brstProfile.SetLength(0);
1145 brstProfile.SetDiuc(i + 1); // DIUC will be between 1-11, see Table 237
1146 brstProfile.SetFecCodeType(i);
1147 dcd->AddDlBurstProfile(brstProfile);
1148 }
1149}
1150
1151void
1153{
1154 for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1155 {
1156 OfdmUlBurstProfile brstProfile;
1157 brstProfile.SetType(0);
1158 brstProfile.SetLength(0);
1159 // UIUC will be between 5-12, see Table 246. UIUC 1 (initial ranging) is not included
1160 brstProfile.SetUiuc(i + 5);
1161 brstProfile.SetFecCodeType(i);
1162
1163 ucd->AddUlBurstProfile(brstProfile);
1164 }
1165}
1166
1169{
1170 Ptr<WimaxConnection> connection = nullptr;
1171 if (cid.IsInitialRanging())
1172 {
1174 }
1175 else if (cid.IsBroadcast())
1176 {
1177 connection = GetBroadcastConnection();
1178 }
1179 else
1180 {
1181 connection = GetConnectionManager()->GetConnection(cid);
1182 }
1183
1184 NS_ASSERT_MSG(connection, "BS: Invalid connection=0");
1185 return connection;
1186}
1187
1188void
1190{
1191 uint16_t symbolsToAllocation = 0;
1192 std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1193 for (auto iter = uplinkAllocations.begin(); iter != uplinkAllocations.end(); ++iter)
1194 {
1195 OfdmUlMapIe uplinkAllocation = *iter;
1196
1197 if (uplinkAllocation.GetUiuc() == OfdmUlBurstProfile::UIUC_END_OF_MAP)
1198 {
1199 break;
1200 }
1201
1202 symbolsToAllocation = uplinkAllocation.GetStartTime();
1203 MarkUplinkAllocationStart(symbolsToAllocation * m_symbolDuration);
1204 MarkUplinkAllocationEnd((symbolsToAllocation + uplinkAllocation.GetDuration()) *
1206 uplinkAllocation.GetCid(),
1207 uplinkAllocation.GetUiuc());
1208 }
1209}
1210
1211void
1213{
1215}
1216
1217void
1218BaseStationNetDevice::MarkUplinkAllocationEnd(Time allocationEndTime, Cid cid, uint8_t uiuc)
1219{
1220 Simulator::Schedule(allocationEndTime,
1222 this,
1223 cid,
1224 uiuc);
1225}
1226
1227void
1229{
1231
1232 NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1233 << " started : " << Simulator::Now().As(Time::S));
1234}
1235
1236void
1238{
1239 NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1240 << " ended : " << Simulator::Now().As(Time::S));
1241
1242 if (m_cidFactory->IsBasic(cid))
1243 {
1244 m_linkManager->VerifyInvitedRanging(cid, uiuc);
1245 }
1246}
1247
1248void
1250{
1252}
1253
1254void
1256{
1258
1259 NS_LOG_DEBUG("Ranging TO " << (uint32_t)m_rangingOppNumber << ": "
1260 << Simulator::Now().As(Time::S));
1261}
1262
1263} // 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
AttributeValue implementation for Time.
Definition: nstime.h:1413
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
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1434
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1414
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
#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:1326
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
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.