DynamicTest.ned 2.9 KB

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