A Discrete-Event Network Simulator
API
ss-net-device.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008,2009 INRIA, UDcast
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20  * <amine.ismail@UDcast.com>
21  */
22 
23 #include "ns3/simulator.h"
24 #include "ns3/node.h"
25 #include "ss-net-device.h"
26 #include "wimax-phy.h"
27 #include "ns3/packet-burst.h"
28 #include <algorithm>
29 #include "dl-mac-messages.h"
30 #include "ul-mac-messages.h"
31 #include "ss-scheduler.h"
32 #include "wimax-mac-queue.h"
33 #include "ns3/trace-source-accessor.h"
34 #include "ns3/pointer.h"
35 #include "ns3/enum.h"
36 #include "service-flow.h"
37 #include "service-flow-record.h"
38 #include "service-flow-manager.h"
39 #include "connection-manager.h"
40 #include "burst-profile-manager.h"
41 #include "ss-link-manager.h"
42 #include "bandwidth-manager.h"
43 
44 namespace ns3 {
45 
46 NS_LOG_COMPONENT_DEFINE ("SubscriberStationNetDevice");
47 
48 NS_OBJECT_ENSURE_REGISTERED (SubscriberStationNetDevice);
49 
51 {
52  return (MicroSeconds (500000));
53 }
54 
55 TypeId
57 {
58  static TypeId
59  tid =
60  TypeId ("ns3::SubscriberStationNetDevice")
61 
63  .SetGroupName ("Wimax")
64 
65  .AddConstructor<SubscriberStationNetDevice> ()
66 
67  .AddAttribute ("BasicConnection",
68  "Basic connection",
69  PointerValue (),
71  MakePointerChecker<WimaxConnection> ())
72 
73  .AddAttribute ("PrimaryConnection",
74  "Primary connection",
75  PointerValue (),
77  MakePointerChecker<WimaxConnection> ())
78 
79  .AddAttribute ("LostDlMapInterval",
80  "Time since last received DL-MAP message before downlink synchronization is considered lost. Maximum is 600ms",
81  TimeValue (Seconds (0.5)),
84  MakeTimeChecker ())
85 
86  .AddAttribute ("LostUlMapInterval",
87  "Time since last received UL-MAP before uplink synchronization is considered lost, maximum is 600.",
88  TimeValue (MilliSeconds (500)),
91  MakeTimeChecker ())
92 
93  .AddAttribute ("MaxDcdInterval",
94  "Maximum time between transmission of DCD messages. Maximum is 10s",
95  TimeValue (Seconds (10)),
98  MakeTimeChecker ())
99 
100  .AddAttribute ("MaxUcdInterval",
101  "Maximum time between transmission of UCD messages. Maximum is 10s",
102  TimeValue (Seconds (10)),
105  MakeTimeChecker ())
106 
107  .AddAttribute ("IntervalT1",
108  "Wait for DCD timeout. Maximum is 5*maxDcdInterval",
109  TimeValue (Seconds (50)),
112  MakeTimeChecker ())
113 
114  .AddAttribute ("IntervalT2",
115  "Wait for broadcast ranging timeout, i.e., wait for initial ranging opportunity. Maximum is 5*Ranging interval",
116  TimeValue (Seconds (10)),
119  MakeTimeChecker ())
120 
121  .AddAttribute ("IntervalT3",
122  "ranging Response reception timeout following the transmission of a ranging request. Maximum is 200ms",
123  TimeValue (Seconds (0.2)),
126  MakeTimeChecker ())
127 
128  .AddAttribute ("IntervalT7",
129  "wait for DSA/DSC/DSD Response timeout. Maximum is 1s",
130  TimeValue (Seconds (0.1)),
133  MakeTimeChecker ())
134 
135  .AddAttribute ("IntervalT12",
136  "Wait for UCD descriptor.Maximum is 5*MaxUcdInterval",
137  TimeValue (Seconds (10)),
140  MakeTimeChecker ())
141 
142  .AddAttribute ("IntervalT20",
143  "Time the SS searches for preambles on a given channel. Minimum is 2 MAC frames",
144  TimeValue (Seconds (0.5)),
147  MakeTimeChecker ())
148 
149  .AddAttribute ("IntervalT21",
150  "time the SS searches for (decodable) DL-MAP on a given channel",
151  TimeValue (Seconds (10)),
154  MakeTimeChecker ())
155 
156  .AddAttribute ("MaxContentionRangingRetries",
157  "Number of retries on contention Ranging Requests",
158  UintegerValue (16),
161  MakeUintegerChecker<uint8_t> (1, 16))
162 
163  .AddAttribute ("SSScheduler",
164  "The ss scheduler attached to this device.",
165  PointerValue (),
168  MakePointerChecker<SSScheduler> ())
169 
170  .AddAttribute ("LinkManager",
171  "The ss link manager attached to this device.",
172  PointerValue (),
175  MakePointerChecker<SSLinkManager> ())
176 
177  .AddAttribute ("Classifier",
178  "The ss classifier attached to this device.",
179  PointerValue (),
182  MakePointerChecker<IpcsClassifier> ())
183 
184  .AddTraceSource ("SSTxDrop",
185  "A packet has been dropped in the MAC layer before being queued for transmission.",
187  "ns3::Packet::TracedCallback")
188 
189  .AddTraceSource ("SSPromiscRx",
190  "A packet has been received by this device, has been passed up from the physical layer "
191  "and is being forwarded up the local protocol stack. This is a promiscuous trace,",
193  "ns3::Packet::TracedCallback")
194 
195  .AddTraceSource ("SSRx",
196  "A packet has been received by this device, has been passed up from the physical layer "
197  "and is being forwarded up the local protocol stack. This is a non-promiscuous trace,",
199  "ns3::Packet::TracedCallback")
200 
201  .AddTraceSource ("SSRxDrop",
202  "A packet has been dropped in the MAC layer after it has been passed up from the physical "
203  "layer.",
205  "ns3::Packet::TracedCallback")
206  ;
207  return tid;
208 }
209 
211 {
212 
214 
215 }
216 
217 void
219 {
222  m_maxDcdInterval = Seconds (10);
223  m_maxUcdInterval = Seconds (10);
225  m_intervalT2 = Seconds (5 * 2); // shall be 5 * RangingInterval, if ranging interval=see T2 at page 638) means Initial Ranging Interval=see page 637)
226  m_intervalT3 = MilliSeconds (200);
227  m_intervalT7 = Seconds (0.1); // maximum is 1
229  m_intervalT21 = Seconds (11);
231  m_dcdCount = 0;
232  m_baseStationId = Mac48Address ("00:00:00:00:00:00");
233  m_ucdCount = 0;
235  m_nrDlMapElements = 0;
236  m_nrUlMapElements = 0;
237  m_nrDlMapRecvd = 0;
238  m_nrUlMapRecvd = 0;
239  m_nrDcdRecvd = 0;
240  m_nrUcdRecvd = 0;
244 
245  m_basicConnection = 0;
247 
250  m_classifier = CreateObject<IpcsClassifier> ();
251  m_linkManager = CreateObject<SSLinkManager> (this);
252  m_scheduler = CreateObject<SSScheduler> (this);
253  m_serviceFlowManager = CreateObject<SsServiceFlowManager> (this);
254 }
255 
257 {
259  this->SetNode (node);
260  this->SetPhy (phy);
261 }
262 
264 {
265 }
266 
267 void
269 {
270  delete m_dlBurstProfile;
271  delete m_ulBurstProfile;
272  m_scheduler = 0;
274  m_basicConnection = 0;
276  m_classifier = 0;
277  m_dlBurstProfile = 0;
278  m_ulBurstProfile = 0;
279 
280  m_linkManager = 0;
281 
283 }
284 
285 void
287 {
288  m_lostDlMapInterval = lostDlMapInterval;
289 }
290 
291 Time
293 {
294  return m_lostDlMapInterval;
295 }
296 
297 void
299 {
300  m_lostUlMapInterval = lostUlMapInterval;
301 }
302 
303 Time
305 {
306  return m_lostUlMapInterval;
307 }
308 
309 void
311 {
312  m_maxDcdInterval = maxDcdInterval;
313 }
314 
315 Time
317 {
318  return m_maxDcdInterval;
319 }
320 
321 void
323 {
324  m_maxUcdInterval = maxUcdInterval;
325 }
326 
327 Time
329 {
330  return m_maxUcdInterval;
331 }
332 
333 void
335 {
336  m_intervalT1 = interval;
337 }
338 
339 Time
341 {
342  return m_intervalT1;
343 }
344 
345 void
347 {
348  m_intervalT2 = interval;
349 }
350 
351 Time
353 {
354  return m_intervalT2;
355 }
356 
357 void
359 {
360  m_intervalT3 = interval;
361 }
362 
363 Time
365 {
366  return m_intervalT3;
367 }
368 
369 void
371 {
372  m_intervalT7 = interval;
373 }
374 
375 Time
377 {
378  return m_intervalT7;
379 }
380 
381 void
383 {
384  m_intervalT12 = interval;
385 }
386 
387 Time
389 {
390  return m_intervalT12;
391 }
392 
393 void
395 {
396  m_intervalT20 = interval;
397 }
398 
399 Time
401 {
402  return m_intervalT20;
403 }
404 
405 void
407 {
408  m_intervalT21 = interval;
409 }
410 
411 Time
413 {
414  return m_intervalT21;
415 }
416 
417 void
419 {
420  m_maxContentionRangingRetries = maxContentionRangingRetries;
421 }
422 
423 uint8_t
425 {
427 }
428 
429 void
431 {
432  m_basicConnection = basicConnection;
433 }
434 
437 {
438  return m_basicConnection;
439 }
440 
441 void
443 {
444  m_primaryConnection = primaryConnection;
445 }
446 
449 {
450  return m_primaryConnection;
451 }
452 
453 Cid
455 {
456  return m_basicConnection->GetCid ();
457 }
458 
459 Cid
461 {
462  return m_primaryConnection->GetCid ();
463 }
464 
465 void
467 {
468  m_modulationType = modulationType;
469 }
470 
473 {
474  return m_modulationType;
475 }
476 
477 void
479 {
480  m_areManagementConnectionsAllocated = areManagementConnectionsAllocated;
481 }
482 
483 bool
485 {
487 }
488 
489 void
491 {
492  m_areServiceFlowsAllocated = areServiceFlowsAllocated;
493 }
494 
495 bool
497 {
499 }
500 
503 {
504  return m_scheduler;
505 }
506 
507 void
509 {
510  m_scheduler = scheduler;
511 }
512 
513 bool
515 {
516  return GetServiceFlowManager ()->GetServiceFlows (ServiceFlow::SF_TYPE_ALL).size () > 0;
517 }
518 
521 {
522 
523  return m_classifier;
524 }
525 
526 void
528 {
529  m_classifier = classifier;
530 }
531 
534 {
535  return m_linkManager;
536 }
537 
538 void
540 {
541  m_linkManager = linkManager;
542 }
543 
546 {
547  return m_serviceFlowManager;
548 }
549 
550 void
552 {
553  m_serviceFlowManager = sfm;
554 }
555 
556 void
558 {
560 
561  GetPhy ()->SetPhyParameters ();
562  GetPhy ()->SetDataRates ();
563  m_intervalT20 = Seconds (4 * GetPhy ()->GetFrameDuration ().GetSeconds ());
564 
567 }
568 
569 void
571 {
573 }
574 
575 void
577 {
578  GetServiceFlowManager ()->AddServiceFlow (sf);
579 }
580 
581 void
583 {
584  GetServiceFlowManager ()->AddServiceFlow (sf);
585 }
586 
587 bool
589  const Mac48Address &source,
590  const Mac48Address &dest,
591  uint16_t protocolNumber)
592 {
593  NS_LOG_INFO ("SS (" << source << "):" );
594  NS_LOG_INFO ("\tSending packet..." );
595  NS_LOG_INFO ("\t\tDestination: " << dest );
596  NS_LOG_INFO ("\t\tPacket Size: " << packet->GetSize () );
597  NS_LOG_INFO ("\t\tProtocol: " << protocolNumber );
598 
599  ServiceFlow *serviceFlow = 0;
600 
601  if (IsRegistered ())
602  {
603  NS_LOG_DEBUG ("SS (Basic CID: " << m_basicConnection->GetCid () << ")");
604  }
605  else
606  {
607  NS_LOG_DEBUG ("SS (" << GetMacAddress () << ")");
608  NS_LOG_INFO ("\tCan't send packet! (NotRegitered with the network)");
609  return false;
610  }
611 
612  NS_LOG_DEBUG ("packet to send, size : " << packet->GetSize () << ", destination : " << dest);
613 
614  if (GetServiceFlowManager ()->GetNrServiceFlows () == 0)
615  {
616  NS_LOG_INFO ("\tCan't send packet! (No service Flow)");
617  return false;
618  }
619 
620  if (protocolNumber == 2048)
621  {
622  serviceFlow = m_classifier->Classify (packet, GetServiceFlowManager (), ServiceFlow::SF_DIRECTION_UP);
623  }
624 
625  if ((protocolNumber != 2048) || (serviceFlow == NULL))
626  {
627  serviceFlow = *GetServiceFlowManager ()->GetServiceFlows (ServiceFlow::SF_TYPE_ALL).begin ();
628  NS_LOG_INFO ("\tNo service flows matches...using the default one.");
629  }
630 
631  NS_LOG_INFO ("\tPacket classified in the service flow SFID = " << serviceFlow->GetSfid () << " CID = "
632  << serviceFlow->GetCid ());
633  if (serviceFlow->GetIsEnabled ())
634  {
635  if (!Enqueue (packet, MacHeaderType (), serviceFlow->GetConnection ()))
636  {
637  NS_LOG_INFO ("\tEnqueue ERROR!!" );
638  m_ssTxDropTrace (packet);
639  return false;
640  }
641  else
642  {
643  m_ssTxTrace (packet);
644  }
645  }
646  else
647  {
648  NS_LOG_INFO ("Error!! The Service Flow is not enabled" );
649  m_ssTxDropTrace (packet);
650  return false;
651  }
652 
653  return true;
654 }
655 
656 bool
658  const MacHeaderType &hdrType,
659  Ptr<WimaxConnection> connection)
660 {
661  NS_ASSERT_MSG (connection != 0, "SS: Can not enqueue the packet: the selected connection is nor initialized");
662 
663  GenericMacHeader hdr;
664 
666  {
667  hdr.SetLen (packet->GetSize () + hdr.GetSerializedSize ());
668  hdr.SetCid (connection->GetCid ());
669 
670  }
671 
672  if (connection->GetType () == Cid::TRANSPORT)
673  {
674 
675  if (connection->GetSchedulingType () == ServiceFlow::SF_TYPE_UGS && m_scheduler->GetPollMe ())
676  {
678  "Error while equeuing packet: incorrect header type");
679 
680  GrantManagementSubheader grantMgmntSubhdr;
681  grantMgmntSubhdr.SetPm (true);
682  packet->AddHeader (grantMgmntSubhdr);
683  }
684  }
685  NS_LOG_INFO ("ServiceFlowManager: enqueuing packet" );
686  return connection->Enqueue (packet, hdrType, hdr);
687 }
688 
689 void
691  uint16_t nrSymbols,
692  Ptr<WimaxConnection> connection,
693  MacHeaderType::HeaderType packetType)
694 {
695  WimaxPhy::ModulationType modulationType;
696 
698  {
699  modulationType = WimaxPhy::MODULATION_TYPE_BPSK_12;
700  }
701  else
702  {
703  modulationType = GetBurstProfileManager ()->GetModulationType (uiuc, DIRECTION_UPLINK);
704  }
705  Ptr<PacketBurst> burst = m_scheduler->Schedule (nrSymbols, modulationType, packetType, connection);
706 
707  if (burst->GetNPackets () == 0)
708  {
709  return;
710  }
711 
712  if (IsRegistered ())
713  {
714  NS_LOG_DEBUG ("SS (Basic CID: " << m_basicConnection->GetCid () << ")");
715  }
716  else
717  {
718  NS_LOG_DEBUG ("SS (" << GetMacAddress () << ")");
719  }
720 
721  if (connection->GetType () == Cid::TRANSPORT)
722  {
723  ServiceFlowRecord *record = connection->GetServiceFlow ()->GetRecord ();
724  record->UpdatePktsSent (burst->GetNPackets ());
725  record->UpdateBytesSent (burst->GetSize ());
726 
727  NS_LOG_DEBUG (" sending burst" << ", SFID: " << connection->GetServiceFlow ()->GetSfid () << ", pkts sent: "
728  << record->GetPktsSent () << ", pkts rcvd: " << record->GetPktsRcvd () << ", bytes sent: "
729  << record->GetBytesSent () << ", bytes rcvd: " << record->GetBytesRcvd () );
730 
731  }
732  else
733  {
734 
735  }
736  ForwardDown (burst, modulationType);
737 }
738 
739 void
741 {
742  GenericMacHeader gnrcMacHdr;
743  ManagementMessageType msgType;
744  RngRsp rngrsp;
745  Cid cid;
746  uint32_t pktSize = packet->GetSize ();
747  packet->RemoveHeader (gnrcMacHdr);
748  FragmentationSubheader fragSubhdr;
749  bool fragmentation = false; // it becomes true when there is a fragmentation subheader
750 
751  if (gnrcMacHdr.GetHt () == MacHeaderType::HEADER_TYPE_GENERIC)
752  {
753  if (gnrcMacHdr.check_hcs () == false)
754  {
755  // The header is noisy
756  NS_LOG_INFO ("Header HCS ERROR");
757  m_ssRxDropTrace (packet);
758  return;
759  }
760 
761  cid = gnrcMacHdr.GetCid ();
762 
763  // checking for subheaders
764  uint8_t type = gnrcMacHdr.GetType ();
765  if (type)
766  {
767  // Check if there is a fragmentation Subheader
768  uint8_t tmpType = type;
769  if (((tmpType >> 2) & 1) == 1)
770  {
771  // a TRANSPORT packet with fragmentation subheader has been received!
772  fragmentation = true;
773  NS_LOG_INFO ("SS DoReceive -> the packet is a fragment" << std::endl);
774  }
775  }
776 
777  if (cid == GetBroadcastConnection ()->GetCid () && !fragmentation)
778  {
779  packet->RemoveHeader (msgType);
780  switch (msgType.GetType ())
781  {
783  {
785  {
786  Simulator::Cancel (m_linkManager->GetDlMapSyncTimeoutEvent ());
787  }
788 
790  {
792  }
793 
794  m_linkManager->ScheduleScanningRestart (m_lostDlMapInterval, EVENT_LOST_DL_MAP, false, m_lostDlMapEvent);
795 
797  {
799  }
800 
801  m_linkManager->ScheduleScanningRestart (m_intervalT1,
803  false,
805 
807  {
809  }
810 
811  m_linkManager->ScheduleScanningRestart (m_intervalT12,
813  true,
815 
816  DlMap dlmap;
817  packet->RemoveHeader (dlmap);
818  ProcessDlMap (dlmap);
819  break;
820  }
822  {
824  {
826  m_linkManager->ScheduleScanningRestart (m_lostUlMapInterval,
828  true,
830  }
831 
832  UlMap ulmap;
833  packet->RemoveHeader (ulmap);
834 
835  ProcessUlMap (ulmap);
836 
838  {
839  if (m_linkManager->GetRangingIntervalFound ())
840  {
842  {
844  }
845  m_linkManager->PerformBackoff ();
846  }
847  }
848  break;
849  }
851  {
853  {
855  }
856 
858  {
860  m_linkManager->ScheduleScanningRestart (m_intervalT1,
862  false,
864  }
865 
866  Dcd dcd;
867  // number of burst profiles is set to number of DL-MAP IEs after processing DL-MAP, not a very good solution
868  // dcd.SetNrDlBurstProfiles (m_nrDlMapElements);
869  dcd.SetNrDlBurstProfiles (7);
870  packet->RemoveHeader (dcd);
871 
872  ProcessDcd (dcd);
873  break;
874  }
876  {
877  Ucd ucd;
878  // number of burst profiles is set to number of UL-MAP IEs after processing UL-MAP, not a very good solution
879  // ucd.SetNrUlBurstProfiles (m_nrUlMapElements);
880  ucd.SetNrUlBurstProfiles (7);
881  packet->RemoveHeader (ucd);
882 
883  ProcessUcd (ucd);
884 
886  {
888  m_linkManager->ScheduleScanningRestart (m_intervalT12,
890  true,
892  }
893 
895  {
896  /*state indicating that SS has completed scanning, synchronization and parameter acquisition
897  successfully and now waiting for UL-MAP to start initial ranging.*/
899 
900  m_linkManager->ScheduleScanningRestart (m_intervalT2,
902  false,
904  m_linkManager->ScheduleScanningRestart (m_lostUlMapInterval,
906  true,
908  }
909  break;
910  }
911  default:
912  NS_FATAL_ERROR ("Invalid management message type");
913  }
914  }
915  else if (GetInitialRangingConnection () != 0 && cid == GetInitialRangingConnection ()->GetCid () && !fragmentation)
916  {
917  m_traceSSRx (packet, GetMacAddress (), cid);
918  packet->RemoveHeader (msgType);
919  switch (msgType.GetType ())
920  {
922  // intended for base station, ignore
923  break;
926  "SS: Error while receiving a ranging response message: SS state should be at least SS_STATE_WAITING_REG_RANG_INTRVL");
927  packet->RemoveHeader (rngrsp);
928  m_linkManager->PerformRanging (cid, rngrsp);
929  break;
930  default:
931  NS_LOG_ERROR ("Invalid management message type");
932  }
933  }
934  else if (m_basicConnection != 0 && cid == m_basicConnection->GetCid () && !fragmentation)
935  {
936  m_traceSSRx (packet, GetMacAddress (), cid);
937  packet->RemoveHeader (msgType);
938  switch (msgType.GetType ())
939  {
941  // intended for base station, ignore
942  break;
945  "SS: Error while receiving a ranging response message: SS state should be SS_STATE_WAITING_RNG_RSP");
946  packet->RemoveHeader (rngrsp);
947  m_linkManager->PerformRanging (cid, rngrsp);
948  break;
949  default:
950  NS_LOG_ERROR ("Invalid management message type");
951  }
952  }
953  else if (m_primaryConnection != 0 && cid == m_primaryConnection->GetCid () && !fragmentation)
954  {
955  m_traceSSRx (packet, GetMacAddress (), cid);
956  packet->RemoveHeader (msgType);
957  switch (msgType.GetType ())
958  {
960  // not yet implemented
961  break;
963  // intended for base station, ignore
964  break;
966  /*from other station as DSA initiation
967  by BS is not supported, ignore*/
968  break;
970  {
971  Simulator::Cancel (GetServiceFlowManager ()->GetDsaRspTimeoutEvent ());
972  DsaRsp dsaRsp;
973  packet->RemoveHeader (dsaRsp);
974  GetServiceFlowManager ()->ProcessDsaRsp (dsaRsp);
975  break;
976  }
978  /*from other station as DSA initiation
979  by BS is not supported, ignore*/
980  break;
981  default:
982  NS_LOG_ERROR ("Invalid management message type");
983  }
984  }
985  else if (GetConnectionManager ()->GetConnection (cid)) // transport connection
986  {
987  ServiceFlow *serviceFlow = GetConnectionManager ()->GetConnection (cid)->GetServiceFlow ();
988  ServiceFlowRecord *record = serviceFlow->GetRecord ();
989 
990  record->UpdatePktsRcvd (1);
991  record->UpdateBytesRcvd (pktSize);
992 
993  // If fragmentation is true, the packet is a fragment.
994  if (!fragmentation)
995  {
996  m_ssRxTrace (packet);
997  ForwardUp (packet, m_baseStationId, GetMacAddress ()); // source shall be BS's address or sender SS's?
998  }
999  else
1000  {
1001  NS_LOG_INFO ( "FRAG_DEBUG: SS DoReceive, the Packet is a fragment" << std::endl);
1002  packet->RemoveHeader (fragSubhdr);
1003  uint32_t fc = fragSubhdr.GetFc ();
1004  NS_LOG_INFO ( "\t fragment size = " << packet->GetSize () << std::endl);
1005 
1006  if (fc == 2)
1007  {
1008  // This is the latest fragment.
1009  // Take the fragment queue, defragment a packet and send it to the upper layer
1010  NS_LOG_INFO ( "\t Received the latest fragment" << std::endl);
1011  GetConnectionManager ()->GetConnection (cid)
1012  ->FragmentEnqueue (packet);
1013 
1015  GetConnection (cid)->GetFragmentsQueue ();
1016 
1017  Ptr<Packet> fullPacket = Create<Packet> ();
1018 
1019  // DEFRAGMENTATION
1020  NS_LOG_INFO ( "\t SS PACKET DEFRAGMENTATION" << std::endl);
1021  for (std::list<Ptr<const Packet> >::const_iterator iter = fragmentsQueue.begin ();
1022  iter != fragmentsQueue.end (); ++iter)
1023  {
1024  // Create the whole Packet
1025  fullPacket->AddAtEnd (*iter);
1026  }
1027  GetConnectionManager ()->GetConnection (cid)
1028  ->ClearFragmentsQueue ();
1029  NS_LOG_INFO ( "\t fullPacket size = " << fullPacket->GetSize () << std::endl);
1030 
1031  m_ssRxTrace (fullPacket);
1032  ForwardUp (fullPacket, m_baseStationId, GetMacAddress ()); // source shall be BS's address or sender SS's?
1033  }
1034  else
1035  {
1036  // This is the first or middle fragment.
1037  // Take the fragment queue, store the fragment into the queue
1038  NS_LOG_INFO ( "\t Received the first or the middle fragment" << std::endl);
1039  GetConnectionManager ()->GetConnection (cid)->FragmentEnqueue (packet);
1040  }
1041  }
1042  }
1043  else if (cid.IsMulticast ())
1044  {
1045  m_traceSSRx (packet, GetMacAddress (), cid);
1046  ForwardUp (packet, m_baseStationId, GetMacAddress ()); // source shall be BS's address or sender SS's?
1047  }
1048  else if (IsPromisc ())
1049  {
1050  NotifyPromiscTrace (packet);
1051  m_ssPromiscRxTrace (packet);
1052 
1053  // not for me, ignore
1054  }
1055  else
1056  {
1057  // not for me drop
1058  }
1059  }
1060  else
1061  {
1062  // from other SS, ignore
1063  }
1064 }
1065 
1066 void
1068 {
1069  m_nrDlMapRecvd++;
1070  m_dcdCount = dlmap.GetDcdCount ();
1071  m_baseStationId = dlmap.GetBaseStationId ();
1072  std::list<OfdmDlMapIe> dlMapElements = dlmap.GetDlMapElements ();
1073 
1074  for (std::list<OfdmDlMapIe>::iterator iter = dlMapElements.begin (); iter != dlMapElements.end (); ++iter)
1075  {
1076  if (iter->GetDiuc () == OfdmDlBurstProfile::DIUC_END_OF_MAP)
1077  {
1078  break;
1079  }
1080 
1081  if (iter->GetCid () == m_basicConnection->GetCid ())
1082  {
1083  /*here the SS shall actually acquire the start time it shall start receiving the burst at. start time is used for power saving
1084  which is not implemented here, furthermore there is no need since the simulator architecture automatically callbacks the receive
1085  function. shall acquire the DIUC (burst profile) as well to decode the burst, again not required again because the callback
1086  mechanism automatically passes it as parameter.*/
1087  }
1088 
1089 #if 0 /* a template for future implementation following */
1090  uint8_t temp = iter->GetDiuc ();
1091  temp = iter->GetPreamblePresent ();
1092  temp = iter->GetStartTime ();
1093 #endif
1094  }
1095 }
1096 
1097 void
1099 {
1100  m_nrUlMapRecvd++;
1101  m_ucdCount = ulmap.GetUcdCount ();
1103  std::list<OfdmUlMapIe> ulMapElements = ulmap.GetUlMapElements ();
1104  m_linkManager->SetRangingIntervalFound (false);
1105 
1106  for (std::list<OfdmUlMapIe>::iterator iter = ulMapElements.begin (); iter != ulMapElements.end (); ++iter)
1107  {
1108  OfdmUlMapIe ulMapIe = *iter;
1109 
1110  if (ulMapIe.GetUiuc () == OfdmUlBurstProfile::UIUC_END_OF_MAP)
1111  {
1112  break;
1113  }
1114 
1115  Cid cid = ulMapIe.GetCid ();
1116 
1117  if (ulMapIe.GetUiuc () == OfdmUlBurstProfile::UIUC_INITIAL_RANGING && cid == GetBroadcastConnection ()->GetCid ())
1118  {
1119  m_linkManager->SetRangingIntervalFound (true);
1120  }
1121 
1122  if (m_areManagementConnectionsAllocated && cid == m_basicConnection->GetCid ())
1123  {
1124 
1125  Time timeToAllocation = GetTimeToAllocation (Seconds (ulMapIe.GetStartTime ()
1126  * GetPhy ()->GetSymbolDuration ().GetSeconds ()));
1127 
1128  if (ulMapIe.GetUiuc () == OfdmUlBurstProfile::UIUC_INITIAL_RANGING) // invited ranging interval
1129 
1130  {
1131 
1132  m_linkManager->IncrementNrInvitedPollsRecvd ();
1134  "SS: Error while processing UL MAP: SS state should be SS_STATE_WAITING_INV_RANG_INTRVL");
1135  Simulator::Schedule (timeToAllocation,
1137  m_linkManager,
1138  ulMapIe.GetUiuc (),
1139  ulMapIe.GetDuration ());
1140  }
1141  else if (ulMapIe.GetUiuc () == OfdmUlBurstProfile::UIUC_REQ_REGION_FULL) // unicast poll
1142 
1143  {
1144 
1145  Simulator::Schedule (timeToAllocation,
1148  ulMapIe.GetUiuc (),
1149  ulMapIe.GetDuration ());
1150  }
1151  else // regular allocation/grant for data, for UGS flows or in response of requests for non-UGS flows
1152 
1153  {
1154 
1155  Ptr<WimaxConnection> connection = NULL;
1156  Simulator::Schedule (timeToAllocation,
1158  this,
1159  ulMapIe.GetUiuc (),
1160  ulMapIe.GetDuration (),
1161  connection,
1163  }
1164  }
1165  else
1166  {
1167  if (ulMapIe.GetUiuc () == OfdmUlBurstProfile::UIUC_INITIAL_RANGING && cid
1168  == GetBroadcastConnection ()->GetCid ()) // regular ranging interval
1169 
1170  {
1172  {
1173  m_linkManager->SetNrRangingTransOpps ((ulMapIe.GetDuration () * GetPhy ()->GetPsPerSymbol ())
1175 
1176  }
1177 
1179  {
1180  m_linkManager->StartContentionResolution ();
1181  }
1182 
1183  }
1184  }
1185  }
1186 }
1187 
1188 void
1190 {
1191  m_nrDcdRecvd++;
1193  {
1194  return; // nothing new in DCD so don't read
1195 
1196  }
1197  SetCurrentDcd (dcd);
1198  OfdmDcdChannelEncodings dcdChnlEncodings = dcd.GetChannelEncodings ();
1199 
1200  // parameters for initial ranging
1201  m_linkManager->SetBsEirp (dcdChnlEncodings.GetBsEirp ());
1202  m_linkManager->SetEirXPIrMax (dcdChnlEncodings.GetEirxPIrMax ());
1203 
1204  GetPhy ()->GetFrameDuration (dcdChnlEncodings.GetFrameDurationCode ());
1205 
1206  std::vector<OfdmDlBurstProfile> dlBurstProfiles = dcd.GetDlBurstProfiles ();
1207 
1208  for (std::vector<OfdmDlBurstProfile>::iterator iter = dlBurstProfiles.begin (); iter != dlBurstProfiles.end (); ++iter)
1209  {
1210  OfdmDlBurstProfile brstProfile = *iter;
1211 
1212  /*NS-2 does this, may be not correct, assumes DIUC/UIUC to
1213  modulation type mapping in DCD/UCD may change over time*/
1214  if (brstProfile.GetFecCodeType () == m_modulationType)
1215  {
1217  m_dlBurstProfile->SetDiuc (brstProfile.GetDiuc ());
1218  }
1219  }
1220 }
1221 
1222 void
1224 {
1225  m_nrUcdRecvd++;
1226  if (!m_linkManager->IsUlChannelUsable ())
1227  {
1228  m_linkManager->StartScanning (EVENT_NONE, false);
1229  return;
1230  }
1231 
1233  {
1234  return; // nothing new in UCD so don't read
1235 
1236  }
1237  SetCurrentUcd (ucd);
1238  m_linkManager->SetRangingCW ((uint8_t) std::pow ((double) 2, (double) ucd.GetRangingBackoffStart ()) - 1); // initializing ranging CW
1239  OfdmUcdChannelEncodings ucdChnlEncodings = ucd.GetChannelEncodings ();
1240 
1241  std::vector<OfdmUlBurstProfile> ulBurstProfiles = ucd.GetUlBurstProfiles ();
1242 
1243  for (std::vector<OfdmUlBurstProfile>::iterator iter = ulBurstProfiles.begin (); iter != ulBurstProfiles.end (); ++iter)
1244  {
1245  OfdmUlBurstProfile brstProfile = *iter;
1246 
1247  /*NS-2 does this, may be not correct, assumes DIUC/UIUC to
1248  modulation type mapping in DCD/UCD may change over time*/
1249  if (brstProfile.GetFecCodeType () == m_modulationType)
1250  {
1252  m_ulBurstProfile->SetUiuc (brstProfile.GetUiuc ());
1253  }
1254  }
1255 }
1256 
1257 /*temporarily assuming registered if ranging is complete,
1258  shall actually consider the registration step also */
1259 bool
1261 {
1262  return GetState () >= SS_STATE_REGISTERED;
1263 }
1264 
1265 Time
1267 {
1268  Time timeAlreadyElapsed = Simulator::Now () - m_frameStartTime;
1269  Time timeToUlSubframe = Seconds (m_allocationStartTime * GetPhy ()->GetPsDuration ().GetSeconds ())
1270  - timeAlreadyElapsed;
1271  return timeToUlSubframe + deferTime;
1272 }
1273 
1274 void
1276 {
1277  if (GetState () == SS_STATE_STOPPED)
1278  {
1279  Simulator::Cancel (eventId); // cancelling this event (already scheduled in function call)
1280  return;
1281  }
1282 
1283  event = eventId;
1284 }
1285 
1286 } // namespace ns`
void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize)
Send bandwidth request.
This class implements the OFDM UCD channel encodings as described by "IEEE Standard for Local and met...
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
HeaderType
Header type enumeration.
Ptr< WimaxConnection > GetInitialRangingConnection(void) const
Get the initial ranging connection.
void SetIntervalT3(Time interval3)
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan ...
Definition: mac-messages.h:474
void SetTimer(EventId eventId, EventId &event)
Set timer.
uint32_t GetBytesSent(void) const
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
void SetIntervalT1(Time interval1)
static Time GetDefaultLostDlMapInterval()
Get default lost DL map interval.
This class implements DL-MAP as described by "IEEE Standard for Local and metropolitan area networks ...
Time m_intervalT21
in seconds, time the SS searches for (decodable) DL-MAP on a given channel
uint32_t GetSerializedSize(void) const
void SetLostDlMapInterval(Time lostDlMapInterval)
void ProcessUcd(const Ucd &ucd)
Process UCD.
void ProcessDcd(const Dcd &dcd)
Process DCD.
void SetIntervalT21(Time interval21)
Ptr< WimaxConnection > m_basicConnection
basic connection
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
Definition: mac-messages.h:121
uint8_t GetUiuc(void) const
Get UIUC.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Ptr< WimaxConnection > m_primaryConnection
primary connection
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
uint8_t GetDiuc(void) const
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43...
Definition: mac-messages.h:43
uint8_t GetDcdCount(void) const
Get DCD count field.
this class implements a structure to manage some parameters and statistics related to a service flow ...
uint16_t GetStartTime(void) const
Get start time.
void SetIntervalT2(Time interval2)
void SetModulationType(WimaxPhy::ModulationType modulationType)
Set the most efficient modulation and coding scheme (MCS) supported by the device.
void SetPm(uint8_t pm)
Set PM field.
uint32_t GetPktsSent(void) const
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:355
uint8_t GetType(void) const
Get type field.
void ProcessDlMap(const DlMap &dlmap)
Process DL map.
EventId m_lostUlMapEvent
lost UL map event
void ForwardUp(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest)
Forward a packet to the next layer above the device.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
void SetMaxDcdInterval(Time maxDcdInterval)
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1070
void SetAreManagementConnectionsAllocated(bool areManagementConnectionsAllocated)
uint32_t m_nrUcdRecvd
number UCD received
void SetLostUlMapInterval(Time lostUlMapInterval)
Ptr< IpcsClassifier > GetIpcsClassifier() const
uint8_t GetFrameDurationCode(void) const
Get frame duration code field.
uint8_t GetConfigurationChangeCount(void) const
Get configuration change count.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:280
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
This class implements the UL burst profile as described by "IEEE Standard for Local and metropolitan ...
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event&#39;s associated function will not be invoked when it expires...
Definition: simulator.cc:290
void SetScheduler(Ptr< SSScheduler > ssScheduler)
Time m_lostDlMapInterval
in milliseconds, time since last received DL-MAP before downlink synchronization is considered lost...
void SetMaxUcdInterval(Time maxUcdInterval)
void Start(void)
Start the device.
Cid GetCid(void) const
Get CID field.
Time GetLostDlMapInterval(void) const
std::list< OfdmDlMapIe > GetDlMapElements(void) const
Get DL Map elements field.
Mac48Address m_baseStationId
base station ID
Ptr< SsServiceFlowManager > GetServiceFlowManager(void) const
TracedCallback< Ptr< const Packet > > m_ssPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
Ptr< SSScheduler > m_scheduler
the scheduler
Ptr< BurstProfileManager > GetBurstProfileManager(void) const
Get the burst profile manager.
void ProcessUlMap(const UlMap &ulmap)
Process UL map.
uint32_t GetSfid(void) const
Get SFID.
bool m_areServiceFlowsAllocated
are service flows allocated
void SetDiuc(uint8_t diuc)
Set DIUC field.
bool GetIsEnabled(void) const
Get is enabled flag.
This class implements the Generic mac Header as described by IEEE Standard for Local and metropolitan...
uint8_t GetUiuc(void) const
Get UIUC.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Time m_intervalT3
in milliseconds, ranging Response reception timeout following the transmission of a ranging request ...
phy
Definition: third.py:93
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
void SetNrUlBurstProfiles(uint8_t nrUlBurstProfiles)
Set NR UL burst profiles.
void DoReceive(Ptr< Packet > packet)
Receive a packet.
TracedCallback< Ptr< const Packet > > m_ssRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Definition: packet.cc:335
Ucd GetCurrentUcd(void) const
Get the current UCD.
Ptr< WimaxConnection > GetConnection(void) const
Can return a null connection is this service flow has not been associated yet to a connection...
void SetNrDlBurstProfiles(uint8_t nrDlBurstProfiles)
Set number DL burst profile field.
Time m_intervalT20
in seconds, time the SS searches for preambles on a given channel
uint32_t m_nrDlMapRecvd
number DL map received
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:220
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1389
Time m_intervalT7
in seconds, wait for DSA/DSC/DSD Response timeout
void SetIntervalT20(Time interval20)
void SetMaxContentionRangingRetries(uint8_t maxContentionRangingRetries)
uint8_t m_maxContentionRangingRetries
maximum contention ranging retries
void SetCid(Cid cid)
Set CID field.
void SetCurrentDcd(Dcd dcd)
Set the current DCD.
uint8_t GetConfigurationChangeCount(void) const
Get configuration change count field.
AttributeValue implementation for Time.
Definition: nstime.h:1124
double m_allocationStartTime
allocation start time
uint32_t m_nrDcdRecvd
number DCD received
void SetIntervalT12(Time interval12)
void SetFecCodeType(uint8_t fecCodeType)
Set FEC code type.
bool DoSend(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest, uint16_t protocolNumber)
Send a packet.
Hold an unsigned integer type.
Definition: uinteger.h:44
bool Enqueue(Ptr< Packet > packet, const MacHeaderType &hdrType, Ptr< WimaxConnection > connection)
Enqueue a packet into a connection queue.
void SetUiuc(uint8_t uiuc)
Set UIUC.
bool GetAreServiceFlowsAllocated(void) const
TracedCallback< Ptr< const Packet > > m_ssTxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
This class implements the UCD message as described by "IEEE Standard for Local and metropolitan area ...
Time m_intervalT12
in seconds, wait for UCD descriptor
Ptr< SsServiceFlowManager > m_serviceFlowManager
the service flow manager
Ptr< BandwidthManager > GetBandwidthManager(void) const
Get the bandwidth manager on the device.
This class implements the grant management sub-header as described by IEEE Standard for Local and met...
TracedCallback< Ptr< const Packet > > m_ssTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition...
void SetLinkManager(Ptr< SSLinkManager > linkManager)
sets the link manager to be used
uint16_t GetEirxPIrMax(void) const
Get EIRX IR MAX field.
EventId m_ucdWaitTimeoutEvent
UCD wait timeout event.
ServiceFlowRecord * GetRecord(void) const
Get service flow record.
Ptr< WimaxConnection > GetPrimaryConnection(void) const
Mac48Address GetBaseStationId(void) const
Get base station ID field.
bool IsPromisc(void)
Check if device is promiscious.
This class implements Downlink channel descriptor as described by "IEEE Standard for Local and metrop...
void SendBurst(uint8_t uiuc, uint16_t nrSymbols, Ptr< WimaxConnection > connection, MacHeaderType::HeaderType packetType=MacHeaderType::HEADER_TYPE_GENERIC)
Sends a burst on the uplink frame.
This class Represents the HT (Header Type) field of generic MAC and bandwidth request headers...
TracedCallback< Ptr< const Packet > > m_ssRxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
virtual void DoDispose(void)
Destructor implementation.
#define list
Ptr< WimaxPhy > GetPhy(void) const
Get the physical layer object.
uint8_t GetFc(void) const
Get FC field.
void UpdatePktsRcvd(uint32_t pktsRcvd)
update the number of received packets by adding pktsRcvd
uint8_t GetHt(void) const
Get HT field.
Ptr< WimaxConnection > GetBasicConnection(void) const
Dcd GetCurrentDcd(void) const
Get the current DCD.
uint16_t GetBsEirp(void) const
Get BS EIRP field.
uint16_t GetCid(void) const
Get CID.
Time m_maxDcdInterval
in seconds, maximum time between transmission of DCD messages
Time GetLostUlMapInterval(void) const
uint8_t GetType(void) const
Get type field.
Definition: mac-messages.cc:56
EventId m_lostDlMapEvent
lost DL map event
Hold together all WiMAX-related objects in a NetDevice.
Mac48Address GetMacAddress(void) const
Get the MAC address.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
uint32_t GetAllocationStartTime(void) const
Get allocation start time.
Ptr< ConnectionManager > GetConnectionManager(void) const
Get the connection manager of the device.
static TypeId GetTypeId(void)
Get the type ID.
Cid class.
Definition: cid.h:37
void DoDispose(void)
Destructor implementation.
Time m_lostUlMapInterval
in milliseconds, time since last received UL-MAP before uplink synchronization is considered lost...
Ptr< SSLinkManager > GetLinkManager(void) const
uint32_t GetPktsRcvd(void) const
std::list< OfdmUlMapIe > GetUlMapElements(void) const
Get UL map elements.
uint8_t GetRangingBackoffStart(void) const
Get ranging backoff start.
OfdmUcdChannelEncodings GetChannelEncodings(void) const
Get channel encodings.
an EUI-48 address
Definition: mac48-address.h:43
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Definition: simulator.h:1578
std::list< Ptr< const Packet > > FragmentsQueue
Definition of Fragments Queue data type.
Ptr< SSLinkManager > m_linkManager
link manager
void SetBasicConnection(Ptr< WimaxConnection > basicConnection)
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:1125
TracedCallback< Ptr< const Packet >, Mac48Address, const Cid & > m_traceSSRx
trace SS receive callback
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:193
This class implements the OFDM DCD channel encodings as described by "IEEE Standard for Local and met...
void SetPhy(Ptr< WimaxPhy > phy)
Set the physical layer object.
void SetAreServiceFlowsAllocated(bool areServiceFlowsAllocated)
bool GetAreManagementConnectionsAllocated(void) const
This class implements the fragmentation sub-header as described by IEEE Standard for Local and metrop...
uint16_t m_nrDlMapElements
number DL Map elements
void NotifyPromiscTrace(Ptr< Packet > p)
Notify promiscious trace of a packet arrival.
void SetIpcsPacketClassifier(Ptr< IpcsClassifier > classifier)
Sets the packet classifier to be used.
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:49
EventId m_rangOppWaitTimeoutEvent
range opp wait timeout event
WimaxPhy::ModulationType GetModulationType(void) const
uint8_t GetMaxContentionRangingRetries(void) const
bool m_areManagementConnectionsAllocated
are management connections allocated
An identifier for simulation events.
Definition: event-id.h:53
Time m_intervalT2
in seconds, wait for broadcast ranging timeout, i.e., wait for initial ranging opportunity ...
void SetCurrentUcd(Ucd ucd)
Set the current UCD.
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
void ForwardDown(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType)
Forward a packet down the stack.
Ptr< SSScheduler > GetScheduler(void) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:272
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1062
void SetIntervalT7(Time interval7)
void CreateDefaultConnections(void)
Creates the initial ranging and broadcast connections.
std::vector< OfdmUlBurstProfile > GetUlBurstProfiles(void) const
Get UL burst profiles.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:65
bool IsMulticast(void) const
Definition: cid.cc:51
OfdmDlBurstProfile * m_dlBurstProfile
DL burst profile.
uint8_t GetType(void) const
Get type field.
SubscriberStationNetDevice subclass of WimaxNetDevice.
Definition: ss-net-device.h:48
Time m_intervalT1
in seconds, wait for DCD timeout
Time m_maxUcdInterval
in seconds, maximum time between transmission of UCD messages
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1078
void SetState(uint8_t state)
Set the device state.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:256
uint8_t GetFecCodeType(void) const
Get FEC code type.
uint16_t GetDuration(void) const
Get duration.
Ptr< IpcsClassifier > m_classifier
the classifier
void InitSubscriberStationNetDevice(void)
initializes the net device and sets the parameters to the default values
Cid GetCid(void) const
Get CID.
bool check_hcs(void) const
Check HCS.
uint8_t GetState(void) const
Get the device state.
WimaxPhy::ModulationType m_modulationType
modulation type
void UpdateBytesSent(uint32_t bytesSent)
update the number of sent bytes by adding bytesSent
Time GetTimeToAllocation(Time deferTime)
Get time to allocation.
virtual void SetNode(Ptr< Node > node)
Set node pointer.
OfdmUlBurstProfile * m_ulBurstProfile
UL burst profile.
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:45
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
void AddServiceFlow(ServiceFlow *sf)
adds a new service flow
a unique identifier for an interface.
Definition: type-id.h:58
uint32_t GetBytesRcvd(void) const
uint16_t m_nrUlMapElements
number UL Map elements
void SetServiceFlowManager(Ptr< SsServiceFlowManager > sfm)
Sets the service flow manager to be installed on the device.
Ptr< WimaxConnection > GetBroadcastConnection(void) const
Get the broadcast connection.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
void SetReceiveCallback(void)
Set receive callback function.
uint32_t m_nrUlMapRecvd
number UL map received
static Time m_frameStartTime
temp, to determine the frame start time at SS side, shall actually be determined by frame start pream...
void SetPrimaryConnection(Ptr< WimaxConnection > primaryConnection)
uint8_t GetUcdCount(void) const
Get UCD count.
This class implements the OFDM Downlink burst profile descriptor as described by "IEEE Standard for L...
OfdmDcdChannelEncodings GetChannelEncodings(void) const
Get channel encodings field.
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
uint8_t GetFecCodeType(void) const
void SetFecCodeType(uint8_t fecCodeType)
Set FEC code type.
void SetLen(uint16_t len)
Set length field.
void Stop(void)
Stop the device.
std::vector< OfdmDlBurstProfile > GetDlBurstProfiles(void) const
Get DL burst profile field.
uint16_t GetRangReqOppSize(void) const
Get range request opp size.
void UpdatePktsSent(uint32_t pktsSent)
update the number of sent packets by adding pktsSent
EventId m_dcdWaitTimeoutEvent
DCD wait timeout event.
void UpdateBytesRcvd(uint32_t bytesRcvd)
update the number of received bytes by adding bytesRcvd