Network.ned 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. package inet.examples.bgpv4.BGPandOSPF;
  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[3];
  24. }
  25. B: BGPRouter {
  26. parameters:
  27. @display("p=338,141");
  28. gates:
  29. pppg[3];
  30. }
  31. RA1: OSPFRouter {
  32. parameters:
  33. @display("p=198,113;i=device/router");
  34. gates:
  35. pppg[2];
  36. ethg[1];
  37. }
  38. RA2: OSPFRouter {
  39. parameters:
  40. @display("p=198,187;i=device/router");
  41. gates:
  42. pppg[2];
  43. ethg[1];
  44. }
  45. RB1: OSPFRouter {
  46. parameters:
  47. @display("p=406,105;i=device/router");
  48. gates:
  49. pppg[2];
  50. ethg[1];
  51. }
  52. RB2: OSPFRouter {
  53. parameters:
  54. @display("p=406,187;i=device/router");
  55. gates:
  56. pppg[2];
  57. ethg[1];
  58. }
  59. PA1: EtherSwitch {
  60. parameters:
  61. @display("p=124,70;i=device/switch");
  62. gates:
  63. ethg[3];
  64. }
  65. PA2: EtherSwitch {
  66. parameters:
  67. @display("p=114,190;i=device/switch");
  68. gates:
  69. ethg[3];
  70. }
  71. PB1: EtherSwitch {
  72. parameters:
  73. @display("p=484,78;i=device/switch");
  74. gates:
  75. ethg[3];
  76. }
  77. PB2: EtherSwitch {
  78. parameters:
  79. @display("p=492,190;i=device/switch");
  80. gates:
  81. ethg[3];
  82. }
  83. HA11: StandardHost {
  84. parameters:
  85. @display("p=42,34;i=device/pc");
  86. gates:
  87. ethg[1];
  88. }
  89. HA12: StandardHost {
  90. parameters:
  91. @display("p=34,90;i=device/pc");
  92. gates:
  93. ethg[1];
  94. }
  95. HA21: StandardHost {
  96. parameters:
  97. @display("p=34,156;i=device/pc");
  98. gates:
  99. ethg[1];
  100. }
  101. HA22: StandardHost {
  102. parameters:
  103. @display("p=34,218;i=device/pc");
  104. gates:
  105. ethg[1];
  106. }
  107. HB11: StandardHost {
  108. parameters:
  109. @display("p=558,34;i=device/pc");
  110. gates:
  111. ethg[1];
  112. }
  113. HB12: StandardHost {
  114. parameters:
  115. @display("p=558,90;i=device/pc");
  116. gates:
  117. ethg[1];
  118. }
  119. HB21: StandardHost {
  120. parameters:
  121. @display("p=558,156;i=device/pc");
  122. gates:
  123. ethg[1];
  124. }
  125. HB22: StandardHost {
  126. parameters:
  127. @display("p=558,220;i=device/pc");
  128. gates:
  129. ethg[1];
  130. }
  131. configurator: IPv4NetworkConfigurator {
  132. @display("p=305,34");
  133. config = xmldoc("IPv4Config.xml");
  134. //assignAddresses = false;
  135. //assignDisjunctSubnetAddresses = false;
  136. addStaticRoutes = false;
  137. addDefaultRoutes = false;
  138. addSubnetRoutes = false;
  139. }
  140. connections:
  141. //LAN A1 et A2
  142. HA11.ethg[0] <--> LINK_100 <--> PA1.ethg[0];
  143. HA12.ethg[0] <--> LINK_100 <--> PA1.ethg[1];
  144. HA21.ethg[0] <--> LINK_100 <--> PA2.ethg[0];
  145. HA22.ethg[0] <--> LINK_100 <--> PA2.ethg[1];
  146. PA1.ethg[2] <--> LINK_100 <--> RA1.ethg[0];
  147. PA2.ethg[2] <--> LINK_100 <--> RA2.ethg[0];
  148. //OSPF A
  149. RA1.pppg[1] <--> LINK_100 <--> RA2.pppg[1];
  150. RA1.pppg[0] <--> LINK_100 <--> A.pppg[1];
  151. RA2.pppg[0] <--> LINK_100 <--> A.pppg[2];
  152. //BGP
  153. A.pppg[0] <--> LINK_100 <--> B.pppg[0];
  154. //LAN B1 et B2
  155. HB11.ethg[0] <--> LINK_100 <--> PB1.ethg[0];
  156. HB12.ethg[0] <--> LINK_100 <--> PB1.ethg[1];
  157. HB21.ethg[0] <--> LINK_100 <--> PB2.ethg[0];
  158. HB22.ethg[0] <--> LINK_100 <--> PB2.ethg[1];
  159. PB1.ethg[2] <--> LINK_100 <--> RB1.ethg[0];
  160. PB2.ethg[2] <--> LINK_100 <--> RB2.ethg[0];
  161. //OSPF B
  162. RB1.pppg[1] <--> LINK_100 <--> RB2.pppg[1];
  163. RB1.pppg[0] <--> LINK_100 <--> B.pppg[1];
  164. RB2.pppg[0] <--> LINK_100 <--> B.pppg[2];
  165. }