Networks.ned 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. //
  2. // This program is free software: you can redistribute it and/or modify
  3. // it under the terms of the GNU Lesser General Public License as published by
  4. // the Free Software Foundation, either version 3 of the License, or
  5. // (at your option) any later version.
  6. //
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU Lesser General Public License for more details.
  11. //
  12. // You should have received a copy of the GNU Lesser General Public License
  13. // along with this program. If not, see http://www.gnu.org/licenses/.
  14. //
  15. package inet.examples.ieee8021d;
  16. import inet.common.lifecycle.LifecycleController;
  17. import inet.common.scenario.ScenarioManager;
  18. import inet.linklayer.configurator.L2NetworkConfigurator;
  19. import inet.linklayer.ieee8021d.tester.STPTester;
  20. import inet.node.ethernet.Eth1G;
  21. import inet.node.ethernet.EtherHost;
  22. import inet.node.ethernet.EtherSwitch;
  23. network SwitchNetwork
  24. {
  25. @display("bgb=689,368");
  26. submodules:
  27. stpTester: STPTester {
  28. @display("p=75,277");
  29. }
  30. scenarioManager: ScenarioManager {
  31. @display("p=75,101");
  32. }
  33. l2NetworkConfigurator: L2NetworkConfigurator {
  34. @display("p=75,217");
  35. }
  36. lifecycleController: LifecycleController {
  37. @display("p=75,155");
  38. }
  39. switch1: EtherSwitch {
  40. parameters:
  41. @display("p=333,78");
  42. gates:
  43. ethg[];
  44. }
  45. switch2: EtherSwitch {
  46. parameters:
  47. @display("p=301,217");
  48. gates:
  49. ethg[];
  50. }
  51. switch3: EtherSwitch {
  52. parameters:
  53. @display("p=443,78");
  54. gates:
  55. ethg[];
  56. }
  57. switch4: EtherSwitch {
  58. parameters:
  59. @display("p=322,153");
  60. gates:
  61. ethg[];
  62. }
  63. switch5: EtherSwitch {
  64. parameters:
  65. @display("p=529,217");
  66. gates:
  67. ethg[];
  68. }
  69. switch6: EtherSwitch {
  70. parameters:
  71. @display("p=200,154");
  72. gates:
  73. ethg[];
  74. }
  75. switch7: EtherSwitch {
  76. parameters:
  77. @display("p=443,153");
  78. gates:
  79. ethg[];
  80. }
  81. connections:
  82. switch1.ethg++ <--> Eth1G <--> switch4.ethg++;
  83. switch1.ethg++ <--> Eth1G <--> switch3.ethg++;
  84. switch2.ethg++ <--> Eth1G <--> switch4.ethg++;
  85. switch2.ethg++ <--> Eth1G <--> switch6.ethg++;
  86. switch2.ethg++ <--> Eth1G <--> switch7.ethg++;
  87. switch3.ethg++ <--> Eth1G <--> switch7.ethg++;
  88. switch4.ethg++ <--> Eth1G <--> switch6.ethg++;
  89. switch4.ethg++ <--> Eth1G <--> switch7.ethg++;
  90. switch5.ethg++ <--> Eth1G <--> switch7.ethg++;
  91. }
  92. network LargeNet extends SwitchNetwork
  93. {
  94. @display("bgb=952,472");
  95. submodules:
  96. host1: EtherHost {
  97. @display("p=200,79");
  98. }
  99. host2: EtherHost {
  100. @display("p=609,217");
  101. }
  102. host3: EtherHost {
  103. @display("p=529,78");
  104. }
  105. host4: EtherHost {
  106. @display("p=679,422");
  107. }
  108. host5: EtherHost {
  109. @display("p=479,422");
  110. }
  111. host6: EtherHost {
  112. @display("p=322,321");
  113. }
  114. switch8: EtherSwitch {
  115. @display("p=443,282");
  116. }
  117. switch9: EtherSwitch {
  118. @display("p=518,352");
  119. }
  120. switch10: EtherSwitch {
  121. @display("p=648,352");
  122. }
  123. switch11: EtherSwitch {
  124. @display("p=579,288");
  125. }
  126. connections:
  127. switch11.ethg++ <--> Eth1G <--> switch9.ethg++;
  128. switch11.ethg++ <--> Eth1G <--> switch10.ethg++;
  129. switch11.ethg++ <--> Eth1G <--> switch5.ethg++;
  130. switch9.ethg++ <--> Eth1G <--> switch10.ethg++;
  131. switch8.ethg++ <--> Eth1G <--> switch9.ethg++;
  132. switch8.ethg++ <--> Eth1G <--> switch11.ethg++;
  133. switch8.ethg++ <--> Eth1G <--> switch5.ethg++;
  134. switch8.ethg++ <--> Eth1G <--> switch2.ethg++;
  135. switch3.ethg++ <--> Eth1G <--> host3.ethg;
  136. switch5.ethg++ <--> Eth1G <--> host2.ethg;
  137. switch6.ethg++ <--> Eth1G <--> host1.ethg;
  138. host5.ethg <--> Eth1G <--> switch9.ethg++;
  139. host4.ethg <--> Eth1G <--> switch10.ethg++;
  140. host6.ethg <--> Eth1G <--> switch8.ethg++;
  141. }