InfinityCount.ned 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // This program is property of its copyright holder. All rights reserved.
  3. //
  4. package inet.examples.rip.infinitycount;
  5. import inet.common.scenario.ScenarioManager;
  6. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  7. import inet.node.inet.Router;
  8. import ned.DatarateChannel;
  9. network RIPInfinityCountTest
  10. {
  11. parameters:
  12. int numRipRouters;
  13. types:
  14. channel C extends DatarateChannel
  15. {
  16. datarate = 10Mbps;
  17. delay = 0.1us;
  18. }
  19. submodules:
  20. cRouter: Router {
  21. hasRIP = true;
  22. @display("p=237,192");
  23. }
  24. bRouter: Router {
  25. hasRIP = true;
  26. @display("p=337,192");
  27. }
  28. rRouter[numRipRouters]: Router {
  29. hasRIP = true;
  30. @display("p=487,192,ri,100,100");
  31. }
  32. configurator: IPv4NetworkConfigurator {
  33. @display("p=59,31");
  34. config = xml("<config>"
  35. +"<interface among='cRouter bRouter' address='10.0.0.x' netmask='255.255.255.x' add-static-route='off'/>"
  36. +"<interface among='bRouter rRouter[0]' address='10.1.0.x' netmask='255.255.255.x' add-static-route='off'/>"
  37. +"<interface among='rRouter[*]' address='192.168.1.x' netmask='255.255.255.x' add-static-route='off'/>"
  38. +"</config>");
  39. }
  40. scenarioManager: ScenarioManager {
  41. @display("p=59,86");
  42. script = xml("<scenario>"
  43. +"<at t='60'>"
  44. +"<disconnect src-module='rRouter[0]' src-gate='ethg[0]' />"
  45. +"</at>"
  46. +"</scenario>");
  47. }
  48. connections:
  49. bRouter.ethg++ <--> C <--> rRouter[0].ethg++;
  50. cRouter.ethg++ <--> C <--> bRouter.ethg++; // ha ez a link van, akkor van infinity count
  51. for i=0..numRipRouters-1 {
  52. rRouter[i].ethg++ <--> C <--> rRouter[(i+1)%numRipRouters].ethg++;
  53. }
  54. }