SimpleTest.ned 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package inet.examples.ospfv2.simpletest;
  2. import inet.common.lifecycle.LifecycleController;
  3. import inet.common.misc.ThruputMeteringChannel;
  4. import inet.common.scenario.ScenarioManager;
  5. import inet.linklayer.ethernet.EtherHub;
  6. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  7. import inet.node.inet.StandardHost;
  8. import inet.node.ospfv2.OSPFRouter;
  9. network SimpleTest
  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. H1: StandardHost {
  22. parameters:
  23. @display("p=56,92;i=device/laptop");
  24. gates:
  25. ethg[1];
  26. }
  27. N1: EtherHub {
  28. parameters:
  29. @display("p=184,92");
  30. gates:
  31. ethg[2];
  32. }
  33. R1: OSPFRouter {
  34. parameters:
  35. @display("p=296,92");
  36. hasStatus = true;
  37. gates:
  38. ethg[2];
  39. }
  40. R2: OSPFRouter {
  41. parameters:
  42. @display("p=416,92");
  43. hasStatus = true;
  44. gates:
  45. ethg[2];
  46. }
  47. N2: EtherHub {
  48. parameters:
  49. @display("p=532,92");
  50. gates:
  51. ethg[2];
  52. }
  53. H2: StandardHost {
  54. parameters:
  55. @display("p=660,92;i=device/laptop");
  56. gates:
  57. ethg[1];
  58. }
  59. configurator: IPv4NetworkConfigurator {
  60. parameters:
  61. config = xml("<config>"+
  62. "<interface among='H1 R1' address='192.168.1.x' netmask='255.255.255.0' />"+
  63. "<interface among='H2 R2' address='192.168.2.x' netmask='255.255.255.0' />"+
  64. "<interface among='R1 R2' address='192.168.60.x' netmask='255.255.255.0' />"+
  65. "<route hosts='H1 H2' destination='*' netmask='0.0.0.0' interface='eth0' />"+
  66. "</config>");
  67. addStaticRoutes = false;
  68. addDefaultRoutes = false;
  69. @display("p=75,43");
  70. }
  71. scenarioManager: ScenarioManager {
  72. @display("p=75,43");
  73. }
  74. lifecycleController: LifecycleController {
  75. @display("p=208,43");
  76. }
  77. connections:
  78. H1.ethg[0] <--> C <--> N1.ethg[0];
  79. N1.ethg[1] <--> C <--> R1.ethg[0];
  80. R1.ethg[1] <--> C <--> R2.ethg[0];
  81. R2.ethg[1] <--> C <--> N2.ethg[0];
  82. N2.ethg[1] <--> C <--> H2.ethg[0];
  83. }