Network.ned 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. package inet.examples.bgpv4.BGP3Routers;
  2. import inet.common.misc.ThruputMeteringChannel;
  3. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  4. import inet.node.bgp.BGPRouter;
  5. import inet.node.ethernet.EtherSwitch;
  6. import inet.node.inet.StandardHost;
  7. import inet.node.ospfv2.OSPFRouter;
  8. network BGPTest
  9. {
  10. types:
  11. channel LINK_100 extends ThruputMeteringChannel
  12. {
  13. parameters:
  14. delay = 0;
  15. datarate = 100Mbps;
  16. thruputDisplayFormat = "#N";
  17. }
  18. submodules:
  19. A: BGPRouter {
  20. parameters:
  21. @display("p=266,141");
  22. gates:
  23. pppg[4];
  24. }
  25. B: BGPRouter {
  26. parameters:
  27. @display("p=338,141");
  28. gates:
  29. pppg[4];
  30. }
  31. C: BGPRouter {
  32. parameters:
  33. @display("p=298,197");
  34. gates:
  35. pppg[4];
  36. }
  37. RA1: OSPFRouter {
  38. parameters:
  39. @display("p=198,113;i=device/router");
  40. gates:
  41. pppg[2];
  42. ethg[1];
  43. }
  44. RA2: OSPFRouter {
  45. parameters:
  46. @display("p=198,187;i=device/router");
  47. gates:
  48. pppg[2];
  49. ethg[1];
  50. }
  51. RB1: OSPFRouter {
  52. parameters:
  53. @display("p=406,105;i=device/router");
  54. gates:
  55. pppg[2];
  56. ethg[1];
  57. }
  58. RB2: OSPFRouter {
  59. parameters:
  60. @display("p=406,187;i=device/router");
  61. gates:
  62. pppg[2];
  63. ethg[1];
  64. }
  65. RC1: OSPFRouter {
  66. parameters:
  67. @display("p=262,273;i=device/router");
  68. gates:
  69. pppg[2];
  70. ethg[1];
  71. }
  72. RC2: OSPFRouter {
  73. parameters:
  74. @display("p=342,275;i=device/router");
  75. gates:
  76. pppg[2];
  77. ethg[1];
  78. }
  79. PA1: EtherSwitch {
  80. parameters:
  81. @display("p=124,70;i=device/switch");
  82. gates:
  83. ethg[3];
  84. }
  85. PA2: EtherSwitch {
  86. parameters:
  87. @display("p=114,190;i=device/switch");
  88. gates:
  89. ethg[3];
  90. }
  91. PB1: EtherSwitch {
  92. parameters:
  93. @display("p=484,78;i=device/switch");
  94. gates:
  95. ethg[3];
  96. }
  97. PB2: EtherSwitch {
  98. parameters:
  99. @display("p=492,190;i=device/switch");
  100. gates:
  101. ethg[3];
  102. }
  103. PC1: EtherSwitch {
  104. parameters:
  105. @display("p=244,350;i=device/switch");
  106. gates:
  107. ethg[3];
  108. }
  109. PC2: EtherSwitch {
  110. parameters:
  111. @display("p=364,350;i=device/switch");
  112. gates:
  113. ethg[3];
  114. }
  115. HA11: StandardHost {
  116. parameters:
  117. @display("p=42,34;i=device/pc");
  118. gates:
  119. ethg[1];
  120. }
  121. HA12: StandardHost {
  122. parameters:
  123. @display("p=34,90;i=device/pc");
  124. gates:
  125. ethg[1];
  126. }
  127. HA21: StandardHost {
  128. parameters:
  129. @display("p=34,156;i=device/pc");
  130. gates:
  131. ethg[1];
  132. }
  133. HA22: StandardHost {
  134. parameters:
  135. @display("p=34,218;i=device/pc");
  136. gates:
  137. ethg[1];
  138. }
  139. HB11: StandardHost {
  140. parameters:
  141. @display("p=558,34;i=device/pc");
  142. gates:
  143. ethg[1];
  144. }
  145. HB12: StandardHost {
  146. parameters:
  147. @display("p=558,90;i=device/pc");
  148. gates:
  149. ethg[1];
  150. }
  151. HB21: StandardHost {
  152. parameters:
  153. @display("p=558,156;i=device/pc");
  154. gates:
  155. ethg[1];
  156. }
  157. HB22: StandardHost {
  158. parameters:
  159. @display("p=558,220;i=device/pc");
  160. gates:
  161. ethg[1];
  162. }
  163. HC11: StandardHost {
  164. parameters:
  165. @display("p=206,426;i=device/pc");
  166. gates:
  167. ethg[1];
  168. }
  169. HC12: StandardHost {
  170. parameters:
  171. @display("p=262,426;i=device/pc");
  172. gates:
  173. ethg[1];
  174. }
  175. HC21: StandardHost {
  176. parameters:
  177. @display("p=334,428;i=device/pc");
  178. gates:
  179. ethg[1];
  180. }
  181. HC22: StandardHost {
  182. parameters:
  183. @display("p=398,428;i=device/pc");
  184. gates:
  185. ethg[1];
  186. }
  187. configurator: IPv4NetworkConfigurator {
  188. @display("p=71,374");
  189. config = xmldoc("IPv4Config.xml");
  190. //assignAddresses = false;
  191. //assignDisjunctSubnetAddresses = false;
  192. addStaticRoutes = false;
  193. addDefaultRoutes = false;
  194. addSubnetRoutes = false;
  195. }
  196. connections:
  197. //LAN A1 et A2
  198. HA11.ethg[0] <--> LINK_100 <--> PA1.ethg[0];
  199. HA12.ethg[0] <--> LINK_100 <--> PA1.ethg[1];
  200. HA21.ethg[0] <--> LINK_100 <--> PA2.ethg[0];
  201. HA22.ethg[0] <--> LINK_100 <--> PA2.ethg[1];
  202. PA1.ethg[2] <--> LINK_100 <--> RA1.ethg[0];
  203. PA2.ethg[2] <--> LINK_100 <--> RA2.ethg[0];
  204. //LAN B1 et B2
  205. HB11.ethg[0] <--> LINK_100 <--> PB1.ethg[0];
  206. HB12.ethg[0] <--> LINK_100 <--> PB1.ethg[1];
  207. HB21.ethg[0] <--> LINK_100 <--> PB2.ethg[0];
  208. HB22.ethg[0] <--> LINK_100 <--> PB2.ethg[1];
  209. PB1.ethg[2] <--> LINK_100 <--> RB1.ethg[0];
  210. PB2.ethg[2] <--> LINK_100 <--> RB2.ethg[0];
  211. //LAN C1 et C2
  212. HC11.ethg[0] <--> LINK_100 <--> PC1.ethg[0];
  213. HC12.ethg[0] <--> LINK_100 <--> PC1.ethg[1];
  214. HC21.ethg[0] <--> LINK_100 <--> PC2.ethg[0];
  215. HC22.ethg[0] <--> LINK_100 <--> PC2.ethg[1];
  216. PC1.ethg[2] <--> LINK_100 <--> RC1.ethg[0];
  217. PC2.ethg[2] <--> LINK_100 <--> RC2.ethg[0];
  218. //OSPF A
  219. RA1.pppg[1] <--> LINK_100 <--> RA2.pppg[1];
  220. RA1.pppg[0] <--> LINK_100 <--> A.pppg[2];
  221. RA2.pppg[0] <--> LINK_100 <--> A.pppg[3];
  222. //OSPF B
  223. RB1.pppg[1] <--> LINK_100 <--> RB2.pppg[1];
  224. RB1.pppg[0] <--> LINK_100 <--> B.pppg[2];
  225. RB2.pppg[0] <--> LINK_100 <--> B.pppg[3];
  226. //OSPF C
  227. RC1.pppg[1] <--> LINK_100 <--> RC2.pppg[1];
  228. RC1.pppg[0] <--> LINK_100 <--> C.pppg[2];
  229. RC2.pppg[0] <--> LINK_100 <--> C.pppg[3];
  230. //BGP
  231. A.pppg[0] <--> LINK_100 <--> B.pppg[0];
  232. A.pppg[1] <--> LINK_100 <--> C.pppg[0];
  233. B.pppg[1] <--> LINK_100 <--> C.pppg[1];
  234. }