tcp_nosack_moreclients_speed_strict.test.off 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. %description:
  2. Testing TCP communication speed
  3. TCP
  4. TCP_NSC
  5. %#--------------------------------------------------------------------------------------------------------------
  6. %testprog: opp_run
  7. %#--------------------------------------------------------------------------------------------------------------
  8. %file: test.ned
  9. import ned.DatarateChannel;
  10. import inet.node.inet.StandardHost;
  11. import inet.node.inet.Router;
  12. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  13. channel C extends DatarateChannel
  14. {
  15. delay = 0.01us; // ~ 2m
  16. datarate = 10Mbps;
  17. }
  18. module SubTest
  19. {
  20. parameters:
  21. string cliTcpType = default("n/a");
  22. string srvTcpType = default("n/a");
  23. int k = default(3);
  24. submodules:
  25. server: StandardHost {
  26. parameters:
  27. numTcpApps = 1;
  28. tcpType = srvTcpType;
  29. }
  30. switch: Router {
  31. parameters:
  32. }
  33. client[k]: StandardHost {
  34. parameters:
  35. numTcpApps = 1;
  36. tcpType = cliTcpType;
  37. tcpApp[0].connectAddress = substringBeforeLast(fullPath(),".client[")+".server";
  38. }
  39. connections:
  40. server.pppg++ <--> C <--> switch.pppg++;
  41. for i=0..k-1 {
  42. client[i].pppg++ <--> C <--> switch.pppg++;
  43. }
  44. }
  45. module STest
  46. {
  47. parameters:
  48. string srvTcpType = default("n/a");
  49. submodules:
  50. clients_INET: SubTest {
  51. parameters:
  52. srvTcpType = srvTcpType;
  53. cliTcpType = "TCP";
  54. }
  55. clients_NSC: SubTest {
  56. parameters:
  57. srvTcpType = srvTcpType;
  58. cliTcpType = "TCP_NSC";
  59. }
  60. clients_LWIP: SubTest {
  61. parameters:
  62. srvTcpType = srvTcpType;
  63. cliTcpType = "TCP_lwIP";
  64. }
  65. }
  66. network TcpSpeedTest
  67. {
  68. submodules:
  69. server_INET: STest {
  70. parameters:
  71. srvTcpType = "TCP";
  72. }
  73. server_NSC: STest {
  74. parameters:
  75. srvTcpType = "TCP_NSC";
  76. }
  77. server_LWIP: STest {
  78. parameters:
  79. srvTcpType = "TCP_lwIP";
  80. }
  81. configurator: IPv4NetworkConfigurator {
  82. @display("p=70,40");
  83. }
  84. }
  85. %#--------------------------------------------------------------------------------------------------------------
  86. %inifile: omnetpp.ini
  87. [General]
  88. network = TcpSpeedTest
  89. total-stack = 7MiB
  90. tkenv-plugin-path = ../../../etc/plugins
  91. #debug-on-errors = true
  92. #record-eventlog = true
  93. **.vector-recording = false
  94. sim-time-limit = 2s+60s
  95. #sim-time-limit = 2s+60s+12s
  96. **.server*.tcpApp[0].typename = "TCPEchoApp"
  97. **.client*.tcpApp[0].typename = "TCPSessionApp"
  98. #client app:
  99. **.client*.tcpApp[0].active = true
  100. **.client*.tcpApp[0].localPort = -1
  101. **.client*.tcpApp[0].connectPort = 1000
  102. **.client*.tcpApp[0].tOpen = 1s
  103. **.client*.tcpApp[0].tSend = 2s
  104. **.client*.tcpApp[0].sendBytes = 10000000B
  105. **.client*.tcpApp[0].sendScript = ""
  106. **.client*.tcpApp[0].tClose = 100s
  107. #server app:
  108. **.server*.tcpApp[0].localPort = 1000
  109. **.server*.tcpApp[0].echoFactor = 2.0
  110. **.server*.tcpApp[0].echoDelay = 0
  111. ## tcp apps
  112. # NIC configuration
  113. **.ppp[*].queueType = "DropTailQueue" # in routers
  114. **.ppp[*].queue.frameCapacity = 10
  115. #**.ppp[*].queue.frameCapacity = 100 # good:(13,15,16,18,19,21-25, 7) bad:(17,20)
  116. %#--------------------------------------------------------------------------------------------------------------
  117. %postrun-command: Rscript check.r
  118. %#--------------------------------------------------------------------------------------------------------------
  119. %file: check.r
  120. #!/usr/bin/env Rscript
  121. options(echo=FALSE)
  122. options(width=160)
  123. library("omnetpp", warn.conflicts=FALSE)
  124. #TEST parameters
  125. scafile <- 'results/General-#0.sca'
  126. cliPerSrv <- 3
  127. srvCount <- 3 * 3
  128. cliCount <- srvCount * cliPerSrv
  129. echoFactor <- 2
  130. cliSentBytes <- 10000000
  131. cliRcvdBytes <- cliSentBytes * echoFactor
  132. srvRcvdBytes <- cliPerSrv * cliSentBytes
  133. srvSentBytes <- srvRcvdBytes * echoFactor
  134. # begin TEST:
  135. dataset <- loadDataset(scafile)
  136. cat("\nOMNETPP TEST RESULT:\n")
  137. cli <- dataset$scalars[grep("\\.client\\[\\d\\]\\.tcpApp\\[\\d\\]$",dataset$scalars$module),]
  138. cliSent <- cli[cli$name == "bytesSent",]
  139. cliRcvd <- cli[cli$name == "bytesRcvd",]
  140. srv <- dataset$scalars[grep("\\.server\\.tcpApp\\[\\d\\]$",dataset$scalars$module),]
  141. srvSent <- srv[srv$name == "bytesSent",]
  142. srvRcvd <- srv[srv$name == "bytesRcvd",]
  143. cat("\nTCP SPEED TEST RESULT:\n")
  144. if(length(cliSent$value) == cliCount & min(cliSent$value) == cliSentBytes)
  145. {
  146. cat("CLIENT SENT OK\n")
  147. } else {
  148. cat("CLIENT SENT BAD:\n")
  149. cliSent$rate = cliSent$value*100/cliSentBytes
  150. print(cliSent[cliSent$value != cliSentBytes,])
  151. }
  152. if(length(srvRcvd$value) == srvCount & min(srvRcvd$value) == srvRcvdBytes)
  153. {
  154. cat("SERVER RCVD OK\n")
  155. } else {
  156. cat("SERVER RCVD BAD:\n")
  157. srvRcvd$rate = srvRcvd$value*100/srvRcvdBytes
  158. print(srvRcvd[srvRcvd$value != srvRcvdBytes,])
  159. }
  160. if(length(srvSent$value) == srvCount & min(srvSent$value) == srvSentBytes)
  161. {
  162. cat("SERVER SENT OK\n")
  163. } else {
  164. cat("SERVER SENT BAD:\n")
  165. srvSent$rate = srvSent$value*100/srvSentBytes
  166. print(srvSent[srvSent$value != srvSentBytes,])
  167. }
  168. if(length(cliRcvd$value) == cliCount & min(cliRcvd$value) == cliRcvdBytes)
  169. {
  170. cat("CLIENT RCVD OK\n")
  171. } else {
  172. cat("CLIENT RCVD BAD:\n")
  173. cliRcvd$rate = cliRcvd$value*100/cliRcvdBytes
  174. print(cliRcvd[cliRcvd$value != cliRcvdBytes,])
  175. }
  176. cat("\n")
  177. %#--------------------------------------------------------------------------------------------------------------
  178. %contains: postrun-command(1).out
  179. OMNETPP TEST RESULT:
  180. TCP SPEED TEST RESULT:
  181. CLIENT SENT OK
  182. SERVER RCVD OK
  183. SERVER SENT OK
  184. CLIENT RCVD OK
  185. %#--------------------------------------------------------------------------------------------------------------