A Discrete-Event Network Simulator
API
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"
28 #include "burst-profile-manager.h"
29 #include "connection-manager.h"
30 #include "service-flow-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 
49 namespace ns3
50 {
51 
52 NS_LOG_COMPONENT_DEFINE("BaseStationNetDevice");
53 
54 NS_OBJECT_ENSURE_REGISTERED(BaseStationNetDevice);
55 
56 TypeId
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",
70  PointerValue(),
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.",
83  TimeValue(Seconds(3)),
87 
88  .AddAttribute("UcdInterval",
89  "Time between transmission of UCD messages. Maximum value is 10s.",
90  TimeValue(Seconds(3)),
94 
95  .AddAttribute("IntervalT8",
96  "Wait for DSA/DSC Acknowledge timeout. Maximum 300ms.",
97  TimeValue(Seconds(0.05)),
100  MakeTimeChecker())
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 
208 void
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;
232  m_nrSsRegistered = 0;
233  m_nrDlAllocations = 0;
234  m_nrUlAllocations = 0;
238  m_rangingOppNumber = 0;
240  m_psDuration = Seconds(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 
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 
272 void
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 
290 void
292 {
293  m_bsClassifier = bsc;
294 }
295 
298 {
299  return m_bsClassifier;
300 }
301 
302 void
304 {
305  m_initialRangInterval = initialRangInterval;
306 }
307 
308 Time
310 {
311  return m_initialRangInterval;
312 }
313 
314 void
316 {
317  m_dcdInterval = dcdInterval;
318 }
319 
320 Time
322 {
323  return m_dcdInterval;
324 }
325 
326 void
328 {
329  m_ucdInterval = ucdInterval;
330 }
331 
332 Time
334 {
335  return m_ucdInterval;
336 }
337 
338 void
340 {
341  m_intervalT8 = interval;
342 }
343 
344 Time
346 {
347  return m_intervalT8;
348 }
349 
350 void
352 {
353  m_maxRangCorrectionRetries = maxRangCorrectionRetries;
354 }
355 
356 uint8_t
358 {
360 }
361 
362 void
364 {
365  m_maxInvitedRangRetries = maxInvitedRangRetries;
366 }
367 
368 uint8_t
370 {
372 }
373 
374 void
376 {
377  m_rangReqOppSize = rangReqOppSize;
378 }
379 
380 uint8_t
382 {
383  return m_rangReqOppSize;
384 }
385 
386 void
388 {
389  m_bwReqOppSize = bwReqOppSize;
390 }
391 
392 uint8_t
394 {
395  return m_bwReqOppSize;
396 }
397 
398 void
400 {
401  m_nrDlSymbols = nrDlSymbols;
402 }
403 
404 uint32_t
406 {
407  return m_nrDlSymbols;
408 }
409 
410 void
412 {
413  m_nrUlSymbols = nrUlSymbols;
414 }
415 
416 uint32_t
418 {
419  return m_nrUlSymbols;
420 }
421 
422 uint32_t
424 {
425  return m_nrDcdSent;
426 }
427 
428 uint32_t
430 {
431  return m_nrUcdSent;
432 }
433 
434 Time
436 {
437  return m_dlSubframeStartTime;
438 }
439 
440 Time
442 {
443  return m_ulSubframeStartTime;
444 }
445 
446 uint8_t
448 {
449  return m_rangingOppNumber;
450 }
451 
454 {
455  return m_ssManager;
456 }
457 
458 void
460 {
461  m_ssManager = ssm;
462 }
463 
466 {
467  return m_serviceFlowManager;
468 }
469 
470 void
472 {
473  m_serviceFlowManager = sfm;
474 }
475 
478 {
479  return m_uplinkScheduler;
480 }
481 
482 void
484 {
485  m_uplinkScheduler = uls;
486 }
487 
490 {
491  return m_linkManager;
492 }
493 
494 void
496 {
497  m_linkManager = lm;
498 }
499 
500 void
502 {
503  m_scheduler = bss;
504 }
505 
508 {
509  return m_scheduler;
510 }
511 
512 Time
514 {
515  return m_psDuration;
516 }
517 
518 Time
520 {
521  return m_symbolDuration;
522 }
523 
524 void
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 
546 void
548 {
549 }
550 
551 void
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 
567  StartDlSubFrame();
568 }
569 
570 void
572 {
573  m_dlSubframeStartTime = Simulator::Now(); // same as m_frameStartTime
574 
575  NS_LOG_DEBUG("DL frame started : " << m_frameStartTime.As(Time::S));
576 
577  SetNrFrames(GetNrFrames() + 1);
580  m_uplinkScheduler->Schedule();
582  m_scheduler->Schedule();
583  SendBursts();
586  this);
587 }
588 
589 void
591 {
592  m_nrDlFrames++;
596  this);
597 }
598 
599 void
601 {
603 
604  NS_LOG_INFO("UL frame started : " << m_ulSubframeStartTime.As(Time::S));
605 
611  this);
612 }
613 
614 void
616 {
617  m_nrUlFrames++;
621  this);
622 }
623 
624 void
626 {
627  StartFrame();
628 }
629 
630 bool
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\tPaket 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 
683 bool
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 
692  GenericMacHeader hdr;
693  hdr.SetLen(packet->GetSize() + hdr.GetSerializedSize());
694 
695  hdr.SetCid(connection->GetCid());
696 
697  return connection->Enqueue(packet, hdrType, hdr);
698 }
699 
700 void
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() == false)
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("ff:ff:ff:ff:ff:ff"));
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 (std::list<Ptr<const Packet>>::const_iterator iter = fragmentsQueue.begin();
855  iter != fragmentsQueue.end();
856  ++iter)
857  {
858  // Create the whole Packet
859  fullPacket->AddAtEnd(*iter);
860  }
861  GetConnectionManager()->GetConnection(cid)->ClearFragmentsQueue();
862 
863  NS_LOG_INFO("\t fullPacket size = " << fullPacket->GetSize() << std::endl);
864  source = m_ssManager->GetMacAddress(cid);
865  m_bsRxTrace(fullPacket);
866  ForwardUp(fullPacket->Copy(), source, Mac48Address("ff:ff:ff:ff:ff:ff"));
867  }
868  else
869  {
870  // This is the first or middle fragment.
871  // Take the fragment queue, store the fragment into the queue
872  NS_LOG_INFO("\t Received the first or the middle fragment" << std::endl);
873  GetConnectionManager()->GetConnection(cid)->FragmentEnqueue(packet);
874  }
875  }
876  }
877  }
878  else
879  {
880  // bandwidth request header
881  packet->AddHeader(gnrcMacHdr);
882  packet->RemoveHeader(bwRequestHdr);
884  "A bandwidth request should be carried by a bandwidth header type");
885  if (bwRequestHdr.check_hcs() == false)
886  {
887  // The header is noisy
888  NS_LOG_INFO("BS:Header HCS ERROR");
889  return;
890  }
891  cid = bwRequestHdr.GetCid();
892  source = m_ssManager->GetMacAddress(cid);
893  m_traceBSRx(packet, source, cid);
894  GetBandwidthManager()->ProcessBandwidthRequest(bwRequestHdr);
895  }
896 }
897 
898 void
900 {
901  Ptr<Packet> dlmap;
902  Ptr<Packet> ulmap;
903  bool sendDcd = false;
904  bool sendUcd = false;
905  bool updateDcd = false;
906  bool updateUcd = false;
907 
908  uint16_t currentNrSsRegistered = m_ssManager->GetNRegisteredSSs();
909 
910  if (m_nrSsRegistered == currentNrSsRegistered)
911  {
912  m_uplinkScheduler->GetChannelDescriptorsToUpdate(updateDcd, updateUcd, sendDcd, sendUcd);
913  }
914  else
915  {
916  sendDcd = sendUcd = true;
917  }
918 
919  m_nrSsRegistered = currentNrSsRegistered;
920 
921  /*either DCD and UCD must be created first because CCC is set during their
922  creation, or CCC must be calculated first so that it could be set during
923  creation of DL-MAP and UL-MAP and then set during creation of DCD and UCD*/
924 
925  if (sendDcd)
926  {
927  m_dcdConfigChangeCount += 1 % 256;
928  }
929 
930  if (sendUcd)
931  {
932  m_ucdConfigChangeCount += 1 % 256;
933  }
934 
935  dlmap = CreateDlMap();
937  m_nrDlMapSent++;
938 
939  ulmap = CreateUlMap();
941  m_nrUlMapSent++;
942 
943  CreateDescriptorMessages(sendDcd, sendUcd);
944 }
945 
946 void
948 {
949  Ptr<Packet> dcd;
950  Ptr<Packet> ucd;
951 
952  if (sendDcd)
953  {
954  dcd = CreateDcd();
956  m_nrDcdSent++;
958  }
959  else
960  {
962  }
963 
964  if (sendUcd)
965  {
966  ucd = CreateUcd();
968  m_nrUcdSent++;
970  }
971  else
972  {
974  }
975 }
976 
977 /*
978  Sends bursts in the downlink subframe. i.e., creates the downlink subframe. The first burst
979  is broadcast burst with MAC management messages. The rest of the bursts contain data packets.
980  */
981 void
983 {
984  Time txTime = Seconds(0);
985  std::pair<OfdmDlMapIe*, Ptr<PacketBurst>> pair;
987  std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
988  m_scheduler->GetDownlinkBursts();
989  Ptr<PacketBurst> burst;
990  OfdmDlMapIe* dlMapIe;
991  Cid cid;
992 
993  while (!downlinkBursts->empty())
994  {
995  pair = downlinkBursts->front();
996  burst = pair.second;
997  dlMapIe = pair.first;
998  cid = dlMapIe->GetCid();
999  uint8_t diuc = dlMapIe->GetDiuc();
1000 
1001  if (cid != GetInitialRangingConnection()->GetCid() &&
1002  cid != GetBroadcastConnection()->GetCid())
1003  {
1004  modulationType =
1005  GetBurstProfileManager()->GetModulationType(diuc,
1007  }
1008  else
1009  {
1010  modulationType = WimaxPhy::MODULATION_TYPE_BPSK_12;
1011  }
1012 
1013  Simulator::Schedule(txTime, &WimaxNetDevice::ForwardDown, this, burst, modulationType);
1014  txTime += GetPhy()->GetTransmissionTime(burst->GetSize(), modulationType);
1015  downlinkBursts->pop_front();
1016  delete dlMapIe;
1017  }
1018 }
1019 
1022 {
1023  m_nrDlAllocations = 0;
1024 
1025  DlMap dlmap;
1028 
1029  std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* downlinkBursts =
1030  m_scheduler->GetDownlinkBursts();
1031 
1032  for (std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>::iterator iter =
1033  downlinkBursts->begin();
1034  iter != downlinkBursts->end();
1035  ++iter)
1036  {
1037  iter->first->SetPreamblePresent(0);
1038  iter->first->SetStartTime(0);
1039  dlmap.AddDlMapElement(*(iter->first));
1040  }
1041 
1042  OfdmDlMapIe dlMapIeEnd;
1043 
1044  dlMapIeEnd.SetCid(Cid::InitialRanging());
1046  dlMapIeEnd.SetPreamblePresent(0);
1047  dlMapIeEnd.SetStartTime(0);
1048 
1049  dlmap.AddDlMapElement(dlMapIeEnd);
1050  m_nrDlAllocations = downlinkBursts->size();
1051 
1052  Ptr<Packet> p = Create<Packet>();
1053  p->AddHeader(dlmap);
1055  return p;
1056 }
1057 
1060 {
1061  Dcd dcd;
1062  OfdmDcdChannelEncodings chnlEncodings;
1063 
1064  chnlEncodings.SetBsEirp(0);
1065  chnlEncodings.SetEirxPIrMax(0);
1066  chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1067  chnlEncodings.SetChannelNr(0);
1068  chnlEncodings.SetTtg(GetTtg());
1069  chnlEncodings.SetRtg(GetRtg());
1070  chnlEncodings.SetBaseStationId(GetMacAddress());
1071  chnlEncodings.SetFrameDurationCode(GetPhy()->GetFrameDurationCode());
1072  chnlEncodings.SetFrameNumber(GetNrFrames());
1073 
1075  dcd.SetChannelEncodings(chnlEncodings);
1076 
1077  SetDlBurstProfiles(&dcd);
1078  SetCurrentDcd(dcd);
1079 
1080  Ptr<Packet> p = Create<Packet>();
1081  p->AddHeader(dcd);
1083  return p;
1084 }
1085 
1088 {
1090  m_rangingOppNumber = 0;
1091  m_nrUlAllocations = 0;
1092 
1093  UlMap ulmap;
1095  ulmap.SetAllocationStartTime(m_uplinkScheduler->CalculateAllocationStartTime());
1096 
1097  std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1098 
1099  for (std::list<OfdmUlMapIe>::iterator iter = uplinkAllocations.begin();
1100  iter != uplinkAllocations.end();
1101  ++iter)
1102  {
1103  ulmap.AddUlMapElement(*iter);
1104  }
1105 
1106  m_nrUlAllocations = uplinkAllocations.size();
1107 
1108  Ptr<Packet> p = Create<Packet>();
1109  p->AddHeader(ulmap);
1111  return p;
1112 }
1113 
1116 {
1117  Ucd ucd;
1119  ucd.SetRangingBackoffStart(3); // setting to 7. i.e., 2^3 = 8 -> 0-7
1120  ucd.SetRangingBackoffEnd(6); // setting to 63. i.e., 2^6 = 64 -> 0-63
1121  ucd.SetRequestBackoffStart(3);
1122  ucd.SetRequestBackoffEnd(6);
1123 
1124  OfdmUcdChannelEncodings chnlEncodings;
1125 
1126  chnlEncodings.SetBwReqOppSize(m_bwReqOppSize * GetPhy()->GetPsPerSymbol());
1127  chnlEncodings.SetRangReqOppSize(m_rangReqOppSize * GetPhy()->GetPsPerSymbol());
1128 
1129  chnlEncodings.SetFrequency(GetPhy()->GetFrequency());
1130  chnlEncodings.SetSbchnlReqRegionFullParams(0);
1131  chnlEncodings.SetSbchnlFocContCodes(0);
1132 
1133  ucd.SetChannelEncodings(chnlEncodings);
1134 
1135  SetUlBurstProfiles(&ucd);
1136  SetCurrentUcd(ucd);
1137 
1138  Ptr<Packet> p = Create<Packet>();
1139  p->AddHeader(ucd);
1141  return p;
1142 }
1143 
1144 void
1146 {
1147  for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1148  {
1149  OfdmDlBurstProfile brstProfile;
1150  brstProfile.SetType(0);
1151  brstProfile.SetLength(0);
1152  brstProfile.SetDiuc(i + 1); // DIUC will be between 1-11, see Table 237
1153  brstProfile.SetFecCodeType(i);
1154  dcd->AddDlBurstProfile(brstProfile);
1155  }
1156 }
1157 
1158 void
1160 {
1161  for (int i = 0; i < GetBurstProfileManager()->GetNrBurstProfilesToDefine(); ++i)
1162  {
1163  OfdmUlBurstProfile brstProfile;
1164  brstProfile.SetType(0);
1165  brstProfile.SetLength(0);
1166  // UIUC will be between 5-12, see Table 246. UIUC 1 (initial ranging) is not included
1167  brstProfile.SetUiuc(i + 5);
1168  brstProfile.SetFecCodeType(i);
1169 
1170  ucd->AddUlBurstProfile(brstProfile);
1171  }
1172 }
1173 
1176 {
1177  Ptr<WimaxConnection> connection = nullptr;
1178  if (cid.IsInitialRanging())
1179  {
1180  return GetInitialRangingConnection();
1181  }
1182  else if (cid.IsBroadcast())
1183  {
1184  connection = GetBroadcastConnection();
1185  }
1186  else
1187  {
1188  connection = GetConnectionManager()->GetConnection(cid);
1189  }
1190 
1191  NS_ASSERT_MSG(connection, "BS: Invalid connection=0");
1192  return connection;
1193 }
1194 
1195 void
1197 {
1198  uint16_t symbolsToAllocation = 0;
1199  std::list<OfdmUlMapIe> uplinkAllocations = m_uplinkScheduler->GetUplinkAllocations();
1200  for (std::list<OfdmUlMapIe>::iterator iter = uplinkAllocations.begin();
1201  iter != uplinkAllocations.end();
1202  ++iter)
1203  {
1204  OfdmUlMapIe uplinkAllocation = *iter;
1205 
1206  if (uplinkAllocation.GetUiuc() == OfdmUlBurstProfile::UIUC_END_OF_MAP)
1207  {
1208  break;
1209  }
1210 
1211  symbolsToAllocation = uplinkAllocation.GetStartTime();
1212  MarkUplinkAllocationStart(symbolsToAllocation * m_symbolDuration);
1213  MarkUplinkAllocationEnd((symbolsToAllocation + uplinkAllocation.GetDuration()) *
1215  uplinkAllocation.GetCid(),
1216  uplinkAllocation.GetUiuc());
1217  }
1218 }
1219 
1220 void
1222 {
1224 }
1225 
1226 void
1227 BaseStationNetDevice::MarkUplinkAllocationEnd(Time allocationEndTime, Cid cid, uint8_t uiuc)
1228 {
1229  Simulator::Schedule(allocationEndTime,
1231  this,
1232  cid,
1233  uiuc);
1234 }
1235 
1236 void
1238 {
1240 
1241  NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1242  << " started : " << Simulator::Now().As(Time::S));
1243 }
1244 
1245 void
1247 {
1248  NS_LOG_DEBUG("--UL allocation " << (uint32_t)m_ulAllocationNumber
1249  << " ended : " << Simulator::Now().As(Time::S));
1250 
1251  if (m_cidFactory->IsBasic(cid))
1252  {
1253  m_linkManager->VerifyInvitedRanging(cid, uiuc);
1254  }
1255 }
1256 
1257 void
1259 {
1260  Simulator::Schedule(rangingOppStartTime, &BaseStationNetDevice::RangingOppStart, this);
1261 }
1262 
1263 void
1265 {
1267 
1268  NS_LOG_DEBUG("Ranging TO " << (uint32_t)m_rangingOppNumber << ": "
1269  << Simulator::Now().As(Time::S));
1270 }
1271 
1272 } // 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
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.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:294
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Definition: packet.cc:354
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:268
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:863
Ptr< Packet > Copy() const
performs a COW copy of the packet.
Definition: packet.cc:131
Hold objects of type Ptr<T>.
Definition: pointer.h:37
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:568
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:276
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:606
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:417
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:402
@ S
second
Definition: nstime.h:116
AttributeValue implementation for Time.
Definition: nstime.h:1423
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
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)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: pointer.h:231
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1424
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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:1336
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1348
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 AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:535
phy
Definition: third.py:82
#define list