mpls-doc.ned 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. //
  2. // This library is free software, you can redistribute it
  3. // and/or modify
  4. // it under the terms of the GNU Lesser General Public License
  5. // as published by the Free Software Foundation;
  6. // either version 2 of the License, or any later version.
  7. // The library is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. // See the GNU Lesser General Public License for more details.
  11. //
  12. //
  13. // @page standards.html, MPLS/RSVP/LDP Model - Implemented Standards
  14. //
  15. // The implementation follows those RFCs below:
  16. // - RFC 2702: Requirements for Traffic Engineering Over MPLS
  17. // - RFC 2205: Resource ReSerVation Protocol
  18. // - RFC 3031: Multiprotocol Label Switching Architecture
  19. // - RFC 3036: LDP Specification
  20. // - RFC 3209: RSVP-TE Extension to RSVP for LSP tunnels
  21. // - RFC 2205: RSVP Version 1 - Functional Specification
  22. // - RFC 2209: RSVP Message processing Version 1
  23. //
  24. //#------------------------------------------------------------------------
  25. // @page mpls-pseudocode.html, MPLS Operation
  26. //
  27. // The following algorithm is carried out by the ~MPLS module:
  28. //
  29. // <pre>
  30. // Step 1: - Check which layer the packet is coming from
  31. // Alternative 1: From layer 3
  32. // Step 1: Find and check the next hop of this packet
  33. // Alternative 1: Next hop belongs to this MPLS cloud
  34. // Step 1: Encapsulate the packet in an MPLS packet with
  35. // IP_NATIVE_LABEL label
  36. // Step 2: Send to the next hop
  37. // Step 3: Return
  38. // Alternative 2: Next hop does not belong to this MPLS cloud
  39. // Step 1: Send the packet to the next hop
  40. // Alternative 2: From layer 2
  41. // Step 1: Record the packet incoming interface
  42. // Step 2: - Check if the packet is for this LSR
  43. // Alternative 1: Yes
  44. // Step 1: Check if the packet has label
  45. // Alternative 1: Yes
  46. // Step 1: Strip off all labels and send the packet to L3
  47. // Step 2: Return
  48. // Alternative 2: No
  49. // Step 1: Send the packet to L3
  50. // Step 2: Return
  51. // Alternative 2: No
  52. // Step 1: Continue to the next step
  53. // Step 3: Check the packet type
  54. // Alternative 1: The packet is native IP
  55. // Step 1: Check the LSR type
  56. // Alternative 1: The LSR is an Ingress Router
  57. // Step 1: Look up LIB for outgoing label
  58. // Alternative 1: Label cannot be found
  59. // Step 1: Check if the label for this FEC is being requested
  60. // Alternative 1: Yes
  61. // Step 1: Return
  62. // Alternative 2: No
  63. // Step 1: Store the packet with FEC id
  64. // Step 2: Do request the signalling component
  65. // Step 3: Return
  66. // Alternative 2: Label found
  67. // Step 1: Carry out the label operation on the packet
  68. // Step 2: Forward the packet to the outgoing interface found
  69. // Step 3: Return
  70. // Alternative 2: The LSR is not an Ingress Router
  71. // Step 1: Print out the error
  72. // Step 2: Delete the packet and return
  73. // Alternative 2: The packet is MPLS
  74. // Step 1: Check the LSR type
  75. // Alternative 1: The LSR is an Egress Router
  76. // Step 1: POP the top label
  77. // Step 2: Forward the packet to the outgoing interface found
  78. // Step 3: Return
  79. // Alternative 2: The LSR is not an Egress Router
  80. // Step 1: Look up LIB for outgoing label
  81. // Alternative 1: Label cannot be found
  82. // Step 1: Check if the label for this FEC is being requested
  83. // Alternative 1: Yes
  84. // Step 1: Return
  85. // Alternative 2: No
  86. // Step 1: Store the packet with FEC id
  87. // Step 2: Do request the signalling component
  88. // Step 3: Return
  89. // Alternative 2: Label found
  90. // Step 1: Carry out the label operation on the packet
  91. // Step 2: Forward the packet to the outgoing interface found
  92. // Step 3: Return
  93. // Step 2: Return
  94. // </pre>
  95. //
  96. //
  97. //#------------------------------------------------------------------------
  98. // @page ldp-processing.html, LDP Message Processing
  99. //
  100. // The simulation follows message processing rules specified in RFC3036
  101. // (LDP Specification). A summary of the algorithm used in the RFC is
  102. // presented below.
  103. //
  104. // <b>Label Request Message processing</b>
  105. //
  106. // An LSR may transmit a Request message under any of the conditions below:
  107. // - The LSR recognizes a new FEC via the forwarding tale, and the next hop
  108. // is its LDP peer. The LIB of this LSR does not have a mapping from the
  109. // next hop for the given FEC.
  110. // - Network topology changes, the next hop to the FEC is no longer valid
  111. // and new mapping is not available.
  112. // - The LSR receives a Label Request for a FEC from an upstream LDP and it
  113. // does not have label binding information for this FEC. The FEC next hop
  114. // is an LDP peer.
  115. //
  116. // Upon receiving a Label Request message, the following procedures will be
  117. // performed:
  118. //
  119. // <pre>
  120. // Step 1: Extract the FEC from the message and locate the incoming interface
  121. // of the message.
  122. // Step 2: Check whether the FEC is an outstanding FEC.
  123. // Alternative 1: This FEC is outstanding
  124. // Step 1: Return
  125. // Alternative 2: This FEC is not outstanding
  126. // Step 1: Continue
  127. // Step 3: Check if there is an exact match of the FEC in the routing table.
  128. // Alternative 1: There is an exact match
  129. // Step 1: Continue
  130. // Alternative 2: There is no match
  131. // Step 1: Construct a Notification message of No route and
  132. // send this message back to the sender.
  133. // Step 4: Make query to local LIB to find out the corresponding label.
  134. // Alternative 1: The label found
  135. // Step 1: Construct a Label Mapping message and send over
  136. // the incoming interface.
  137. // Alternative 2: The label cannot be found for this FEC
  138. // Step 1: Construct a new Label Request message and send
  139. // the message out using L3 routing.
  140. // Step 2: Construct a Notification message indicating that the
  141. // label cannot be found.
  142. // </pre>
  143. //
  144. // <b>Label Mapping Message processing</b>
  145. //
  146. // Upon receiving a Label Mapping message, the following procedures will be
  147. // performed:
  148. //
  149. // <pre>
  150. // Step 1: Extract the FEC and the label from the message.
  151. // Step 2: Check whether this is an outstanding FEC
  152. // Alternative 1: This FEC is outstanding
  153. // Step 1: Continue
  154. // Alternative 2: This FEC is not outstanding
  155. // Step 1: Send back the server an Notification of Error message.
  156. // Step 3: Install the new label to the local LIB using the extracted label,
  157. // FEC and the message incoming interface.
  158. // </pre>
  159. //
  160. //
  161. //#------------------------------------------------------------------------
  162. // @page lib-table-file.html, LIB Table File Format
  163. //
  164. // The format of a LIB table file is:
  165. //
  166. // The beginning of the file should begin with comments. Lines begin with # are treated
  167. // as comments. An empty line is required after the comments. The "LIB TABLE"
  168. // syntax must come next with an empty line. The column headers follow. This header
  169. // must be strictly "In-lbl In-intf Out-lbl Out-intf". Column
  170. // values are after that with space or tab for field separation.
  171. // The following is a sample of lib table file.
  172. //
  173. // <pre>
  174. // #lib table for MPLS network simulation test
  175. // #lib1.table for LSR1 - this is an edge router
  176. // #no incoming label for traffic from in-intf 0 &1 - LSR1 is ingress router for those traffic
  177. // #no outgoing label for traffic from in_intf 2 &3 - LSR 1 is egress router for those traffic
  178. //
  179. // LIB TABLE:
  180. //
  181. // In-lbl In-intf Out-lbl Out-intf
  182. // 1 193.233.7.90 1 193.231.7.21
  183. // 2 193.243.2.1 0 193.243.2.3
  184. // </pre>
  185. //
  186. //#------------------------------------------------------------------------
  187. // @page cspf-algorithm.html, The CSPF Algorithm
  188. //
  189. // CSPF stands for Constraint Shortest Path First.
  190. // This constraint-based routing is executed online by Ingress Router.
  191. // The CSPF calculates an optimum explicit route (ER), based on
  192. // specific constraints. CSPF relies on a Traffic Engineering Database (TED)
  193. // to do those calculations. The resulting route is then used by RSVP-TE.
  194. //
  195. // The CSPF in particular and any constraint based routing process requires following
  196. // inputs:
  197. // - Attributes of the traffic trunks, e.g., bandwidth, link affinities
  198. // - Attributes of the links of the network, e.g. bandwidth, delay
  199. // - Attributes of the LSRs, e.g. types of signaling protocols supported
  200. // - Other topology state information.
  201. //
  202. // There has been no standard for CSPF so far. The implementation of CSPF in
  203. // the simulation is based on the concept of "induced graph" introduced in RFC
  204. // 2702. An induced graph is analogous to a virtual topology in an overlay
  205. // model. It is logically mapped onto the physical network through the
  206. // selection of LSPs for traffic trunks. CSPF is similar to a normal SPF,
  207. // except during link examination, it rejects links without capacity or links
  208. // that do not match color constraints or configured policy. The CSPF
  209. // algorithm used in the simulation has two phases. In the first phase, all
  210. // the links that do not satisfy the constraints of bandwidth are excluded
  211. // from the network topology. The link affinity is also examined in this
  212. // phase. In the second phase, Dijkstra algorithm is performed.
  213. //
  214. // Dijkstra Algorithm:
  215. //
  216. // <pre>
  217. // Dijkstra(G, w, s):
  218. // Initialize-single-source(G,s);
  219. // S = empty set;
  220. // Q = V[G];
  221. // While Q is not empty {
  222. // u = Extract-Min(Q);
  223. // S = S union {u};
  224. // for each vertex v in Adj[u] {
  225. // relax(u, v, w);
  226. // }
  227. // }
  228. // </pre>
  229. //
  230. // In which:
  231. // - G: the graph, represented in some way (e.g. adjacency list)
  232. // - w: the distance (weight) for each edge (u,v)
  233. // - s (small s): the starting vertex (source)
  234. // - S (big S): a set of vertices whose final shortest path from s have already been determined
  235. // - Q: set of remaining vertices, Q union S = V
  236. //
  237. //
  238. //#------------------------------------------------------------------------
  239. // @page traffic-xml-file.html, The traffic.xml file
  240. //
  241. // The traffic.xml file is read by the RSVP-TE module (RSVP).
  242. // The file must be in the same folder as the executable
  243. // network simulation file.
  244. //
  245. // The XML elements used in the "traffic.xml" file:
  246. // - <Traffic></Traffic> is the root element. It may contain one or more <Conn>
  247. // elements.
  248. // - <Conn></Conn> specifies an RSVP session. It may contain the following elements.
  249. // - <src></src> specifies sender IP address
  250. // - <dest></dest> specifies receiver IP address
  251. // - <setupPri></setupPri> specifies LSP setup priority
  252. // - <holdingPri></holdingPri> specifies LSP holding priority
  253. // - <bandwidth></bandwidth> specifies the requested BW.
  254. // - <delay></delay> specifies the requested delay.
  255. // - <route></route> specifies the explicit route. This is a comma-separated
  256. // list of IP address, hop-type pairs (also separated by comma).
  257. // A hop type has a value of 1 if the hop is a loose hop and 0 otherwise.
  258. //
  259. // The following presents an example file:
  260. //
  261. // <pre>
  262. // <?xml version="1.0"?>
  263. // <!-- Example of traffic control file -->
  264. // <traffic>
  265. // <conn>
  266. // <src>10.0.0.1</src>
  267. // <dest>10.0.1.2</dest>
  268. // <setupPri>7</setupPri>
  269. // <holdingPri>7</holdingPri>
  270. // <bandwidth>400</bandwidth>
  271. // <delay>5</delay>
  272. // </conn>
  273. // <conn>
  274. // <src>11.0.0.1</src>
  275. // <dest>11.0.1.2</dest>
  276. // <setupPri>7</setupPri>
  277. // <holdingPri>7</holdingPri>
  278. // <bandwidth>100</bandwidth>
  279. // <delay>5</delay>
  280. // </conn>
  281. // </traffic>
  282. // </pre>
  283. //
  284. // An example of using RSVP-TE as signaling protocol can be found in
  285. // ExplicitRouting folder distributed with the simulation. In this
  286. // example, a network similar to the network in LDP-MPLS example is
  287. // setup. Instead of using LDP, "signaling" parameter is set to 2 (value
  288. // of RSVP-TE handler). The following xml file is used for traffic
  289. // control. Note the explicit routes specified in the second connection.
  290. // It indicates that the route is a strict one since the values of every
  291. // hop types are 0. The route defined is 10.0.0.1 -> 1.0.0.1 ->
  292. // 10.0.0.3 -> 1.0.0.4 -> 10.0.0.5 -> 10.0.1.2.
  293. //
  294. // <pre>
  295. // <?xml version="1.0"?>
  296. // <!-- Example of traffic control file -->
  297. // <traffic>
  298. // <conn>
  299. // <src>10.0.0.1</src>
  300. // <dest>10.0.1.2</dest>
  301. // <setupPri>7</setupPri>
  302. // <holdingPri>7</holdingPri>
  303. // <bandwidth>0</bandwidth>
  304. // <delay>0</delay>
  305. // <ER>false</ER>
  306. // </conn>
  307. // <conn>
  308. // <src>11.0.0.1</src>
  309. // <dest>11.0.1.2</dest>
  310. // <setupPri>7</setupPri>
  311. // <holdingPri>7</holdingPri>
  312. // <bandwidth>0</bandwidth>
  313. // <delay>0</delay>
  314. // <ER>true</ER>
  315. // <route>1.0.0.1,0,1.0.0.3,0,1.0.0.4,0,1.0.0.5,0,10.0.1.2,0</route>
  316. // </conn>
  317. // </traffic>
  318. // </pre>
  319. //
  320. package inet;