SimpleTest.ned 2.6 KB

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