ospf_backbone_and_2_stub.test 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. %description:
  2. Testing OSPF routing
  3. Backbone and 2 stub areas
  4. UDP communications through entire network
  5. %#--------------------------------------------------------------------------------------------------------------
  6. %file: test.ned
  7. import inet.linklayer.ethernet.EtherHub;
  8. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  9. import inet.node.inet.StandardHost;
  10. import inet.node.ospfv2.OSPFRouter;
  11. import inet.common.misc.ThruputMeteringChannel;
  12. network Test1
  13. {
  14. parameters:
  15. int numIRouters = default(0);
  16. @display("p=10,10;b=712,152");
  17. types:
  18. channel C extends ThruputMeteringChannel
  19. {
  20. delay = 0.1us;
  21. datarate = 100Mbps;
  22. thruputDisplayFormat = "#N";
  23. }
  24. submodules:
  25. H1: StandardHost {
  26. parameters:
  27. @display("p=56,92;i=device/laptop");
  28. gates:
  29. ethg[1];
  30. }
  31. N1: EtherHub {
  32. parameters:
  33. @display("p=184,182");
  34. gates:
  35. ethg[2];
  36. }
  37. RA1I[numIRouters]: OSPFRouter {
  38. gates:
  39. ethg[2];
  40. }
  41. R1: OSPFRouter {
  42. parameters:
  43. @display("p=296,92");
  44. gates:
  45. ethg[2];
  46. }
  47. RI[numIRouters]: OSPFRouter {
  48. gates:
  49. ethg[2];
  50. }
  51. R2: OSPFRouter {
  52. parameters:
  53. @display("p=416,92");
  54. gates:
  55. ethg[2];
  56. }
  57. RA2I[numIRouters]: OSPFRouter {
  58. gates:
  59. ethg[2];
  60. }
  61. N2: EtherHub {
  62. parameters:
  63. @display("p=532,182");
  64. gates:
  65. ethg[2];
  66. }
  67. H2: StandardHost {
  68. parameters:
  69. @display("p=660,92;i=device/laptop");
  70. gates:
  71. ethg[1];
  72. }
  73. configurator: IPv4NetworkConfigurator {
  74. parameters:
  75. config = xml("<config>"+
  76. "<interface among='H1 RA1I[*] R1' address='192.168.1.x' netmask='255.255.255.x' />"+
  77. "<interface among='H2 RA2I[*] R2' address='192.168.2.x' netmask='255.255.255.x' />"+
  78. "<interface among='R1 RI[*] R2' address='192.168.60.x' netmask='255.255.255.x' />"+
  79. "<route hosts='H1 H2' destination='*' netmask='0.0.0.0' interface='eth0' />"+
  80. "</config>");
  81. addStaticRoutes = false;
  82. addDefaultRoutes = false;
  83. @display("p=75,43");
  84. }
  85. connections:
  86. H1.ethg[0] <--> C <--> N1.ethg[0];
  87. N1.ethg[1] <--> C <--> R1.ethg[0] if numIRouters == 0;
  88. N1.ethg[1] <--> C <--> RA1I[0].ethg[0] if numIRouters > 0;
  89. for i = 1..numIRouters-1 {
  90. RA1I[i-1].ethg[1] <--> C <--> RA1I[i].ethg[0];
  91. }
  92. RA1I[numIRouters-1].ethg[1] <--> C <--> R1.ethg[0] if numIRouters > 0;
  93. R1.ethg[1] <--> C <--> R2.ethg[0] if numIRouters == 0;
  94. R1.ethg[1] <--> C <--> RI[0].ethg[0] if numIRouters > 0;
  95. for i = 1..numIRouters-1 {
  96. RI[i-1].ethg[1] <--> C <--> RI[i].ethg[0];
  97. }
  98. RI[numIRouters-1].ethg[1] <--> C <--> R2.ethg[0] if numIRouters > 0;
  99. R2.ethg[1] <--> C <--> N2.ethg[0] if numIRouters == 0;
  100. R2.ethg[1] <--> C <--> RA2I[0].ethg[0] if numIRouters > 0;
  101. for i = 1..numIRouters-1 {
  102. RA2I[i-1].ethg[1] <--> C <--> RA2I[i].ethg[0];
  103. }
  104. RA2I[numIRouters-1].ethg[1] <--> C <--> N2.ethg[0] if numIRouters > 0;
  105. N2.ethg[1] <--> C <--> H2.ethg[0];
  106. }
  107. %#--------------------------------------------------------------------------------------------------------------
  108. %inifile: omnetpp.ini
  109. [General]
  110. description = "Simple test"
  111. network = Test1
  112. ned-path = .;../../../../src;../../lib
  113. tkenv-plugin-path = ../../../etc/plugins
  114. sim-time-limit = 200s
  115. #omnetpp 5.0 - 5.1 compatibility:
  116. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  117. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  118. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  119. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  120. **.ospf.ospfConfig = xmldoc("ASConfig.xml")
  121. **.numUdpApps = 2
  122. **.udpApp[0].typename = "UDPBasicApp"
  123. **.udpApp[0].destPort = 1234
  124. **.udpApp[0].messageLength = 32 bytes
  125. **.udpApp[0].sendInterval = 1s
  126. **.udpApp[0].startTime = 55s
  127. **.udpApp[0].stopTime = this.startTime + 100s
  128. **.H2.udpApp[0].destAddresses = "H1"
  129. **.H1.udpApp[0].destAddresses = "H2"
  130. **.udpApp[1].typename = "UDPEchoApp"
  131. **.udpApp[1].localPort = 1234
  132. **.arp.cacheTimeout = 1s
  133. **.numIRouters = ${0,1,2,3,5,7,8}
  134. %#--------------------------------------------------------------------------------------------------------------
  135. %file: ASConfig.xml
  136. <?xml version="1.0"?>
  137. <OSPFASConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OSPF.xsd">
  138. <!-- Areas -->
  139. <Area id="0.0.0.0">
  140. <AddressRange address="192.168.60.0" mask="255.255.255.0" status="Advertise" />
  141. </Area>
  142. <Area id="0.0.0.1">
  143. <Stub defaultCost="10" />
  144. </Area>
  145. <Area id="0.0.0.2">
  146. <Stub defaultCost="10" />
  147. </Area>
  148. <!-- Routers -->
  149. <Router name="RA1I[*]" RFC1583Compatible="true">
  150. <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceOutputCost="2" />
  151. <BroadcastInterface ifName="eth1" areaID="0.0.0.1" interfaceOutputCost="2" />
  152. </Router>
  153. <Router name="R1" RFC1583Compatible="true">
  154. <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceOutputCost="1" routerPriority="1" />
  155. <PointToPointInterface ifName="eth1" areaID="0.0.0.0" interfaceOutputCost="2" />
  156. </Router>
  157. <Router name="RI[*]" RFC1583Compatible="true">
  158. <PointToPointInterface ifName="eth0" areaID="0.0.0.0" interfaceOutputCost="2" />
  159. <PointToPointInterface ifName="eth1" areaID="0.0.0.0" interfaceOutputCost="2" />
  160. </Router>
  161. <Router name="R2" RFC1583Compatible="true">
  162. <PointToPointInterface ifName="eth0" areaID="0.0.0.0" interfaceOutputCost="2" />
  163. <BroadcastInterface ifName="eth1" areaID="0.0.0.2" interfaceOutputCost="1" routerPriority="2" />
  164. </Router>
  165. <Router name="RA2I[*]" RFC1583Compatible="true">
  166. <BroadcastInterface ifName="eth0" areaID="0.0.0.2" interfaceOutputCost="2" />
  167. <BroadcastInterface ifName="eth1" areaID="0.0.0.2" interfaceOutputCost="2" />
  168. </Router>
  169. </OSPFASConfig>
  170. %#--------------------------------------------------------------------------------------------------------------
  171. %contains: results/General-0.sca
  172. scalar Test1.H1.udpApp[0] sentPk:count 100
  173. %contains: results/General-0.sca
  174. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  175. %contains: results/General-0.sca
  176. scalar Test1.H1.udpApp[1] echoedPk:count 100
  177. %contains: results/General-0.sca
  178. scalar Test1.H2.udpApp[0] sentPk:count 100
  179. %contains: results/General-0.sca
  180. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  181. %contains: results/General-0.sca
  182. scalar Test1.H2.udpApp[1] echoedPk:count 100
  183. %contains: results/General-1.sca
  184. scalar Test1.H1.udpApp[0] sentPk:count 100
  185. %contains: results/General-1.sca
  186. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  187. %contains: results/General-1.sca
  188. scalar Test1.H1.udpApp[1] echoedPk:count 100
  189. %contains: results/General-1.sca
  190. scalar Test1.H2.udpApp[0] sentPk:count 100
  191. %contains: results/General-1.sca
  192. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  193. %contains: results/General-1.sca
  194. scalar Test1.H2.udpApp[1] echoedPk:count 100
  195. %contains: results/General-2.sca
  196. scalar Test1.H1.udpApp[0] sentPk:count 100
  197. %contains: results/General-2.sca
  198. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  199. %contains: results/General-2.sca
  200. scalar Test1.H1.udpApp[1] echoedPk:count 100
  201. %contains: results/General-2.sca
  202. scalar Test1.H2.udpApp[0] sentPk:count 100
  203. %contains: results/General-2.sca
  204. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  205. %contains: results/General-2.sca
  206. scalar Test1.H2.udpApp[1] echoedPk:count 100
  207. %contains: results/General-3.sca
  208. scalar Test1.H1.udpApp[0] sentPk:count 100
  209. %contains: results/General-3.sca
  210. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  211. %contains: results/General-3.sca
  212. scalar Test1.H1.udpApp[1] echoedPk:count 100
  213. %contains: results/General-3.sca
  214. scalar Test1.H2.udpApp[0] sentPk:count 100
  215. %contains: results/General-3.sca
  216. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  217. %contains: results/General-3.sca
  218. scalar Test1.H2.udpApp[1] echoedPk:count 100
  219. %contains: results/General-4.sca
  220. scalar Test1.H1.udpApp[0] sentPk:count 100
  221. %contains: results/General-4.sca
  222. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  223. %contains: results/General-4.sca
  224. scalar Test1.H1.udpApp[1] echoedPk:count 100
  225. %contains: results/General-4.sca
  226. scalar Test1.H2.udpApp[0] sentPk:count 100
  227. %contains: results/General-4.sca
  228. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  229. %contains: results/General-4.sca
  230. scalar Test1.H2.udpApp[1] echoedPk:count 100
  231. %contains: results/General-5.sca
  232. scalar Test1.H1.udpApp[0] sentPk:count 100
  233. %contains: results/General-5.sca
  234. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  235. %contains: results/General-5.sca
  236. scalar Test1.H1.udpApp[1] echoedPk:count 100
  237. %contains: results/General-5.sca
  238. scalar Test1.H2.udpApp[0] sentPk:count 100
  239. %contains: results/General-5.sca
  240. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  241. %contains: results/General-5.sca
  242. scalar Test1.H2.udpApp[1] echoedPk:count 100
  243. %contains: results/General-6.sca
  244. scalar Test1.H1.udpApp[0] sentPk:count 100
  245. %contains: results/General-6.sca
  246. scalar Test1.H1.udpApp[0] rcvdPk:count 100
  247. %contains: results/General-6.sca
  248. scalar Test1.H1.udpApp[1] echoedPk:count 100
  249. %contains: results/General-6.sca
  250. scalar Test1.H2.udpApp[0] sentPk:count 100
  251. %contains: results/General-6.sca
  252. scalar Test1.H2.udpApp[0] rcvdPk:count 100
  253. %contains: results/General-6.sca
  254. scalar Test1.H2.udpApp[1] echoedPk:count 100
  255. %#--------------------------------------------------------------------------------------------------------------
  256. %not-contains: stdout
  257. undisposed object:
  258. %not-contains: stdout
  259. -- check module destructor
  260. %#--------------------------------------------------------------------------------------------------------------