Network.ned 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. package inet.examples.bgpv4.BGP2RoutersInAS;
  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. A1: BGPRouter {
  20. parameters:
  21. @display("p=274,93");
  22. gates:
  23. pppg[2];
  24. }
  25. A2: BGPRouter {
  26. parameters:
  27. @display("p=184,221");
  28. gates:
  29. pppg[2];
  30. }
  31. B: BGPRouter {
  32. parameters:
  33. @display("p=386,93");
  34. gates:
  35. pppg[2];
  36. }
  37. C: BGPRouter {
  38. parameters:
  39. @display("p=298,221");
  40. gates:
  41. pppg[3];
  42. }
  43. RA1: OSPFRouter {
  44. parameters:
  45. @display("p=198,41;i=device/router");
  46. gates:
  47. pppg[3];
  48. }
  49. RA2: OSPFRouter {
  50. parameters:
  51. @display("p=150,139;i=device/router");
  52. gates:
  53. pppg[3];
  54. }
  55. RA3: OSPFRouter {
  56. parameters:
  57. @display("p=102,43;i=device/router");
  58. gates:
  59. pppg[2];
  60. ethg[1];
  61. }
  62. RB1: OSPFRouter {
  63. parameters:
  64. @display("p=462,145;i=device/router");
  65. gates:
  66. pppg[1];
  67. ethg[1];
  68. }
  69. RC1: OSPFRouter {
  70. parameters:
  71. @display("p=326,313;i=device/router");
  72. gates:
  73. pppg[2];
  74. ethg[1];
  75. }
  76. RC2: OSPFRouter {
  77. parameters:
  78. @display("p=398,227;i=device/router");
  79. gates:
  80. pppg[2];
  81. ethg[1];
  82. }
  83. PA3: EtherSwitch {
  84. parameters:
  85. @display("p=52,102;i=device/switch");
  86. gates:
  87. ethg[3];
  88. }
  89. PB1: EtherSwitch {
  90. parameters:
  91. @display("p=460,62;i=device/switch");
  92. gates:
  93. ethg[3];
  94. }
  95. PC1: EtherSwitch {
  96. parameters:
  97. @display("p=420,318;i=device/switch");
  98. gates:
  99. ethg[3];
  100. }
  101. PC2: EtherSwitch {
  102. parameters:
  103. @display("p=492,230;i=device/switch");
  104. gates:
  105. ethg[3];
  106. }
  107. HA31: StandardHost {
  108. parameters:
  109. @display("p=42,178;i=device/pc");
  110. gates:
  111. ethg[1];
  112. }
  113. HA32: StandardHost {
  114. parameters:
  115. @display("p=98,178;i=device/pc");
  116. gates:
  117. ethg[1];
  118. }
  119. HB11: StandardHost {
  120. parameters:
  121. @display("p=542,50;i=device/pc");
  122. gates:
  123. ethg[1];
  124. }
  125. HB12: StandardHost {
  126. parameters:
  127. @display("p=542,114;i=device/pc");
  128. gates:
  129. ethg[1];
  130. }
  131. HC11: StandardHost {
  132. parameters:
  133. @display("p=390,394;i=device/pc");
  134. gates:
  135. ethg[1];
  136. }
  137. HC12: StandardHost {
  138. parameters:
  139. @display("p=454,394;i=device/pc");
  140. gates:
  141. ethg[1];
  142. }
  143. HC21: StandardHost {
  144. parameters:
  145. @display("p=478,308;i=device/pc");
  146. gates:
  147. ethg[1];
  148. }
  149. HC22: StandardHost {
  150. parameters:
  151. @display("p=526,308;i=device/pc");
  152. gates:
  153. ethg[1];
  154. }
  155. configurator: IPv4NetworkConfigurator {
  156. @display("p=71,374");
  157. config = xmldoc("IPv4Config.xml");
  158. //assignAddresses = false;
  159. //assignDisjunctSubnetAddresses = false;
  160. addStaticRoutes = false;
  161. addDefaultRoutes = false;
  162. addSubnetRoutes = false;
  163. }
  164. connections:
  165. //LAN RA3
  166. HA31.ethg[0] <--> LINK_100 <--> PA3.ethg[0];
  167. HA32.ethg[0] <--> LINK_100 <--> PA3.ethg[1];
  168. PA3.ethg[2] <--> LINK_100 <--> RA3.ethg[0];
  169. //LAN RB1
  170. HB11.ethg[0] <--> LINK_100 <--> PB1.ethg[0];
  171. HB12.ethg[0] <--> LINK_100 <--> PB1.ethg[1];
  172. PB1.ethg[2] <--> LINK_100 <--> RB1.ethg[0];
  173. //LAN C1 et C2
  174. HC11.ethg[0] <--> LINK_100 <--> PC1.ethg[0];
  175. HC12.ethg[0] <--> LINK_100 <--> PC1.ethg[1];
  176. HC21.ethg[0] <--> LINK_100 <--> PC2.ethg[0];
  177. HC22.ethg[0] <--> LINK_100 <--> PC2.ethg[1];
  178. PC1.ethg[2] <--> LINK_100 <--> RC1.ethg[0];
  179. PC2.ethg[2] <--> LINK_100 <--> RC2.ethg[0];
  180. //OSPF A
  181. RA1.pppg[2] <--> LINK_100 <--> RA3.pppg[0];
  182. RA2.pppg[2] <--> LINK_100 <--> RA3.pppg[1];
  183. RA1.pppg[1] <--> LINK_100 <--> RA2.pppg[1];
  184. RA1.pppg[0] <--> LINK_100 <--> A1.pppg[1];
  185. RA2.pppg[0] <--> LINK_100 <--> A2.pppg[1];
  186. //OSPF B
  187. RB1.pppg[0] <--> LINK_100 <--> B.pppg[1];
  188. //OSPF C
  189. RC1.pppg[1] <--> LINK_100 <--> RC2.pppg[1];
  190. RC1.pppg[0] <--> LINK_100 <--> C.pppg[1];
  191. RC2.pppg[0] <--> LINK_100 <--> C.pppg[2];
  192. //BGP
  193. A1.pppg[0] <--> LINK_100 <--> B.pppg[0];
  194. A2.pppg[0] <--> LINK_100 <--> C.pppg[0];
  195. }