nnodes.ned 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // ----------------------------------------------------------------------------
  2. //
  3. // HttpTools Project
  4. //
  5. // This file is a part of the HttpTools project. The project was created at
  6. // Reykjavik University, the Laboratory for Dependable Secure Systems (LDSS).
  7. // Its purpose is to create a set of OMNeT++ components to simulate browsing
  8. // behaviour in a high-fidelity manner along with a highly configurable
  9. // Web server component.
  10. //
  11. // Maintainer: Kristjan V. Jonsson (LDSS) kristjanvj@gmail.com
  12. // Project home page: code.google.com/p/omnet-httptools
  13. //
  14. // ----------------------------------------------------------------------------
  15. //
  16. // This program is free software; you can redistribute it and/or
  17. // modify it under the terms of the GNU General Public License version 3
  18. // as published by the Free Software Foundation.
  19. //
  20. // This program is distributed in the hope that it will be useful,
  21. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. // GNU General Public License for more details.
  24. //
  25. // You should have received a copy of the GNU General Public License
  26. // along with this program; if not, write to the Free Software
  27. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  28. //
  29. // ----------------------------------------------------------------------------
  30. package inet.examples.httptools.socket.simpleddos;
  31. import inet.applications.httptools.configurator.HttpController;
  32. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  33. import inet.node.inet.Router;
  34. import inet.node.inet.StandardHost;
  35. //
  36. // n-nodes test scenario for sockets.
  37. //
  38. // The scenario consists of a number of clients and servers connected to two routers. The routers are connected
  39. // with a single link.
  40. //
  41. network HttpNnodes
  42. {
  43. parameters:
  44. double numclients @prompt("Number of clients") = default(10);
  45. @display("bgb=474,374");
  46. types:
  47. channel ethernetline extends ned.DatarateChannel
  48. {
  49. delay = 0.1us;
  50. datarate = 100Mbps;
  51. }
  52. submodules:
  53. // channelInstaller: ChannelInstaller {
  54. // parameters:
  55. //// channelClass = "ThruputMeteringChannel";
  56. //// channelAttrs = "format=u";
  57. // @display("p=98,50;i=block/cogwheel_s");
  58. // }
  59. configurator: IPv4NetworkConfigurator {
  60. parameters:
  61. // moduleTypes = "Router StandardHost";
  62. // nonIPModuleTypes = "";
  63. config = xml("<config><interface hosts='*' address='145.236.x.x' netmask='255.255.x.x'/></config>");
  64. @display("p=50,64;i=block/cogwheel");
  65. }
  66. controller: HttpController {
  67. parameters:
  68. @display("p=46,140;i=block/cogwheel");
  69. }
  70. router_c: Router {
  71. parameters:
  72. @display("p=100,200;i=abstract/router_l");
  73. }
  74. router_s: Router {
  75. parameters:
  76. @display("p=300,200;i=abstract/router_l");
  77. }
  78. client[numclients]: StandardHost {
  79. parameters:
  80. @display("i=device/laptop_l");
  81. }
  82. thegood: StandardHost {
  83. parameters:
  84. @display("i=device/server_l");
  85. }
  86. thebad: StandardHost {
  87. parameters:
  88. @display("i=device/server_l");
  89. }
  90. theugly: StandardHost {
  91. parameters:
  92. @display("i=device/server_l");
  93. }
  94. connections allowunconnected:
  95. thegood.ethg++ <--> ethernetline <--> router_s.ethg++;
  96. thebad.ethg++ <--> ethernetline <--> router_s.ethg++;
  97. theugly.ethg++ <--> ethernetline <--> router_s.ethg++;
  98. for i=0..numclients-1 {
  99. client[i].ethg++ <--> ethernetline <--> router_c.ethg++;
  100. }
  101. router_s.ethg++ <--> ethernetline <--> router_c.ethg++;
  102. }