%description: Testing Ethernet communication on EtherBus with 10MBps. The network contains two hosts that communicate with each other. All hosts use EtherMAC implementation with half duplex mode. All hosts have same ethernet configurations. All hosts send requests and also reply to requests sent to them. checks: - the idle state of rx is less than or equals to 4% in all hosts - the utilization state of rx is more than or equals to 96% in all hosts %#-------------------------------------------------------------------------------------------------------------- %testprog: opp_run %#-------------------------------------------------------------------------------------------------------------- %file: test.ned import inet.linklayer.ethernet.EtherBus; import inet.node.ethernet.EtherHost; import ned.DatarateChannel; module EtherHostQ extends EtherHost { parameters: queueType = "DropTailQueue"; } // // Sample Ethernet LAN: hosts connected via bus // network SpeedTest { types: channel C10 extends DatarateChannel { delay = 0.1us; datarate = 10Mbps; } submodules: host_1_H_A: EtherHostQ { parameters: @display("p=70,70"); } host_1_H_B: EtherHostQ { parameters: @display("p=110,290"); } host_2_H_A: EtherHostQ { parameters: @display("p=150,70"); } host_2_H_B: EtherHostQ { parameters: @display("p=190,290"); } host_3_H_A: EtherHostQ { parameters: @display("p=230,70"); } host_3_H_B: EtherHostQ { parameters: @display("p=270,290"); } host_4_H_A: EtherHostQ { parameters: @display("p=310,70"); } host_4_H_B: EtherHostQ { parameters: @display("p=350,290"); } host_5_H_A: EtherHostQ { parameters: @display("p=390,70"); } host_5_H_B: EtherHostQ { parameters: @display("p=430,290"); } bus: EtherBus { parameters: positions = "10 20 30 40 50 60 70 80 90 100"; propagationSpeed = 2e8 mps; // 1us = 200m @display("p=250,180;b=400,6;o=#408060"); gates: ethg[10]; } connections: bus.ethg++ <--> C10 <--> host_1_H_A.ethg; bus.ethg++ <--> C10 <--> host_1_H_B.ethg; bus.ethg++ <--> C10 <--> host_2_H_A.ethg; bus.ethg++ <--> C10 <--> host_2_H_B.ethg; bus.ethg++ <--> C10 <--> host_3_H_A.ethg; bus.ethg++ <--> C10 <--> host_3_H_B.ethg; bus.ethg++ <--> C10 <--> host_4_H_A.ethg; bus.ethg++ <--> C10 <--> host_4_H_B.ethg; bus.ethg++ <--> C10 <--> host_5_H_A.ethg; bus.ethg++ <--> C10 <--> host_5_H_B.ethg; } %#-------------------------------------------------------------------------------------------------------------- %inifile: omnetpp.ini [General] sim-time-limit = 5s tkenv-plugin-path = ../../../etc/plugins #record-eventlog = true **.vector-recording = false network = SpeedTest *.host_1_H_A.cli.destAddress = "host_1_H_B" *.host_1_H_B.cli.destAddress = "host_1_H_A" *.host_2_H_A.cli.destAddress = "host_2_H_B" *.host_2_H_B.cli.destAddress = "host_2_H_A" *.host_3_H_A.cli.destAddress = "host_3_H_B" *.host_3_H_B.cli.destAddress = "host_3_H_A" *.host_4_H_A.cli.destAddress = "host_4_H_B" *.host_4_H_B.cli.destAddress = "host_4_H_A" *.host_5_H_A.cli.destAddress = "host_5_H_B" *.host_5_H_B.cli.destAddress = "host_5_H_A" **.cli.reqLength = 1250B # 10.000 bit **.cli.respLength = 1250B # 10.000 bit *.host_*_*.cli.startTime = 0s *.host_*_H_*.mac.duplexMode = false *.host_*_H_*.cli.sendInterval = 1ms # 10.000 / speed [ / nodecount, when halfduplex] **.mac.address = "auto" %#-------------------------------------------------------------------------------------------------------------- %postrun-command: Rscript check.r %#-------------------------------------------------------------------------------------------------------------- %file: check.r #!/usr/bin/env Rscript options(echo=FALSE) options(width=160) library("omnetpp", warn.conflicts=FALSE) #TEST parameters scafile <- 'results/General-#0.sca' linecount <- 10 idlelimit <- 4.0 usedlimit <- 96.0 # begin TEST: idle <- loadDataset(scafile, add(type='scalar', select='name("rx channel idle *")')) used <- loadDataset(scafile, add(type='scalar', select='name("rx channel utilization *")')) cat("\nOMNETPP TEST RESULT: ") if(length(idle$scalars$value) == linecount & max(idle$scalars$value) <= idlelimit) { cat("IDLE OK\n") } else { cat("IDLE BAD:\n") print(idle$scalars[idle$scalars$value > idlelimit,]) } cat("\nOMNETPP TEST RESULT: ") if(length(used$scalars$value) == linecount & min(used$scalars$value) >= usedlimit) { cat("USED OK\n") } else { cat("USED BAD:\n") print(used$scalars[used$scalars$value < usedlimit,]) } cat("\n") %#-------------------------------------------------------------------------------------------------------------- %contains: postrun-command(1).out OMNETPP TEST RESULT: IDLE OK OMNETPP TEST RESULT: USED OK %#--------------------------------------------------------------------------------------------------------------