DiffservNetwork.ned 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.onedomain;
  20. import inet.common.misc.ThruputMeteringChannel;
  21. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  22. import inet.node.inet.Router;
  23. import inet.node.inet.StandardHost;
  24. network DiffservNetwork
  25. {
  26. parameters:
  27. double edgeDatarate @unit(bps);
  28. double coreDatarate @unit(bps);
  29. types:
  30. channel edgeline extends ThruputMeteringChannel
  31. {
  32. delay = 2ms;
  33. datarate = edgeDatarate;
  34. thruputDisplayFormat = "b B U";
  35. }
  36. channel coreline extends ThruputMeteringChannel
  37. {
  38. delay = 2ms;
  39. datarate = coreDatarate;
  40. thruputDisplayFormat = "b B U";
  41. }
  42. channel ethernetline extends ThruputMeteringChannel
  43. {
  44. delay = 0.1us;
  45. datarate = 100Mbps;
  46. thruputDisplayFormat = "b B U";
  47. }
  48. submodules:
  49. H1: StandardHost {
  50. @display("p=46,43");
  51. }
  52. H2: StandardHost {
  53. @display("p=46,143");
  54. }
  55. R4: Router {
  56. @display("p=473,108");
  57. }
  58. R2: Router {
  59. @display("p=237,178");
  60. }
  61. R1: Router {
  62. @display("p=156,263");
  63. }
  64. R3: Router {
  65. @display("p=390,178");
  66. }
  67. R5: Router {
  68. @display("p=473,263");
  69. }
  70. R0: Router {
  71. @display("p=156,108");
  72. }
  73. H5: StandardHost {
  74. @display("p=570,59");
  75. }
  76. H6: StandardHost {
  77. @display("p=570,150");
  78. }
  79. H7: StandardHost {
  80. @display("p=571,250");
  81. }
  82. H8: StandardHost {
  83. @display("p=571,350");
  84. }
  85. H3: StandardHost {
  86. @display("p=41,240");
  87. }
  88. H4: StandardHost {
  89. @display("p=42,346");
  90. }
  91. configurator: IPv4NetworkConfigurator {
  92. @display("p=300,24");
  93. }
  94. connections:
  95. H1.ethg++ <--> ethernetline <--> R0.ethg++;
  96. H2.ethg++ <--> ethernetline <--> R0.ethg++;
  97. H3.ethg++ <--> ethernetline <--> R1.ethg++;
  98. H4.ethg++ <--> ethernetline <--> R1.ethg++;
  99. H5.ethg++ <--> ethernetline <--> R4.ethg++;
  100. H6.ethg++ <--> ethernetline <--> R4.ethg++;
  101. H7.ethg++ <--> ethernetline <--> R5.ethg++;
  102. H8.ethg++ <--> ethernetline <--> R5.ethg++;
  103. R0.pppg++ <--> edgeline <--> R2.pppg++;
  104. R1.pppg++ <--> edgeline <--> R2.pppg++;
  105. R2.pppg++ <--> coreline <--> R3.pppg++;
  106. R4.pppg++ <--> coreline <--> R3.pppg++;
  107. R5.pppg++ <--> coreline <--> R3.pppg++;
  108. }