ospf_backbone_and_2_areas.test 11 KB

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