ospf_1_area_HostInterface.test 8.8 KB

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