Guest User

.NED simulation

a guest
Jul 20th, 2015
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. //
  2. // Copyright (C) 2005 Andras Varga
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU General Public License
  6. // as published by the Free Software Foundation; either version 2
  7. // of the License, or (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. //
  18.  
  19. package inet.examples.inet.LISPMNmultihoming;
  20.  
  21. import inet.nodes.inet.DHCPServer;
  22. import inet.nodes.ethernet.EtherSwitch;
  23. import inet.nodes.inet.StandardHostWithDHCP;
  24. import inet.nodes.inet.Router;
  25. import inet.nodes.inet.LISPMapServer;
  26. import inet.nodes.inet.LISPRouter;
  27. import inet.nodes.wireless.WirelessRouter;
  28. import inet.nodes.wireless.LISPMobileNodeWithDHCPmimo;
  29. import inet.nodes.wireless.WirelessAP;
  30. import inet.nodes.wireless.WirelessHost;
  31. import inet.world.ChannelControl;
  32. import inet.nodes.inet.DHCPServer;
  33. import inet.nodes.wireless.WirelessAPWithEth;
  34. import inet.networklayer.lisp.autorouting.LISPEIDConfigurator;
  35. import ned.DatarateChannel;
  36. import inet.networklayer.autorouting.FlatNetworkConfigurator;
  37. import inet.world.ScenarioManager;
  38. import ned.IdealChannel;
  39.  
  40. channel ethernet extends DatarateChannel
  41. {
  42. delay = 0.1us;
  43. //datarate = 1 Gbps; parameter is set in EtherMAC module as txrate
  44. }
  45.  
  46. channel ppLink extends DatarateChannel
  47. {
  48. delay = 1ms;
  49. datarate = 40 Gbps;
  50. }
  51.  
  52. channel ppLinkMS extends DatarateChannel
  53. {
  54. delay = 10ms;
  55. datarate = 40 Gbps;
  56. }
  57.  
  58. network MultiHomingNetwork
  59. {
  60. parameters:
  61. double playgroundSizeX;
  62. double playgroundSizeY;
  63. @display("bgb=871,600");
  64. submodules:
  65. channelcontrol: ChannelControl {
  66. playgroundSizeX = playgroundSizeX;
  67. playgroundSizeY = playgroundSizeY;
  68. @display("p=60,50");
  69. }
  70. lispMobileNode: LISPMobileNodeWithDHCPmimo {
  71. useLocatorTypeBit = true;
  72. mobileEID = "132.187.0.20";
  73. @display("p=81,119");
  74. }
  75. wirelessRouter1: WirelessRouter {
  76. routingFile = "wirelessRouter1.irt";
  77. numUdpApps = 1;
  78. udpAppType = "DHCPServer";
  79. mgmtType = default("Ieee80211MgmtAP");
  80. @display("p=147,204");
  81. }
  82. wirelessRouter2: WirelessRouter {
  83. numUdpApps = 1;
  84. udpAppType = "DHCPServer";
  85. mgmtType = default("Ieee80211MgmtAP");
  86. routingFile = "wirelessRouter2.irt";
  87. @display("p=320,204");
  88. }
  89. lispRouter1: LISPRouter {
  90. routingFile = "lisprouter1.irt";
  91. @display("p=160,314");
  92. }
  93. mapServer: LISPMapServer {
  94. routingFile = "mapserver.irt";
  95. @display("p=160,394");
  96. }
  97. router: Router {
  98. routingFile = "router.irt";
  99. @display("p=252,394");
  100. }
  101. lispRouter2: LISPRouter {
  102. routingFile = "lispRouter2.irt";
  103. @display("p=339,314");
  104. }
  105. PITR: LISPRouter {
  106. parameters:
  107. mapServerAddress = "mapServer";
  108. routingFile = "PITR.irt";
  109. @display("p=252,314;is=n");
  110. }
  111. lispRouter3: LISPRouter {
  112. parameters:
  113. routingFile = "lispRouter3.irt";
  114. @display("p=339,394;is=n");
  115. }
  116. standardHost: StandardHostWithDHCP {
  117. parameters:
  118. @display("is=n;p=494,394");
  119. }
  120. etherSwitch: EtherSwitch {
  121. @display("p=416,393");
  122. }
  123. dhcpServer: DHCPServer {
  124. parameters:
  125. @display("p=416,461;is=n");
  126. routingFile = "dhcpServer.irt";
  127. }
  128. etherSwitch1: EtherSwitch {
  129. @display("p=147,260");
  130. }
  131. etherSwitch2: EtherSwitch {
  132. @display("p=314,260");
  133. }
  134. lispRouter4: LISPRouter {
  135. parameters:
  136. routingFile = "lispRouter4.irt";
  137. @display("p=640,322");
  138. }
  139. etherSwitch3: EtherSwitch {
  140. @display("p=640,278");
  141. }
  142. PITR2: LISPRouter {
  143. parameters:
  144. mapServerAddress = "mapServer";
  145. routingFile = "PITR.irt";
  146. @display("p=442,314");
  147. }
  148. wirelessRouter3: WirelessRouter {
  149. routingFile = "wirelessRouter3.irt";
  150. numUdpApps = 1;
  151. udpAppType = "DHCPServer";
  152. mgmtType = default("Ieee80211MgmtAP");
  153. @display("p=640,224");
  154. }
  155. connections:
  156. router.pppg++ <--> ppLink <--> lispRouter3.pppg++;
  157. router.pppg++ <--> ppLink <--> lispRouter1.pppg++;
  158. router.pppg++ <--> ppLink <--> lispRouter2.pppg++;
  159. router.pppg++ <--> ppLinkMS <--> mapServer.pppg++;
  160. router.pppg++ <--> ppLink <--> PITR.pppg++;
  161. PITR.pppg++ <--> ppLink <--> lispRouter1.pppg++;
  162. PITR.pppg++ <--> ppLink <--> lispRouter2.pppg++;
  163. lispRouter3.ethg++ <--> ethernet <--> etherSwitch.ethg++;
  164. standardHost.ethg++ <--> ethernet <--> etherSwitch.ethg++;
  165. etherSwitch.ethg++ <--> ethernet <--> dhcpServer.ethg++;
  166. etherSwitch1.ethg++ <--> ethernet <--> wirelessRouter1.ethg++;
  167. etherSwitch2.ethg++ <--> ethernet <--> wirelessRouter2.ethg++;
  168. lispRouter1.ethg++ <--> ethernet <--> etherSwitch1.ethg++;
  169. lispRouter2.ethg++ <--> ethernet <--> etherSwitch2.ethg++;
  170. PITR2.pppg++ <--> ppLink <--> lispRouter4.pppg++;
  171. router.pppg++ <--> ppLink <--> PITR2.pppg++;
  172. lispRouter4.ethg++ <--> ethernet <--> etherSwitch3.ethg++;
  173. etherSwitch3.ethg++ <--> ethernet <--> wirelessRouter3.ethg++;
  174. router.pppg++ <--> ppLink <--> lispRouter4.pppg++;
  175.  
  176. }
Advertisement
Add Comment
Please, Sign In to add comment