Ns3Test.ned 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // Copyright (C) 2015 OpenSim Ltd.
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public License
  6. // as published by the Free Software Foundation; either version 2
  7. // of the License, or (at your option) any later version.
  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 Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. //
  17. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  18. import inet.node.inet.AdhocHost;
  19. import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
  20. network Ns3Test
  21. {
  22. parameters:
  23. // double simulationTime;
  24. int numClients;
  25. int numApps;
  26. double serverYPos @unit(m);
  27. bool withQos;
  28. double sendInterval @unit(s);
  29. double appStartTime @unit(s);
  30. double appStartDelta @unit(s);
  31. @display("b=297,203");
  32. **.constraintAreaMinX = 0m;
  33. **.constraintAreaMinY = 0m;
  34. **.constraintAreaMinZ = 0m;
  35. **.constraintAreaMaxX = 20m + numClients*10m;
  36. **.constraintAreaMaxY = 10m + serverYPos;
  37. **.constraintAreaMaxZ = 0m;
  38. **.mobility.initFromDisplayString = false;
  39. submodules:
  40. configurator: IPv4NetworkConfigurator {
  41. @display("p=61,164");
  42. }
  43. srvHost: AdhocHost {
  44. parameters:
  45. numUdpApps = numApps;
  46. mobility.initFromDisplayString = false;
  47. mobility.initialX = 15m;
  48. mobility.initialY = serverYPos;
  49. mobility.initialZ = 0m;
  50. wlan[*].classifierType = withQos ? "ExampleQoSClassifier" : "";
  51. wlan[*].mac.EDCA = withQos;
  52. @display("r=,,#707070");
  53. }
  54. cliHost[numClients]: AdhocHost {
  55. parameters:
  56. numUdpApps = numApps;
  57. udpApp[*].sendInterval = sendInterval;
  58. mobility.initialX = 10m + 10m * index();
  59. mobility.initialY = 10m;
  60. mobility.initialZ = 0m;
  61. wlan[*].classifierType = withQos ? "ExampleQoSClassifier" : "";
  62. wlan[*].mac.EDCA = withQos;
  63. udpApp[*].startTime = appStartTime + appStartDelta * index();
  64. @display("r=,,#707070");
  65. }
  66. radioMedium: Ieee80211ScalarRadioMedium {
  67. parameters:
  68. @display("p=61,46");
  69. }
  70. }