EtherMACs_compare_twohosts_speed.test 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. %description:
  2. Testing Ethernet communication from a source host to a sink host on full duplex gigabit ethernet connection.
  3. The hosts have same ethernet configurations in pairs.
  4. variations:
  5. - queue: internal / external
  6. - implementation: EtherMAC / EtherMACFullDuplex
  7. compare results of variations and checks:
  8. - the number of sent packets are equals (one packet different is acceptable, because the first event of endtime is processed.)
  9. - the idle state of rx is smaller or equals than 2% in all sink hosts
  10. - the utilization state of rx is more tan or equals to 98% in all sink hosts
  11. %#--------------------------------------------------------------------------------------------------------------
  12. %testprog: opp_run
  13. %#--------------------------------------------------------------------------------------------------------------
  14. %file: test.ned
  15. import ned.DatarateChannel;
  16. import inet.node.ethernet.EtherHost;
  17. network CompareMACs
  18. {
  19. types:
  20. channel C extends DatarateChannel
  21. {
  22. delay = 0s;
  23. datarate = 1000Mbps;
  24. }
  25. submodules:
  26. host_iq_1_F_A: EtherHost {
  27. parameters:
  28. @display("p=70,70");
  29. }
  30. host_iq_1_F_B: EtherHost {
  31. parameters:
  32. @display("p=210,70");
  33. }
  34. host_eq_1_F_A: EtherHost {
  35. parameters:
  36. queueType = "DropTailQueue";
  37. @display("p=70,140");
  38. }
  39. host_eq_1_F_B: EtherHost {
  40. parameters:
  41. queueType = "DropTailQueue";
  42. @display("p=210,140");
  43. }
  44. host_iq_2_F_A: EtherHost {
  45. parameters:
  46. macType = "EtherMACFullDuplex";
  47. @display("p=70,210");
  48. }
  49. host_iq_2_F_B: EtherHost {
  50. parameters:
  51. macType = "EtherMACFullDuplex";
  52. @display("p=210,210");
  53. }
  54. host_eq_2_F_A: EtherHost {
  55. parameters:
  56. queueType = "DropTailQueue";
  57. macType = "EtherMACFullDuplex";
  58. @display("p=70,280");
  59. }
  60. host_eq_2_F_B: EtherHost {
  61. parameters:
  62. queueType = "DropTailQueue";
  63. macType = "EtherMACFullDuplex";
  64. @display("p=210,280");
  65. }
  66. connections:
  67. host_iq_1_F_A.ethg <--> C <--> host_iq_1_F_B.ethg;
  68. host_eq_1_F_A.ethg <--> C <--> host_eq_1_F_B.ethg;
  69. host_iq_2_F_A.ethg <--> C <--> host_iq_2_F_B.ethg;
  70. host_eq_2_F_A.ethg <--> C <--> host_eq_2_F_B.ethg;
  71. }
  72. %#--------------------------------------------------------------------------------------------------------------
  73. %inifile: omnetpp.ini
  74. [General]
  75. sim-time-limit = 1s
  76. tkenv-plugin-path = ../../../etc/plugins
  77. #record-eventlog = true
  78. **.vector-recording = false
  79. network = CompareMACs
  80. *.host_iq_1_F_A.cli.destAddress = "host_iq_1_F_B"
  81. *.host_iq_1_F_B.cli.destAddress = "host_iq_1_F_A"
  82. *.host_eq_1_F_A.cli.destAddress = "host_eq_1_F_B"
  83. *.host_eq_1_F_B.cli.destAddress = "host_eq_1_F_A"
  84. *.host_iq_2_F_A.cli.destAddress = "host_iq_2_F_B"
  85. *.host_iq_2_F_B.cli.destAddress = "host_iq_2_F_A"
  86. *.host_eq_2_F_A.cli.destAddress = "host_eq_2_F_B"
  87. *.host_eq_2_F_B.cli.destAddress = "host_eq_2_F_A"
  88. **.cli.reqLength = 1250B # 10.000 bit
  89. **.cli.respLength = 0B # no response
  90. *.host_*_A.cli.startTime = 0s
  91. *.host_*_B.cli.startTime = 10000s # out of simulation time
  92. *.host_*_F_*.mac.duplexMode = true
  93. *.host_*_F_*.cli.sendInterval = 0.009ms # 1000Mbps 10.000 / speed [ / 2 when halfduplex]
  94. **.mac.address = "auto"
  95. *.host_iq_*.mac.txQueueLimit = 100000
  96. *.host_eq_*.queue.dataQueue.frameCapacity = 100
  97. %#--------------------------------------------------------------------------------------------------------------
  98. %postrun-command: Rscript check.r
  99. %#--------------------------------------------------------------------------------------------------------------
  100. %file: check.r
  101. #!/usr/bin/env Rscript
  102. options(echo=FALSE)
  103. options(width=160)
  104. library("omnetpp", warn.conflicts=FALSE)
  105. #TEST parameters
  106. scafile <- 'results/General-#0.sca'
  107. linecount <- 4
  108. idlelimit <- 2.0
  109. usedlimit <- 98.0
  110. # begin TEST:
  111. dataset <- loadDataset(scafile)
  112. cat("\nOMNETPP TEST RESULT:\n")
  113. cat("\nCHECK SENT PACKETS:\n")
  114. x <- dataset$scalars[dataset$scalars$name == "sentPk:count",]
  115. xx <- x[grep("_F_A.cli$",x$module)==1,]
  116. if(length(xx$value) != linecount)
  117. {
  118. cat("LINECOUNT INCORRECT\n")
  119. print(xx)
  120. } else {
  121. cat("LINECOUNT CORRECT\n")
  122. # one packet different is acceptable, because the first event of endtime is processed.
  123. if( 1 >= (max(xx$value) - min(xx$value)))
  124. {
  125. cat("NUMBER OF SENT PACKETS ARE EQUALS\n")
  126. } else {
  127. cat("NUMBER OF SENT PACKETS ARE DIFFERS\n")
  128. print(xx)
  129. }
  130. }
  131. x <- dataset$scalars[grep("_F_B.mac$",dataset$scalars$module),]
  132. cat("\nCHECK RX CHANNEL IDLE RATES:\n")
  133. xx <- x[x$name == "rx channel idle (%)",]
  134. if(length(xx$value) != linecount)
  135. {
  136. cat("LINECOUNT INCORRECT\n")
  137. print(xx)
  138. } else {
  139. cat("LINECOUNT CORRECT\n")
  140. if(max(xx$value) <= idlelimit)
  141. {
  142. cat("IDLE OK\n")
  143. } else {
  144. cat("IDLE BAD:\n")
  145. print(xx[xx$value > idlelimit,])
  146. }
  147. }
  148. cat("\nCHECK RX CHANNEL UTILIZATION RATES:\n")
  149. xx <- x[x$name == "rx channel utilization (%)",]
  150. if(length(xx$value) != linecount)
  151. {
  152. cat("LINECOUNT INCORRECT\n")
  153. print(xx)
  154. } else {
  155. cat("LINECOUNT CORRECT\n")
  156. if(min(xx$value) >= usedlimit)
  157. {
  158. cat("USED OK\n")
  159. } else {
  160. cat("USED BAD:\n")
  161. print(xx[xx$value < usedlimit,])
  162. }
  163. }
  164. cat("\n")
  165. %#--------------------------------------------------------------------------------------------------------------
  166. %contains: postrun-command(1).out
  167. OMNETPP TEST RESULT:
  168. CHECK SENT PACKETS:
  169. LINECOUNT CORRECT
  170. NUMBER OF SENT PACKETS ARE EQUALS
  171. CHECK RX CHANNEL IDLE RATES:
  172. LINECOUNT CORRECT
  173. IDLE OK
  174. CHECK RX CHANNEL UTILIZATION RATES:
  175. LINECOUNT CORRECT
  176. USED OK
  177. %#--------------------------------------------------------------------------------------------------------------