tenservers.ned 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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.tenserverssocket;
  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. channel ethernetline extends ned.DatarateChannel
  36. {
  37. parameters:
  38. delay = 0.1us;
  39. datarate = 100Mbps;
  40. }
  41. //
  42. // 10-nodes test scenario for sockets.
  43. //
  44. // The scenario consists of a number of clients and 10 servers connected to two routers. The routers are connected
  45. // with a single link.
  46. //
  47. network Http10Servers
  48. {
  49. parameters:
  50. double numclients @prompt("Number of clients") = default(10);
  51. @display("bgb=939,624");
  52. submodules:
  53. configurator: IPv4NetworkConfigurator {
  54. parameters:
  55. // moduleTypes = "Router StandardHost";
  56. // nonIPModuleTypes = "";
  57. @display("p=58,79;i=block/cogwheel");
  58. }
  59. controller: HttpController {
  60. parameters:
  61. @display("p=62,156;i=block/cogwheel");
  62. }
  63. router_c: Router {
  64. parameters:
  65. @display("p=492,424;i=abstract/router_l");
  66. }
  67. router_s: Router {
  68. parameters:
  69. @display("p=492,320;i=abstract/router_l");
  70. }
  71. client[numclients]: StandardHost {
  72. parameters:
  73. @display("i=device/laptop_l");
  74. }
  75. server1: StandardHost {
  76. parameters:
  77. @display("p=191,316;i=device/server_l");
  78. }
  79. server2: StandardHost {
  80. parameters:
  81. @display("p=231,220;i=device/server_l");
  82. }
  83. server3: StandardHost {
  84. parameters:
  85. @display("p=278,140;i=device/server_l");
  86. }
  87. server4: StandardHost {
  88. parameters:
  89. @display("p=355,92;i=device/server_l");
  90. }
  91. server5: StandardHost {
  92. parameters:
  93. @display("p=452,60;i=device/server_l");
  94. }
  95. server6: StandardHost {
  96. parameters:
  97. @display("p=549,60;i=device/server_l");
  98. }
  99. server7: StandardHost {
  100. parameters:
  101. @display("p=660,84;i=device/server_l");
  102. }
  103. server8: StandardHost {
  104. parameters:
  105. @display("p=734,148;i=device/server_l");
  106. }
  107. server9: StandardHost {
  108. parameters:
  109. @display("p=772,228;i=device/server_l");
  110. }
  111. server10: StandardHost {
  112. parameters:
  113. @display("p=797,324;i=device/server_l");
  114. }
  115. connections allowunconnected:
  116. server1.ethg++ <--> ethernetline <--> router_s.ethg++;
  117. server2.ethg++ <--> ethernetline <--> router_s.ethg++;
  118. server3.ethg++ <--> ethernetline <--> router_s.ethg++;
  119. server4.ethg++ <--> ethernetline <--> router_s.ethg++;
  120. server5.ethg++ <--> ethernetline <--> router_s.ethg++;
  121. server6.ethg++ <--> ethernetline <--> router_s.ethg++;
  122. server7.ethg++ <--> ethernetline <--> router_s.ethg++;
  123. server8.ethg++ <--> ethernetline <--> router_s.ethg++;
  124. server9.ethg++ <--> ethernetline <--> router_s.ethg++;
  125. server10.ethg++ <--> ethernetline <--> router_s.ethg++;
  126. for i=0..numclients-1 {
  127. client[i].ethg++ <--> ethernetline <--> router_c.ethg++;
  128. }
  129. router_s.ethg++ <--> ethernetline <--> router_c.ethg++;
  130. }