BackboneAndTwoStubs.ned 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package inet.examples.ospfv2.areatests;
  2. import inet.common.misc.ThruputMeteringChannel;
  3. import inet.common.scenario.ScenarioManager;
  4. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  5. import inet.node.ospfv2.OSPFRouter;
  6. network OSPF_BackboneAndTwoStubsTest
  7. {
  8. parameters:
  9. int numBBRouters = default(3);
  10. @display("bgb=561,300");
  11. types:
  12. channel C extends ThruputMeteringChannel
  13. {
  14. delay = 0.1us;
  15. datarate = 100Mbps;
  16. thruputDisplayFormat = "#N";
  17. }
  18. submodules:
  19. BBR[numBBRouters]: OSPFRouter;
  20. Stub1: TestArea {
  21. parameters:
  22. numHosts = 2;
  23. extGates = 1;
  24. @display("p=138,156;b=136,136");
  25. }
  26. Stub2: TestArea {
  27. parameters:
  28. numHosts = 2;
  29. extGates = 1;
  30. @display("p=409,156;b=136,136");
  31. }
  32. configurator: IPv4NetworkConfigurator {
  33. parameters:
  34. config = xml("<config>"+
  35. "<interface among='BBR[*]' address='192.168.100.x' netmask='255.255.255.x' />"+
  36. "<interface hosts='Stub1.*' address='192.168.91.x' netmask='255.255.255.x' />"+
  37. "<interface hosts='BBR[*]' towards='Stub1.*' address='192.168.91.x' netmask='255.255.255.x' />"+
  38. "<interface hosts='Stub2.*' address='192.168.92.x' netmask='255.255.255.x' />"+
  39. "<interface hosts='BBR[*]' towards='Stub2.*' address='192.168.92.x' netmask='255.255.255.x' />"+
  40. "<multicast-group hosts='**.R[*] **.B[*] BBR[*]' address='224.0.0.5 224.0.0.6' />"+
  41. "<route hosts='**.H[*]' destination='*' netmask='0.0.0.0' interface='eth0' />"+
  42. "<route hosts='**.B[*] BBR[*]' destination='224.0.0.0' netmask='240.0.0.0' interface='eth0' />"+
  43. "<route hosts='**.R[*] **.B[*] BBR[*]' destination='224.0.0.0' netmask='240.0.0.0' interface='eth1' />"+
  44. "<route hosts='**.R[*] **.B[*]' destination='224.0.0.0' netmask='240.0.0.0' interface='eth2' />"+
  45. "</config>");
  46. addStaticRoutes = false;
  47. addDefaultRoutes = false;
  48. @display("p=75,43");
  49. }
  50. scenarioManager: ScenarioManager {
  51. @display("p=187,43");
  52. }
  53. connections:
  54. BBR[0].ethg++ <--> C <--> Stub1.ethg[0];
  55. BBR[numBBRouters-1].ethg++ <--> C <--> Stub2.ethg[0];
  56. for i=1..numBBRouters-1 {
  57. BBR[i].ethg++ <--> C <--> BBR[i-1].ethg++;
  58. }
  59. //BBR[0].ethg++ <--> C <--> BBR[numBBRouters-1].ethg++;
  60. }