Hierarchical99.ned 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // Copyright (C) 2012 Opensim Ltd.
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU 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 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. package inet.examples.inet.hierarchical99;
  19. import inet.networklayer.configurator.contract.INetworkConfigurator;
  20. import inet.networklayer.ipv4.RoutingTableRecorder;
  21. import inet.node.ethernet.Eth100M;
  22. import inet.node.ethernet.Eth10G;
  23. import inet.node.ethernet.Eth1G;
  24. import inet.node.ethernet.EtherSwitch;
  25. import inet.node.inet.Router;
  26. import inet.node.inet.StandardHost;
  27. //
  28. // This hierarchical network topology contains 3 levels, 72 hosts and 27 routers.
  29. //
  30. network Hierarchical99
  31. {
  32. parameters:
  33. string networkConfiguratorType;
  34. @display("bgb=708,518;bgl=22");
  35. types:
  36. module LAN
  37. {
  38. @display("bgl=12;bgb=395,342;i=misc/cloud;is=vl");
  39. gates:
  40. inout ethg[];
  41. submodules:
  42. switch: EtherSwitch {
  43. @display("p=206,163");
  44. }
  45. host1: StandardHost {
  46. @display("p=302,84;t=10.x.x.1");
  47. }
  48. host2: StandardHost {
  49. @display("p=263,271;t=10.x.x.2");
  50. }
  51. host3: StandardHost {
  52. @display("p=84,164;t=10.x.x.3");
  53. }
  54. connections:
  55. host1.ethg++ <--> Eth100M <--> switch.ethg++;
  56. host2.ethg++ <--> Eth100M <--> switch.ethg++;
  57. host3.ethg++ <--> Eth100M <--> switch.ethg++;
  58. for i=0..sizeof(ethg) - 1 {
  59. switch.ethg++ <--> ethg++;
  60. }
  61. }
  62. module Area
  63. {
  64. @display("bgl=12;bgb=506,453;i=misc/cloud;is=vl");
  65. gates:
  66. inout ethg[];
  67. submodules:
  68. lan1: LAN {
  69. @display("p=391,86;t=10.x.1.x");
  70. }
  71. lan2: LAN {
  72. @display("p=391,355;t=10.x.2.x");
  73. }
  74. lan3: LAN {
  75. @display("p=106,355;t=10.x.3.x");
  76. }
  77. lan4: LAN {
  78. @display("p=106,86;t=10.x.4.x");
  79. }
  80. router1: Router {
  81. @display("p=250,87");
  82. }
  83. router2: Router {
  84. @display("p=391,219");
  85. }
  86. router3: Router {
  87. @display("p=250,356");
  88. }
  89. router4: Router {
  90. @display("p=106,219");
  91. }
  92. connections:
  93. lan1.ethg++ <--> Eth1G <--> router1.ethg++;
  94. lan2.ethg++ <--> Eth1G <--> router2.ethg++;
  95. lan3.ethg++ <--> Eth1G <--> router3.ethg++;
  96. lan4.ethg++ <--> Eth1G <--> router4.ethg++;
  97. router1.ethg++ <--> Eth1G <--> router2.ethg++;
  98. router2.ethg++ <--> Eth1G <--> router3.ethg++;
  99. router3.ethg++ <--> Eth1G <--> router4.ethg++;
  100. router4.ethg++ <--> Eth1G <--> router1.ethg++;
  101. router1.ethg++ <--> ethg++;
  102. }
  103. submodules:
  104. recorder: RoutingTableRecorder {
  105. @display("p=37,81");
  106. }
  107. networkConfigurator: <networkConfiguratorType> like INetworkConfigurator {
  108. @display("p=37,31");
  109. }
  110. area11: Area {
  111. @display("p=261,80;t=10.11.x.x");
  112. }
  113. area12: Area {
  114. @display("p=426,80;t=10.12.x.x");
  115. }
  116. area21: Area {
  117. @display("p=581,299;t=10.21.x.x");
  118. }
  119. area22: Area {
  120. @display("p=426,432;t=10.22.x.x");
  121. }
  122. area31: Area {
  123. @display("p=104,299;t=10.31.x.x");
  124. }
  125. area32: Area {
  126. @display("p=261,432;t=10.32.x.x");
  127. }
  128. router1: Router {
  129. @display("p=337,196");
  130. }
  131. router2: Router {
  132. @display("p=426,300");
  133. }
  134. router3: Router {
  135. @display("p=261,300");
  136. }
  137. connections:
  138. router1.ethg++ <--> Eth10G <--> router2.ethg++;
  139. router2.ethg++ <--> Eth10G <--> router3.ethg++;
  140. router3.ethg++ <--> Eth10G <--> router1.ethg++;
  141. router1.ethg++ <--> Eth10G <--> area11.ethg++;
  142. router1.ethg++ <--> Eth10G <--> area12.ethg++;
  143. router2.ethg++ <--> Eth10G <--> area21.ethg++;
  144. router2.ethg++ <--> Eth10G <--> area22.ethg++;
  145. router3.ethg++ <--> Eth10G <--> area31.ethg++;
  146. router3.ethg++ <--> Eth10G <--> area32.ethg++;
  147. }