failover.ned 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // Copyright (C) 2008 Irene Ruengeler
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU General Public License
  6. // as published by the Free Software Foundation; either version 2
  7. // of the License, or (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. //
  18. import inet.node.inet.Router;
  19. import inet.node.inet.StandardHost;
  20. import ned.DatarateChannel;
  21. import inet.common.scenario.ScenarioManager;
  22. network failover
  23. {
  24. parameters:
  25. double testTimeout @unit(s) = default(0s);
  26. bool testing = default(false);
  27. types:
  28. channel BottlePath extends DatarateChannel
  29. {
  30. parameters:
  31. datarate = 1Mbps;
  32. per = 0.005;
  33. }
  34. channel NormalPath extends DatarateChannel
  35. {
  36. parameters:
  37. datarate = 1Gbps;
  38. }
  39. submodules:
  40. sctp_client: StandardHost {
  41. parameters:
  42. routingTable.routingFile = "../../lib/multi_client.mrt";
  43. networkLayer.configurator.networkConfiguratorModule = "";
  44. gates:
  45. pppg[2];
  46. }
  47. sctp_server: StandardHost {
  48. parameters:
  49. routingTable.routingFile = "../../lib/multi_server.mrt";
  50. networkLayer.configurator.networkConfiguratorModule = "";
  51. gates:
  52. pppg[2];
  53. }
  54. router1: Router {
  55. parameters:
  56. routingTable.routingFile = "../../lib/multi_router1.mrt";
  57. networkLayer.configurator.networkConfiguratorModule = "";
  58. gates:
  59. pppg[4];
  60. }
  61. router2: Router {
  62. parameters:
  63. routingTable.routingFile = "../../lib/multi_router2.mrt";
  64. networkLayer.configurator.networkConfiguratorModule = "";
  65. gates:
  66. pppg[4];
  67. }
  68. scenarioManager: ScenarioManager {
  69. @display("p=184,180");
  70. }
  71. connections:
  72. sctp_client.pppg[0] <--> NormalPath <--> router1.pppg[0];
  73. sctp_client.pppg[1] <--> NormalPath <--> router1.pppg[1];
  74. router1.pppg[2] <--> BottlePath <--> router2.pppg[0];
  75. router1.pppg[3] <--> BottlePath <--> router2.pppg[1];
  76. router2.pppg[2] <--> NormalPath <--> sctp_server.pppg[0];
  77. router2.pppg[3] <--> NormalPath <--> sctp_server.pppg[1];
  78. }