Backbone.ned 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package inet.examples.ospfv2.backbone;
  2. import inet.common.misc.ThruputMeteringChannel;
  3. import inet.linklayer.ethernet.EtherHub;
  4. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  5. import inet.node.inet.StandardHost;
  6. import inet.node.ospfv2.OSPFRouter;
  7. network Backbone
  8. {
  9. parameters:
  10. @display("p=10,10;b=736,568");
  11. types:
  12. channel C extends ThruputMeteringChannel
  13. {
  14. delay = 0.1us;
  15. datarate = 100Mbps;
  16. thruputDisplayFormat = "#N";
  17. }
  18. submodules:
  19. R1: OSPFRouter {
  20. parameters:
  21. @display("p=372,340");
  22. gates:
  23. ethg[3];
  24. }
  25. N1: EtherHub {
  26. parameters:
  27. @display("p=368,268");
  28. gates:
  29. ethg[2];
  30. }
  31. N2: EtherHub {
  32. parameters:
  33. @display("p=452,384");
  34. gates:
  35. ethg[3];
  36. }
  37. R2: OSPFRouter {
  38. parameters:
  39. @display("p=368,188");
  40. gates:
  41. ethg[2];
  42. }
  43. R4: OSPFRouter {
  44. parameters:
  45. @display("p=216,432");
  46. gates:
  47. ethg[2];
  48. }
  49. R3: OSPFRouter {
  50. parameters:
  51. @display("p=532,428");
  52. gates:
  53. ethg[2];
  54. }
  55. N4: EtherHub {
  56. parameters:
  57. @display("p=368,100");
  58. gates:
  59. ethg[4];
  60. }
  61. N5: EtherHub {
  62. parameters:
  63. @display("p=612,476");
  64. gates:
  65. ethg[3];
  66. }
  67. R5: OSPFRouter {
  68. parameters:
  69. @display("p=488,284");
  70. gates:
  71. ethg[2];
  72. }
  73. R7: OSPFRouter {
  74. parameters:
  75. @display("p=256,284");
  76. gates:
  77. ethg[2];
  78. }
  79. R6: OSPFRouter {
  80. parameters:
  81. @display("p=372,476");
  82. gates:
  83. ethg[2];
  84. }
  85. N6: EtherHub {
  86. parameters:
  87. @display("p=136,476");
  88. gates:
  89. ethg[3];
  90. }
  91. N3: EtherHub {
  92. parameters:
  93. @display("p=292,384");
  94. gates:
  95. ethg[2];
  96. }
  97. H1: StandardHost {
  98. parameters:
  99. @display("p=372,420;i=device/laptop");
  100. gates:
  101. ethg[1];
  102. }
  103. H2: StandardHost {
  104. parameters:
  105. @display("p=368,40;i=device/laptop");
  106. gates:
  107. ethg[1];
  108. }
  109. configurator: IPv4NetworkConfigurator {
  110. parameters:
  111. config = xml("<config>"+
  112. "<interface hosts='R2' towards='N1 R1' address='192.168.1.1' netmask='255.255.255.0' metric='1' />"+
  113. "<interface hosts='R1' towards='N1 R2' address='192.168.1.2' netmask='255.255.255.0' metric='1' />"+
  114. "<interface hosts='R3' towards='N2 R1' address='192.168.2.1' netmask='255.255.255.0' metric='2' />"+
  115. "<interface hosts='H1' address='192.168.2.2' netmask='255.255.255.0' metric='1' />"+
  116. "<interface hosts='R1' towards='N2 R3' address='192.168.2.3' netmask='255.255.255.0' metric='2' />"+
  117. "<interface hosts='R1' towards='N3 R4' address='192.168.3.1' netmask='255.255.255.0' metric='3' />"+
  118. "<interface hosts='R4' towards='N3 R1' address='192.168.3.2' netmask='255.255.255.0' metric='3' />"+
  119. "<interface hosts='H2' address='192.168.4.1' netmask='255.255.255.0' metric='1' />"+
  120. "<interface hosts='R5' towards='N4 H2' address='192.168.4.2' netmask='255.255.255.0' metric='4' />"+
  121. "<interface hosts='R2' towards='N4 H2' address='192.168.4.3' netmask='255.255.255.0' metric='4' />"+
  122. "<interface hosts='R7' towards='N4 H2' address='192.168.4.4' netmask='255.255.255.0' metric='4' />"+
  123. "<interface hosts='R6' towards='N5 R5' address='192.168.5.1' netmask='255.255.255.0' metric='5' />"+
  124. "<interface hosts='R3' towards='N5 R5' address='192.168.5.2' netmask='255.255.255.0' metric='5' />"+
  125. "<interface hosts='R5' towards='N5 R6' address='192.168.5.3' netmask='255.255.255.0' metric='5' />"+
  126. "<interface hosts='R7' towards='N6 R6' address='192.168.6.1' netmask='255.255.255.0' metric='6' />"+
  127. "<interface hosts='R4' towards='N6 R6' address='192.168.6.2' netmask='255.255.255.0' metric='6' />"+
  128. "<interface hosts='R6' towards='N6 R7' address='192.168.6.3' netmask='255.255.255.0' metric='6' />"+
  129. "<multicast-group hosts='R*' address='224.0.0.5 224.0.0.6' />"+
  130. "<route hosts='H*' destination='*' netmask='0.0.0.0' interface='eth0' />"+
  131. "<route hosts='R*' destination='224.0.0.0' netmask='240.0.0.0' interface='eth0' />"+
  132. "<route hosts='R*' destination='224.0.0.0' netmask='240.0.0.0' interface='eth1' />"+
  133. "<route hosts='R1' destination='224.0.0.0' netmask='240.0.0.0' interface='eth2' />"+
  134. "</config>");
  135. addStaticRoutes = false;
  136. addDefaultRoutes = false;
  137. @display("p=75,43");
  138. }
  139. connections:
  140. R1.ethg[0] <--> C <--> N1.ethg[1];
  141. R1.ethg[1] <--> C <--> N2.ethg[2];
  142. N1.ethg[0] <--> C <--> R2.ethg[1];
  143. R2.ethg[0] <--> C <--> N4.ethg[2];
  144. N4.ethg[1] <--> C <--> R5.ethg[1];
  145. R5.ethg[0] <--> C <--> N5.ethg[2];
  146. N2.ethg[0] <--> C <--> R3.ethg[1];
  147. R3.ethg[0] <--> C <--> N5.ethg[1];
  148. N5.ethg[0] <--> C <--> R6.ethg[0];
  149. N6.ethg[2] <--> C <--> R6.ethg[1];
  150. R1.ethg[2] <--> C <--> N3.ethg[0];
  151. N3.ethg[1] <--> C <--> R4.ethg[0];
  152. R4.ethg[1] <--> C <--> N6.ethg[1];
  153. N4.ethg[3] <--> C <--> R7.ethg[0];
  154. R7.ethg[1] <--> C <--> N6.ethg[0];
  155. N4.ethg[0] <--> C <--> H2.ethg[0];
  156. N2.ethg[1] <--> C <--> H1.ethg[0];
  157. }