A Discrete-Event Network Simulator
API
test-asn1-encoding.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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  * Author: Lluis Parcerisa <lparcerisa@cttc.cat>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/string.h"
23 #include "ns3/double.h"
24 #include "ns3/enum.h"
25 #include "ns3/boolean.h"
26 #include "ns3/test.h"
27 #include "ns3/ptr.h"
28 #include "ns3/packet.h"
29 
30 #include "ns3/lte-rrc-header.h"
31 #include "ns3/lte-rrc-sap.h"
32 
33 using namespace ns3;
34 
35 NS_LOG_COMPONENT_DEFINE ("Asn1EncodingTest");
36 
43 class TestUtils
44 {
45 public:
51  static std::string sprintPacketContentsHex (Ptr<Packet> pkt)
52  {
53  uint32_t psize = pkt->GetSize ();
54  uint8_t buffer[psize];
55  char sbuffer[psize * 3];
56  pkt->CopyData (buffer, psize);
57  for (uint32_t i = 0; i < psize; i++)
58  {
59  sprintf (&sbuffer[i * 3],"%02x ",buffer[i]);
60  }
61  return std::string (sbuffer);
62  }
63 
69  static std::string sprintPacketContentsBin (Ptr<Packet> pkt)
70  {
71  uint32_t psize = pkt->GetSize ();
72  uint8_t buffer[psize];
73  std::ostringstream oss (std::ostringstream::out);
74  pkt->CopyData (buffer, psize);
75  for (uint32_t i = 0; i < psize; i++)
76  {
77  oss << (std::bitset<8> (buffer[i]));
78  }
79  return std::string (oss.str () + "\n");
80  }
81 
86  static void LogPacketContents (Ptr<Packet> pkt)
87  {
88  NS_LOG_DEBUG ("---- SERIALIZED PACKET CONTENTS (HEX): -------");
91  }
92 
98  template <class T>
99  static void LogPacketInfo (T source,std::string s)
100  {
101  NS_LOG_DEBUG ("--------- " << s.data () << " INFO: -------");
102  std::ostringstream oss (std::ostringstream::out);
103  source.Print (oss);
104  NS_LOG_DEBUG (oss.str ());
105  }
106 };
107 
108 // --------------------------- CLASS RrcHeaderTestCase -----------------------------
117 {
118 public:
123  RrcHeaderTestCase (std::string s);
124  virtual void DoRun (void) = 0;
129  LteRrcSap::RadioResourceConfigDedicated CreateRadioResourceConfigDedicated ();
135  void AssertEqualRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedicated rrcd1, LteRrcSap::RadioResourceConfigDedicated rrcd2);
136 
137 protected:
139 };
140 
142 {
143 }
144 
147 {
149 
150  rrd.drbToReleaseList = std::list<uint8_t> (4,2);
151 
152  LteRrcSap::SrbToAddMod srbToAddMod;
153  srbToAddMod.srbIdentity = 2;
154 
155  LteRrcSap::LogicalChannelConfig logicalChannelConfig;
156  logicalChannelConfig.priority = 9;
157  logicalChannelConfig.prioritizedBitRateKbps = 128;
158  logicalChannelConfig.bucketSizeDurationMs = 100;
159  logicalChannelConfig.logicalChannelGroup = 3;
160  srbToAddMod.logicalChannelConfig = logicalChannelConfig;
161 
162  rrd.srbToAddModList.insert (rrd.srbToAddModList.begin (),srbToAddMod);
163 
164  LteRrcSap::DrbToAddMod drbToAddMod;
165  drbToAddMod.epsBearerIdentity = 1;
166  drbToAddMod.drbIdentity = 1;
167  drbToAddMod.logicalChannelIdentity = 5;
168  LteRrcSap::RlcConfig rlcConfig;
169  rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL;
170  drbToAddMod.rlcConfig = rlcConfig;
171 
172  LteRrcSap::LogicalChannelConfig logicalChannelConfig2;
173  logicalChannelConfig2.priority = 7;
174  logicalChannelConfig2.prioritizedBitRateKbps = 256;
175  logicalChannelConfig2.bucketSizeDurationMs = 50;
176  logicalChannelConfig2.logicalChannelGroup = 2;
177  drbToAddMod.logicalChannelConfig = logicalChannelConfig2;
178 
179  rrd.drbToAddModList.insert (rrd.drbToAddModList.begin (),drbToAddMod);
180 
181  rrd.havePhysicalConfigDedicated = true;
182  LteRrcSap::PhysicalConfigDedicated physicalConfigDedicated;
183  physicalConfigDedicated.haveSoundingRsUlConfigDedicated = true;
184  physicalConfigDedicated.soundingRsUlConfigDedicated.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP;
185  physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth = 2;
186  physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex = 12;
187 
188  physicalConfigDedicated.haveAntennaInfoDedicated = true;
189  physicalConfigDedicated.antennaInfo.transmissionMode = 2;
190 
191  physicalConfigDedicated.havePdschConfigDedicated = true;
192  physicalConfigDedicated.pdschConfigDedicated.pa = LteRrcSap::PdschConfigDedicated::dB0;
193 
194  rrd.physicalConfigDedicated = physicalConfigDedicated;
195 
196  return rrd;
197 }
198 
199 void
201 {
202  NS_TEST_ASSERT_MSG_EQ (rrcd1.srbToAddModList.size (), rrcd2.srbToAddModList.size (),"SrbToAddModList different sizes");
203 
204  std::list<LteRrcSap::SrbToAddMod> srcSrbToAddModList = rrcd1.srbToAddModList;
205  std::list<LteRrcSap::SrbToAddMod>::iterator it1 = srcSrbToAddModList.begin ();
206  std::list<LteRrcSap::SrbToAddMod> dstSrbToAddModList = rrcd2.srbToAddModList;
207  std::list<LteRrcSap::SrbToAddMod>::iterator it2 = dstSrbToAddModList.begin ();
208 
209  for (; it1 != srcSrbToAddModList.end (); it1++, it2++)
210  {
211  NS_TEST_ASSERT_MSG_EQ (it1->srbIdentity,it2->srbIdentity, "srbIdentity");
212  NS_TEST_ASSERT_MSG_EQ (it1->logicalChannelConfig.priority,it2->logicalChannelConfig.priority, "logicalChannelConfig.priority");
213  NS_TEST_ASSERT_MSG_EQ (it1->logicalChannelConfig.prioritizedBitRateKbps,it2->logicalChannelConfig.prioritizedBitRateKbps, "logicalChannelConfig.prioritizedBitRateKbps");
214  NS_TEST_ASSERT_MSG_EQ (it1->logicalChannelConfig.bucketSizeDurationMs,it2->logicalChannelConfig.bucketSizeDurationMs, "logicalChannelConfig.bucketSizeDurationMs");
215  NS_TEST_ASSERT_MSG_EQ (it1->logicalChannelConfig.logicalChannelGroup,it2->logicalChannelConfig.logicalChannelGroup, "logicalChannelConfig.logicalChannelGroup");
216  }
217 
218  NS_TEST_ASSERT_MSG_EQ (rrcd1.drbToAddModList.size (), rrcd2.drbToAddModList.size (),"DrbToAddModList different sizes");
219 
220  std::list<LteRrcSap::DrbToAddMod> srcDrbToAddModList = rrcd1.drbToAddModList;
221  std::list<LteRrcSap::DrbToAddMod>::iterator it3 = srcDrbToAddModList.begin ();
222  std::list<LteRrcSap::DrbToAddMod> dstDrbToAddModList = rrcd2.drbToAddModList;
223  std::list<LteRrcSap::DrbToAddMod>::iterator it4 = dstDrbToAddModList.begin ();
224 
225  for (; it3 != srcDrbToAddModList.end (); it3++, it4++)
226  {
227  NS_TEST_ASSERT_MSG_EQ (it3->epsBearerIdentity,it4->epsBearerIdentity, "epsBearerIdentity");
228  NS_TEST_ASSERT_MSG_EQ (it3->drbIdentity,it4->drbIdentity, "drbIdentity");
229  NS_TEST_ASSERT_MSG_EQ (it3->rlcConfig.choice,it4->rlcConfig.choice, "rlcConfig.choice");
230  NS_TEST_ASSERT_MSG_EQ (it3->logicalChannelIdentity,it4->logicalChannelIdentity, "logicalChannelIdentity");
231  NS_TEST_ASSERT_MSG_EQ (it3->epsBearerIdentity,it4->epsBearerIdentity, "epsBearerIdentity");
232 
233  NS_TEST_ASSERT_MSG_EQ (it3->logicalChannelConfig.priority,it4->logicalChannelConfig.priority, "logicalChannelConfig.priority");
234  NS_TEST_ASSERT_MSG_EQ (it3->logicalChannelConfig.prioritizedBitRateKbps,it4->logicalChannelConfig.prioritizedBitRateKbps, "logicalChannelConfig.prioritizedBitRateKbps");
235  NS_TEST_ASSERT_MSG_EQ (it3->logicalChannelConfig.bucketSizeDurationMs,it4->logicalChannelConfig.bucketSizeDurationMs, "logicalChannelConfig.bucketSizeDurationMs");
236  NS_TEST_ASSERT_MSG_EQ (it3->logicalChannelConfig.logicalChannelGroup,it4->logicalChannelConfig.logicalChannelGroup, "logicalChannelConfig.logicalChannelGroup");
237  }
238 
239  NS_TEST_ASSERT_MSG_EQ (rrcd1.drbToReleaseList.size (), rrcd2.drbToReleaseList.size (),"DrbToReleaseList different sizes");
240 
241  std::list<uint8_t> srcDrbToReleaseList = rrcd1.drbToReleaseList;
242  std::list<uint8_t> dstDrbToReleaseList = rrcd2.drbToReleaseList;
243  std::list<uint8_t>::iterator it5 = srcDrbToReleaseList.begin ();
244  std::list<uint8_t>::iterator it6 = dstDrbToReleaseList.begin ();
245 
246  for (; it5 != srcDrbToReleaseList.end (); it5++, it6++)
247  {
248  NS_TEST_ASSERT_MSG_EQ (*it5, *it6,"element != in DrbToReleaseList");
249  }
250 
251  NS_TEST_ASSERT_MSG_EQ (rrcd1.havePhysicalConfigDedicated,rrcd2.havePhysicalConfigDedicated, "HavePhysicalConfigDedicated");
252 
253  if (rrcd1.havePhysicalConfigDedicated)
254  {
257  "haveSoundingRsUlConfigDedicated");
258 
261  "soundingRsUlConfigDedicated.type");
264  "soundingRsUlConfigDedicated.srsBandwidth");
265 
268  "soundingRsUlConfigDedicated.srsConfigIndex");
269 
272  "haveAntennaInfoDedicated");
273 
275  {
278  "antennaInfo.transmissionMode");
279  }
280 
283  "havePdschConfigDedicated");
284 
286  {
289  "pdschConfigDedicated.pa");
290  }
291  }
292 }
293 
301 {
302 public:
304  virtual void DoRun (void);
305 };
306 
308 {
309 }
310 
311 void
313 {
314  packet = Create<Packet> ();
315  NS_LOG_DEBUG ("============= RrcConnectionRequestTestCase ===========");
316 
318  msg.ueIdentity = 0x83fecafecaULL;
319 
321  source.SetMessage (msg);
322 
323  // Log source info
324  TestUtils::LogPacketInfo<RrcConnectionRequestHeader> (source,"SOURCE");
325 
326  // Add header
327  packet->AddHeader (source);
328 
329  // Log serialized packet contents
331 
332  // Remove header
333  RrcConnectionRequestHeader destination;
334  packet->RemoveHeader (destination);
335 
336  // Log destination info
337  TestUtils::LogPacketInfo<RrcConnectionRequestHeader> (destination,"DESTINATION");
338 
339  // Check that the destination and source headers contain the same values
340  NS_TEST_ASSERT_MSG_EQ (source.GetMmec (),destination.GetMmec (), "Different m_mmec!");
341  NS_TEST_ASSERT_MSG_EQ (source.GetMtmsi (),destination.GetMtmsi (), "Different m_mTmsi!");
342 
343  packet = 0;
344 }
345 
353 {
354 public:
356  virtual void DoRun (void);
357 };
358 
360 {
361 }
362 
363 void
365 {
366  packet = Create<Packet> ();
367  NS_LOG_DEBUG ("============= RrcConnectionSetupTestCase ===========");
368 
370  msg.rrcTransactionIdentifier = 3;
372 
374  source.SetMessage (msg);
375 
376  // Log source info
377  TestUtils::LogPacketInfo<RrcConnectionSetupHeader> (source,"SOURCE");
378 
379  // Add header
380  packet->AddHeader (source);
381 
382  // Log serialized packet contents
384 
385  // remove header
386  RrcConnectionSetupHeader destination;
387  packet->RemoveHeader (destination);
388 
389  // Log destination info
390  TestUtils::LogPacketInfo<RrcConnectionSetupHeader> (destination,"DESTINATION");
391 
392  // Check that the destination and source headers contain the same values
393  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
394 
395  AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (),destination.GetRadioResourceConfigDedicated ());
396 
397  packet = 0;
398 }
399 
407 {
408 public:
410  virtual void DoRun (void);
411 };
412 
414 {
415 }
416 
417 void
419 {
420  packet = Create<Packet> ();
421  NS_LOG_DEBUG ("============= RrcConnectionSetupCompleteTestCase ===========");
422 
424  msg.rrcTransactionIdentifier = 3;
425 
427  source.SetMessage (msg);
428 
429  // Log source info
430  TestUtils::LogPacketInfo<RrcConnectionSetupCompleteHeader> (source,"SOURCE");
431 
432  // Add header
433  packet->AddHeader (source);
434 
435  // Log serialized packet contents
437 
438  // Remove header
440  packet->RemoveHeader (destination);
441 
442  // Log destination info
443  TestUtils::LogPacketInfo<RrcConnectionSetupCompleteHeader> (destination,"DESTINATION");
444 
445  // Check that the destination and source headers contain the same values
446  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
447 
448  packet = 0;
449 }
450 
458 {
459 public:
461  virtual void DoRun (void);
462 };
463 
465  : RrcHeaderTestCase ("Testing RrcConnectionReconfigurationCompleteTestCase")
466 {
467 }
468 
469 void
471 {
472  packet = Create<Packet> ();
473  NS_LOG_DEBUG ("============= RrcConnectionReconfigurationCompleteTestCase ===========");
474 
476  msg.rrcTransactionIdentifier = 2;
477 
479  source.SetMessage (msg);
480 
481  // Log source info
482  TestUtils::LogPacketInfo<RrcConnectionReconfigurationCompleteHeader> (source,"SOURCE");
483 
484  // Add header
485  packet->AddHeader (source);
486 
487  // Log serialized packet contents
489 
490  // remove header
492  packet->RemoveHeader (destination);
493 
494  // Log destination info
495  TestUtils::LogPacketInfo<RrcConnectionReconfigurationCompleteHeader> (destination,"DESTINATION");
496 
497  // Check that the destination and source headers contain the same values
498  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
499 
500  packet = 0;
501 }
502 
510 {
511 public:
513  virtual void DoRun (void);
514 };
515 
517  : RrcHeaderTestCase ("Testing RrcConnectionReconfigurationTestCase")
518 {
519 }
520 
521 void
523 {
524  packet = Create<Packet> ();
525  NS_LOG_DEBUG ("============= RrcConnectionReconfigurationTestCase ===========");
526 
528  msg.rrcTransactionIdentifier = 2;
529 
530  msg.haveMeasConfig = true;
531 
532  msg.measConfig.haveQuantityConfig = true;
535 
536  msg.measConfig.haveMeasGapConfig = true;
537  msg.measConfig.measGapConfig.type = LteRrcSap::MeasGapConfig::SETUP;
538  msg.measConfig.measGapConfig.gapOffsetChoice = LteRrcSap::MeasGapConfig::GP0;
540 
541  msg.measConfig.haveSmeasure = true;
542  msg.measConfig.sMeasure = 57;
543 
544  msg.measConfig.haveSpeedStatePars = true;
545  msg.measConfig.speedStatePars.type = LteRrcSap::SpeedStatePars::SETUP;
552 
553  msg.measConfig.measObjectToRemoveList.push_back (23);
554  msg.measConfig.measObjectToRemoveList.push_back (13);
555 
556  msg.measConfig.reportConfigToRemoveList.push_back (7);
557  msg.measConfig.reportConfigToRemoveList.push_back (16);
558 
559  msg.measConfig.measIdToRemoveList.push_back (4);
560  msg.measConfig.measIdToRemoveList.push_back (18);
561 
562  // Set measObjectToAddModList
563  LteRrcSap::MeasObjectToAddMod measObjectToAddMod;
564  measObjectToAddMod.measObjectId = 3;
565  measObjectToAddMod.measObjectEutra.carrierFreq = 21;
566  measObjectToAddMod.measObjectEutra.allowedMeasBandwidth = 15;
567  measObjectToAddMod.measObjectEutra.presenceAntennaPort1 = true;
568  measObjectToAddMod.measObjectEutra.neighCellConfig = 3;
569  measObjectToAddMod.measObjectEutra.offsetFreq = -12;
570  measObjectToAddMod.measObjectEutra.cellsToRemoveList.push_back (5);
571  measObjectToAddMod.measObjectEutra.cellsToRemoveList.push_back (2);
572  measObjectToAddMod.measObjectEutra.blackCellsToRemoveList.push_back (1);
573  measObjectToAddMod.measObjectEutra.haveCellForWhichToReportCGI = true;
574  measObjectToAddMod.measObjectEutra.cellForWhichToReportCGI = 250;
575  LteRrcSap::CellsToAddMod cellsToAddMod;
576  cellsToAddMod.cellIndex = 20;
577  cellsToAddMod.physCellId = 14;
578  cellsToAddMod.cellIndividualOffset = 22;
579  measObjectToAddMod.measObjectEutra.cellsToAddModList.push_back (cellsToAddMod);
580  LteRrcSap::BlackCellsToAddMod blackCellsToAddMod;
581  blackCellsToAddMod.cellIndex = 18;
582  blackCellsToAddMod.physCellIdRange.start = 128;
583  blackCellsToAddMod.physCellIdRange.haveRange = true;
584  blackCellsToAddMod.physCellIdRange.range = 128;
585  measObjectToAddMod.measObjectEutra.blackCellsToAddModList.push_back (blackCellsToAddMod);
586  msg.measConfig.measObjectToAddModList.push_back (measObjectToAddMod);
587 
588  // Set reportConfigToAddModList
589  LteRrcSap::ReportConfigToAddMod reportConfigToAddMod;
590  reportConfigToAddMod.reportConfigId = 22;
591  reportConfigToAddMod.reportConfigEutra.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
592  reportConfigToAddMod.reportConfigEutra.eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
593  reportConfigToAddMod.reportConfigEutra.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
594  reportConfigToAddMod.reportConfigEutra.threshold1.range = 15;
595  reportConfigToAddMod.reportConfigEutra.threshold2.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRQ;
596  reportConfigToAddMod.reportConfigEutra.threshold2.range = 10;
597  reportConfigToAddMod.reportConfigEutra.reportOnLeave = true;
598  reportConfigToAddMod.reportConfigEutra.a3Offset = -25;
599  reportConfigToAddMod.reportConfigEutra.hysteresis = 18;
600  reportConfigToAddMod.reportConfigEutra.timeToTrigger = 100;
601  reportConfigToAddMod.reportConfigEutra.purpose = LteRrcSap::ReportConfigEutra::REPORT_STRONGEST_CELLS;
602  reportConfigToAddMod.reportConfigEutra.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRQ;
603  reportConfigToAddMod.reportConfigEutra.reportQuantity = LteRrcSap::ReportConfigEutra::SAME_AS_TRIGGER_QUANTITY;
604  reportConfigToAddMod.reportConfigEutra.maxReportCells = 5;
605  reportConfigToAddMod.reportConfigEutra.reportInterval = LteRrcSap::ReportConfigEutra::MIN60;
606  reportConfigToAddMod.reportConfigEutra.reportAmount = 16;
607  msg.measConfig.reportConfigToAddModList.push_back (reportConfigToAddMod);
608 
609  // Set measIdToAddModList
610  LteRrcSap::MeasIdToAddMod measIdToAddMod,measIdToAddMod2;
611  measIdToAddMod.measId = 7;
612  measIdToAddMod.measObjectId = 6;
613  measIdToAddMod.reportConfigId = 5;
614  measIdToAddMod2.measId = 4;
615  measIdToAddMod2.measObjectId = 8;
616  measIdToAddMod2.reportConfigId = 12;
617  msg.measConfig.measIdToAddModList.push_back (measIdToAddMod);
618  msg.measConfig.measIdToAddModList.push_back (measIdToAddMod2);
619 
620  msg.haveMobilityControlInfo = true;
635 
637 
639 
640  msg.haveNonCriticalExtension = false; //Danilo
642  source.SetMessage (msg);
643 
644  // Log source info
645  TestUtils::LogPacketInfo<RrcConnectionReconfigurationHeader> (source,"SOURCE");
646 
647  // Add header
648  packet->AddHeader (source);
649 
650  // Log serialized packet contents
652 
653  // remove header
655  packet->RemoveHeader (destination);
656 
657  // Log destination info
658  TestUtils::LogPacketInfo<RrcConnectionReconfigurationHeader> (destination,"DESTINATION");
659 
660  // Check that the destination and source headers contain the same values
661  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
662  NS_TEST_ASSERT_MSG_EQ (source.GetHaveMeasConfig (),destination.GetHaveMeasConfig (), "GetHaveMeasConfig");
663  NS_TEST_ASSERT_MSG_EQ (source.GetHaveMobilityControlInfo (),destination.GetHaveMobilityControlInfo (), "GetHaveMobilityControlInfo");
664  NS_TEST_ASSERT_MSG_EQ (source.GetHaveRadioResourceConfigDedicated (),destination.GetHaveRadioResourceConfigDedicated (), "GetHaveRadioResourceConfigDedicated");
665 
666  if ( source.GetHaveMobilityControlInfo () )
667  {
668  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().targetPhysCellId,destination.GetMobilityControlInfo ().targetPhysCellId, "GetMobilityControlInfo().targetPhysCellId");
669  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().haveCarrierFreq,destination.GetMobilityControlInfo ().haveCarrierFreq, "GetMobilityControlInfo().haveCarrierFreq");
670  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().haveCarrierBandwidth,destination.GetMobilityControlInfo ().haveCarrierBandwidth, "GetMobilityControlInfo().haveCarrierBandwidth");
671  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().newUeIdentity,destination.GetMobilityControlInfo ().newUeIdentity, "GetMobilityControlInfo().newUeIdentity");
672  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().haveRachConfigDedicated,destination.GetMobilityControlInfo ().haveRachConfigDedicated, "GetMobilityControlInfo().haveRachConfigDedicated");
673 
674  if (source.GetMobilityControlInfo ().haveCarrierFreq)
675  {
676  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().carrierFreq.dlCarrierFreq,
677  destination.GetMobilityControlInfo ().carrierFreq.dlCarrierFreq,
678  "GetMobilityControlInfo().carrierFreq.dlCarrierFreq");
679  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().carrierFreq.ulCarrierFreq,
680  destination.GetMobilityControlInfo ().carrierFreq.ulCarrierFreq,
681  "GetMobilityControlInfo().carrierFreq.ulCarrierFreq");
682  }
683 
684  if (source.GetMobilityControlInfo ().haveCarrierBandwidth)
685  {
686  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().carrierBandwidth.dlBandwidth,
687  destination.GetMobilityControlInfo ().carrierBandwidth.dlBandwidth,
688  "GetMobilityControlInfo().carrierBandwidth.dlBandwidth");
689  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().carrierBandwidth.ulBandwidth,
690  destination.GetMobilityControlInfo ().carrierBandwidth.ulBandwidth,
691  "GetMobilityControlInfo().carrierBandwidth.ulBandwidth");
692  }
693 
694  if (source.GetMobilityControlInfo ().haveRachConfigDedicated)
695  {
696  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().rachConfigDedicated.raPreambleIndex,
697  destination.GetMobilityControlInfo ().rachConfigDedicated.raPreambleIndex,
698  "GetMobilityControlInfo().rachConfigDedicated.raPreambleIndex");
699  NS_TEST_ASSERT_MSG_EQ (source.GetMobilityControlInfo ().rachConfigDedicated.raPrachMaskIndex,
700  destination.GetMobilityControlInfo ().rachConfigDedicated.raPrachMaskIndex,
701  "GetMobilityControlInfo().rachConfigDedicated.raPrachMaskIndex");
702  }
703  }
704 
705  if (source.GetHaveRadioResourceConfigDedicated ())
706  {
707  AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (), destination.GetRadioResourceConfigDedicated ());
708  }
709 
710  packet = 0;
711 }
712 
720 {
721 public:
723  virtual void DoRun (void);
724 };
725 
727 {
728 }
729 
730 void
732 {
733  packet = Create<Packet> ();
734  NS_LOG_DEBUG ("============= HandoverPreparationInfoTestCase ===========");
735 
738  msg.asConfig.sourceUeIdentity = 11;
742 
747 
753 
758 
760  source.SetMessage (msg);
761 
762  // Log source info
763  TestUtils::LogPacketInfo<HandoverPreparationInfoHeader> (source,"SOURCE");
764 
765  // Add header
766  packet->AddHeader (source);
767 
768  // Log serialized packet contents
770 
771  // remove header
772  HandoverPreparationInfoHeader destination;
773  packet->RemoveHeader (destination);
774 
775  // Log destination info
776  TestUtils::LogPacketInfo<HandoverPreparationInfoHeader> (destination,"DESTINATION");
777 
778  // Check that the destination and source headers contain the same values
779  AssertEqualRadioResourceConfigDedicated (source.GetAsConfig ().sourceRadioResourceConfig, destination.GetAsConfig ().sourceRadioResourceConfig);
780  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceUeIdentity, destination.GetAsConfig ().sourceUeIdentity, "sourceUeIdentity");
781  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceMasterInformationBlock.dlBandwidth,destination.GetAsConfig ().sourceMasterInformationBlock.dlBandwidth, "dlBandwidth");
782  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceMasterInformationBlock.systemFrameNumber, destination.GetAsConfig ().sourceMasterInformationBlock.systemFrameNumber, "systemFrameNumber");
783  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity, "plmnIdentity");
784  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication, "csgIndication");
785  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity, "cellIdentity");
786  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity, "csgIdentity");
787  NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceDlCarrierFreq, destination.GetAsConfig ().sourceDlCarrierFreq, "sourceDlCarrierFreq");
788 
789  packet = 0;
790 }
791 
799 {
800 public:
802  virtual void DoRun (void);
803 };
804 
806 {
807 }
808 
809 void
811 {
812  packet = Create<Packet> ();
813  NS_LOG_DEBUG ("============= RrcConnectionReestablishmentRequestTestCase ===========");
814 
816  msg.ueIdentity.cRnti = 12;
817  msg.ueIdentity.physCellId = 21;
818  msg.reestablishmentCause = LteRrcSap::HANDOVER_FAILURE;
819 
821  source.SetMessage (msg);
822 
823  // Log source info
824  TestUtils::LogPacketInfo<RrcConnectionReestablishmentRequestHeader> (source,"SOURCE");
825 
826  // Add header
827  packet->AddHeader (source);
828 
829  // Log serialized packet contents
831 
832  // remove header
834  packet->RemoveHeader (destination);
835 
836  // Log destination info
837  TestUtils::LogPacketInfo<RrcConnectionReestablishmentRequestHeader> (destination,"DESTINATION");
838 
839  // Check that the destination and source headers contain the same values
840  NS_TEST_ASSERT_MSG_EQ (source.GetUeIdentity ().cRnti, destination.GetUeIdentity ().cRnti, "cRnti");
841  NS_TEST_ASSERT_MSG_EQ (source.GetUeIdentity ().physCellId, destination.GetUeIdentity ().physCellId, "physCellId");
842  NS_TEST_ASSERT_MSG_EQ (source.GetReestablishmentCause (),destination.GetReestablishmentCause (), "ReestablishmentCause");
843 
844  packet = 0;
845 }
846 
854 {
855 public:
857  virtual void DoRun (void);
858 };
859 
861 {
862 }
863 
864 void
866 {
867  packet = Create<Packet> ();
868  NS_LOG_DEBUG ("============= RrcConnectionReestablishmentTestCase ===========");
869 
871  msg.rrcTransactionIdentifier = 2;
873 
875  source.SetMessage (msg);
876 
877  // Log source info
878  TestUtils::LogPacketInfo<RrcConnectionReestablishmentHeader> (source,"SOURCE");
879 
880  // Add header
881  packet->AddHeader (source);
882 
883  // Log serialized packet contents
885 
886  // remove header
888  packet->RemoveHeader (destination);
889 
890  // Log destination info
891  TestUtils::LogPacketInfo<RrcConnectionReestablishmentHeader> (destination,"DESTINATION");
892 
893  // Check that the destination and source headers contain the same values
894  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (), destination.GetRrcTransactionIdentifier (), "rrcTransactionIdentifier");
895  AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (),destination.GetRadioResourceConfigDedicated ());
896 
897  packet = 0;
898 }
899 
907 {
908 public:
910  virtual void DoRun (void);
911 };
912 
914 {
915 }
916 
917 void
919 {
920  packet = Create<Packet> ();
921  NS_LOG_DEBUG ("============= RrcConnectionReestablishmentCompleteTestCase ===========");
922 
924  msg.rrcTransactionIdentifier = 3;
925 
927  source.SetMessage (msg);
928 
929  // Log source info
930  TestUtils::LogPacketInfo<RrcConnectionReestablishmentCompleteHeader> (source,"SOURCE");
931 
932  // Add header
933  packet->AddHeader (source);
934 
935  // Log serialized packet contents
937 
938  // remove header
940  packet->RemoveHeader (destination);
941 
942  // Log destination info
943  TestUtils::LogPacketInfo<RrcConnectionReestablishmentCompleteHeader> (destination,"DESTINATION");
944 
945  // Check that the destination and source headers contain the same values
946  NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (), destination.GetRrcTransactionIdentifier (), "rrcTransactionIdentifier");
947 
948  packet = 0;
949 }
950 
958 {
959 public:
961  virtual void DoRun (void);
962 };
963 
965 {
966 }
967 
968 void
970 {
971  packet = Create<Packet> ();
972  NS_LOG_DEBUG ("============= RrcConnectionRejectTestCase ===========");
973 
975  msg.waitTime = 2;
976 
978  source.SetMessage (msg);
979 
980  // Log source info
981  TestUtils::LogPacketInfo<RrcConnectionRejectHeader> (source,"SOURCE");
982 
983  // Add header
984  packet->AddHeader (source);
985 
986  // Log serialized packet contents
988 
989  // remove header
990  RrcConnectionRejectHeader destination;
991  packet->RemoveHeader (destination);
992 
993  // Log destination info
994  TestUtils::LogPacketInfo<RrcConnectionRejectHeader> (destination,"DESTINATION");
995 
996  // Check that the destination and source headers contain the same values
997  NS_TEST_ASSERT_MSG_EQ (source.GetMessage ().waitTime, destination.GetMessage ().waitTime, "Different waitTime!");
998 
999  packet = 0;
1000 }
1001 
1009 {
1010 public:
1012  virtual void DoRun (void);
1013 };
1014 
1016 {
1017 }
1018 
1019 void
1021 {
1022  packet = Create<Packet> ();
1023  NS_LOG_DEBUG ("============= MeasurementReportTestCase ===========");
1024 
1026  msg.measResults.measId = 5;
1027  msg.measResults.rsrpResult = 18;
1028  msg.measResults.rsrqResult = 21;
1030 
1031  LteRrcSap::MeasResultEutra mResEutra;
1032  mResEutra.physCellId = 9;
1033  mResEutra.haveRsrpResult = true;
1034  mResEutra.rsrpResult = 33;
1035  mResEutra.haveRsrqResult = true;
1036  mResEutra.rsrqResult = 22;
1037  mResEutra.haveCgiInfo = true;
1038  mResEutra.cgiInfo.plmnIdentity = 7;
1039  mResEutra.cgiInfo.cellIdentity = 6;
1040  mResEutra.cgiInfo.trackingAreaCode = 5;
1041  msg.measResults.measResultListEutra.push_back (mResEutra);
1042 
1043  msg.measResults.haveScellsMeas = false;
1044 
1045  MeasurementReportHeader source;
1046  source.SetMessage (msg);
1047 
1048  // Log source info
1049  TestUtils::LogPacketInfo<MeasurementReportHeader> (source,"SOURCE");
1050 
1051  // Add header
1052  packet->AddHeader (source);
1053 
1054  // Log serialized packet contents
1056 
1057  // remove header
1058  MeasurementReportHeader destination;
1059  packet->RemoveHeader (destination);
1060 
1061  // Log destination info
1062  TestUtils::LogPacketInfo<MeasurementReportHeader> (destination,"DESTINATION");
1063 
1064  // Check that the destination and source headers contain the same values
1065  LteRrcSap::MeasResults srcMeas = source.GetMessage ().measResults;
1066  LteRrcSap::MeasResults dstMeas = destination.GetMessage ().measResults;
1067 
1068  NS_TEST_ASSERT_MSG_EQ (srcMeas.measId, dstMeas.measId, "Different measId!");
1069  NS_TEST_ASSERT_MSG_EQ (srcMeas.rsrpResult, dstMeas.rsrpResult, "Different rsrpResult!");
1070  NS_TEST_ASSERT_MSG_EQ (srcMeas.rsrqResult, dstMeas.rsrqResult, "Different rsrqResult!");
1071  NS_TEST_ASSERT_MSG_EQ (srcMeas.haveMeasResultNeighCells, dstMeas.haveMeasResultNeighCells, "Different haveMeasResultNeighCells!");
1072 
1073  if (srcMeas.haveMeasResultNeighCells)
1074  {
1075  std::list<LteRrcSap::MeasResultEutra>::iterator itsrc = srcMeas.measResultListEutra.begin ();
1076  std::list<LteRrcSap::MeasResultEutra>::iterator itdst = dstMeas.measResultListEutra.begin ();
1077  for (; itsrc != srcMeas.measResultListEutra.end (); itsrc++, itdst++)
1078  {
1079  NS_TEST_ASSERT_MSG_EQ (itsrc->physCellId, itdst->physCellId, "Different physCellId!");
1080 
1081  NS_TEST_ASSERT_MSG_EQ (itsrc->haveCgiInfo, itdst->haveCgiInfo, "Different haveCgiInfo!");
1082  if (itsrc->haveCgiInfo)
1083  {
1084  NS_TEST_ASSERT_MSG_EQ (itsrc->cgiInfo.plmnIdentity, itdst->cgiInfo.plmnIdentity, "Different cgiInfo.plmnIdentity!");
1085  NS_TEST_ASSERT_MSG_EQ (itsrc->cgiInfo.cellIdentity, itdst->cgiInfo.cellIdentity, "Different cgiInfo.cellIdentity!");
1086  NS_TEST_ASSERT_MSG_EQ (itsrc->cgiInfo.trackingAreaCode, itdst->cgiInfo.trackingAreaCode, "Different cgiInfo.trackingAreaCode!");
1087  NS_TEST_ASSERT_MSG_EQ (itsrc->cgiInfo.plmnIdentityList.size (), itdst->cgiInfo.plmnIdentityList.size (), "Different cgiInfo.plmnIdentityList.size()!");
1088 
1089  if (!itsrc->cgiInfo.plmnIdentityList.empty ())
1090  {
1091  std::list<uint32_t>::iterator itsrc2 = itsrc->cgiInfo.plmnIdentityList.begin ();
1092  std::list<uint32_t>::iterator itdst2 = itdst->cgiInfo.plmnIdentityList.begin ();
1093  for (; itsrc2 != itsrc->cgiInfo.plmnIdentityList.begin (); itsrc2++, itdst2++)
1094  {
1095  NS_TEST_ASSERT_MSG_EQ (*itsrc2, *itdst2, "Different plmnId elements!");
1096  }
1097  }
1098  }
1099 
1100  NS_TEST_ASSERT_MSG_EQ (itsrc->haveRsrpResult, itdst->haveRsrpResult, "Different haveRsrpResult!");
1101  if (itsrc->haveRsrpResult)
1102  {
1103  NS_TEST_ASSERT_MSG_EQ (itsrc->rsrpResult, itdst->rsrpResult, "Different rsrpResult!");
1104  }
1105 
1106  NS_TEST_ASSERT_MSG_EQ (itsrc->haveRsrqResult, itdst->haveRsrqResult, "Different haveRsrqResult!");
1107  if (itsrc->haveRsrqResult)
1108  {
1109  NS_TEST_ASSERT_MSG_EQ (itsrc->rsrqResult, itdst->rsrqResult, "Different rsrqResult!");
1110  }
1111 
1112  }
1113  }
1114 
1115  packet = 0;
1116 }
1117 
1125 {
1126 public:
1127  Asn1EncodingSuite ();
1128 };
1129 
1131  : TestSuite ("test-asn1-encoding", UNIT)
1132 {
1133  NS_LOG_FUNCTION (this);
1134  AddTestCase (new RrcConnectionRequestTestCase (), TestCase::QUICK);
1135  AddTestCase (new RrcConnectionSetupTestCase (), TestCase::QUICK);
1136  AddTestCase (new RrcConnectionSetupCompleteTestCase (), TestCase::QUICK);
1138  AddTestCase (new RrcConnectionReconfigurationTestCase (), TestCase::QUICK);
1139  AddTestCase (new HandoverPreparationInfoTestCase (), TestCase::QUICK);
1140  AddTestCase (new RrcConnectionReestablishmentRequestTestCase (), TestCase::QUICK);
1141  AddTestCase (new RrcConnectionReestablishmentTestCase (), TestCase::QUICK);
1143  AddTestCase (new RrcConnectionRejectTestCase (), TestCase::QUICK);
1144  AddTestCase (new MeasurementReportTestCase (), TestCase::QUICK);
1145 }
1146 
1148 
RrcHeaderTestCase(std::string s)
Constructor.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
RrcConnectionRequest structure.
Definition: lte-rrc-sap.h:685
enum ns3::LteRrcSap::ReportConfigEutra::@67 reportQuantity
Report type enumeration.
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:459
SystemInformationBlockType2 sourceSystemInformationBlockType2
source system information block type 2
Definition: lte-rrc-sap.h:615
PhysicalConfigDedicated structure.
Definition: lte-rrc-sap.h:216
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
bool haveNonCriticalExtension
have critical extension?
Definition: lte-rrc-sap.h:838
uint32_t carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:320
uint8_t drbIdentity
DRB identity.
Definition: lte-rrc-sap.h:238
CarrierFreqEutra carrierFreq
carrier frequency
Definition: lte-rrc-sap.h:555
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Asn1Encoding Test Suite.
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Definition: lte-rrc-sap.h:223
uint16_t physCellId
Phy cell ID.
Definition: lte-rrc-sap.h:298
MeasurementReport structure.
Definition: lte-rrc-sap.h:894
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:445
PhysCellIdRange physCellIdRange
Phy cell ID range.
Definition: lte-rrc-sap.h:314
MeasConfig sourceMeasConfig
source measure config
Definition: lte-rrc-sap.h:610
uint32_t sourceDlCarrierFreq
source DL carrier frequency
Definition: lte-rrc-sap.h:616
uint8_t cellIndex
cell index
Definition: lte-rrc-sap.h:297
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
Definition: lte-rrc-sap.h:514
uint8_t numberOfRaPreambles
number of RA preambles
Definition: lte-rrc-sap.h:247
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:831
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Definition: lte-rrc-sap.h:219
bool presenceAntennaPort1
antenna port 1 present?
Definition: lte-rrc-sap.h:322
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition...
Definition: lte-rrc-sap.h:384
CellsToAddMod structure.
Definition: lte-rrc-sap.h:295
std::list< CellsToAddMod > cellsToAddModList
cells to add mod list
Definition: lte-rrc-sap.h:326
Asn1EncodingSuite asn1EncodingSuite
Rrc Connection Request Test Case.
Rrc Connection Reject Test Case.
QuantityConfig quantityConfig
quantity config
Definition: lte-rrc-sap.h:520
std::list< uint8_t > reportConfigToRemoveList
report config to remove list
Definition: lte-rrc-sap.h:515
RlcConfig rlcConfig
RLC config.
Definition: lte-rrc-sap.h:239
uint8_t rsrpResult
RSRP result.
Definition: lte-rrc-sap.h:635
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Definition: lte-rrc-sap.h:677
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:452
A suite of tests to run.
Definition: test.h:1342
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:374
Rrc Connection Reconfiguration Test Case.
void SetMessage(LteRrcSap::RrcConnectionRequest msg)
Receives a RrcConnectionRequest IE and stores the contents into the class attributes.
void SetMessage(LteRrcSap::RrcConnectionSetupCompleted msg)
Receives a RrcConnectionSetupCompleted IE and stores the contents into the class attributes.
void SetMessage(LteRrcSap::RrcConnectionReestablishmentRequest msg)
Receives a RrcConnectionReestablishmentRequest IE and stores the contents into the class attributes...
static std::string sprintPacketContentsHex(Ptr< Packet > pkt)
Function to convert packet contents in hex format.
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
Definition: lte-rrc-sap.h:280
enum ns3::LteRrcSap::ReportConfigEutra::report purpose
purpose
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:837
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
std::list< uint8_t > measObjectToRemoveList
measure object to remove list
Definition: lte-rrc-sap.h:513
uint16_t start
starting cell ID
Definition: lte-rrc-sap.h:305
Rrc Connection Reestablishment Request Test Case.
uint16_t srsConfigIndex
SRS config index.
Definition: lte-rrc-sap.h:137
void SetMessage(LteRrcSap::RrcConnectionReestablishmentComplete msg)
Receives a RrcConnectionReestablishmentComplete IE and stores the contents into the class attributes...
MeasObjectEutra measObjectEutra
measure object eutra
Definition: lte-rrc-sap.h:446
uint16_t sourceUeIdentity
source UE identity
Definition: lte-rrc-sap.h:612
void SetMessage(LteRrcSap::RrcConnectionReestablishment msg)
Receives a RrcConnectionReestablishment IE and stores the contents into the class attributes...
static void LogPacketInfo(T source, std::string s)
Function to log packet info.
bool haveCarrierFreq
have carrier frequency?
Definition: lte-rrc-sap.h:554
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
encapsulates test code
Definition: test.h:1155
uint8_t neighCellConfig
neighbor cell config
Definition: lte-rrc-sap.h:323
static void LogPacketContents(Ptr< Packet > pkt)
Function to log packet contents.
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
Definition: lte-rrc-sap.h:561
bool haveSmeasure
have S measure?
Definition: lte-rrc-sap.h:523
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:867
uint32_t cellIdentity
cell identity
Definition: lte-rrc-sap.h:623
Handover Preparation Info Test Case.
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:90
bool haveRsrqResult
have RSRQ result?
Definition: lte-rrc-sap.h:636
virtual void DoRun(void)
Implementation to actually run this TestCase.
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
Definition: lte-rrc-sap.h:836
uint16_t trackingAreaCode
tracking area code
Definition: lte-rrc-sap.h:624
DrbToAddMod structure.
Definition: lte-rrc-sap.h:235
This class manages the serialization/deserialization of RrcConnectionSetupComplete IE...
std::list< BlackCellsToAddMod > blackCellsToAddModList
black cells to add mod list
Definition: lte-rrc-sap.h:328
SystemInformationBlockType1 sourceSystemInformationBlockType1
source system information block type 1
Definition: lte-rrc-sap.h:614
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:831
PreambleInfo preambleInfo
preamble info
Definition: lte-rrc-sap.h:260
uint8_t rsrpResult
RSRP result.
Definition: lte-rrc-sap.h:674
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Rrc Connection Reconfiguration Complete Test Case.
static std::string sprintPacketContentsBin(Ptr< Packet > pkt)
Function to convert packet contents in binary format.
Rrc Connection Setup Test Case.
This class manages the serialization/deserialization of RrcConnectionSetup IE.
static std::string sprintPacketContentsHex(Ptr< Packet > pkt)
Function to convert packet contents in hex format.
enum ns3::LteRrcSap::MeasGapConfig::gap gapOffsetChoice
gap offset
uint8_t preambleTransMax
preamble transmit maximum
Definition: lte-rrc-sap.h:253
MeasResults measResults
measure results
Definition: lte-rrc-sap.h:896
uint8_t epsBearerIdentity
EPS bearer identity.
Definition: lte-rrc-sap.h:237
MeasResults structure.
Definition: lte-rrc-sap.h:671
uint64_t ueIdentity
UE identity.
Definition: lte-rrc-sap.h:687
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
enum ns3::LteRrcSap::SpeedStatePars::action type
action type
RrcConnectionReestablishment structure.
Definition: lte-rrc-sap.h:858
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:267
ReportConfigEutra reportConfigEutra
report config eutra
Definition: lte-rrc-sap.h:453
uint8_t logicalChannelGroup
logical channel group
Definition: lte-rrc-sap.h:113
CellAccessRelatedInfo cellAccessRelatedInfo
cell access related info
Definition: lte-rrc-sap.h:589
uint8_t nCellChangeHigh
cell change high
Definition: lte-rrc-sap.h:486
Rrc Connection Setup Complete Test Case.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:700
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:168
uint8_t sMeasure
S measure.
Definition: lte-rrc-sap.h:524
This class manages the serialization/deserialization of RrcConnectionReject IE.
bool haveMeasGapConfig
have measure gap config?
Definition: lte-rrc-sap.h:521
MeasResultEutra structure.
Definition: lte-rrc-sap.h:629
RrcConnectionReconfiguration structure.
Definition: lte-rrc-sap.h:829
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
Definition: lte-rrc-sap.h:518
bool haveRachConfigDedicated
Have RACH config dedicated?
Definition: lte-rrc-sap.h:560
uint8_t raPrachMaskIndex
RA PRACH mask index.
Definition: lte-rrc-sap.h:547
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Definition: lte-rrc-sap.h:284
uint8_t filterCoefficientRSRP
filter coefficient RSRP
Definition: lte-rrc-sap.h:290
void SetMessage(LteRrcSap::RrcConnectionReject msg)
Receives a RrcConnectionReject IE and stores the contents into the class attributes.
RrcConnectionReconfigurationCompleted structure.
Definition: lte-rrc-sap.h:844
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
bool haveRsrpResult
have RSRP result
Definition: lte-rrc-sap.h:634
MeasIdToAddMod structure.
Definition: lte-rrc-sap.h:457
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:693
virtual void DoRun(void)
Implementation to actually run this TestCase.
MobilityStateParameters mobilityStateParameters
mobility state parameters
Definition: lte-rrc-sap.h:506
This class manages the serialization/deserialization of RRCConnectionReestablishmentRequest IE...
RrcConnectionSetupCompleted structure.
Definition: lte-rrc-sap.h:698
HandoverPreparationInfo structure.
Definition: lte-rrc-sap.h:888
Rrc Connection Reestablishment Complete Test Case.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:694
RrcConnectionSetup structure.
Definition: lte-rrc-sap.h:691
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:846
void SetMessage(LteRrcSap::MeasurementReport msg)
Receives a MeasurementReport IE and stores the contents into the class attributes.
RrcConnectionReestablishmentRequest structure.
Definition: lte-rrc-sap.h:851
uint8_t raPreambleIndex
RA preamble index.
Definition: lte-rrc-sap.h:546
RadioResourceConfigDedicated sourceRadioResourceConfig
source radio resource config
Definition: lte-rrc-sap.h:611
void SetMessage(LteRrcSap::RrcConnectionReconfigurationCompleted msg)
Receives a RrcConnectionReconfigurationCompleted IE and stores the contents into the class attributes...
uint8_t reportConfigId
report config ID
Definition: lte-rrc-sap.h:461
uint16_t cellForWhichToReportCGI
cell for which to report CGI
Definition: lte-rrc-sap.h:330
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
Definition: lte-rrc-sap.h:378
uint16_t physCellId
Phy cell ID.
Definition: lte-rrc-sap.h:631
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool haveQuantityConfig
have quantity config?
Definition: lte-rrc-sap.h:519
uint16_t targetPhysCellId
target Phy cell ID
Definition: lte-rrc-sap.h:553
RrcConnectionReject structure.
Definition: lte-rrc-sap.h:882
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Definition: lte-rrc-sap.h:860
bool haveMobilityControlInfo
have mobility control info
Definition: lte-rrc-sap.h:834
uint16_t prioritizedBitRateKbps
prioritized bit rate Kbps
Definition: lte-rrc-sap.h:111
uint8_t maxReportCells
Maximum number of cells, excluding the serving cell, to be included in the measurement report...
Definition: lte-rrc-sap.h:411
int8_t cellIndividualOffset
cell individual offset
Definition: lte-rrc-sap.h:299
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
Definition: lte-rrc-sap.h:861
bool haveMeasResultNeighCells
have measure result neighbor cells
Definition: lte-rrc-sap.h:676
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
Definition: lte-rrc-sap.h:291
bool havePdschConfigDedicated
have PDSCH config dedicated?
Definition: lte-rrc-sap.h:222
This class manages the serialization/deserialization of RrcConnectionRequest IE.
uint8_t logicalChannelIdentity
logical channel identify
Definition: lte-rrc-sap.h:240
uint8_t sfHigh
scale factor high
Definition: lte-rrc-sap.h:494
This class manages the serialization/deserialization of HandoverPreparationInfo IE.
uint16_t newUeIdentity
new UE identity
Definition: lte-rrc-sap.h:558
MeasGapConfig measGapConfig
measure gap config
Definition: lte-rrc-sap.h:522
uint8_t range
Value range used in RSRP/RSRQ threshold.
Definition: lte-rrc-sap.h:350
bool havePhysicalConfigDedicated
have physical config dedicated?
Definition: lte-rrc-sap.h:283
bool haveCgiInfo
have CGI info?
Definition: lte-rrc-sap.h:632
uint8_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:91
uint8_t reportAmount
Number of measurement reports applicable, always assumed to be infinite.
Definition: lte-rrc-sap.h:435
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
Definition: lte-rrc-sap.h:218
RadioResourceConfigCommonSib radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:596
BlackCellsToAddMod structure.
Definition: lte-rrc-sap.h:311
This class provides common functions to be inherited by the children TestCases.
uint8_t measObjectId
measure object ID
Definition: lte-rrc-sap.h:460
void SetMessage(LteRrcSap::HandoverPreparationInfo msg)
Receives a HandoverPreparationInfo IE and stores the contents into the class attributes.
uint8_t gapOffsetValue
gap offset value
Definition: lte-rrc-sap.h:477
uint16_t physCellId
Phy cell ID.
Definition: lte-rrc-sap.h:568
RadioResourceConfigCommon radioResourceConfigCommon
radio resource config common
Definition: lte-rrc-sap.h:559
uint32_t plmnIdentity
PLMN identity.
Definition: lte-rrc-sap.h:68
This class manages the serialization/deserialization of MeasurementReport IE.
RlcConfig structure.
Definition: lte-rrc-sap.h:95
uint32_t dlCarrierFreq
DL carrier frequency.
Definition: lte-rrc-sap.h:532
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
Definition: lte-rrc-sap.h:557
int8_t a3Offset
Offset value for Event A3. An integer between -30 and 30. The actual value is (value * 0...
Definition: lte-rrc-sap.h:381
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:673
virtual void DoRun(void)
Implementation to actually run this TestCase.
LogicalChannelConfig logicalChannelConfig
logical channel config
Definition: lte-rrc-sap.h:241
RachConfigCommon rachConfigCommon
RACH config common.
Definition: lte-rrc-sap.h:273
SpeedStatePars speedStatePars
speed state parameters
Definition: lte-rrc-sap.h:526
Rrc Connection Reestablishment Test Case.
uint8_t raResponseWindowSize
RA response window size.
Definition: lte-rrc-sap.h:254
This class manages the serialization/deserialization of RrcConnectionReconfiguration IE...
bool haveCarrierBandwidth
have carrier bandwidth?
Definition: lte-rrc-sap.h:556
virtual void DoRun(void)
Implementation to actually run this TestCase.
bool haveAntennaInfoDedicated
have antenna info dedicated?
Definition: lte-rrc-sap.h:220
uint8_t ulBandwidth
UL bandwidth.
Definition: lte-rrc-sap.h:540
uint8_t rsrqResult
RSRQ result.
Definition: lte-rrc-sap.h:637
void SetMessage(LteRrcSap::RrcConnectionSetup msg)
Receives a RrcConnectionSetup IE and stores the contents into the class attributes.
std::list< uint8_t > blackCellsToRemoveList
black cells to remove list
Definition: lte-rrc-sap.h:327
bool haveSpeedStatePars
have speed state parameters?
Definition: lte-rrc-sap.h:525
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
Definition: packet.cc:378
uint8_t allowedMeasBandwidth
allowed measure bandwidth
Definition: lte-rrc-sap.h:321
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
Definition: lte-rrc-sap.h:281
enum ns3::LteRrcSap::SoundingRsUlConfigDedicated::action type
action type
uint8_t systemFrameNumber
system frame number
Definition: lte-rrc-sap.h:583
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:270
void AssertEqualRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated rrcd1, LteRrcSap::RadioResourceConfigDedicated rrcd2)
Assert equal radio resource config dedicated.
int8_t offsetFreq
offset frequency
Definition: lte-rrc-sap.h:324
This class manages the serialization/deserialization of RrcConnectionReestablishmentComplete IE...
RrcConnectionReestablishmentComplete structure.
Definition: lte-rrc-sap.h:865
uint8_t transmissionMode
transmission mode
Definition: lte-rrc-sap.h:143
enum ns3::LteRrcSap::RlcConfig::direction choice
direction choice
void SetMessage(LteRrcSap::RrcConnectionReconfiguration msg)
Receives a RrcConnectionReconfiguration IE and stores the contents into the class attributes...
enum ns3::LteRrcSap::MeasGapConfig::action type
action type
This class manages the serialization/deserialization of RrcConnectionReestablishment IE...
MobilityControlInfo mobilityControlInfo
mobility control info
Definition: lte-rrc-sap.h:835
SrbToAddMod structure.
Definition: lte-rrc-sap.h:228
virtual void DoRun(void)
Implementation to actually run this TestCase.
AntennaInfoDedicated antennaInfo
antenna info
Definition: lte-rrc-sap.h:221
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t plmnIdentity
PLMN identity.
Definition: lte-rrc-sap.h:622
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::list< uint8_t > cellsToRemoveList
cells to remove list
Definition: lte-rrc-sap.h:325
uint8_t rsrqResult
RSRQ result.
Definition: lte-rrc-sap.h:675
LteRrcSap::RadioResourceConfigDedicated CreateRadioResourceConfigDedicated()
Create radio resource config dedicated.
ReestablishmentCause reestablishmentCause
reestablishment cause
Definition: lte-rrc-sap.h:854
uint8_t dlBandwidth
DL bandwidth.
Definition: lte-rrc-sap.h:539
static std::string sprintPacketContentsBin(Ptr< Packet > pkt)
Function to convert packet contents in binary format.
uint8_t sfMedium
scale factor medium
Definition: lte-rrc-sap.h:493
LogicalChannelConfig structure.
Definition: lte-rrc-sap.h:108
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
Definition: lte-rrc-sap.h:387
uint16_t bucketSizeDurationMs
bucket size duration ms
Definition: lte-rrc-sap.h:112
std::list< uint8_t > measIdToRemoveList
measure ID to remove list
Definition: lte-rrc-sap.h:517
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
Definition: lte-rrc-sap.h:516
ReportConfigToAddMod structure.
Definition: lte-rrc-sap.h:450
std::list< uint8_t > drbToReleaseList
DRB to release list.
Definition: lte-rrc-sap.h:282
MeasObjectToAddMod structure.
Definition: lte-rrc-sap.h:443
SpeedStateScaleFactors timeToTriggerSf
time to trigger scale factors
Definition: lte-rrc-sap.h:507
Ptr< Packet > packet
the packet
This class manages the serialization/deserialization of RrcConnectionSetupComplete IE...
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
RaSupervisionInfo raSupervisionInfo
RA supervision info.
Definition: lte-rrc-sap.h:261
uint8_t nCellChangeMedium
cell change medium
Definition: lte-rrc-sap.h:485
bool haveScellsMeas
has SCells measure
Definition: lte-rrc-sap.h:678
Measurement Report Test Case.
RadioResourceConfigDedicated structure.
Definition: lte-rrc-sap.h:278
uint32_t ulCarrierFreq
UL carrier frequency.
Definition: lte-rrc-sap.h:533
MasterInformationBlock sourceMasterInformationBlock
source master information block
Definition: lte-rrc-sap.h:613
enum ns3::LteRrcSap::ReportConfigEutra::@64 triggerType
Trigger enumeration.
bool haveCellForWhichToReportCGI
have cell for which to report CGI?
Definition: lte-rrc-sap.h:329
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:375
virtual void DoRun(void)
Implementation to actually run this TestCase.