%description: Testing OSPF routing Detects bugs in OSPF on RFC2328 fig.6. network These UDP communications don't work yet: Area3.N10.host0 <--> N15.host0 N12.host0 <--> Area3.H1 %#-------------------------------------------------------------------------------------------------------------- %file: test.ned import inet.linklayer.ethernet.EtherHub; import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator; import inet.nodes.inet.StandardHost; import inet.nodes.ospfv2.OSPFRouter; import inet.util.ThruputMeteringChannel; channel C extends ThruputMeteringChannel { delay = 0.1us; datarate = 100Mbps; thruputDisplayFormat = "#N"; } module OspfLan { parameters: int h; // number of hosts on the hub @display("i=cloud"); gates: inout ethg[]; submodules: hub: EtherHub { @display("is=s"); } host[h]: StandardHost { @display("is=s"); } connections: for i=0..sizeof(ethg)-1 { hub.ethg++ <--> ethg[i]; } for i=0..h-1 { hub.ethg++ <--> C <--> host[i].ethg++; } } network Fig6 { parameters: @display("p=10,10;b=704,560"); submodules: RT5: OSPFRouter { parameters: @display("p=496,144"); gates: ethg[6]; } RT6: OSPFRouter { parameters: @display("p=424,208"); gates: ethg[3]; } RT7: OSPFRouter { parameters: @display("p=496,328"); gates: ethg[4]; } RT10: OSPFRouter { parameters: @display("p=424,328"); gates: ethg[3]; } RT11: OSPFRouter { parameters: @display("p=282,404"); gates: ethg[2]; } N12: OspfLan { parameters: h = 1; @display("p=620,277"); } N15: OspfLan { parameters: h = 1; @display("p=608,356"); } Area2_N6: EtherHub { parameters: @display("p=504,467"); } Area2_N8: EtherHub { parameters: @display("p=411,467"); } Area3_RT12: OSPFRouter { parameters: @display("p=148,360"); gates: ethg[3]; } Area3_N9: EtherHub { parameters: @display("p=148,284"); } Area3_N10: OspfLan { parameters: h = 1; @display("p=148,452"); } Area3_H1: StandardHost { parameters: @display("p=64,360;i=device/pc_s"); } configurator: IPv4NetworkConfigurator { parameters: config = xml(""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"+ ""+"\n"); addStaticRoutes = false; addDefaultRoutes = false; @display("p=120,43"); } connections allowunconnected: Area3_RT12.ethg[1] <--> C <--> Area3_H1.ethg++; Area3_RT12.ethg[0] <--> C <--> Area3_N9.ethg++; Area3_RT12.ethg[2] <--> C <--> Area3_N10.ethg++; RT11.ethg[0] <--> C <--> Area3_N9.ethg++; Area2_N8.ethg++ <--> C <--> RT11.ethg[1]; Area2_N8.ethg++ <--> C <--> RT10.ethg[1]; Area2_N6.ethg++ <--> C <--> RT10.ethg[2]; Area2_N6.ethg++ <--> C <--> RT7.ethg[1]; RT5.ethg[3] <--> C <--> RT7.ethg[0]; RT5.ethg[2] <--> C <--> RT6.ethg[2]; RT5.ethg[4] <--> C <--> N12.ethg++; RT6.ethg[1] <--> C <--> RT10.ethg[0]; RT7.ethg[3] <--> C <--> N12.ethg++; RT7.ethg[2] <--> C <--> N15.ethg++; } %#-------------------------------------------------------------------------------------------------------------- %inifile: omnetpp.ini [General] description = "Full network test" network = Fig6 ned-path = .;../../../../src;../../lib tkenv-plugin-path = ../../../etc/plugins sim-time-limit = 300s #omnetpp 5.0 - 5.1 compatibility: eventlog-file = "${resultdir}/${configname}-${runnumber}.elog" output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca" output-vector-file = "${resultdir}/${configname}-${runnumber}.vec" snapshot-file = "${resultdir}/${configname}-${runnumber}.sna" **.ospf.ospfConfig = xmldoc("ASConfig.xml") **.arp.cacheTimeout = 1s *.usenew = true **.Area3_N10.host[0].numUdpApps = 2 **.N15.host[0].numUdpApps = 2 **.N12.host[0].numUdpApps = 2 **.Area3_H1.numUdpApps = 2 **.udpApp[0].typename = "UDPEchoApp" **.udpApp[0].localPort = 1234 **.udpApp[1..].typename = "UDPBasicApp" **.udpApp[1..].destPort = 1234 **.udpApp[1..].messageLength = 32 bytes **.udpApp[1..].sendInterval = 1s **.udpApp[1..].startTime = 100s **.udpApp[1..].stopTime = this.startTime + 100s **.Area3_N10.host[0].udpApp[1].destAddresses = "N15.host[0]" **.N15.host[0].udpApp[1].destAddresses = "Area3_N10.host[0]" **.N12.host[0].udpApp[1].destAddresses = "Area3_H1" **.Area3_H1.udpApp[1].destAddresses = "N12.host[0]" %#-------------------------------------------------------------------------------------------------------------- %file: ASConfig.xml %#-------------------------------------------------------------------------------------------------------------- %contains: results/General-0.sca scalar Fig6.N12.host[0].udpApp[0] echoedPk:count 100 %contains: results/General-0.sca scalar Fig6.N12.host[0].udpApp[1] sentPk:count 100 %contains: results/General-0.sca scalar Fig6.N12.host[0].udpApp[1] rcvdPk:count 100 %contains: results/General-0.sca scalar Fig6.N15.host[0].udpApp[0] echoedPk:count 100 %contains: results/General-0.sca scalar Fig6.N15.host[0].udpApp[1] sentPk:count 100 %contains: results/General-0.sca scalar Fig6.N15.host[0].udpApp[1] rcvdPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_N10.host[0].udpApp[0] echoedPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_N10.host[0].udpApp[1] sentPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_N10.host[0].udpApp[1] rcvdPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_H1.udpApp[0] echoedPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_H1.udpApp[1] sentPk:count 100 %contains: results/General-0.sca scalar Fig6.Area3_H1.udpApp[1] rcvdPk:count 100 %#-------------------------------------------------------------------------------------------------------------- %not-contains: stdout undisposed object: %not-contains: stdout -- check module destructor %#--------------------------------------------------------------------------------------------------------------