NED File examples/ospfv2/simpletest/SimpleTest.ned
| Name | Type | Description |
|---|---|---|
| SimpleTest | network | (no description) |
Source code
package inet.examples.ospfv2.simpletest; import inet.common.misc.ThruputMeteringChannel; import inet.common.scenario.ScenarioManager; import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator; import inet.node.ethernet.EthernetSwitch; import inet.node.inet.StandardHost; import inet.node.ospfv2.OspfRouter; network SimpleTest { parameters: @display("p=10,10;b=712,152"); types: channel C extends ThruputMeteringChannel { delay = 0.1us; datarate = 100Mbps; thruputDisplayFormat = "#N"; } submodules: H1: StandardHost { parameters: @display("p=250,150;i=device/laptop"); gates: ethg[1]; } N1: EthernetSwitch { parameters: @display("p=400,150"); gates: ethg[2]; } R1: OspfRouter { parameters: @display("p=550,150"); hasStatus = true; gates: ethg[2]; } R2: OspfRouter { parameters: @display("p=700,150"); hasStatus = true; gates: ethg[2]; } N2: EthernetSwitch { parameters: @display("p=850,150"); gates: ethg[2]; } H2: StandardHost { parameters: @display("p=1000,150;i=device/laptop"); gates: ethg[1]; } configurator: Ipv4NetworkConfigurator { parameters: config = xml("<config>"+ "<interface among='H1 R1' address='192.168.1.x' netmask='255.255.255.0' />"+ "<interface among='H2 R2' address='192.168.2.x' netmask='255.255.255.0' />"+ "<interface among='R1 R2' address='192.168.60.x' netmask='255.255.255.0' />"+ "<route hosts='H1 H2' destination='*' netmask='0.0.0.0' interface='eth0' />"+ "</config>"); addStaticRoutes = false; addDefaultRoutes = false; @display("p=100,100;is=s"); } scenarioManager: ScenarioManager { @display("p=100,200;is=s"); } connections: H1.ethg[0] <--> C <--> N1.ethg[0]; N1.ethg[1] <--> C <--> R1.ethg[0]; R1.ethg[1] <--> C <--> R2.ethg[0]; R2.ethg[1] <--> C <--> N2.ethg[0]; N2.ethg[1] <--> C <--> H2.ethg[0]; }