DiffservNetwork.ned 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // Copyright (C) 2012 Opensim Ltd.
  3. // Author: Tamas Borbely
  4. //
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. package inet.examples.diffserv.simple_;
  20. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  21. import inet.node.ethernet.EtherSwitch;
  22. import inet.node.inet.Router;
  23. import inet.node.inet.StandardHost;
  24. import ned.DatarateChannel;
  25. //
  26. // This network contains a router with an 10Mbps Ethernet interface,
  27. // and with a 128kbps dialup connection to a server.
  28. //
  29. // The dialup connection is the bottleneck of the traffic from the clients
  30. // to the server. Without QoS, high traffic can cause random packet drops
  31. // at the router PPP interface.
  32. //
  33. network DiffservNetwork
  34. {
  35. parameters:
  36. int numClients = default(1);
  37. types:
  38. channel dialup extends DatarateChannel
  39. {
  40. delay = normal(0.004s, 0.0018s);
  41. datarate = 128kbps;
  42. }
  43. channel ethernetline extends DatarateChannel
  44. {
  45. delay = 0.1us;
  46. datarate = 10Mbps;
  47. }
  48. submodules:
  49. router: Router {
  50. @display("p=318,108");
  51. }
  52. client[numClients]: StandardHost;
  53. server: StandardHost {
  54. @display("p=436,108");
  55. }
  56. configurator: IPv4NetworkConfigurator {
  57. @display("p=181,21");
  58. }
  59. etherSwitch: EtherSwitch {
  60. @display("p=198,107");
  61. }
  62. connections:
  63. router.pppg++ <--> dialup <--> server.pppg++;
  64. etherSwitch.ethg++ <--> ethernetline <--> router.ethg++;
  65. for i=0..numClients-1 {
  66. client[i].ethg++ <--> ethernetline <--> etherSwitch.ethg++;
  67. }
  68. }