├── .cproject ├── .gitignore ├── .nedexclusions ├── .nedfolders ├── .oppbuildspec ├── .oppfeaturestate ├── .project ├── .settings ├── language.settings.xml ├── org.eclipse.cdt.codan.core.prefs └── org.eclipse.ltk.core.refactoring.prefs ├── Makefile ├── README.md ├── makemakefiles ├── simulations ├── .qtenvrc ├── Makefile ├── detnetmod ├── detnetmod_dbg ├── experiments │ ├── .qtenvrc │ ├── DetnetTestScenario.ini │ ├── DetnetTestScenario.ned │ ├── DetnetTestScenarioAttack.ned │ ├── DetnetTestScenarioAttackLB.ned │ ├── General.anf │ ├── NestingTestScenario.ned │ ├── NestingTestScenarioAttack.ned │ ├── frame_preemption_detnet_attack_mfd.ini │ ├── frame_preemption_detnet_attack_mfd │ │ ├── frame_preemption_detnet_attack_mfd_forwarding.xml │ │ └── frame_preemption_detnet_attack_mfd_schedule.xml │ ├── frame_preemption_detnet_mfd.ini │ ├── frame_preemption_detnet_mfd │ │ ├── frame_preemption_detnet_mfd_forwarding.xml │ │ └── frame_preemption_detnet_mfd_schedule.xml │ ├── frame_preemption_nesting.ini │ ├── frame_preemption_nesting_attack.ini │ ├── gating_detnet_attack_mfd.ini │ ├── gating_detnet_attack_mfd │ │ ├── gating_detnet_attack_mfd_forwarding.xml │ │ └── gating_detnet_attack_mfd_schedule.xml │ ├── gating_detnet_mfd.ini │ ├── gating_detnet_mfd │ │ ├── gating_detnet_mfd_forwarding.xml │ │ └── gating_detnet_mfd_schedule.xml │ ├── gating_lb_detnet_attack_mfd.ini │ ├── gating_lb_detnet_attack_mfd │ │ ├── gating_lb_detnet_attack_mfd_forwarding.xml │ │ └── gating_lb_detnet_attack_mfd_schedule.xml │ ├── gating_nesting.ini │ ├── gating_nesting_attack.ini │ ├── strict_priority_detnet_attack_mfd.ini │ ├── strict_priority_detnet_attack_mfd │ │ ├── strict_priority_detnet_attack_mfd_forwarding.xml │ │ └── strict_priority_detnet_attack_mfd_schedule.xml │ ├── strict_priority_detnet_mfd.ini │ ├── strict_priority_detnet_mfd │ │ ├── strict_priority_detnet_mfd_forwarding.xml │ │ └── strict_priority_detnet_mfd_schedule.xml │ ├── strict_priority_nesting.ini │ ├── strict_priority_nesting_attack.ini │ └── xml │ │ ├── 01_SanityCheck_Schedule.xml │ │ ├── TestScenarioRouting1.xml │ │ ├── TestScenarioRouting2.xml │ │ ├── TestScenarioRouting5.xml │ │ ├── TestScenarioSchedule1.xml │ │ ├── TestScenarioScheduleSwap.xml │ │ ├── TestScenarioSchedule_AllOpen.xml │ │ ├── TestScenarioSchedule_AllOpen5.xml │ │ ├── TestScenarioSchedule_GatingOn.xml │ │ ├── ipassign.xml │ │ ├── multicast_example │ │ └── t.xml ├── experiments_l3 │ ├── .qtenvrc │ ├── DetnetTestScenarioAttackDiffserv.ned │ ├── General.anf │ ├── TCA.ned │ ├── activeflows_test │ │ ├── .qtenvrc │ │ ├── configPaper.xml │ │ ├── filtersPaper.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ned │ │ ├── paper2.ini │ │ └── schedule.xml │ ├── config.xml │ ├── configPaper.xml │ ├── dens_sc1 │ │ ├── .qtenvrc │ │ ├── configPaper.xml │ │ ├── filtersPaper.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ini │ │ ├── paper.ned │ │ └── schedule.xml │ ├── dens_sc2 │ │ ├── .cmdenv-log │ │ ├── .qtenvrc │ │ ├── General.anf │ │ ├── cmd.sh │ │ ├── configPaper.xml │ │ ├── configPaperbk.xml │ │ ├── filtersPaper.xml │ │ ├── filtersPaperCQF.xml │ │ ├── filtersPaperbk.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ini │ │ ├── paper.ned │ │ ├── paper2.ini │ │ ├── paper3.ini │ │ ├── paper_cqf.ini │ │ ├── papertrial.ini │ │ ├── papertrial.ned │ │ ├── schedule.xml │ │ ├── scheduleCQF.xml │ │ └── schedulebk.xml │ ├── filters.xml │ ├── filtersPaper.xml │ ├── frame_preemption_detnet_attack_mfd.ini │ ├── frame_preemption_detnet_attack_mfd_forwarding.xml │ ├── frame_preemption_detnet_attack_mfd_schedule.xml │ ├── method │ │ ├── .qtenvrc │ │ ├── General.anf │ │ ├── configPaper.xml │ │ ├── filtersPaper.xml │ │ ├── forwardingDummy.xml │ │ ├── method.ini │ │ ├── method.ned │ │ └── schedule.xml │ ├── nesting_sc1 │ │ ├── configPaper.xml │ │ ├── filtersPaper.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ini │ │ ├── paper.ned │ │ └── schedule.xml │ ├── nesting_sc2 │ │ ├── .cmdenv-log │ │ ├── .qtenvrc │ │ ├── General.anf │ │ ├── cmd.sh │ │ ├── configPaper.xml │ │ ├── filtersPaper.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ned │ │ ├── paper2.ini │ │ ├── paper3.ini │ │ ├── papertrial.ini │ │ └── schedule.xml │ ├── paper.ini │ ├── paper.ned │ ├── performance_evaluation │ │ ├── .cmdenv-log │ │ ├── .qtenvrc │ │ ├── cmd.sh │ │ ├── configPaper.xml │ │ ├── configPaperbk.xml │ │ ├── filtersPaper.xml │ │ ├── filtersPaperbk.xml │ │ ├── forwardingDummy.xml │ │ ├── paper.ini │ │ ├── paper.ned │ │ ├── paper2.ini │ │ ├── paper3.ini │ │ ├── schedule.xml │ │ └── schedulebk.xml │ └── schedule.xml ├── omnetpp.ini ├── package.ned └── test │ ├── .qtenvrc │ ├── 01_example_strict_priority.ini │ ├── 01_example_strict_priority2.ini │ ├── 01_example_strict_priority3.ini │ ├── 01_example_strict_priority4.ini │ ├── 01_example_strict_priority5.ini │ ├── TestScenario.ned │ ├── TestScenariodetnet1.ned │ ├── TestScenariodetnet3.ned │ ├── TestScenariodetnet5.ned │ ├── TestScenarionesting.ned │ ├── TestScenarionesting1.ned │ ├── t.ini │ └── xml │ ├── 01_SanityCheck_Schedule.xml │ ├── TestScenarioRouting1.xml │ ├── TestScenarioRouting2.xml │ ├── TestScenarioRouting5.xml │ ├── TestScenarioSchedule1.xml │ ├── TestScenarioScheduleSwap.xml │ ├── TestScenarioSchedule_AllOpen.xml │ ├── TestScenarioSchedule_AllOpen5.xml │ ├── TestScenarioSchedule_GatingOn.xml │ ├── multicast_example │ └── t.xml └── src ├── Makefile ├── detnetmod ├── applications │ ├── IApplication.ned │ ├── SetKind.cc │ ├── SetKind.h │ ├── SetKind.ned │ ├── SetKindNetPerf.cc │ ├── SetKindNetPerf.h │ ├── SetKindNetPerf.ned │ ├── UdpBasicAppRandomScheduled.cc │ ├── UdpBasicAppRandomScheduled.h │ ├── UdpBasicAppRandomScheduled.ned │ ├── UdpBasicAppTest.cc │ ├── UdpBasicAppTest.h │ ├── UdpBasicAppTest.ned │ ├── UdpSink.cc │ ├── UdpSink.h │ ├── UdpSink.ned │ ├── UdpVlantraffic.ned │ ├── VlanEtherTrafGenFullLoadDetnet.cc │ ├── VlanEtherTrafGenFullLoadDetnet.h │ ├── VlanEtherTrafGenFullLoadDetnet.ned │ ├── VlanEtherTrafGenSchedDetnet.cc │ ├── VlanEtherTrafGenSchedDetnet.h │ └── VlanEtherTrafGenSchedDetnet.ned ├── dropper │ ├── dropper.ned │ ├── mfd.cc │ ├── mfd.h │ ├── mfd.ned │ ├── red.cc │ ├── red.h │ └── red.ned ├── ethernetInterface │ ├── DetnetVlanEthernetInterfaceSwitchPreemptable.ned │ ├── EtherMACFullDuplexPreemptableMod.ned │ ├── detnetFw.ned │ ├── detnetFwHost.ned │ ├── detnetStandardSwitch.ned │ ├── detnetSwitch.ned │ └── queuingDetnet.ned ├── ieee8021q │ ├── Ieee8021q.h │ ├── relay │ │ ├── macrelay.cc │ │ ├── macrelay.h │ │ └── macrelay.ned │ └── tunnel8021q │ │ ├── DetnetVlanInterface.ned │ │ ├── tunnel8021q.cc │ │ ├── tunnel8021q.h │ │ └── tunnel8021q.ned ├── linklayer │ ├── common │ │ ├── Ieee8021QCtrl.h │ │ ├── VLANTag.msg │ │ ├── VLANTag_m.cc │ │ └── VLANTag_m.h │ └── ethernet │ │ ├── VLAN8021qEncap.cc │ │ ├── VLAN8021qEncap.h │ │ └── VLAN8021qEncap.ned ├── networklayer │ ├── DetnetRouter.ned │ └── diffserv │ │ ├── DumbTC.ned │ │ ├── DummyTC.cc │ │ ├── DummyTC.h │ │ ├── DummyTC.ned │ │ ├── FrameForward.cc │ │ ├── FrameForward.h │ │ ├── FrameForward.ned │ │ ├── PFPC.ned │ │ ├── PcpMarker.cc │ │ ├── PcpMarker.h │ │ ├── PcpMarker.ned │ │ ├── TokenBucketClass.cc │ │ ├── TokenBucketClass.h │ │ ├── detnetDiffserv.ned │ │ └── diffservPCP.ned ├── node │ ├── .ned │ ├── DetnetEtherHost.ned │ ├── DetnetEtherSwitch.ned │ ├── VlanEtherHostFullLoadDetnet.ned │ ├── VlanEtherHostSchedDetnet.ned │ ├── base │ │ ├── ApplicationLayerNodeBase.ned │ │ ├── ChangeLog │ │ ├── LinkLayerNodeBase.ned │ │ ├── NetPerfDetnet.ned │ │ ├── NetworkLayerNodeBase.ned │ │ ├── NodeBase.ned │ │ └── TransportLayerNodeBase.ned │ └── detnethost.ned └── queuing │ ├── DetnetQueuingFrames.cc │ ├── DetnetQueuingFrames.h │ ├── DetnetQueuingFrames.ned │ ├── PifoDetnet.cc │ ├── PifoDetnet.h │ ├── PifoDetnet.ned │ ├── QueueDetnet.cc │ ├── QueueDetnet.h │ └── QueueDetnet.ned ├── documentation.svg ├── package.ned └── version.svg /.gitignore: -------------------------------------------------------------------------------- 1 | /.computed/ 2 | out/ 3 | *.so 4 | *.pcap 5 | *.csv 6 | *.sca 7 | *.vec 8 | *.vci 9 | *.elog 10 | *.txt 11 | *.log 12 | *.o 13 | *.o.d 14 | *.dat 15 | -------------------------------------------------------------------------------- /.nedexclusions: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/.nedexclusions -------------------------------------------------------------------------------- /.nedfolders: -------------------------------------------------------------------------------- 1 | src 2 | simulations 3 | -------------------------------------------------------------------------------- /.oppbuildspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.oppfeaturestate: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | detnetmod 4 | 5 | 6 | inet 7 | nesting 8 | 9 | 10 | 11 | org.omnetpp.cdt.MakefileBuilder 12 | 13 | 14 | 15 | 16 | org.omnetpp.scave.builder.vectorfileindexer 17 | 18 | 19 | 20 | 21 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 22 | clean,full,incremental, 23 | 24 | 25 | 26 | 27 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 28 | full,incremental, 29 | 30 | 31 | 32 | 33 | 34 | org.eclipse.cdt.core.cnature 35 | org.eclipse.cdt.core.ccnature 36 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 37 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 38 | org.omnetpp.main.omnetppnature 39 | 40 | 41 | -------------------------------------------------------------------------------- /.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ### 2 | # Location of INET project directory (relative to './src/' and './simulations/'): 3 | # 4 | INET ?= ../../inet 5 | NESTING ?= ./../nesting 6 | # 7 | ### 8 | 9 | .PHONY: all clean cleanall makefiles checkmakefiles 10 | 11 | all: checkmakefiles 12 | cd src && $(MAKE) 13 | cd simulations && $(MAKE) 14 | 15 | clean: checkmakefiles 16 | cd src && $(MAKE) clean 17 | cd simulations && $(MAKE) clean 18 | 19 | cleanall: checkmakefiles 20 | @cd src && $(MAKE) MODE=release clean 21 | @cd src && $(MAKE) MODE=debug clean 22 | @rm -f src/Makefile 23 | @cd simulations && $(MAKE) MODE=release clean 24 | @cd simulations && $(MAKE) MODE=debug clean 25 | @rm -f simulations/Makefile 26 | 27 | ### 28 | # Command line arguments for 'opp_makemake' generated by IDE using meta flags 29 | # '--meta:use-exported-include-paths' 30 | # '--meta:use-exported-libs' 31 | # for correct resolution of INET dependencies (cf. '.oppbuildspec'): 32 | # 33 | #MAKEMAKE_OPTIONS = -f --deep -o detnetmod -O out -KINET_PROJ=$(INET) -DINET_IMPORT -I'$$(INET_PROJ)/src' -L'$$(INET_PROJ)/src' -l'INET$$(D)' 34 | MAKEMAKE_OPTIONS = -f --deep -o detnetmod -O out -KINET_PROJ=../../inet -KNESTING_PROJ=../../nesting -DINET_IMPORT -I$$\(INET_PROJ\)/src -I$$\(NESTING_PROJ\)/simulations -I$$\(NESTING_PROJ\)/src -L$$\(INET_PROJ\)/src -L$$\(NESTING_PROJ\)/src -L../out/$$\(CONFIGNAME\)/src -lINET$$\(D\) -lnesting$$\(D\) 35 | # 36 | ### 37 | 38 | makefiles: 39 | @cd src && opp_makemake --make-so $(MAKEMAKE_OPTIONS) 40 | @cd simulations && opp_makemake $(MAKEMAKE_OPTIONS) 41 | 42 | checkmakefiles: 43 | @if [ ! -f src/Makefile -o ! -f simulations/Makefile ]; then \ 44 | echo; \ 45 | echo ' ---------------------------------------------------------'; \ 46 | echo '| Makefiles in "src/" and/or "simulations/" do not exist. |'; \ 47 | echo '| Please use "make makefiles" to generate them! |'; \ 48 | echo ' ---------------------------------------------------------'; \ 49 | echo; \ 50 | exit 1; \ 51 | fi 52 | -------------------------------------------------------------------------------- /makemakefiles: -------------------------------------------------------------------------------- 1 | # 2 | # Usage: 3 | # make -f makemakefiles 4 | # or, for Microsoft Visual C++: 5 | # nmake -f makemakefiles MMOPT=-n 6 | # 7 | 8 | MAKEMAKE=opp_makemake $(MMOPT) 9 | 10 | INET_PROJ=../inet 11 | NESTING_PROJ=../nesting 12 | 13 | all: 14 | cd src && $(MAKEMAKE) --make-so -f --deep -KINET_PROJ=../../inet -KNESTING_PROJ=../../nesting -DINET_IMPORT -I$$\(INET_PROJ\)/src -L$$\(INET_PROJ\)/src -L$$\(NESTING_PROJ\)/src -lINET$$\(D\) -lnesting$$\(D\) 15 | -------------------------------------------------------------------------------- /simulations/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=1 12 | -------------------------------------------------------------------------------- /simulations/detnetmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/simulations/detnetmod -------------------------------------------------------------------------------- /simulations/detnetmod_dbg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/simulations/detnetmod_dbg -------------------------------------------------------------------------------- /simulations/experiments/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=9.120108393559097 12 | -------------------------------------------------------------------------------- /simulations/experiments/General.anf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /simulations/experiments/frame_preemption_detnet_attack_mfd/frame_preemption_detnet_attack_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments/frame_preemption_detnet_attack_mfd/frame_preemption_detnet_attack_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 15us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 3.5us 30 | 31 | 32 | 2us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 100us 46 | 11111111 47 | 48 | 49 | 50 | 51 | 100us 52 | 53 | 54 | 55 | 100us 56 | 11111111 57 | 58 | 59 | 60 | 61 | 100us 62 | 63 | 64 | 65 | 100us 66 | 11111111 67 | 68 | 69 | 70 | 71 | 100us 72 | 73 | 74 | 75 | 100us 76 | 11111111 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /simulations/experiments/frame_preemption_detnet_mfd/frame_preemption_detnet_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/frame_preemption_detnet_mfd/frame_preemption_detnet_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 15us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 100us 30 | 31 | 32 | 5us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 100us 46 | 11111111 47 | 48 | 49 | 50 | 51 | 100us 52 | 53 | 54 | 55 | 100us 56 | 11111111 57 | 58 | 59 | 60 | 61 | 100us 62 | 63 | 64 | 65 | 100us 66 | 11111111 67 | 68 | 69 | 70 | 71 | 100us 72 | 73 | 74 | 75 | 100us 76 | 11111111 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /simulations/experiments/gating_detnet_attack_mfd/gating_detnet_attack_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/gating_detnet_attack_mfd/gating_detnet_attack_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 15us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 12us 30 | 31 | 32 | 5us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 50us 46 | 00000001 47 | 48 | 49 | 50us 50 | 11111110 51 | 52 | 53 | 54 | 55 | 100us 56 | 57 | 58 | 59 | 50us 60 | 00000001 61 | 62 | 63 | 50us 64 | 11111110 65 | 66 | 67 | 68 | 69 | 70 | 50us 71 | 00000001 72 | 73 | 74 | 50us 75 | 11111110 76 | 77 | 78 | 79 | 80 | 81 | 50us 82 | 00000001 83 | 84 | 85 | 50us 86 | 11111110 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /simulations/experiments/gating_detnet_mfd/gating_detnet_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/gating_detnet_mfd/gating_detnet_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 5us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 100us 30 | 31 | 32 | 15us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 50us 46 | 00000001 47 | 48 | 49 | 50us 50 | 11111110 51 | 52 | 53 | 54 | 55 | 100us 56 | 57 | 58 | 59 | 50us 60 | 00000001 61 | 62 | 63 | 50us 64 | 11111110 65 | 66 | 67 | 68 | 69 | 70 | 50us 71 | 00000001 72 | 73 | 74 | 50us 75 | 11111110 76 | 77 | 78 | 79 | 80 | 81 | 50us 82 | 00000001 83 | 84 | 85 | 50us 86 | 11111110 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /simulations/experiments/gating_lb_detnet_attack_mfd/gating_lb_detnet_attack_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /simulations/experiments/strict_priority_detnet_attack_mfd/strict_priority_detnet_attack_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/strict_priority_detnet_attack_mfd/strict_priority_detnet_attack_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 15us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 12us 30 | 31 | 32 | 5us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 100us 46 | 11111111 47 | 48 | 49 | 50 | 51 | 100us 52 | 53 | 54 | 55 | 100us 56 | 11111111 57 | 58 | 59 | 60 | 61 | 100us 62 | 63 | 64 | 65 | 100us 66 | 11111111 67 | 68 | 69 | 70 | 71 | 100us 72 | 73 | 74 | 75 | 100us 76 | 11111111 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /simulations/experiments/strict_priority_detnet_mfd/strict_priority_detnet_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/strict_priority_detnet_mfd/strict_priority_detnet_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 5us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 100us 30 | 31 | 32 | 15us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 100us 46 | 11111111 47 | 48 | 49 | 50 | 51 | 100us 52 | 53 | 54 | 55 | 100us 56 | 11111111 57 | 58 | 59 | 60 | 61 | 100us 62 | 63 | 64 | 65 | 100us 66 | 11111111 67 | 68 | 69 | 70 | 71 | 100us 72 | 73 | 74 | 75 | 100us 76 | 11111111 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /simulations/experiments/xml/01_SanityCheck_Schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10us 4 | 5 | 40us 6 | 7 | 0us 8 | 7 9 | 00:00:00:00:00:06 10 | 354 11 | 12 | 13 | 14 | 400us 15 | 16 | 17 | 400us 18 | 11111111 19 | 20 | 21 | 22 | 23 | 400us 24 | 25 | 26 | 400us 27 | 11111111 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioRouting1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioRouting2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioRouting5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioSchedule1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 20us 8 | 7 9 | 00:00:00:00:00:04 10 | 1400 11 | 12 | 13 | 14 | 400us 15 | 16 | 17 | 400us 18 | 11111111 19 | 20 | 21 | 22 | 23 | 400us 24 | 25 | 26 | 400us 27 | 11111111 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioScheduleSwap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 500 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioSchedule_AllOpen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:04 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 20 | 400us 21 | 11111111 22 | 23 | 24 | 25 | 26 | 400us 27 | 28 | 29 | 30 | 400us 31 | 11111111 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioSchedule_AllOpen5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:06 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 10us 20 | 7 21 | 00:00:00:00:00:07 22 | 23 | 354 24 | 25 | 26 | 27 | 400us 28 | 29 | 30 | 10us 31 | 7 32 | 00:00:00:00:00:08 33 | 34 | 354 35 | 36 | 37 | 38 | 400us 39 | 40 | 41 | 42 | 400us 43 | 11111111 44 | 45 | 46 | 47 | 48 | 400us 49 | 50 | 51 | 52 | 400us 53 | 11111111 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /simulations/experiments/xml/TestScenarioSchedule_GatingOn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:04 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 20 | 200us 21 | 00000001 22 | 23 | 24 | 25 | 200us 26 | 11111110 27 | 28 | 29 | 30 | 31 | 400us 32 | 33 | 34 | 35 | 200us 36 | 00000001 37 | 38 | 39 | 40 | 200us 41 | 11111110 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /simulations/experiments/xml/ipassign.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /simulations/experiments/xml/t.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simulations/experiments_l3/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=4677.351412871981 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=1.8197008586099834 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/General.anf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /simulations/experiments_l3/TCA.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2012 Opensim Ltd. 3 | // Author: Tamas Borbely 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | 20 | package detnetmod.simulations.experiments_l3; 21 | 22 | import detnetmod.detnetmod.networklayer.diffserv.FrameForward; 23 | import inet.linklayer.contract.ITrafficConditioner; 24 | import inet.linklayer.ethernet.EtherEncap; 25 | import inet.networklayer.diffserv.DscpMarker; 26 | import inet.networklayer.diffserv.MultiFieldClassifier; 27 | 28 | 29 | // 30 | // Traffic conditioner used in Experiments 1.1-1.6 and 5.1. 31 | // 32 | module TCA like ITrafficConditioner 33 | { 34 | parameters: 35 | int numClasses; 36 | string interfaceTableModule; 37 | @display("i=block/classifier;bgb=598,497"); 38 | *.interfaceTableModule = default(absPath(interfaceTableModule)); 39 | string fcsMode @enum("declared","computed") = default("declared"); 40 | *.fcsMode = fcsMode; 41 | bool bind = default(false); 42 | gates: 43 | input in; 44 | output out; 45 | submodules: 46 | classifier: MultiFieldClassifier { 47 | @display("p=265,161"); 48 | } 49 | marker: DscpMarker { 50 | @display("p=265,274"); 51 | } 52 | frameForward: FrameForward if bind{ 53 | @display("p=323,387"); 54 | } 55 | connections: 56 | for i=1..numClasses { 57 | classifier.outs++ --> marker.in++; 58 | } 59 | classifier.defaultOut --> marker.in++; 60 | marker.out --> frameForward.lowerLayerIn if bind; 61 | in --> classifier.in; 62 | frameForward.upperLayerOut --> out if bind; 63 | marker.out --> out if !bind; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=1 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/paper.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.simulations.experiments_l3.activeflows_test; 17 | 18 | import detnetmod.detnetmod.ethernetInterface.detnetStandardSwitch; 19 | 20 | import detnetmod.detnetmod.ethernetInterface.detnetSwitch; 21 | import detnetmod.detnetmod.networklayer.DetnetRouter; 22 | import detnetmod.detnetmod.node.DetnetEtherSwitch; 23 | import detnetmod.detnetmod.node.VlanEtherHostSchedDetnet; 24 | import detnetmod.detnetmod.node.VlanEtherHostFullLoadDetnet; 25 | 26 | import detnetmod.detnetmod.node.DetnetHost; 27 | import inet.examples.inet.ipv4hook.MyHost; 28 | import inet.linklayer.vlan.VlanInterface; 29 | import inet.networklayer.arp.ipv4.GlobalArp; 30 | import inet.networklayer.configurator.ipv4.Ipv4FlatNetworkConfigurator; 31 | import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator; 32 | import inet.networklayer.flooding.Flooding; 33 | import inet.node.inet.Router; 34 | import inet.node.inet.StandardHost; 35 | import ned.DatarateChannel; 36 | import nesting.node.ethernet.VlanEtherSwitchPreemptable; 37 | import nesting.node.ethernet.VlanEtherHostSched; 38 | import nesting.node.ethernet.VlanEtherHostFullLoad; 39 | import nesting.node.ethernet.VlanEtherHostQ; 40 | 41 | 42 | network paper 43 | { 44 | @display("bgb=1623.0988,1000.65875"); 45 | types: 46 | channel C0 extends DatarateChannel 47 | { 48 | delay = 0.1us; 49 | datarate = 1Gbps; 50 | } 51 | channel C1 extends DatarateChannel 52 | { 53 | delay = 0.1us; 54 | datarate = 10Gbps; 55 | } 56 | channel C2 extends DatarateChannel 57 | { 58 | delay = 0.1us; 59 | datarate = 10Gbps; 60 | } 61 | submodules: 62 | host: DetnetHost { 63 | @display("p=313.1975,262.35376,m,4,150,100;is=l"); 64 | } 65 | sink: DetnetHost { 66 | @display("p=1110.4275,325.4,m,4,150,100;is=l"); 67 | } 68 | configurator: Ipv4NetworkConfigurator { 69 | @display("p=797.23,242.01625;is=s"); 70 | } 71 | routerA: DetnetRouter { 72 | parameters: 73 | numEthInterfaces = 2; 74 | @display("p=681.3062,492.16748;is=l"); 75 | } 76 | connections: 77 | host.ethg[0] <--> C1 <--> routerA.ethg++; 78 | sink.ethg[0] <--> C0 <--> routerA.ethg++; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /simulations/experiments_l3/activeflows_test/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 11111111 11 | 12 | 13 | 14 | 150us 15 | 11111111 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /simulations/experiments_l3/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc1/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=24.547089156850298 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc1/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc1/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc1/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc1/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 50us 15 | 11111110 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/.cmdenv-log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/simulations/experiments_l3/dens_sc2/.cmdenv-log -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1e+6 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=24.547089156850298 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/General.anf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/cmd.sh: -------------------------------------------------------------------------------- 1 | ../../detnetmod -r 0 -m -u Cmdenv -n ../../../src:../..:../../../../inet/src:../../../../inet/examples:../../../../inet/tutorials:../../../../inet/showcases:../../../../nesting/simulations:../../../../nesting/src --image-path=../../../../inet/images -l ../../../src/detnetmod -l ../../../../inet/src/INET -l ../../../../nesting/src/nesting $1 2 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/configPaperbk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/filtersPaperCQF.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/filtersPaperbk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 200us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/dens_sc2/schedulebk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/filters.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /simulations/experiments_l3/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /simulations/experiments_l3/frame_preemption_detnet_attack_mfd_forwarding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /simulations/experiments_l3/frame_preemption_detnet_attack_mfd_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 15us 9 | 7 10 | 1 11 | 00:00:00:00:00:06 12 | 13 | 350 14 | 15 | 16 | 17 | 100us 18 | 19 | 20 | 10us 21 | 7 22 | 2 23 | 00:00:00:00:00:07 24 | 25 | 350 26 | 27 | 28 | 29 | 3.5us 30 | 31 | 32 | 2us 33 | 7 34 | 3 35 | 00:00:00:00:00:08 36 | 37 | 350 38 | 39 | 40 | 41 | 100us 42 | 43 | 44 | 45 | 100us 46 | 11111111 47 | 48 | 49 | 50 | 51 | 100us 52 | 53 | 54 | 55 | 100us 56 | 11111111 57 | 58 | 59 | 60 | 61 | 100us 62 | 63 | 64 | 65 | 100us 66 | 11111111 67 | 68 | 69 | 70 | 71 | 100us 72 | 73 | 74 | 75 | 100us 76 | 11111111 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=1 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/General.anf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/method/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc1/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc1/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc1/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc1/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 50us 15 | 11111110 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/.cmdenv-log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/simulations/experiments_l3/nesting_sc2/.cmdenv-log -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=19.498445997580454 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/General.anf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/cmd.sh: -------------------------------------------------------------------------------- 1 | ../../detnetmod -r 0 -m -u Cmdenv -n ../../../src:../..:../../../../inet/src:../../../../inet/examples:../../../../inet/tutorials:../../../../inet/showcases:../../../../nesting/simulations:../../../../nesting/src --image-path=../../../../inet/images -l ../../../src/detnetmod -l ../../../../inet/src/INET -l ../../../../nesting/src/nesting $1 2 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/nesting_sc2/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/.cmdenv-log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vamsiDT/DeNS/5c0cec2e029d5cd5fb792a8128fd650c353543aa/simulations/experiments_l3/performance_evaluation/.cmdenv-log -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1e+6 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=15.848931924611133 12 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/cmd.sh: -------------------------------------------------------------------------------- 1 | ../../detnetmod -r 0 -m -u Cmdenv -n ../../../src:../..:../../../../inet/src:../../../../inet/examples:../../../../inet/tutorials:../../../../inet/showcases:../../../../nesting/simulations:../../../../nesting/src --image-path=../../../../inet/images -l ../../../src/detnetmod -l ../../../../inet/src/INET -l ../../../../nesting/src/nesting $1 2 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/configPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/configPaperbk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/filtersPaper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/filtersPaperbk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/forwardingDummy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/performance_evaluation/schedulebk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 200us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 150us 15 | 11111110 16 | 17 | 18 | 19 | 20 | 200us 21 | 22 | 23 | 24 | 50us 25 | 00000001 26 | 27 | 28 | 29 | 150us 30 | 11111110 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /simulations/experiments_l3/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 100us 4 | 5 | 100us 6 | 7 | 8 | 9 | 50us 10 | 00000001 11 | 12 | 13 | 14 | 50us 15 | 11111110 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /simulations/omnetpp.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | network = SourceSink 3 | cpu-time-limit = 60s 4 | #debug-on-errors = true 5 | -------------------------------------------------------------------------------- /simulations/package.ned: -------------------------------------------------------------------------------- 1 | // designate the NED package of this folder 2 | package detnetmod.simulations; 3 | 4 | @license(LGPL); 5 | -------------------------------------------------------------------------------- /simulations/test/.qtenvrc: -------------------------------------------------------------------------------- 1 | [RunModeProfiles] 2 | fast-max-animation-speed=nan 3 | fast-max-playback-speed=1e+6 4 | fast-min-animation-speed=nan 5 | fast-min-playback-speed=1 6 | fast-playback-speed=1000 7 | run-max-animation-speed=nan 8 | run-max-playback-speed=100 9 | run-min-animation-speed=nan 10 | run-min-playback-speed=0.01 11 | run-playback-speed=9.120108393559097 12 | -------------------------------------------------------------------------------- /simulations/test/TestScenario.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.simulations.test; 17 | 18 | import detnetmod.detnetmod.ethernetInterface.detnetSwitch; 19 | import ned.DatarateChannel; 20 | import nesting.node.ethernet.VlanEtherSwitchPreemptable; 21 | import nesting.node.ethernet.VlanEtherHostSched; 22 | import nesting.node.ethernet.VlanEtherHostFullLoad; 23 | import nesting.node.ethernet.VlanEtherHostQ; 24 | 25 | 26 | network TestScenario 27 | { 28 | types: 29 | channel C extends DatarateChannel 30 | { 31 | delay = 0.1us; 32 | datarate = 1Gbps; 33 | } 34 | submodules: 35 | switchA: detnetSwitch { 36 | parameters: 37 | @display("p=188,127"); 38 | gates: 39 | ethg[4]; 40 | } 41 | switchB: VlanEtherSwitchPreemptable { 42 | parameters: 43 | @display("p=327,127"); 44 | gates: 45 | ethg[3]; 46 | } 47 | workstation1: VlanEtherHostFullLoad { 48 | @display("p=79,62"); 49 | } 50 | workstation2: VlanEtherHostFullLoad { 51 | @display("p=172,29"); 52 | } 53 | backupServer: VlanEtherHostQ { 54 | @display("p=446,54"); 55 | } 56 | robotController: VlanEtherHostSched { 57 | @display("p=79,202"); 58 | } 59 | roboticArm: VlanEtherHostQ { 60 | @display("p=440,202"); 61 | } 62 | connections: 63 | robotController.ethg <--> C <--> switchA.ethg[0]; 64 | workstation1.ethg <--> C <--> switchA.ethg[1]; 65 | workstation2.ethg <--> C <--> switchA.ethg[2]; 66 | 67 | roboticArm.ethg <--> C <--> switchB.ethg[0]; 68 | backupServer.ethg <--> C <--> switchB.ethg[1]; 69 | 70 | switchA.ethg[3] <--> C <--> switchB.ethg[2]; 71 | } 72 | -------------------------------------------------------------------------------- /simulations/test/TestScenariodetnet1.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.simulations.test; 17 | 18 | import detnetmod.detnetmod.ethernetInterface.detnetSwitch; 19 | import inet.networklayer.flooding.Flooding; 20 | import inet.node.ethernet.EtherSwitch; 21 | import inet.node.inet.Router; 22 | import ned.DatarateChannel; 23 | import nesting.node.ethernet.VlanEtherSwitchPreemptable; 24 | import nesting.node.ethernet.VlanEtherHostSched; 25 | import nesting.node.ethernet.VlanEtherHostFullLoad; 26 | import nesting.node.ethernet.VlanEtherHostQ; 27 | 28 | 29 | network TestScenariodetnet1 30 | { 31 | @display("bgb=922,513"); 32 | types: 33 | channel C extends DatarateChannel 34 | { 35 | delay = 0.1us; 36 | datarate = 1Gbps; 37 | } 38 | submodules: 39 | switchA: detnetSwitch { 40 | parameters: 41 | @display("p=165,121"); 42 | gates: 43 | ethg[4]; 44 | } 45 | switchB: detnetSwitch { 46 | parameters: 47 | @display("p=367,136"); 48 | gates: 49 | ethg[4]; 50 | } 51 | workstation1: VlanEtherHostFullLoad { 52 | @display("p=56,56"); 53 | } 54 | workstation2: VlanEtherHostFullLoad { 55 | @display("p=149,23"); 56 | } 57 | backupServer0: VlanEtherHostQ { 58 | @display("p=470,38"); 59 | } 60 | backupServer1: VlanEtherHostQ { 61 | @display("p=527,104"); 62 | } 63 | robotController: VlanEtherHostSched { 64 | @display("p=75.2375,200.2475"); 65 | } 66 | roboticArm: VlanEtherHostQ { 67 | @display("p=480,211"); 68 | } 69 | connections: 70 | robotController.ethg <--> C <--> switchA.ethg[0]; 71 | workstation1.ethg <--> C <--> switchA.ethg[1]; 72 | workstation2.ethg <--> C <--> switchA.ethg[2]; 73 | 74 | roboticArm.ethg <--> C <--> switchB.ethg[0]; 75 | backupServer0.ethg <--> C <--> switchB.ethg[1]; 76 | backupServer1.ethg <--> C <--> switchB.ethg[2]; 77 | 78 | 79 | switchA.ethg[3] <--> C <--> switchB.ethg[3]; 80 | } 81 | -------------------------------------------------------------------------------- /simulations/test/TestScenarionesting.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.simulations.test; 17 | 18 | import detnetmod.detnetmod.ethernetInterface.detnetSwitch; 19 | import ned.DatarateChannel; 20 | import nesting.node.ethernet.VlanEtherSwitchPreemptable; 21 | import nesting.node.ethernet.VlanEtherHostSched; 22 | import nesting.node.ethernet.VlanEtherHostFullLoad; 23 | import nesting.node.ethernet.VlanEtherHostQ; 24 | 25 | 26 | network TestScenarionesting 27 | { 28 | types: 29 | channel C extends DatarateChannel 30 | { 31 | delay = 0.1us; 32 | datarate = 1Gbps; 33 | } 34 | submodules: 35 | switchA: VlanEtherSwitchPreemptable { 36 | parameters: 37 | @display("p=188,127"); 38 | gates: 39 | ethg[4]; 40 | } 41 | switchB: VlanEtherSwitchPreemptable { 42 | parameters: 43 | @display("p=327,127"); 44 | gates: 45 | ethg[3]; 46 | } 47 | workstation1: VlanEtherHostFullLoad { 48 | @display("p=79,62"); 49 | } 50 | workstation2: VlanEtherHostFullLoad { 51 | @display("p=172,29"); 52 | } 53 | backupServer: VlanEtherHostQ { 54 | @display("p=446,54"); 55 | } 56 | robotController: VlanEtherHostSched { 57 | @display("p=79,202"); 58 | } 59 | roboticArm: VlanEtherHostQ { 60 | @display("p=440,202"); 61 | } 62 | connections: 63 | robotController.ethg <--> C <--> switchA.ethg[0]; 64 | workstation1.ethg <--> C <--> switchA.ethg[1]; 65 | workstation2.ethg <--> C <--> switchA.ethg[2]; 66 | 67 | roboticArm.ethg <--> C <--> switchB.ethg[0]; 68 | backupServer.ethg <--> C <--> switchB.ethg[1]; 69 | 70 | switchA.ethg[3] <--> C <--> switchB.ethg[2]; 71 | } 72 | -------------------------------------------------------------------------------- /simulations/test/TestScenarionesting1.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.simulations.test; 17 | 18 | //import detnetmod.detnetmod.ethernetInterface.detnetSwitch; 19 | import ned.DatarateChannel; 20 | import nesting.node.ethernet.VlanEtherSwitchPreemptable; 21 | import nesting.node.ethernet.VlanEtherHostSched; 22 | import nesting.node.ethernet.VlanEtherHostFullLoad; 23 | import nesting.node.ethernet.VlanEtherHostQ; 24 | 25 | 26 | network TestScenarionesting1 27 | { 28 | types: 29 | channel C extends DatarateChannel 30 | { 31 | delay = 0.1us; 32 | datarate = 1Gbps; 33 | } 34 | submodules: 35 | switchA: VlanEtherSwitchPreemptable { 36 | parameters: 37 | @display("p=188,127"); 38 | gates: 39 | ethg[4]; 40 | } 41 | switchB: VlanEtherSwitchPreemptable { 42 | parameters: 43 | @display("p=327,127"); 44 | gates: 45 | ethg[4]; 46 | } 47 | workstation1: VlanEtherHostFullLoad { 48 | @display("p=79,62"); 49 | } 50 | workstation2: VlanEtherHostFullLoad { 51 | @display("p=172,29"); 52 | } 53 | backupServer0: VlanEtherHostQ { 54 | @display("p=430,29"); 55 | } 56 | backupServer1: VlanEtherHostQ { 57 | @display("p=487,95"); 58 | } 59 | robotController: VlanEtherHostSched { 60 | @display("p=79,202"); 61 | } 62 | roboticArm: VlanEtherHostQ { 63 | @display("p=440,202"); 64 | } 65 | connections: 66 | robotController.ethg <--> C <--> switchA.ethg[0]; 67 | workstation1.ethg <--> C <--> switchA.ethg[1]; 68 | workstation2.ethg <--> C <--> switchA.ethg[2]; 69 | 70 | switchA.ethg[3] <--> C <--> switchB.ethg[3]; 71 | 72 | roboticArm.ethg <--> C <--> switchB.ethg[0]; 73 | backupServer0.ethg <--> C <--> switchB.ethg[1]; 74 | backupServer1.ethg <--> C <--> switchB.ethg[2]; 75 | 76 | } 77 | -------------------------------------------------------------------------------- /simulations/test/xml/01_SanityCheck_Schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10us 4 | 5 | 40us 6 | 7 | 0us 8 | 7 9 | 00:00:00:00:00:06 10 | 354 11 | 12 | 13 | 14 | 400us 15 | 16 | 17 | 400us 18 | 11111111 19 | 20 | 21 | 22 | 23 | 400us 24 | 25 | 26 | 400us 27 | 11111111 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioRouting1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioRouting2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioRouting5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioSchedule1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 20us 8 | 7 9 | 00:00:00:00:00:04 10 | 1400 11 | 12 | 13 | 14 | 400us 15 | 16 | 17 | 400us 18 | 11111111 19 | 20 | 21 | 22 | 23 | 400us 24 | 25 | 26 | 400us 27 | 11111111 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioScheduleSwap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 500 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioSchedule_AllOpen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:04 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 20 | 400us 21 | 11111111 22 | 23 | 24 | 25 | 26 | 400us 27 | 28 | 29 | 30 | 400us 31 | 11111111 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioSchedule_AllOpen5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:02 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 20 | 400us 21 | 11111111 22 | 23 | 24 | 25 | 26 | 400us 27 | 28 | 29 | 30 | 400us 31 | 11111111 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /simulations/test/xml/TestScenarioSchedule_GatingOn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 400us 4 | 5 | 400us 6 | 7 | 8 | 10us 9 | 7 10 | 00:00:00:00:00:04 11 | 12 | 354 13 | 14 | 15 | 16 | 400us 17 | 18 | 19 | 20 | 200us 21 | 00000001 22 | 23 | 24 | 25 | 200us 26 | 11111110 27 | 28 | 29 | 30 | 31 | 400us 32 | 33 | 34 | 35 | 200us 36 | 00000001 37 | 38 | 39 | 40 | 200us 41 | 11111110 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /simulations/test/xml/t.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/detnetmod/applications/IApplication.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.applications; 17 | 18 | moduleinterface IApplication 19 | { 20 | parameters: 21 | @display("i=block/app"); 22 | gates: 23 | input socketIn; 24 | output socketOut; 25 | } -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKind.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * SetKind.cc 3 | * 4 | * Created on: Nov 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #include "SetKind.h" 9 | #include "inet/common/packet/Packet.h" 10 | 11 | //using namespace omnet; 12 | using namespace inet; 13 | 14 | namespace detnetmod { 15 | 16 | Define_Module(SetKind); 17 | 18 | void SetKind::initialize() { 19 | } 20 | 21 | void SetKind::handleMessage(cMessage *msg) { 22 | if (msg->isPacket()){ 23 | std::ostringstream str; 24 | str << getId() << "-" << numSent; 25 | Packet *packet = check_and_cast(msg); 26 | packet->setName(str.str().c_str()); 27 | numSent++; 28 | // packet->setKind(getId()); 29 | } 30 | send(msg, "LowerLayerOut"); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SetKind.h 3 | * 4 | * Created on: Nov 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_APPLICATIONS_SETKIND_H_ 9 | #define DETNETMOD_APPLICATIONS_SETKIND_H_ 10 | 11 | 12 | #include 13 | 14 | using namespace omnetpp; 15 | 16 | namespace detnetmod { 17 | 18 | class SetKind: public cSimpleModule { 19 | protected: 20 | int numSent=0; 21 | virtual void initialize(); 22 | virtual void handleMessage(cMessage *msg); 23 | }; 24 | 25 | } /*namespace detnetmod*/ 26 | 27 | 28 | #endif /* DETNETMOD_APPLICATIONS_SETKIND_H_ */ 29 | -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKind.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.applications; 17 | 18 | simple SetKind 19 | { 20 | parameters: 21 | bool verbose = default(false); 22 | @class(SetKind); 23 | gates: 24 | input UpperLayerIn; 25 | output LowerLayerOut; 26 | } 27 | -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKindNetPerf.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * SetKind.cc 3 | * 4 | * Created on: Nov 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #include "SetKindNetPerf.h" 9 | #include "inet/common/packet/Packet.h" 10 | 11 | //using namespace omnet; 12 | using namespace inet; 13 | 14 | namespace detnetmod { 15 | 16 | Define_Module(SetKindNetPerf); 17 | 18 | void SetKindNetPerf::initialize() { 19 | } 20 | 21 | void SetKindNetPerf::handleMessage(cMessage *msg) { 22 | if (msg->isPacket()){ 23 | std::ostringstream str; 24 | str << getId() << "-" << numSent; 25 | Packet *packet = check_and_cast(msg); 26 | packet->setName(str.str().c_str()); 27 | numSent++; 28 | // packet->setKind(getId()); 29 | EV_DETAIL << "This is a packet"; 30 | } 31 | EV_DETAIL << "Arrival gate is " << msg->getArrivalGate()->getName(); 32 | 33 | if(std::string(msg->getArrivalGate()->getName()) == std::string("UpperLayerInTcp")){ 34 | EV_DETAIL << "Sent out TCP"; 35 | send(msg, "LowerLayerOutTcp"); 36 | 37 | } 38 | if(msg->getArrivalGate()->getName() == "UpperLayerInSctp") 39 | send(msg, "LowerLayerOutSctp"); 40 | if(msg->getArrivalGate()->getName() == "UpperLayerInUdp") 41 | send(msg, "LowerLayerOutUdp"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKindNetPerf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SetKind.h 3 | * 4 | * Created on: Nov 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_APPLICATIONS_SETKINDNETPERF_H_ 9 | #define DETNETMOD_APPLICATIONS_SETKINDNETPERF_H_ 10 | 11 | 12 | #include 13 | 14 | using namespace omnetpp; 15 | 16 | namespace detnetmod { 17 | 18 | class SetKindNetPerf: public cSimpleModule { 19 | protected: 20 | int numSent=0; 21 | virtual void initialize(); 22 | virtual void handleMessage(cMessage *msg); 23 | }; 24 | 25 | } /*namespace detnetmod*/ 26 | 27 | 28 | #endif /* DETNETMOD_APPLICATIONS_SETKINDNETPERF_H_ */ 29 | -------------------------------------------------------------------------------- /src/detnetmod/applications/SetKindNetPerf.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.applications; 17 | 18 | simple SetKindNetPerf 19 | { 20 | parameters: 21 | bool verbose = default(false); 22 | @class(SetKindNetPerf); 23 | gates: 24 | input UpperLayerInTcp; 25 | output LowerLayerOutTcp; 26 | input UpperLayerInSctp; 27 | output LowerLayerOutSctp; 28 | input UpperLayerInUdp; 29 | output LowerLayerOutUdp; 30 | } 31 | -------------------------------------------------------------------------------- /src/detnetmod/applications/UdpBasicAppTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2000 Institut fuer Telematik, Universitaet Karlsruhe 3 | // Copyright (C) 2004,2011 Andras Varga 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU Lesser General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with this program; if not, see . 17 | // 18 | 19 | #ifndef __INET_UdpBasicAppTest_H 20 | #define __INET_UdpBasicAppTest_H 21 | 22 | #include 23 | 24 | #include "inet/common/INETDefs.h" 25 | 26 | #include "inet/applications/base/ApplicationBase.h" 27 | #include "inet/transportlayer/contract/udp/UdpSocket.h" 28 | 29 | using namespace inet; 30 | 31 | namespace detnetmod { 32 | 33 | /** 34 | * UDP application. See NED for more info. 35 | */ 36 | class INET_API UdpBasicAppTest : public ApplicationBase, public UdpSocket::ICallback 37 | { 38 | protected: 39 | enum SelfMsgKinds { START = 1, SEND, STOP }; 40 | 41 | // parameters 42 | std::vector destAddresses; 43 | std::vector destAddressStr; 44 | int localPort = -1, destPort = -1; 45 | simtime_t startTime; 46 | simtime_t stopTime; 47 | bool dontFragment = false; 48 | const char *packetName = nullptr; 49 | 50 | // state 51 | UdpSocket socket; 52 | cMessage *selfMsg = nullptr; 53 | 54 | // statistics 55 | int numSent = 0; 56 | int numReceived = 0; 57 | 58 | protected: 59 | virtual int numInitStages() const override { return NUM_INIT_STAGES; } 60 | virtual void initialize(int stage) override; 61 | virtual void handleMessageWhenUp(cMessage *msg) override; 62 | virtual void finish() override; 63 | virtual void refreshDisplay() const override; 64 | 65 | // chooses random destination address 66 | virtual L3Address chooseDestAddr(); 67 | virtual void sendPacket(); 68 | virtual void processPacket(Packet *msg); 69 | virtual void setSocketOptions(); 70 | 71 | virtual void processStart(); 72 | virtual void processSend(); 73 | virtual void processStop(); 74 | 75 | virtual void handleStartOperation(LifecycleOperation *operation) override; 76 | virtual void handleStopOperation(LifecycleOperation *operation) override; 77 | virtual void handleCrashOperation(LifecycleOperation *operation) override; 78 | 79 | virtual void socketDataArrived(UdpSocket *socket, Packet *packet) override; 80 | virtual void socketErrorArrived(UdpSocket *socket, Indication *indication) override; 81 | virtual void socketClosed(UdpSocket *socket) override; 82 | 83 | public: 84 | UdpBasicAppTest() {} 85 | ~UdpBasicAppTest(); 86 | }; 87 | 88 | } // namespace inet 89 | 90 | #endif // ifndef __INET_UdpBasicAppTest_H 91 | 92 | -------------------------------------------------------------------------------- /src/detnetmod/applications/UdpSink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2004 Andras Varga 3 | // Copyright (C) 2000 Institut fuer Telematik, Universitaet Karlsruhe 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU Lesser General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with this program; if not, see . 17 | // 18 | 19 | #ifndef __INET_UDPSINK_H 20 | #define __INET_UDPSINK_H 21 | 22 | #include "inet/common/INETDefs.h" 23 | 24 | #include "inet/applications/base/ApplicationBase.h" 25 | #include "inet/transportlayer/contract/udp/UdpSocket.h" 26 | 27 | using namespace inet; 28 | 29 | namespace detnetmod { 30 | 31 | /** 32 | * Consumes and prints packets received from the Udp module. See NED for more info. 33 | */ 34 | class INET_API UdpSink : public ApplicationBase, public UdpSocket::ICallback 35 | { 36 | protected: 37 | 38 | simtime_t delaY; 39 | 40 | enum SelfMsgKinds { START = 1, STOP }; 41 | 42 | UdpSocket socket; 43 | int localPort = -1; 44 | L3Address multicastGroup; 45 | simtime_t startTime; 46 | simtime_t stopTime; 47 | cMessage *selfMsg = nullptr; 48 | int numReceived = 0; 49 | 50 | public: 51 | UdpSink() {} 52 | virtual ~UdpSink(); 53 | 54 | protected: 55 | virtual void processPacket(Packet *msg); 56 | virtual void setSocketOptions(); 57 | 58 | protected: 59 | virtual int numInitStages() const override { return NUM_INIT_STAGES; } 60 | virtual void initialize(int stage) override; 61 | virtual void handleMessageWhenUp(cMessage *msg) override; 62 | virtual void finish() override; 63 | virtual void refreshDisplay() const override; 64 | 65 | virtual void socketDataArrived(UdpSocket *socket, Packet *packet) override; 66 | virtual void socketErrorArrived(UdpSocket *socket, Indication *indication) override; 67 | virtual void socketClosed(UdpSocket *socket) override; 68 | 69 | virtual void processStart(); 70 | virtual void processStop(); 71 | 72 | virtual void handleStartOperation(LifecycleOperation *operation) override; 73 | virtual void handleStopOperation(LifecycleOperation *operation) override; 74 | virtual void handleCrashOperation(LifecycleOperation *operation) override; 75 | }; 76 | 77 | } // namespace inet 78 | 79 | #endif // ifndef __INET_UDPSINK_H 80 | 81 | -------------------------------------------------------------------------------- /src/detnetmod/applications/UdpSink.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2004 Andras Varga 3 | // Copyright (C) 2000 Institut fuer Telematik, Universitaet Karlsruhe 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU Lesser General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with this program; if not, see . 17 | // 18 | 19 | package detnetmod.detnetmod.applications; 20 | 21 | import inet.applications.contract.IApp; 22 | 23 | 24 | // 25 | // Consumes and prints packets received from the ~Udp module. 26 | // 27 | simple UdpSink like IApplication 28 | { 29 | parameters: 30 | string interfaceTableModule; // The path to the InterfaceTable module 31 | double startTime @unit(s) = default(0s); // application start time 32 | double stopTime @unit(s) = default(-1s); // time of finishing receiving 33 | int localPort; // local port 34 | bool receiveBroadcast = default(false); // if true, makes the socket receive broadcast packets 35 | string multicastGroup = default(""); // if non-empty, makes the socket receive multicast packets sent to that group 36 | string multicastSources = default(""); // if non-empty, than the socket receives multicast packets from those sources only 37 | 38 | @display("i=block/sink"); 39 | @lifecycleSupport; 40 | double stopOperationExtraTime @unit(s) = default(-1s); // extra time after lifecycle stop operation finished 41 | double stopOperationTimeout @unit(s) = default(2s); // timeout value for lifecycle stop operation 42 | @signal[packetReceived](type=inet::Packet); 43 | @statistic[packetReceived](title="packets received"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); 44 | @statistic[throughput](title="throughput"; unit=bps; source="throughput(packetReceived)"; record=vector); 45 | @statistic[endToEndDelay](title="end-to-end delay"; source="dataAge(packetReceived)"; unit=s; record=histogram,vector; interpolationmode=none); 46 | @statistic[rcvdPkSeqNo](title="received packet sequence number"; source="appPkSeqNo(packetReceived)"; record=vector; interpolationmode=none); 47 | 48 | gates: 49 | input socketIn @labels(UdpControlInfo/up); 50 | output socketOut @labels(UdpControlInfo/down); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/detnetmod/applications/VlanEtherTrafGenFullLoadDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.applications; 17 | 18 | // 19 | // This module provides a queue containing an endless amount of ethernet 20 | // packets and implements the IPassiveQueue Interface of INET. 21 | // 22 | // The queue is never empty and everytime a packet is requested the queue 23 | // generates one and sends it out. 24 | // 25 | simple VlanEtherTrafGenFullLoadDetnet 26 | { 27 | parameters: 28 | @display("i=block/queue"); 29 | @class(VlanEtherTrafGenFullLoadDetnet); 30 | string destAddress = default(""); // destination MAC address, or module path name of destination station; empty means off 31 | int etherType = default(0); // etherType to set on outgoing packets 32 | bool vlanTagEnabled = default(true); // When true, the application's packets will be VLAN encapsulated by the VLANEncap module, otherwise the pcp, dei, vid value is ignored 33 | int pcp = default(0); // PCP (Priority Code Point) value that is added to the packets control information 34 | bool dei = default(false); // DEI (Drop Eligible Indicator) that is added to the packets control information 35 | int vid = default(1); // VID (VLAN Identifier) value that is added to the packets control information 36 | volatile int packetLength @unit(B); // length of packets to send 37 | bool randomPacketLengthEnabled = default(false); 38 | bool verbose = default(false); 39 | string srcip = default("10.0.0.100"); 40 | string destip = default(""); 41 | int srcport = default(4444); 42 | int destport = default(4444); 43 | @signal[sentPk](type=long); // type=unique packet id 44 | @statistic[sentPk](title="packets sent"; source=sentPk; record=count,vector; interpolationmode=none); 45 | 46 | 47 | gates: 48 | // input in @allowunconnected; 49 | output out @labels(Ieee8021QCtrl/down); 50 | } 51 | -------------------------------------------------------------------------------- /src/detnetmod/applications/VlanEtherTrafGenSchedDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.applications; 17 | 18 | // 19 | // Traffic generator application for VLAN tagged ethernet frames. This 20 | // module should be connected to a VLANEncap module and the VLANEncap 21 | // module should be connected to an EtherEncap module to provide encap/decap 22 | // functionality for VLAN Tag and Ethernet Header. 23 | // 24 | // This application module does not generate encapsulated packets but adds 25 | // the necessary information, that other modules (EtherEncap, VLANEncap) can 26 | // provide the necessary encapsulation/decapsulation. Therefore an 27 | // Ieee8021QCtrl control information is added to packets. 28 | // 29 | // @see ~VLANEncap, ~EtherEncap, ~Ieee8021QCtrl 30 | // 31 | simple VlanEtherTrafGenSchedDetnet 32 | { 33 | parameters: 34 | @class(VlanEtherTrafGenSchedDetnet); 35 | @display("i=block/queue"); 36 | @signal[sentPk](type=long); // type=unique packet id 37 | @signal[rcvdPk](type=long); // type=unique packet id 38 | 39 | //Actual schedule has to be set in .ini file 40 | xml initialSchedule = default(xml("100")); 41 | xml emptySchedule = default(xml("100")); 42 | string clockModule = default("^.clock"); 43 | string hostModule = default("^"); 44 | bool verbose = default(false); 45 | double jitter = default(0); // random time, for which transmission of packet can be delayed. Unit depends on clock rate. 46 | string srcip = default("10.0.0.100"); 47 | string destip = default(""); 48 | int srcport = default(4444); 49 | int destport = default(4444); 50 | int vid = default(1); 51 | gates: 52 | input in; 53 | output out; 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/detnetmod/dropper/dropper.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.dropper; 17 | 18 | moduleinterface Dropper 19 | { 20 | parameters: 21 | int numGates; 22 | @display("i=block/downarrow"); 23 | gates: 24 | input in[numGates]; 25 | output out[numGates]; 26 | } 27 | -------------------------------------------------------------------------------- /src/detnetmod/dropper/mfd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mfd.h 3 | * 4 | * Created on: Oct 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_DROPPER_MFD_H_ 9 | #define DETNETMOD_DROPPER_MFD_H_ 10 | 11 | #include "inet/common/INETDefs.h" 12 | #include "inet/common/queue/AlgorithmicDropperBase.h" 13 | #include "inet/common/packet/Packet.h" 14 | //#include "nesting/linklayer/common/VLANTag_m.h" 15 | 16 | #include "../linklayer/common/VLANTag_m.h" 17 | #include "../ieee8021q/Ieee8021q.h" 18 | 19 | #include "nesting/ieee8021q/relay/FilteringDatabase.h" 20 | #include "inet/linklayer/ethernet/switch/IMacAddressTable.h" 21 | #include "inet/networklayer/contract/IInterfaceTable.h" 22 | 23 | #include "nesting/ieee8021q/queue/gating/GateController.h" 24 | #include "nesting/ieee8021q/queue/gating/TransmissionGate.h" 25 | using namespace inet; 26 | using namespace nesting; 27 | 28 | namespace detnetmod { 29 | 30 | /** 31 | * Implementation of Random Early Detection (RED). 32 | */ 33 | class INET_API Mfd : public AlgorithmicDropperBase 34 | { 35 | protected: 36 | 37 | IInterfaceTable *ifTable = nullptr; 38 | IMacAddressTable *macTable = nullptr; 39 | FilteringDatabase* fdb; 40 | GateController* gateController; 41 | nesting::TransmissionGate* tgate; 42 | bool lbEnabled; 43 | int backupPort; 44 | 45 | typedef struct flow_table{ 46 | uint32_t vqueue; 47 | uint32_t flowId; 48 | std::string type; 49 | double bwreq; 50 | simtime_t last_arrival; 51 | uint32_t threshold; 52 | }flow_table_t; 53 | 54 | typedef struct detnetactiveflow{ 55 | flow_table_t *flow; 56 | }detnetactiveflow_t; 57 | 58 | typedef struct otheractiveflow{ 59 | flow_table_t *flow; 60 | }otheractiveflow_t; 61 | 62 | //Parameters 63 | double DetnetBandwidth; 64 | double OutputBandwidth; 65 | uint32_t Threshold; 66 | 67 | 68 | simtime_t LastPacketArrival = 0; 69 | 70 | 71 | public: 72 | Mfd() {} 73 | 74 | protected: 75 | virtual ~Mfd(); 76 | virtual void initialize() override; 77 | virtual void handleMessage(cMessage *msg) override; 78 | virtual bool shouldDrop(cPacket *packet) override; 79 | virtual bool Drop(cPacket *packet,Packet* netpacket); 80 | virtual void sendOut(cPacket *packet) override; 81 | 82 | // Detnet Activelist functions 83 | void AddDetnetActiveFlow(detnetactiveflow_t flow); 84 | virtual detnetactiveflow_t RemoveDetnetActiveFlow(void); 85 | 86 | // Other Activelist functions 87 | virtual void AddOtherActiveFlow(otheractiveflow_t flow); 88 | virtual otheractiveflow_t RemoveOtherActiveFlow(void); 89 | 90 | virtual flow_table_t *ClassifyFlow(Packet* netpacket,cPacket* packet,int flowId,uint32_t PacketLength,int pcp); 91 | 92 | private: 93 | double detnet_consumption; 94 | std::vectorflow_table[1024]; 95 | std::vectordetnetactiveflows; 96 | std::vectorotheractiveflows; 97 | }; 98 | 99 | } // namespace detnetmod 100 | 101 | 102 | 103 | #endif /* DETNETMOD_DROPPER_MFD_H_ */ 104 | -------------------------------------------------------------------------------- /src/detnetmod/dropper/mfd.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.dropper; 17 | 18 | 19 | simple MfdDropper like Dropper 20 | { 21 | parameters: 22 | int numGates = default(1); 23 | @class(Mfd); 24 | double DetnetBandwidthReservation=default(10); // 1Gbps 25 | int vqThreshold = default(10*412*8); // 5 Mtu 26 | double OutputLinkBandwidth = default(10); // 1Gbps 27 | string macTableModule = default("^.^.^.macTable"); // The path to the MacAddressTable module 28 | string interfaceTableModule = default("^.^.^.interfaceTable"); // The path to the InterfaceTable module 29 | string filteringDatabaseModule = default("^.^.^.filteringDatabase"); // Path to the ~FilteringDatabase module 30 | string gateController = default("^.gateController"); 31 | string tgate = default("^.tGates[7]"); 32 | bool lbEnabled = default(false); 33 | int backupPort = default(5); 34 | @display("i=block/downarrow"); 35 | @signal[packetDropped](type=cPacket); 36 | @statistic[packetDropCongestion](title="packet drop: congestion"; source=packetDropReasonIsCongestion(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none); 37 | 38 | gates: 39 | input in[numGates]; 40 | output out[numGates]; 41 | } 42 | -------------------------------------------------------------------------------- /src/detnetmod/dropper/red.h: -------------------------------------------------------------------------------- 1 | /* 2 | * red.h 3 | * 4 | * Created on: Oct 2, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_DROPPER_RED_H_ 9 | #define DETNETMOD_DROPPER_RED_H_ 10 | 11 | #include "inet/common/INETDefs.h" 12 | #include "inet/common/queue/AlgorithmicDropperBase.h" 13 | using namespace inet; 14 | 15 | namespace detnetmod { 16 | 17 | /** 18 | * Implementation of Random Early Detection (RED). 19 | */ 20 | class INET_API RedDropper : public AlgorithmicDropperBase 21 | { 22 | protected: 23 | double wq = 0.0; 24 | double *minths = nullptr; 25 | double *maxths = nullptr; 26 | double *maxps = nullptr; 27 | double *pkrates = nullptr; 28 | double *count = nullptr; 29 | 30 | double avg = 0.0; 31 | simtime_t q_time; 32 | 33 | public: 34 | RedDropper() {} 35 | 36 | protected: 37 | virtual ~RedDropper(); 38 | virtual void initialize() override; 39 | virtual bool shouldDrop(cPacket *packet) override; 40 | virtual void sendOut(cPacket *packet) override; 41 | }; 42 | 43 | } // namespace detnetmod 44 | 45 | #endif /* DETNETMOD_DROPPER_RED_H_ */ 46 | -------------------------------------------------------------------------------- /src/detnetmod/ethernetInterface/detnetFwHost.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.ethernetInterface; 17 | import inet.common.queue.RedDropper; 18 | import inet.linklayer.contract.IEthernetInterface; 19 | import inet.linklayer.ethernet.IEtherEncap; 20 | import inet.linklayer.ethernet.switch.MacRelayUnit; 21 | import inet.networklayer.common.InterfaceEntry; 22 | import inet.linklayer.ethernet.EtherMacFullDuplex; 23 | import inet.node.ethernet.EtherHost2; 24 | import nesting.ieee8021q.queue.Queuing; 25 | import nesting.ieee8021q.queue.QueuingFrames; 26 | import nesting.linklayer.ethernet.VLANEncap; 27 | import inet.common.queue.Sink; 28 | import detnetmod.detnetmod.linklayer.ethernet.VLAN8021qEncap; 29 | import inet.linklayer.ieee8021q.IIeee8021qEncap; 30 | 31 | @namespace(); 32 | // 33 | // TODO documentation 34 | // 35 | module detnetFwHost extends InterfaceEntry like IEthernetInterface 36 | { 37 | parameters: 38 | @class(inet::InterfaceEntry); 39 | string interfaceTableModule; 40 | string address = default("auto"); // MAC address 41 | string fcsMode @enum("declared","computed") = default("declared"); 42 | @display("i=block/ifcard;bgl=2;bgb=388,407"); 43 | *.interfaceTableModule = default(absPath(interfaceTableModule)); 44 | *.fcsMode = fcsMode; 45 | bool framePreemptionDisabled = default(true); 46 | gates: 47 | input upperLayerIn; 48 | output upperLayerOut; 49 | inout phys @labels(EtherFrame); 50 | submodules: 51 | mac: EtherMacFullDuplex { 52 | @display("p=113,340"); 53 | } 54 | vlanEncap: like IIeee8021qEncap { 55 | @display("p=113,228"); 56 | } 57 | etherEncap: like IEtherEncap { 58 | parameters: 59 | @display("p=113,98"); 60 | } 61 | connections: 62 | mac.phys <--> { @display("m=s"); } <--> phys; 63 | 64 | mac.upperLayerOut --> vlanEncap.lowerLayerIn; 65 | mac.upperLayerIn <-- vlanEncap.lowerLayerOut; 66 | 67 | vlanEncap.upperLayerOut --> { @display("m=n"); } --> etherEncap.lowerLayerIn; 68 | vlanEncap.upperLayerIn <-- { @display("m=n"); } <-- etherEncap.lowerLayerOut; 69 | 70 | etherEncap.upperLayerOut --> { @display("m=n"); } --> upperLayerOut; 71 | etherEncap.upperLayerIn <-- { @display("m=n"); } <-- upperLayerIn; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/detnetmod/ieee8021q/relay/macrelay.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.ieee8021q.relay; 17 | import inet.linklayer.contract.IMacRelayUnit; 18 | 19 | 20 | simple macrelay like IMacRelayUnit{ 21 | parameters: 22 | @display("i=block/switch"); 23 | string macTableModule = default("^.macTable"); // The path to the MacAddressTable module 24 | string interfaceTableModule = default("^.interfaceTable"); // The path to the InterfaceTable module 25 | string filteringDatabaseModule = default("^.filteringDatabase"); // Path to the ~FilteringDatabase module 26 | bool hasStp = default(false); 27 | @class(macrelay); 28 | int numberOfPorts; 29 | 30 | string displayStringTextFormat = default("proc: %p\ndisc: %d"); 31 | @signal[packetSentToLower](type=cPacket); 32 | @signal[packetReceivedFromUpper](type=cPacket); 33 | @signal[packetReceivedFromLower](type=cPacket); 34 | gates: 35 | input ifIn @labels(EtherFrame); 36 | output ifOut @labels(EtherFrame); 37 | input upperLayerIn; 38 | output upperLayerOut; 39 | } 40 | -------------------------------------------------------------------------------- /src/detnetmod/ieee8021q/tunnel8021q/DetnetVlanInterface.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) OpenSim Ltd. 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU Lesser General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with this program; if not, see . 16 | // 17 | 18 | package detnetmod.detnetmod.ieee8021q.tunnel8021q; 19 | 20 | import inet.linklayer.contract.IVlanInterface; 21 | import inet.networklayer.common.InterfaceEntry; 22 | @namespace(); 23 | 24 | module DetnetVlanInterface extends InterfaceEntry like IVlanInterface 25 | { 26 | parameters: 27 | string interfaceTableModule; 28 | *.interfaceTableModule = default(absPath(interfaceTableModule)); 29 | @display("i=block/tunnel"); 30 | @class(inet::InterfaceEntry); 31 | gates: 32 | input upperLayerIn; 33 | output upperLayerOut; 34 | submodules: 35 | tunnel: tunnel8021q { 36 | @display("p=100,100"); 37 | } 38 | connections: 39 | upperLayerIn --> tunnel.upperLayerIn; 40 | upperLayerOut <-- tunnel.upperLayerOut; 41 | } 42 | -------------------------------------------------------------------------------- /src/detnetmod/ieee8021q/tunnel8021q/tunnel8021q.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * tunnel8021q.cc 3 | * 4 | * Created on: Oct 21, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | 9 | #include "inet/applications/common/SocketTag_m.h" 10 | #include "inet/common/ModuleAccess.h" 11 | #include "inet/common/packet/Packet.h" 12 | #include "inet/linklayer/common/InterfaceTag_m.h" 13 | #include "inet/linklayer/vlan/VlanTag_m.h" 14 | #include "inet/linklayer/vlan/VlanTunnel.h" 15 | #include "inet/networklayer/contract/IInterfaceTable.h" 16 | 17 | #include "tunnel8021q.h" 18 | using namespace inet; 19 | //using namespace nesting; 20 | 21 | namespace detnetmod { 22 | 23 | Define_Module(tunnel8021q); 24 | 25 | void tunnel8021q::initialize(int stage) 26 | { 27 | 28 | inet::VlanTunnel::initialize(stage); 29 | if (stage == INITSTAGE_LOCAL) { 30 | vid = par("vid"); 31 | de = par("de"); 32 | pcp = par("pcp"); 33 | } 34 | 35 | } 36 | 37 | void tunnel8021q::handleMessage(cMessage *message) 38 | { 39 | if (socket.belongsToSocket(message)) 40 | socket.processMessage(message); 41 | else { 42 | auto packet = check_and_cast(message); 43 | auto vlanTag = packet->addTagIfAbsent(); 44 | // auto vlanTag = packet->findTag(); 45 | vlanTag->setVID(vid); 46 | vlanTag->setDe(de); 47 | vlanTag->setPcp(pcp); 48 | EV_DETAIL << "Pcp Set to - " << pcp; 49 | 50 | socket.send(packet); 51 | } 52 | } 53 | 54 | void tunnel8021q::socketDataArrived(EthernetSocket *socket, Packet *packet) 55 | { 56 | packet->removeTag(); 57 | packet->getTag()->setInterfaceId(interfaceEntry->getInterfaceId()); 58 | send(packet, "upperLayerOut"); 59 | } 60 | 61 | void tunnel8021q::socketErrorArrived(EthernetSocket *socket, Indication *indication) 62 | { 63 | throw cRuntimeError("Invalid operation"); 64 | } 65 | 66 | 67 | 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/detnetmod/ieee8021q/tunnel8021q/tunnel8021q.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tunnel8021q.h 3 | * 4 | * Created on: Oct 21, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_IEEE8021Q_TUNNEL8021Q_TUNNEL8021Q_H_ 9 | #define DETNETMOD_IEEE8021Q_TUNNEL8021Q_TUNNEL8021Q_H_ 10 | 11 | #include "inet/linklayer/vlan/VlanTunnel.h" 12 | 13 | #include "../../linklayer/common/VLANTag_m.h" 14 | #include "../Ieee8021q.h" 15 | 16 | //#include "nesting/ieee8021q/Ieee8021q.h" 17 | //#include "nesting/linklayer/common/VLANTag_m.h" 18 | 19 | #include "inet/linklayer/ethernet/EthernetSocket.h" 20 | #include "inet/networklayer/common/InterfaceEntry.h" 21 | 22 | using namespace inet; 23 | //using namespace nesting; 24 | 25 | namespace detnetmod { 26 | 27 | class tunnel8021q : public inet::VlanTunnel 28 | { 29 | protected: 30 | //parameters 31 | int vid; 32 | bool de; 33 | int pcp; 34 | 35 | protected: 36 | virtual void initialize(int stage) override; 37 | virtual void handleMessage(cMessage *message) override; 38 | 39 | virtual void socketDataArrived(EthernetSocket *socket, Packet *packet) override; 40 | virtual void socketErrorArrived(EthernetSocket *socket, Indication *indication) override; 41 | virtual void socketClosed(EthernetSocket *socket) override {} 42 | }; 43 | 44 | } 45 | 46 | #endif /* DETNETMOD_IEEE8021Q_TUNNEL8021Q_TUNNEL8021Q_H_ */ 47 | -------------------------------------------------------------------------------- /src/detnetmod/ieee8021q/tunnel8021q/tunnel8021q.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) OpenSim Ltd. 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU Lesser General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with this program; if not, see . 16 | // 17 | 18 | package detnetmod.detnetmod.ieee8021q.tunnel8021q; 19 | 20 | import inet.linklayer.contract.INetworkInterface; 21 | 22 | simple tunnel8021q 23 | { 24 | parameters: 25 | string interfaceTableModule; 26 | string address @enum("auto", "copy") = default("copy"); 27 | int vlanId = default(1); 28 | int vid = default(1); 29 | int pcp = default (5); 30 | bool de = default(false); 31 | string realInterfaceName; 32 | @display("i=block/cogwheel"); 33 | 34 | gates: 35 | input upperLayerIn; 36 | output upperLayerOut; 37 | } 38 | -------------------------------------------------------------------------------- /src/detnetmod/linklayer/common/Ieee8021QCtrl.h: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | #include "VLANTag_m.h" 17 | #include "inet/linklayer/common/MacAddressTag_m.h" 18 | 19 | namespace detnetmod { 20 | struct Ieee8021QCtrl { 21 | VLANTagReq q1Tag; 22 | inet::MacAddressReq macTag; 23 | }; 24 | 25 | } // namespace nesting 26 | -------------------------------------------------------------------------------- /src/detnetmod/linklayer/common/VLANTag.msg: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | cplusplus{{ 17 | #include "inet/common/TagBase_m.h" 18 | }} 19 | 20 | class noncobject inet::TagBase; 21 | 22 | namespace detnetmod; 23 | 24 | class VLANTagBase extends inet::TagBase 25 | { 26 | uint8_t pcp; 27 | bool de; 28 | short VID=0; 29 | } 30 | 31 | // 32 | // Determines VLAN 802.1Q parameters for an outgoing packet. 33 | // 34 | class VLANTagReq extends VLANTagBase 35 | { 36 | 37 | } 38 | 39 | // 40 | // Specifies VLAN 802.1Q parameters for an incoming packet. 41 | // 42 | class VLANTagInd extends VLANTagBase 43 | { 44 | 45 | } -------------------------------------------------------------------------------- /src/detnetmod/linklayer/ethernet/VLAN8021qEncap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VLAN8021qEncap.h 3 | * 4 | * Created on: Oct 25, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_LINKLAYER_ETHERNET_VLAN8021QENCAP_H_ 9 | #define DETNETMOD_LINKLAYER_ETHERNET_VLAN8021QENCAP_H_ 10 | 11 | #include 12 | 13 | #include "inet/linklayer/common/Ieee802Ctrl.h" 14 | #include "inet/linklayer/ieee8021q/Ieee8021qHeader_m.h" 15 | #include "inet/linklayer/common/MacAddressTag_m.h" 16 | #include "inet/linklayer/ethernet/EtherFrame_m.h" 17 | #include "inet/linklayer/ethernet/EtherEncap.h" 18 | #include "inet/common/packet/Packet.h" 19 | #include "inet/common/packet/Message_m.h" 20 | 21 | #include "../common/VLANTag_m.h" 22 | #include "../../ieee8021q/Ieee8021q.h" 23 | #include "inet/linklayer/ieee8021q/Ieee8021qEncap.h" 24 | // 25 | //#include "nesting/linklayer/common/VLANTag_m.h" 26 | //#include "nesting/ieee8021q/Ieee8021q.h" 27 | 28 | using namespace omnetpp; 29 | using namespace inet; 30 | namespace detnetmod { 31 | 32 | /** 33 | * See the NED file for a detailed description 34 | */ 35 | class VLAN8021qEncap: public Ieee8021qEncap { 36 | 37 | protected: 38 | // virtual void initialize(int stage) override; 39 | virtual void handleMessage(cMessage *message) override; 40 | // virtual Ieee8021qHeader *findVlanTag(const Ptr& ethernetMacHeader) override; 41 | // virtual Ieee8021qHeader *addVlanTag(const Ptr& ethernetMacHeader) override; 42 | // virtual Ieee8021qHeader *removeVlanTag(const Ptr& ethernetMacHeader) override; 43 | // virtual void parseParameters(const char *filterParameterName, const char *mapParameterName, std::vector& vlanIdFilter, std::map& vlanIdMap); 44 | virtual void processPacket(Packet *packet, std::vector& vlanIdFilter, std::map& vlanIdMap, cGate *gate) override; 45 | public: 46 | // virtual ~VLAN8021qEncap(); 47 | 48 | }; 49 | 50 | } // namespace detnetmod 51 | 52 | #endif /* DETNETMOD_LINKLAYER_ETHERNET_VLAN8021QENCAP_H_ */ 53 | -------------------------------------------------------------------------------- /src/detnetmod/linklayer/ethernet/VLAN8021qEncap.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.linklayer.ethernet; 17 | 18 | // 19 | // This module performs encapsulation/decapsulation of VLAN Tags. This module 20 | // should be used in combination with the EtherEncap modul of inet. 21 | // 22 | // When a frame is received from the lower layer, it is expected to have an 23 | // Ieee802Ctrl control information attached. There are two cases for processing 24 | // packets from the lower layer: 25 | // 26 | // (1) A frame is of type Ethernet1QTag (the frame "is" a VLAN Tag) it is 27 | // decapsulated and the VLAN Tag fields are added to the frame within a 28 | // Ieee8021QCtrl control information. 29 | // 30 | // (2) If a frame is not of type Ethernet1QType (the frame "is" no VLAN Tag) 31 | // an Ieee8021QCtrl information with default values for PCP, DEI, VID 32 | // as specified in this NED file is added. 33 | // 34 | // Analog in the other direction, when a frame is received from the higher 35 | // layer, the Frame is possibly encapsulated into a Ethernet1QTag (VLAN Tag is 36 | // added) when the Ieee8021QCtrl control information the packet must have, 37 | // indicates it. 38 | // 39 | // Alternatively the tagUntaggedFrames flag can be set. Then every frame is 40 | // encapsulated in an default VLAN Tag. Of course this would alter the packet 41 | // size. 42 | // 43 | // @see ~EtherEncap, ~Ieee802Ctrl, ~Ieee8021QCtrl, ~Ethernet1QTag 44 | // 45 | import inet.linklayer.ieee8021q.IIeee8021qEncap; 46 | //@namespace(); 47 | simple VLAN8021qEncap like IIeee8021qEncap 48 | { 49 | parameters: 50 | string vlanTagType @enum("c","s") = default("c"); 51 | string inboundVlanIdFilter = default(""); 52 | string inboundVlanIdMap = default(""); 53 | string outboundVlanIdFilter = default(""); 54 | string outboundVlanIdMap = default(""); 55 | @display("i=block/cogwheel"); 56 | @signal[packetDropped](type=inet::Packet); 57 | @statistic[packetDropped](title="packet dropped"; source=packetDropped; record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none); 58 | gates: 59 | input upperLayerIn; 60 | output upperLayerOut; 61 | input lowerLayerIn; 62 | output lowerLayerOut; 63 | } 64 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/DumbTC.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.networklayer.diffserv; 17 | import inet.linklayer.contract.ITrafficConditioner; 18 | import inet.linklayer.ethernet.EtherEncap; 19 | import inet.networklayer.diffserv.BehaviorAggregateClassifier; 20 | 21 | 22 | // 23 | // TODO documentation 24 | // 25 | module DumbTC like ITrafficConditioner 26 | { 27 | parameters: 28 | @display("i=block/classifier"); 29 | gates: 30 | input in; 31 | output out; 32 | submodules: 33 | dummyTC: DummyTC { 34 | @display("p=334,53"); 35 | } 36 | connections: 37 | in --> dummyTC.in; 38 | dummyTC.out --> out; 39 | } 40 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/DummyTC.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * DummyTC.cc 3 | * 4 | * Created on: Dec 10, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | 9 | 10 | 11 | /* 12 | * PcpMarker.cc 13 | * 14 | * Created on: Nov 7, 2019 15 | * Author: vamsi 16 | */ 17 | 18 | 19 | #include "DummyTC.h" 20 | #include "inet/common/packet/Message.h" 21 | #include "inet/common/packet/Packet.h" 22 | #include "inet/common/packet/Message_m.h" 23 | #include "inet/common/IProtocolRegistrationListener.h" 24 | #include "inet/common/ModuleAccess.h" 25 | #include "inet/common/ProtocolGroup.h" 26 | #include "inet/common/ProtocolTag_m.h" 27 | 28 | namespace detnetmod { 29 | 30 | Define_Module(DummyTC); 31 | 32 | void DummyTC::initialize() { 33 | 34 | llcSocket.setOutputGate(gate("out")); 35 | 36 | llcSocket.open(-1, ssap); 37 | } 38 | void DummyTC::handleMessage(cMessage *msg) 39 | { 40 | 41 | if (dynamic_cast(msg)) { 42 | send(msg,gate("out")); 43 | return; 44 | } 45 | Packet *packet = check_and_cast(msg); 46 | send(msg,gate("out")); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/DummyTC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DummyTC.h 3 | * 4 | * Created on: Dec 10, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_NETWORKLAYER_DIFFSERV_DUMMYTC_H_ 9 | #define DETNETMOD_NETWORKLAYER_DIFFSERV_DUMMYTC_H_ 10 | 11 | #include "inet/common/INETDefs.h" 12 | #include "inet/common/packet/Packet.h" 13 | 14 | 15 | #include "inet/linklayer/ieee8022/Ieee8022LlcSocket.h" 16 | #include "inet/common/IProtocolRegistrationListener.h" 17 | 18 | using namespace inet; 19 | 20 | namespace detnetmod { 21 | 22 | class DummyTC: public cSimpleModule 23 | { 24 | 25 | protected: 26 | int ssap = -1; 27 | int dsap = -1; 28 | 29 | Ieee8022LlcSocket llcSocket; 30 | 31 | virtual int numInitStages() const override { return NUM_INIT_STAGES; } 32 | virtual void initialize(); 33 | virtual void handleMessage(cMessage *msg) override; 34 | }; 35 | 36 | } // namespace detnetmod 37 | 38 | 39 | 40 | 41 | 42 | #endif /* DETNETMOD_NETWORKLAYER_DIFFSERV_DUMMYTC_H_ */ 43 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/DummyTC.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.networklayer.diffserv; 17 | 18 | simple DummyTC 19 | { 20 | parameters: 21 | @display("i=block/classifier"); 22 | @class(DummyTC); 23 | gates: 24 | input in; 25 | output out; 26 | } 27 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/FrameForward.cc: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | #include "FrameForward.h" 17 | #include "inet/applications/common/SocketTag_m.h" 18 | #include "inet/common/packet/Message.h" 19 | #include "inet/common/packet/Packet.h" 20 | 21 | namespace detnetmod { 22 | 23 | Define_Module(FrameForward); 24 | 25 | void FrameForward::initialize() { 26 | } 27 | 28 | void FrameForward::handleMessage(cMessage *msg) { 29 | Packet* packet = check_and_cast(msg); 30 | packet->removeTagIfPresent(); 31 | send(check_and_cast(packet), "upperLayerOut"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/FrameForward.h: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | #ifndef __STUPRONESTINGPROJECT_FRAMEFORWARD_H1_ 17 | #define __STUPRONESTINGPROJECT_FRAMEFORWARD_H1_ 18 | 19 | #include 20 | #include "inet/common/INETDefs.h" 21 | 22 | using namespace omnetpp; 23 | using namespace inet; 24 | 25 | namespace detnetmod { 26 | 27 | class FrameForward: public cSimpleModule { 28 | protected: 29 | virtual void initialize(); 30 | virtual void handleMessage(cMessage *msg); 31 | }; 32 | 33 | } /* namespace nesting */ 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/FrameForward.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.networklayer.diffserv; 17 | 18 | simple FrameForward 19 | { 20 | parameters: 21 | bool verbose = default(false); 22 | @class(FrameForward); 23 | gates: 24 | input lowerLayerIn; 25 | output upperLayerOut; 26 | } 27 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/PcpMarker.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * PcpMarker.cc 3 | * 4 | * Created on: Nov 7, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | 9 | #include "PcpMarker.h" 10 | #include "inet/common/packet/Message.h" 11 | #include "inet/common/packet/Packet.h" 12 | #include "inet/common/packet/Message_m.h" 13 | #include "inet/common/IProtocolRegistrationListener.h" 14 | #include "inet/common/ModuleAccess.h" 15 | #include "inet/common/ProtocolGroup.h" 16 | #include "inet/common/ProtocolTag_m.h" 17 | 18 | namespace detnetmod { 19 | 20 | Define_Module(PcpMarker); 21 | 22 | void PcpMarker::initialize() { 23 | NumClasses = gateSize("in"); 24 | int i=0; 25 | while (i(msg)) { 42 | send(msg,gate("out")); 43 | return; 44 | } 45 | Packet *packet = check_and_cast(msg); 46 | const int Class = packet->getArrivalGate()->getIndex(); 47 | // EV_INFO << "Packet Arrived on gate = ", Class; 48 | auto vlanTag = packet->addTagIfAbsent(); 49 | vlanTag->setPcp(PCPValues[Class]); 50 | send(msg,gate("out")); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/PcpMarker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PcpMarker.h 3 | * 4 | * Created on: Nov 7, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_NETWORKLAYER_DIFFSERV_PCPMARKER_H_ 9 | #define DETNETMOD_NETWORKLAYER_DIFFSERV_PCPMARKER_H_ 10 | 11 | 12 | #include "inet/common/INETDefs.h" 13 | #include "inet/common/packet/Packet.h" 14 | 15 | 16 | #include "../../linklayer/common/VLANTag_m.h" 17 | #include "../../ieee8021q/Ieee8021q.h" 18 | 19 | #include "inet/linklayer/ieee8022/Ieee8022LlcSocket.h" 20 | #include "inet/common/IProtocolRegistrationListener.h" 21 | 22 | using namespace inet; 23 | 24 | namespace detnetmod { 25 | 26 | class PcpMarker: public cSimpleModule 27 | { 28 | 29 | protected: 30 | int ssap = -1; 31 | int dsap = -1; 32 | 33 | Ieee8022LlcSocket llcSocket; 34 | 35 | int NumClasses; 36 | // virtual ~PcpMarker(); 37 | virtual int numInitStages() const override { return NUM_INIT_STAGES; } 38 | virtual void initialize(); 39 | virtual void handleMessage(cMessage *msg) override; 40 | 41 | 42 | private: 43 | std::vectorPCPValues; 44 | 45 | }; 46 | 47 | } // namespace detnetmod 48 | 49 | 50 | 51 | 52 | 53 | #endif /* DETNETMOD_NETWORKLAYER_DIFFSERV_PCPMARKER_H_ */ 54 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/TokenBucketClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TokenBucketClass.h 3 | * 4 | * Created on: Nov 5, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_NETWORKLAYER_DIFFSERV_TOKENBUCKETCLASS_H_ 9 | #define DETNETMOD_NETWORKLAYER_DIFFSERV_TOKENBUCKETCLASS_H_ 10 | 11 | 12 | #include "inet/common/INETDefs.h" 13 | #include "inet/common/packet/Packet.h" 14 | 15 | 16 | #include "../../linklayer/common/VLANTag_m.h" 17 | #include "../../ieee8021q/Ieee8021q.h" 18 | #include "nesting/ieee8021q/queue/gating/GateController.h" 19 | #include "nesting/ieee8021q/queue/gating/TransmissionGate.h" 20 | 21 | using namespace inet; 22 | using namespace nesting; 23 | 24 | namespace detnetmod { 25 | 26 | class INET_API TokenBucketClass : public cSimpleModule 27 | { 28 | protected: 29 | 30 | typedef struct flow_table{ 31 | uint32_t vqueue; 32 | uint32_t flowId; 33 | int type; 34 | double bwreq; 35 | simtime_t last_arrival; 36 | uint32_t threshold; 37 | }flow_table_t; 38 | 39 | typedef struct activeflow{ 40 | flow_table_t *flow; 41 | }activeflow_t; 42 | 43 | //Parameters 44 | int NumClasses; 45 | std::vectorClassBandwidthReservation; 46 | double OutputBandwidth; 47 | uint32_t Threshold; 48 | 49 | 50 | simtime_t LastPacketArrival = 0; 51 | int numActiveflows=0; 52 | GateController* gateController; 53 | nesting::TransmissionGate* tgate; 54 | 55 | 56 | public: 57 | // TokenBucketClass() {} 58 | 59 | protected: 60 | virtual ~TokenBucketClass(); 61 | // virtual void initialize() override; 62 | // virtual void handleMessage(cMessage *msg) override; 63 | 64 | virtual bool shouldDrop(cPacket *packet); 65 | virtual bool Drop(cPacket *packet,Packet* netpacket); 66 | virtual void sendOut(cMessage *msg,int gateIndex); 67 | 68 | // Activelist functions 69 | void AddActiveFlow(activeflow_t flow, int Class); 70 | virtual activeflow_t RemoveActiveFlow(int Class); 71 | 72 | virtual flow_table_t *ClassifyFlow(Packet* netpacket,cPacket* packet,int flowId,uint32_t PacketLength, int Class); 73 | 74 | virtual int numInitStages() const override { return NUM_INIT_STAGES; } 75 | virtual void initialize(); 76 | virtual void handleMessage(cMessage *msg) override; 77 | // virtual void refreshDisplay() const override; 78 | // virtual int meterPacket(cPacket *packet); 79 | 80 | private: 81 | simsignal_t arrivalSignal; 82 | 83 | double reservedBandwidth_consumption; 84 | std::vectorflow_table[102400]; 85 | std::vectorreservedflows[63]; 86 | std::vectorbesteffortflows; 87 | }; 88 | 89 | } // namespace detnetmod 90 | 91 | 92 | 93 | #endif /* DETNETMOD_NETWORKLAYER_DIFFSERV_TOKENBUCKETCLASS_H_ */ 94 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/detnetDiffserv.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.networklayer.diffserv; 17 | import inet.linklayer.contract.ITrafficConditioner; 18 | import inet.linklayer.ethernet.EtherEncap; 19 | import inet.networklayer.diffserv.BehaviorAggregateClassifier; 20 | 21 | 22 | // 23 | // TODO documentation 24 | // 25 | module detnetDiffserv like ITrafficConditioner 26 | { 27 | parameters: 28 | int numClasses; 29 | string interfaceTableModule; 30 | @display("i=block/classifier"); 31 | *.interfaceTableModule = default(absPath(interfaceTableModule)); 32 | string fcsMode @enum("declared","computed") = default("declared"); 33 | *.fcsMode = fcsMode; 34 | gates: 35 | input in; 36 | output out; 37 | submodules: 38 | DscpClassifier: BehaviorAggregateClassifier { 39 | @display("p=110,138"); 40 | } 41 | pfpc: PFPC { 42 | parameters: 43 | NumClasses = numClasses; 44 | @display("p=291,138"); 45 | } 46 | pcpMarker: PcpMarker { 47 | parameters: 48 | NumGates = numClasses+1; 49 | @display("p=453,138"); 50 | } 51 | connections: 52 | for i=1..numClasses { 53 | DscpClassifier.outs++ --> pfpc.in++; 54 | pfpc.out++ --> pcpMarker.in++; 55 | } 56 | DscpClassifier.defaultOut --> pfpc.in++; 57 | pfpc.out++ --> pcpMarker.in++; 58 | pcpMarker.out --> out; 59 | 60 | in --> DscpClassifier.in; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/detnetmod/networklayer/diffserv/diffservPCP.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.networklayer.diffserv; 17 | import inet.linklayer.contract.ITrafficConditioner; 18 | import inet.linklayer.ethernet.EtherEncap; 19 | import inet.networklayer.diffserv.BehaviorAggregateClassifier; 20 | 21 | 22 | // 23 | // TODO documentation 24 | // 25 | module diffservPCP like ITrafficConditioner 26 | { 27 | parameters: 28 | int numClasses; 29 | string interfaceTableModule; 30 | @display("i=block/classifier"); 31 | *.interfaceTableModule = default(absPath(interfaceTableModule)); 32 | string fcsMode @enum("declared","computed") = default("declared"); 33 | *.fcsMode = fcsMode; 34 | gates: 35 | input in; 36 | output out; 37 | submodules: 38 | DscpClassifier: BehaviorAggregateClassifier { 39 | @display("p=110,138"); 40 | } 41 | pcpMarker: PcpMarker { 42 | parameters: 43 | NumGates = numClasses+1; 44 | @display("p=453,138"); 45 | } 46 | connections: 47 | for i=1..numClasses { 48 | DscpClassifier.outs++ --> pcpMarker.in++; 49 | } 50 | DscpClassifier.defaultOut --> pcpMarker.in++; 51 | pcpMarker.out --> out; 52 | 53 | in --> DscpClassifier.in; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/detnetmod/node/.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.node; 17 | -------------------------------------------------------------------------------- /src/detnetmod/node/DetnetEtherHost.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.node; 17 | 18 | 19 | import inet.applications.generic.IIpvxTrafficGenerator; 20 | import inet.common.queue.Sink; 21 | import inet.linklayer.contract.IEthernetInterface; 22 | import inet.node.inet.StandardHost; 23 | import nesting.common.queue.EtherTrafGenQueue; 24 | import detnetmod.detnetmod.applications.VlanEtherTrafGenSchedDetnet; 25 | 26 | // 27 | // VLAN capable host module, that sends packets with the maximum throughput the 28 | // physical medium allows. This module's main use case is to simulate a 29 | // congestion scenarios on a switch. 30 | // 31 | module DetnetEtherHost 32 | { 33 | parameters: 34 | @display("i=device/pc2;bgb=363,398"); 35 | @networkNode(); 36 | @labels(node,ethernet-node); 37 | *.interfaceTableModule = default(""); 38 | eth.mac.queueModule = "^.^.trafGenQueueApp"; 39 | gates: 40 | inout ethg @labels(EtherFrame-conn); 41 | submodules: 42 | trafGenQueueApp: VlanEtherTrafGenSchedDetnet { 43 | @display("p=192,69"); 44 | } 45 | sink: Sink { 46 | @display("p=84,69"); 47 | } 48 | eth: like IEthernetInterface { 49 | parameters: 50 | @display("p=142,283,row,150;q=txQueue"); 51 | } 52 | connections: 53 | eth.upperLayerIn <-- trafGenQueueApp.out; 54 | eth.upperLayerOut --> sink.in++; 55 | eth.phys <--> ethg; 56 | } -------------------------------------------------------------------------------- /src/detnetmod/node/VlanEtherHostFullLoadDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.node; 17 | 18 | import inet.linklayer.ethernet.EtherMacFullDuplex; 19 | import inet.linklayer.ethernet.IEtherEncap; 20 | import inet.networklayer.common.InterfaceTable; 21 | import inet.linklayer.contract.IEthernetInterface; 22 | import nesting.application.ethernet.VlanEtherTrafGenSched; 23 | import nesting.ieee8021q.clock.IClock; 24 | import nesting.ieee8021q.queue.gating.ScheduleSwap; 25 | import nesting.linklayer.ethernet.VLANEncap; 26 | 27 | import inet.common.queue.Sink; 28 | 29 | import detnetmod.detnetmod.applications.VlanEtherTrafGenSchedDetnet; 30 | import detnetmod.detnetmod.applications.VlanEtherTrafGenFullLoadDetnet; 31 | import nesting.linklayer.ethernet.VlanEthernetInterface; 32 | 33 | 34 | // 35 | // Simple Host with the capability to send out frames according to a given schedule 36 | // 37 | // @see ~VlanEtherTrafGen 38 | // 39 | module VlanEtherHostFullLoadDetnet 40 | { 41 | parameters: 42 | string fcsMode @enum("declared","computed") = default("declared"); 43 | @networkNode(); 44 | @labels(node,ethernet-node); 45 | @display("i=device/pc2;bgb=385,371"); 46 | *.interfaceTableModule = default(absPath(".interfaceTable")); 47 | *.fcsMode = fcsMode; 48 | eth.mac.queueModule = "^.^.trafGenQueueApp"; 49 | gates: 50 | inout ethg @labels(EtherFrame-conn); 51 | submodules: 52 | trafGenQueueApp: VlanEtherTrafGenFullLoadDetnet { 53 | @display("p=212.768,69.296005"); 54 | } 55 | interfaceTable: InterfaceTable { 56 | parameters: 57 | @display("p=330,215;is=s"); 58 | } 59 | eth: like IEthernetInterface { 60 | parameters: 61 | @display("p=138,271,row,150;q=txQueue"); 62 | } 63 | sink: Sink { 64 | @display("p=78,90"); 65 | } 66 | connections: 67 | eth.upperLayerIn <-- trafGenQueueApp.out; 68 | eth.phys <--> ethg; 69 | eth.upperLayerOut --> sink.in++; 70 | } 71 | -------------------------------------------------------------------------------- /src/detnetmod/node/VlanEtherHostSchedDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.node; 17 | 18 | import inet.linklayer.ethernet.EtherMacFullDuplex; 19 | import inet.linklayer.ethernet.IEtherEncap; 20 | import inet.networklayer.common.InterfaceTable; 21 | import inet.linklayer.contract.IEthernetInterface; 22 | import nesting.application.ethernet.VlanEtherTrafGenSched; 23 | import nesting.ieee8021q.clock.IClock; 24 | import nesting.ieee8021q.queue.gating.ScheduleSwap; 25 | import nesting.linklayer.ethernet.VLANEncap; 26 | 27 | import detnetmod.detnetmod.applications.VlanEtherTrafGenSchedDetnet; 28 | import nesting.linklayer.ethernet.VlanEthernetInterface; 29 | 30 | 31 | // 32 | // Simple Host with the capability to send out frames according to a given schedule 33 | // 34 | // @see ~VlanEtherTrafGen 35 | // 36 | module VlanEtherHostSchedDetnet 37 | { 38 | parameters: 39 | string fcsMode @enum("declared","computed") = default("declared"); 40 | @networkNode(); 41 | @labels(node,ethernet-node); 42 | @display("i=device/pc2;bgb=385,371"); 43 | *.interfaceTableModule = default(absPath(".interfaceTable")); 44 | *.fcsMode = fcsMode; 45 | gates: 46 | inout ethg @labels(EtherFrame-conn); 47 | submodules: 48 | trafGenSchedApp: VlanEtherTrafGenSchedDetnet { 49 | @display("p=212.768,69.296005"); 50 | } 51 | interfaceTable: InterfaceTable { 52 | parameters: 53 | @display("p=330,215;is=s"); 54 | } 55 | clock: like IClock { 56 | @display("p=330,69"); 57 | } 58 | scheduleSwap: ScheduleSwap { 59 | usedInHost = true; 60 | 61 | @display("p=330,149;b=29,25"); 62 | } 63 | eth: like IEthernetInterface { 64 | parameters: 65 | @display("p=138,271,row,150;q=txQueue"); 66 | // mac.queueModule = "^.^.eth.queuing.transmissionSelection"; 67 | // mac.mtu = 1500B; 68 | // mac.promiscuous = true; 69 | // queuing.tsAlgorithms[*].macModule = "^.^.^.eth.mac"; 70 | // queuing.gateController.macModule = "^.^.^.eth.mac"; 71 | } 72 | connections: 73 | trafGenSchedApp.out --> eth.upperLayerIn; 74 | eth.upperLayerOut --> trafGenSchedApp.in; 75 | 76 | eth.phys <--> ethg; 77 | } 78 | -------------------------------------------------------------------------------- /src/detnetmod/node/base/ApplicationLayerNodeBase.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) OpenSim Ltd. 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU Lesser General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with this program; if not, see . 16 | // 17 | 18 | package detnetmod.detnetmod.node.base; 19 | 20 | import detnetmod.detnetmod.applications.SetKind; 21 | //import detnetmod.detnetmod.applications.IApplication; 22 | import inet.applications.contract.IApp; 23 | 24 | import inet.common.MessageDispatcher; 25 | import inet.applications.udpapp.*; 26 | 27 | @namespace(); 28 | //module ApplicationLayerNodeBase extends TransportLayerNodeBase 29 | module ApplicationLayerNodeBase extends NetPerfDetnet 30 | { 31 | parameters: 32 | int numApps = default(0); 33 | @figure[applicationLayer](type=rectangle; pos=250,6; size=1000,130; lineColor=#808080; cornerRadius=5; fillColor=#ffff00; fillOpacity=0.1); 34 | @figure[applicationLayer.title](type=text; pos=1245,11; anchor=ne; text="application layer"); 35 | bool setKindApp = default(true); 36 | @display("bgb=1293.075,806.39996"); 37 | submodules: 38 | app[numApps]: <> like IApp { 39 | parameters: 40 | @display("p=621.4563,40.56125,row,150"); 41 | } 42 | at: MessageDispatcher if numApps!=0 { 43 | parameters: 44 | @display("p=750,146;b=1000,5,,,,1"); 45 | } 46 | 47 | setFlowIdApp[numApps]: SetKind if numApps!=0 && setKindApp { 48 | @display("p=950.05255,40.56125;i=block/star"); 49 | } 50 | connections allowunconnected: 51 | for i=0..numApps-1 { 52 | app[i].socketOut --> setFlowIdApp[i].UpperLayerIn if setKindApp; 53 | app[i].socketOut --> at.in++ if !setKindApp; 54 | setFlowIdApp[i].LowerLayerOut --> at.in++ if setKindApp; 55 | // app[i].socketOut --> at.in++; 56 | app[i].socketIn <-- at.out++; 57 | } 58 | 59 | at.out++ --> udp.appIn if hasUdp && exists(at); 60 | at.in++ <-- udp.appOut if hasUdp && exists(at); 61 | 62 | at.out++ --> tcp.appIn if hasTcp && exists(at); 63 | at.in++ <-- tcp.appOut if hasTcp && exists(at); 64 | 65 | at.out++ --> sctp.appIn if hasSctp && exists(at); 66 | at.in++ <-- sctp.appOut if hasSctp && exists(at); 67 | 68 | at.out++ --> tn.in++ if exists(at); 69 | at.in++ <-- tn.out++ if exists(at); 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/detnetmod/node/detnethost.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.node; 17 | 18 | 19 | import detnetmod.detnetmod.node.base.ApplicationLayerNodeBase; 20 | //import inet.node.base.ApplicationLayerNodeBase; 21 | import nesting.ieee8021q.clock.IdealClock; 22 | 23 | 24 | 25 | module DetnetHost extends ApplicationLayerNodeBase 26 | { 27 | parameters: 28 | @display("i=device/pc2;bgb=1365.0925,813.86755"); 29 | @figure[submodules]; 30 | forwarding = default(false); // disable routing by default 31 | ipv4.arp.proxyArpInterfaces = default(""); // proxy arp is disabled on hosts by default 32 | *.routingTableModule = default("^.ipv4.routingTable"); 33 | submodules: 34 | 35 | clock: IdealClock { 36 | @display("p=220.5,50.399998"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/DetnetQueuingFrames.h: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | #ifndef __STUPRONESTINGPROJECT_QUEUINGFRAMES_H_ 17 | #define __STUPRONESTINGPROJECT_QUEUINGFRAMES_H_ 18 | 19 | #include 20 | #include 21 | 22 | #include "inet/common/packet/Packet.h" 23 | #include "inet/linklayer/common/MacAddressTag_m.h" 24 | #include "inet/common/packet/Message.h" 25 | #include "inet/linklayer/common/Ieee802SapTag_m.h" 26 | 27 | #include "../linklayer/common/VLANTag_m.h" 28 | #include "../ieee8021q/Ieee8021q.h" 29 | 30 | #include "inet/linklayer/common/Ieee802Ctrl.h" 31 | #include "inet/linklayer/ieee8021q/Ieee8021qHeader_m.h" 32 | #include "inet/linklayer/common/MacAddressTag_m.h" 33 | #include "inet/linklayer/ethernet/EtherFrame_m.h" 34 | #include "inet/linklayer/ethernet/EtherEncap.h" 35 | #include "inet/common/packet/Packet.h" 36 | #include "inet/common/packet/Message_m.h" 37 | 38 | using namespace omnetpp; 39 | 40 | namespace detnetmod { 41 | 42 | /** See NED file for a detailed description */ 43 | class DetnetQueuingFrames: public cSimpleModule { 44 | private: 45 | /** Number of queues per port */ 46 | int numberOfQueues; 47 | 48 | /** 49 | * A static implementation of the traffic class mapping from the standard 50 | */ 51 | int standardTrafficClassMapping[kNumberOfPCPValues][kNumberOfPCPValues] = 52 | { 53 | { 0, 0, 0, 0, 0, 0, 0, 0 }, 54 | { 0, 0, 0, 0, 1, 1, 1, 1 }, 55 | { 0, 0, 0, 0, 1, 1, 2, 2 }, 56 | { 0, 0, 1, 1, 2, 2, 3, 3 }, 57 | { 0, 0, 1, 1, 2, 2, 3, 4 }, 58 | { 1, 0, 2, 2, 3, 3, 4, 5 }, 59 | { 1, 0, 2, 3, 4, 4, 5, 6 }, 60 | { 1, 0, 2, 3, 4, 5, 6, 7 } 61 | }; 62 | 63 | 64 | int getFramePriority(int numberOfQueues); 65 | protected: 66 | virtual void initialize(); 67 | 68 | virtual void handleMessage(cMessage *msg); 69 | }; 70 | 71 | } // namespace nesting 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/DetnetQueuingFrames.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.queuing; 17 | 18 | // 19 | // Receives cPackets with attached Ieee8021QCtrl control information and 20 | // sends those packets to a specific output port by mapping the packets pcp 21 | // value to an out-gate index. For the mapping a default mapping table 22 | // according to the Ieee802.1Q standard is used. 23 | // 24 | // @see ~Ieee8021QCtrl 25 | // 26 | simple DetnetQueuingFrames { 27 | parameters: 28 | @display("i=block/classifier"); 29 | @class(DetnetQueuingFrames); 30 | bool verbose = default(false); 31 | gates: 32 | input in; 33 | output out[]; 34 | } 35 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/PifoDetnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PifoDetnet.h 3 | * 4 | * Created on: Jan 3, 2020 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_QUEUING_PIFODETNET_H_ 9 | #define DETNETMOD_QUEUING_PIFODETNET_H_ 10 | 11 | 12 | #include "inet/common/INETDefs.h" 13 | #include "inet/common/queue/PassiveQueueBase.h" 14 | 15 | #include "inet/common/ModuleAccess.h" 16 | #include "inet/common/queue/IQueueAccess.h" 17 | #include "nesting/ieee8021q/queue/framePreemption/IPreemptableQueue.h" 18 | #include "nesting/ieee8021q/Ieee8021q.h" 19 | #include "nesting/ieee8021q/queue/transmissionSelectionAlgorithms/TSAlgorithm.h" 20 | 21 | using namespace inet; 22 | using namespace nesting; 23 | namespace detnetmod { 24 | 25 | /** 26 | * Drop-front queue. See NED for more info. 27 | */ 28 | class PifoDetnet : public nesting::LengthAwareQueue, public IQueueAccess 29 | { 30 | protected: 31 | 32 | int bytelength; 33 | cObject *enqueuedDetnet; 34 | 35 | protected: 36 | virtual void initialize() override; 37 | 38 | /** 39 | * Redefined from PassiveQueueBase. 40 | */ 41 | virtual void enqueue(cPacket* packet) override; 42 | virtual cPacket* dequeue() override; 43 | 44 | virtual int getLength() const override { return queue.getLength(); } 45 | virtual int getByteLength() const override { return bytelength; } 46 | 47 | public: 48 | virtual ~PifoDetnet(); 49 | 50 | }; 51 | 52 | } // namespace detnetmod 53 | 54 | 55 | 56 | #endif /* DETNETMOD_QUEUING_PIFODETNET_H_ */ 57 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/PifoDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2005 Andras Varga 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU Lesser General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with this program; if not, see . 16 | // 17 | 18 | package detnetmod.detnetmod.queuing; 19 | import inet.common.queue.IOutputQueue; 20 | // 21 | // Drop-tail queue, to be used in network interfaces. 22 | // Conforms to the ~IOutputQueue interface. 23 | // 24 | simple PifoDetnet like IOutputQueue 25 | { 26 | parameters: 27 | int bufferCapacity @unit(bit) = default(100*1500*8b); // Buffer can hold up to 100 MTU size packets 28 | string queueName = default("l2queue"); // Name of the inner cQueue object, used in the 'q' tag of the display string 29 | bool expressQueue = default(true); 30 | string transmissionSelectionAlgorithmModule; // Path to the ~TSAlgorithm module 31 | @display("i=block/queue"); 32 | @class(PifoDetnet); 33 | @signal[rcvdPk](type=long); // type=unique packet id 34 | @signal[enqueuePk](type=long); // type=unique packet id 35 | @signal[dequeuePk](type=long); // type=unique packet id 36 | @signal[dropPkByQueue](type=long); // type=unique packet id 37 | @signal[queueingTime](type=simtime_t; unit=s); 38 | @signal[queueLength](type=long); 39 | @statistic[rcvdPk](title="received packets"; record=count,vector; interpolationmode=none); 40 | @statistic[dropPk](title="dropped packets"; source=dropPkByQueue; record=count,vector; interpolationmode=none); 41 | @statistic[queueingTime](title="queueing time"; record=histogram,vector; interpolationmode=none); 42 | @statistic[queueLength](title="queue length"; record=max,timeavg,vector; interpolationmode=sample-hold); 43 | bool verbose = default(false); 44 | gates: 45 | input in; 46 | output out; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/QueueDetnet.cc: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | #include "QueueDetnet.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | namespace detnetmod{ 24 | 25 | Define_Module(QueueDetnet); 26 | 27 | QueueDetnet::~QueueDetnet() { 28 | cancelEvent(&requestPacketMsg); 29 | while (!queue.isEmpty()) { 30 | delete queue.pop(); 31 | } 32 | queue.clear(); 33 | } 34 | 35 | void QueueDetnet::initialize() { 36 | rcvdPkSignal = registerSignal("rcvdPk"); 37 | enqueuePkSignal = registerSignal("enqueuePk"); 38 | dequeuePkSignal = registerSignal("dequeuePk"); 39 | dropPkByQueueSignal = registerSignal("dropPkByQueue"); 40 | queueingTimeSignal = registerSignal("queueingTime"); 41 | queueLengthSignal = registerSignal("queueLength"); 42 | 43 | queue.setName(par("queueName")); 44 | availableBufferCapacity = par("bufferCapacity"); 45 | expressQueue = par("expressQueue"); 46 | WATCH(numPacketsReceived); 47 | WATCH(numPacketsDropped); 48 | WATCH(numPacketsEnqueued); 49 | WATCH(availableBufferCapacity); 50 | // WATCH(numPacketsDequeued); 51 | 52 | // module references 53 | tsAlgorithm = getModuleFromPar( 54 | par("transmissionSelectionAlgorithmModule"), this); 55 | 56 | // statistics 57 | emit(queueLengthSignal, queue.getLength()); 58 | } 59 | 60 | void QueueDetnet::enqueue(cPacket* packet) { 61 | if (availableBufferCapacity >= packet->getBitLength()) { 62 | emit(enqueuePkSignal, packet->getTreeId()); 63 | numPacketsEnqueued++; 64 | queue.insert(packet); 65 | availableBufferCapacity -= packet->getBitLength(); 66 | handlePacketEnqueuedEvent(packet); 67 | bytelength+=packet->getByteLength(); 68 | } else { 69 | emit(dropPkByQueueSignal, packet->getTreeId()); 70 | numPacketsDropped++; 71 | handlePacketEnqueuedEvent(packet); 72 | delete packet; 73 | } 74 | emit(queueLengthSignal, queue.getLength()); 75 | } 76 | 77 | cPacket* QueueDetnet::dequeue() { 78 | if (queue.isEmpty()) { 79 | return nullptr; 80 | } 81 | 82 | cPacket* packet = static_cast(queue.pop()); 83 | availableBufferCapacity += packet->getBitLength(); 84 | // numPacketsDequeued++; 85 | emit(queueLengthSignal, queue.getLength()); 86 | bytelength-=packet->getByteLength(); 87 | return packet; 88 | } 89 | 90 | } 91 | // namespace nesting 92 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/QueueDetnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QueueDetnet.h 3 | * 4 | * Created on: Oct 3, 2019 5 | * Author: vamsi 6 | */ 7 | 8 | #ifndef DETNETMOD_QUEUING_QUEUEDETNET_H_ 9 | #define DETNETMOD_QUEUING_QUEUEDETNET_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "inet/common/ModuleAccess.h" 15 | #include "inet/common/queue/IQueueAccess.h" 16 | 17 | 18 | #include "nesting/ieee8021q/Ieee8021q.h" 19 | #include "nesting/ieee8021q/queue/transmissionSelectionAlgorithms/TSAlgorithm.h" 20 | #include "nesting/ieee8021q/queue/framePreemption/IPreemptableQueue.h" 21 | 22 | using namespace omnetpp; 23 | using namespace inet; 24 | using namespace nesting; 25 | namespace detnetmod { 26 | /** 27 | * See the NED file for a detailed description. 28 | */ 29 | //class nesting::TSAlgorithm; 30 | class QueueDetnet: public nesting::LengthAwareQueue, public IQueueAccess{ 31 | protected: 32 | int bytelength; 33 | 34 | protected: 35 | virtual void initialize() override; 36 | virtual void enqueue(cPacket* packet) override; 37 | virtual cPacket* dequeue() override; 38 | virtual int getLength() const override { return queue.getLength(); } 39 | virtual int getByteLength() const override { return bytelength; } 40 | 41 | public: 42 | virtual ~QueueDetnet(); 43 | 44 | }; 45 | 46 | } 47 | 48 | #endif /* DETNETMOD_QUEUING_QUEUEDETNET_H_ */ 49 | -------------------------------------------------------------------------------- /src/detnetmod/queuing/QueueDetnet.ned: -------------------------------------------------------------------------------- 1 | // 2 | // This program is free software: you can redistribute it and/or modify 3 | // it under the terms of the GNU Lesser General Public License as published by 4 | // the Free Software Foundation, either version 3 of the License, or 5 | // (at your option) any later version. 6 | // 7 | // This program is distributed in the hope that it will be useful, 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | // GNU Lesser General Public License for more details. 11 | // 12 | // You should have received a copy of the GNU Lesser General Public License 13 | // along with this program. If not, see http://www.gnu.org/licenses/. 14 | // 15 | 16 | package detnetmod.detnetmod.queuing; 17 | import inet.common.queue.IOutputQueue; 18 | 19 | // 20 | // Queue with fixed capacity and ability to consider packet sizes for length- 21 | // aware-scheduling. 22 | // 23 | // This module must be connected (not necessarely direct) to a ~TSAlgorithm 24 | // module the ouput port. 25 | // 26 | // @see ~TSAlgorithm 27 | // 28 | simple QueueDetnet like IOutputQueue 29 | { 30 | parameters: 31 | int bufferCapacity @unit(bit) = default(100*1500*8b); // Buffer can hold up to 100 MTU size packets 32 | string queueName = default("l2queue"); // Name of the inner cQueue object, used in the 'q' tag of the display string 33 | bool expressQueue = default(true); 34 | string transmissionSelectionAlgorithmModule; // Path to the ~TSAlgorithm module 35 | @display("i=block/queue"); 36 | @class(QueueDetnet); 37 | @signal[rcvdPk](type=long); // type=unique packet id 38 | @signal[enqueuePk](type=long); // type=unique packet id 39 | @signal[dequeuePk](type=long); // type=unique packet id 40 | @signal[dropPkByQueue](type=long); // type=unique packet id 41 | @signal[queueingTime](type=simtime_t; unit=s); 42 | @signal[queueLength](type=long); 43 | @statistic[rcvdPk](title="received packets"; record=count,vector; interpolationmode=none); 44 | @statistic[dropPk](title="dropped packets"; source=dropPkByQueue; record=count,vector; interpolationmode=none); 45 | @statistic[queueingTime](title="queueing time"; record=histogram,vector; interpolationmode=none); 46 | @statistic[queueLength](title="queue length"; record=max,timeavg,vector; interpolationmode=sample-hold); 47 | bool verbose = default(false); 48 | gates: 49 | input in; 50 | output out; 51 | } 52 | -------------------------------------------------------------------------------- /src/documentation.svg: -------------------------------------------------------------------------------- 1 | Documentation: Heavily in ProgressDocumentationHeavily in Progress -------------------------------------------------------------------------------- /src/package.ned: -------------------------------------------------------------------------------- 1 | // designate the NED package of this folder 2 | package detnetmod; 3 | 4 | // namespace of module C++ classes 5 | @namespace(detnetmod); 6 | 7 | @license(LGPL); 8 | -------------------------------------------------------------------------------- /src/version.svg: -------------------------------------------------------------------------------- 1 | Version: 1.0Version1.0 --------------------------------------------------------------------------------