OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2016 Sébastien Deronne | 3 * Copyright (c) 2016 Sébastien Deronne |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // such a small improvement when no non-HT station is present. In order to show
the benefit offered by RIFS, aggregation has been disabled and | 48 // such a small improvement when no non-HT station is present. In order to show
the benefit offered by RIFS, aggregation has been disabled and |
49 // Block ACK together with a TXOP duration of 3008 microseconds have been set. | 49 // Block ACK together with a TXOP duration of 3008 microseconds have been set. |
50 // | 50 // |
51 // The user can also select the payload size and can choose either an UDP or a T
CP connection. | 51 // The user can also select the payload size and can choose either an UDP or a T
CP connection. |
52 // Example: ./waf --run "mixed-network --isUdp=1" | 52 // Example: ./waf --run "mixed-network --isUdp=1" |
53 | 53 |
54 using namespace ns3; | 54 using namespace ns3; |
55 | 55 |
56 NS_LOG_COMPONENT_DEFINE ("MixedNetwork"); | 56 NS_LOG_COMPONENT_DEFINE ("MixedNetwork"); |
57 | 57 |
| 58 /// Parameters structure |
58 struct Parameters | 59 struct Parameters |
59 { | 60 { |
60 std::string testName; | 61 std::string testName; ///< the test name |
61 bool enableErpProtection; | 62 bool enableErpProtection; ///< enable ERP protection flag |
62 std::string erpProtectionMode; | 63 std::string erpProtectionMode; ///< ERP protection mode |
63 bool enableShortSlotTime; | 64 bool enableShortSlotTime; ///< enable short slot time flag |
64 bool enableShortPlcpPreamble; | 65 bool enableShortPlcpPreamble; ///< enable short PLCP preamble flag |
65 WifiPhyStandard apType; | 66 WifiPhyStandard apType; ///< AP type |
66 bool apSupportsGreenfield; | 67 bool apSupportsGreenfield; ///< AP suoorts green field flag |
67 bool rifsSupported; | 68 bool rifsSupported; ///< RIFS supported flag |
68 bool rifsMode; | 69 bool rifsMode; ///< is RIFS Mode flag |
69 uint32_t nWifiB; | 70 uint32_t nWifiB; ///< number of B STA nodes |
70 bool bHasTraffic; | 71 bool bHasTraffic; ///< has B traffic indicator |
71 uint32_t nWifiG; | 72 uint32_t nWifiG; ///< number of G STA Nodes |
72 bool gHasTraffic; | 73 bool gHasTraffic; ///< has G traffic indicator |
73 uint32_t nWifiNNonGreenfield; | 74 uint32_t nWifiNNonGreenfield; ///< number of non green field STA nodes |
74 bool nNonGreenfieldHasTraffic; | 75 bool nNonGreenfieldHasTraffic; ///< non green field has traffic indicator |
75 uint32_t nWifiNGreenfield; | 76 uint32_t nWifiNGreenfield; ///< number of green field STA nodes |
76 bool nGreenfieldHasTraffic; | 77 bool nGreenfieldHasTraffic; ///< green field has traffic indicator |
77 bool isUdp; | 78 bool isUdp; ///< is UDP flag |
78 uint32_t payloadSize; | 79 uint32_t payloadSize; ///< payload size |
79 uint32_t simulationTime; | 80 uint32_t simulationTime; ///< simulation time |
80 }; | 81 }; |
81 | 82 |
| 83 /** |
| 84 * \ingroup wireless-example |
| 85 * \ingroup examples |
| 86 * |
| 87 * \brief mixed network example |
| 88 * \class Experiment |
| 89 */ |
82 class Experiment | 90 class Experiment |
83 { | 91 { |
84 public: | 92 public: |
85 Experiment (); | 93 Experiment (); |
| 94 /** |
| 95 * Run function |
| 96 * \param params the test parameters |
| 97 * \returns the throughput |
| 98 */ |
86 double Run (Parameters params); | 99 double Run (Parameters params); |
87 }; | 100 }; |
88 | 101 |
89 Experiment::Experiment () | 102 Experiment::Experiment () |
90 { | 103 { |
91 } | 104 } |
92 | 105 |
93 double | 106 double |
94 Experiment::Run (Parameters params) | 107 Experiment::Run (Parameters params) |
95 { | 108 { |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 throughput = experiment.Run (params); | 704 throughput = experiment.Run (params); |
692 if (verifyResults && (throughput < 43 || throughput > 44)) | 705 if (verifyResults && (throughput < 43 || throughput > 44)) |
693 { | 706 { |
694 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expe
cted boundaries!"); | 707 NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expe
cted boundaries!"); |
695 exit (1); | 708 exit (1); |
696 } | 709 } |
697 std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl; | 710 std::cout << "Throughput: " << throughput << " Mbit/s \n" << std::endl; |
698 | 711 |
699 return 0; | 712 return 0; |
700 } | 713 } |
OLD | NEW |