Area1.ned 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package inet.examples.ospfv2.areas;
  2. import inet.linklayer.ethernet.EtherHub;
  3. import inet.node.inet.StandardHost;
  4. import inet.node.ospfv2.OSPFRouter;
  5. import ned.DatarateChannel;
  6. module TwoNetsArea
  7. {
  8. parameters:
  9. @display("p=10,10;b=412,316");
  10. gates:
  11. inout ethg[];
  12. types:
  13. channel C extends DatarateChannel
  14. {
  15. delay = 0.1us;
  16. datarate = 100Mbps;
  17. }
  18. submodules:
  19. R1: OSPFRouter {
  20. parameters:
  21. @display("p=248,124");
  22. gates:
  23. ethg[3];
  24. }
  25. N1: EtherHub {
  26. parameters:
  27. @display("p=156,72");
  28. gates:
  29. ethg[2];
  30. }
  31. N2: EtherHub {
  32. parameters:
  33. @display("p=160,284");
  34. gates:
  35. ethg[2];
  36. }
  37. R3: OSPFRouter {
  38. parameters:
  39. @display("p=360,180");
  40. gates:
  41. ethg[3];
  42. }
  43. H1: StandardHost {
  44. parameters:
  45. @display("p=56,72;i=device/laptop");
  46. gates:
  47. ethg[1];
  48. }
  49. H2: StandardHost {
  50. parameters:
  51. @display("p=56,288;i=device/laptop");
  52. gates:
  53. ethg[1];
  54. }
  55. R2: OSPFRouter {
  56. parameters:
  57. @display("p=248,232");
  58. gates:
  59. ethg[3];
  60. }
  61. connections:
  62. H1.ethg[0] <--> C <--> N1.ethg[1];
  63. N1.ethg[0] <--> C <--> R1.ethg[2];
  64. R1.ethg[0] <--> C <--> R3.ethg[2];
  65. N2.ethg[1] <--> C <--> H2.ethg[0];
  66. R1.ethg[1] <--> C <--> R2.ethg[0];
  67. R2.ethg[1] <--> C <--> R3.ethg[1];
  68. R2.ethg[2] <--> C <--> N2.ethg[0];
  69. // towards other areas
  70. ethg[0] <--> R3.ethg[0];
  71. }