CloudAndRouters.ned 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Copyright (C) 2012 OpenSim Ltd.
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. //
  17. package inet.examples.internetcloud.cloudandrouters;
  18. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  19. import inet.node.ethernet.Eth100M;
  20. import inet.node.inet.Router;
  21. import inet.node.inet.StandardHost;
  22. import inet.node.internetcloud.InternetCloud;
  23. import ned.DatarateChannel;
  24. network CloudAndRouters
  25. {
  26. parameters:
  27. int numSenders;
  28. types:
  29. channel C extends DatarateChannel
  30. {
  31. delay = 20ms;
  32. datarate = 5Mbps;
  33. }
  34. submodules:
  35. configurator: IPv4NetworkConfigurator {
  36. parameters:
  37. @display("p=61,163");
  38. }
  39. srouter[numSenders]: Router;
  40. sender[numSenders]: StandardHost;
  41. rrouter: Router;
  42. recip: StandardHost;
  43. internet: InternetCloud;
  44. connections:
  45. rrouter.pppg++ <--> C <--> internet.pppg++;
  46. recip.ethg++ <--> Eth100M <--> rrouter.ethg++;
  47. for i=0..numSenders-1 {
  48. srouter[i].pppg++ <--> C <--> internet.pppg++;
  49. sender[i].ethg++ <--> Eth100M <--> srouter[i].ethg++;
  50. }
  51. }