tcp_sack_moreclients_speed_strict.test.off 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. ## tcp layer
  113. **.tcp.sackSupport = true
  114. # NIC configuration
  115. **.ppp[*].queueType = "DropTailQueue" # in routers
  116. **.ppp[*].queue.frameCapacity = 10
  117. #**.ppp[*].queue.frameCapacity = 100 # good:(13,15,16,18,19,21-25, 7) bad:(17,20)
  118. %#--------------------------------------------------------------------------------------------------------------
  119. %postrun-command: Rscript check.r
  120. %#--------------------------------------------------------------------------------------------------------------
  121. %file: check.r
  122. #!/usr/bin/env Rscript
  123. options(echo=FALSE)
  124. options(width=160)
  125. library("omnetpp", warn.conflicts=FALSE)
  126. #TEST parameters
  127. scafile <- 'results/General-#0.sca'
  128. cliPerSrv <- 3
  129. srvCount <- 3 * 3
  130. cliCount <- srvCount * cliPerSrv
  131. echoFactor <- 2
  132. cliSentBytes <- 10000000
  133. cliRcvdBytes <- cliSentBytes * echoFactor
  134. srvRcvdBytes <- cliPerSrv * cliSentBytes
  135. srvSentBytes <- srvRcvdBytes * echoFactor
  136. # begin TEST:
  137. dataset <- loadDataset(scafile)
  138. cat("\nOMNETPP TEST RESULT:\n")
  139. cli <- dataset$scalars[grep("\\.client\\[\\d\\]\\.tcpApp\\[\\d\\]$",dataset$scalars$module),]
  140. cliSent <- cli[cli$name == "bytesSent",]
  141. cliRcvd <- cli[cli$name == "bytesRcvd",]
  142. srv <- dataset$scalars[grep("\\.server\\.tcpApp\\[\\d\\]$",dataset$scalars$module),]
  143. srvSent <- srv[srv$name == "bytesSent",]
  144. srvRcvd <- srv[srv$name == "bytesRcvd",]
  145. cat("\nTCP SPEED TEST RESULT:\n")
  146. if(length(cliSent$value) == cliCount & min(cliSent$value) == cliSentBytes)
  147. {
  148. cat("CLIENT SENT OK\n")
  149. } else {
  150. cat("CLIENT SENT BAD:\n")
  151. cliSent$rate = cliSent$value*100/cliSentBytes
  152. print(cliSent[cliSent$value != cliSentBytes,])
  153. }
  154. if(length(srvRcvd$value) == srvCount & min(srvRcvd$value) == srvRcvdBytes)
  155. {
  156. cat("SERVER RCVD OK\n")
  157. } else {
  158. cat("SERVER RCVD BAD:\n")
  159. srvRcvd$rate = srvRcvd$value*100/srvRcvdBytes
  160. print(srvRcvd[srvRcvd$value != srvRcvdBytes,])
  161. }
  162. if(length(srvSent$value) == srvCount & min(srvSent$value) == srvSentBytes)
  163. {
  164. cat("SERVER SENT OK\n")
  165. } else {
  166. cat("SERVER SENT BAD:\n")
  167. srvSent$rate = srvSent$value*100/srvSentBytes
  168. print(srvSent[srvSent$value != srvSentBytes,])
  169. }
  170. if(length(cliRcvd$value) == cliCount & min(cliRcvd$value) == cliRcvdBytes)
  171. {
  172. cat("CLIENT RCVD OK\n")
  173. } else {
  174. cat("CLIENT RCVD BAD:\n")
  175. cliRcvd$rate = cliRcvd$value*100/cliRcvdBytes
  176. print(cliRcvd[cliRcvd$value != cliRcvdBytes,])
  177. }
  178. cat("\n")
  179. %#--------------------------------------------------------------------------------------------------------------
  180. %contains: postrun-command(1).out
  181. OMNETPP TEST RESULT:
  182. TCP SPEED TEST RESULT:
  183. CLIENT SENT OK
  184. SERVER RCVD OK
  185. SERVER SENT OK
  186. CLIENT RCVD OK
  187. %#--------------------------------------------------------------------------------------------------------------