DynamicTest.ned 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package inet.examples.ospfv2.dynamictest;
  2. import inet.common.lifecycle.LifecycleController;
  3. import inet.common.misc.ThruputMeteringChannel;
  4. import inet.common.scenario.ScenarioManager;
  5. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  6. import inet.node.inet.StandardHost;
  7. import inet.node.ospfv2.OSPFRouter;
  8. network DynamicTest
  9. {
  10. parameters:
  11. @display("p=10,10;b=712,152");
  12. types:
  13. channel C extends ThruputMeteringChannel
  14. {
  15. delay = 0.1us;
  16. datarate = 100Mbps;
  17. thruputDisplayFormat = "#N";
  18. }
  19. submodules:
  20. H1: StandardHost {
  21. parameters:
  22. @display("p=50,123");
  23. gates:
  24. ethg[1];
  25. }
  26. R1: OSPFRouter {
  27. parameters:
  28. @display("p=192,123");
  29. gates:
  30. ethg[3];
  31. }
  32. RA: OSPFRouter {
  33. parameters:
  34. @display("p=351,42");
  35. gates:
  36. ethg[2];
  37. }
  38. RB: OSPFRouter {
  39. parameters:
  40. @display("p=351,194");
  41. gates:
  42. ethg[2];
  43. }
  44. R2: OSPFRouter {
  45. parameters:
  46. @display("p=486,123");
  47. gates:
  48. ethg[3];
  49. }
  50. H2: StandardHost {
  51. parameters:
  52. @display("p=666,123");
  53. gates:
  54. ethg[1];
  55. }
  56. configurator: IPv4NetworkConfigurator {
  57. parameters:
  58. @display("p=94,42");
  59. config = xml("<config>"
  60. + "<interface among='H1 R1' address='192.168.1.x' netmask='255.255.255.x' />"
  61. + "<interface among='H2 R2' address='192.168.2.x' netmask='255.255.255.x' />"
  62. + "<interface among='R*' address='10.0.0.x' netmask='255.255.255.x' />"
  63. + "<multicast-group hosts='R*' address='224.0.0.5 224.0.0.6' />"
  64. + "<route hosts='H1' destination='*' gateway='R1'/>"
  65. + "<route hosts='H2' destination='*' gateway='R2'/>"
  66. + "<route hosts='R*' destination='224.0.0.0' netmask='240.0.0.0' interface='eth0'/>"
  67. + "<route hosts='R*' destination='224.0.0.0' netmask='240.0.0.0' interface='eth1'/>"
  68. + "<route hosts='R1 R2' destination='224.0.0.0' netmask='240.0.0.0' interface='eth2'/>"
  69. + "</config>");
  70. }
  71. scenarioManager: ScenarioManager {
  72. @display("p=594,50");
  73. }
  74. lifecycleController: LifecycleController {
  75. @display("p=94,194");
  76. }
  77. connections:
  78. H1.ethg[0] <--> C <--> R1.ethg[0];
  79. R1.ethg[1] <--> C <--> RA.ethg[0];
  80. R1.ethg[2] <--> C <--> RB.ethg[0];
  81. RA.ethg[1] <--> C <--> R2.ethg[1];
  82. RB.ethg[1] <--> C <--> R2.ethg[2];
  83. R2.ethg[0] <--> C <--> H2.ethg[0];
  84. }