ila.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ===================================
  3. Identifier Locator Addressing (ILA)
  4. ===================================
  5. Introduction
  6. ============
  7. Identifier-locator addressing (ILA) is a technique used with IPv6 that
  8. differentiates between location and identity of a network node. Part of an
  9. address expresses the immutable identity of the node, and another part
  10. indicates the location of the node which can be dynamic. Identifier-locator
  11. addressing can be used to efficiently implement overlay networks for
  12. network virtualization as well as solutions for use cases in mobility.
  13. ILA can be thought of as means to implement an overlay network without
  14. encapsulation. This is accomplished by performing network address
  15. translation on destination addresses as a packet traverses a network. To
  16. the network, an ILA translated packet appears to be no different than any
  17. other IPv6 packet. For instance, if the transport protocol is TCP then an
  18. ILA translated packet looks like just another TCP/IPv6 packet. The
  19. advantage of this is that ILA is transparent to the network so that
  20. optimizations in the network, such as ECMP, RSS, GRO, GSO, etc., just work.
  21. The ILA protocol is described in Internet-Draft draft-herbert-intarea-ila.
  22. ILA terminology
  23. ===============
  24. - Identifier
  25. A number that identifies an addressable node in the network
  26. independent of its location. ILA identifiers are sixty-four
  27. bit values.
  28. - Locator
  29. A network prefix that routes to a physical host. Locators
  30. provide the topological location of an addressed node. ILA
  31. locators are sixty-four bit prefixes.
  32. - ILA mapping
  33. A mapping of an ILA identifier to a locator (or to a
  34. locator and meta data). An ILA domain maintains a database
  35. that contains mappings for all destinations in the domain.
  36. - SIR address
  37. An IPv6 address composed of a SIR prefix (upper sixty-
  38. four bits) and an identifier (lower sixty-four bits).
  39. SIR addresses are visible to applications and provide a
  40. means for them to address nodes independent of their
  41. location.
  42. - ILA address
  43. An IPv6 address composed of a locator (upper sixty-four
  44. bits) and an identifier (low order sixty-four bits). ILA
  45. addresses are never visible to an application.
  46. - ILA host
  47. An end host that is capable of performing ILA translations
  48. on transmit or receive.
  49. - ILA router
  50. A network node that performs ILA translation and forwarding
  51. of translated packets.
  52. - ILA forwarding cache
  53. A type of ILA router that only maintains a working set
  54. cache of mappings.
  55. - ILA node
  56. A network node capable of performing ILA translations. This
  57. can be an ILA router, ILA forwarding cache, or ILA host.
  58. Operation
  59. =========
  60. There are two fundamental operations with ILA:
  61. - Translate a SIR address to an ILA address. This is performed on ingress
  62. to an ILA overlay.
  63. - Translate an ILA address to a SIR address. This is performed on egress
  64. from the ILA overlay.
  65. ILA can be deployed either on end hosts or intermediate devices in the
  66. network; these are provided by "ILA hosts" and "ILA routers" respectively.
  67. Configuration and datapath for these two points of deployment is somewhat
  68. different.
  69. The diagram below illustrates the flow of packets through ILA as well
  70. as showing ILA hosts and routers::
  71. +--------+ +--------+
  72. | Host A +-+ +--->| Host B |
  73. | | | (2) ILA (') | |
  74. +--------+ | ...addressed.... ( ) +--------+
  75. V +---+--+ . packet . +---+--+ (_)
  76. (1) SIR | | ILA |----->-------->---->| ILA | | (3) SIR
  77. addressed +->|router| . . |router|->-+ addressed
  78. packet +---+--+ . IPv6 . +---+--+ packet
  79. / . Network .
  80. / . . +--+-++--------+
  81. +--------+ / . . |ILA || Host |
  82. | Host +--+ . .- -|host|| |
  83. | | . . +--+-++--------+
  84. +--------+ ................
  85. Transport checksum handling
  86. ===========================
  87. When an address is translated by ILA, an encapsulated transport checksum
  88. that includes the translated address in a pseudo header may be rendered
  89. incorrect on the wire. This is a problem for intermediate devices,
  90. including checksum offload in NICs, that process the checksum. There are
  91. three options to deal with this:
  92. - no action Allow the checksum to be incorrect on the wire. Before
  93. a receiver verifies a checksum the ILA to SIR address
  94. translation must be done.
  95. - adjust transport checksum
  96. When ILA translation is performed the packet is parsed
  97. and if a transport layer checksum is found then it is
  98. adjusted to reflect the correct checksum per the
  99. translated address.
  100. - checksum neutral mapping
  101. When an address is translated the difference can be offset
  102. elsewhere in a part of the packet that is covered by
  103. the checksum. The low order sixteen bits of the identifier
  104. are used. This method is preferred since it doesn't require
  105. parsing a packet beyond the IP header and in most cases the
  106. adjustment can be precomputed and saved with the mapping.
  107. Note that the checksum neutral adjustment affects the low order sixteen
  108. bits of the identifier. When ILA to SIR address translation is done on
  109. egress the low order bits are restored to the original value which
  110. restores the identifier as it was originally sent.
  111. Identifier types
  112. ================
  113. ILA defines different types of identifiers for different use cases.
  114. The defined types are:
  115. 0: interface identifier
  116. 1: locally unique identifier
  117. 2: virtual networking identifier for IPv4 address
  118. 3: virtual networking identifier for IPv6 unicast address
  119. 4: virtual networking identifier for IPv6 multicast address
  120. 5: non-local address identifier
  121. In the current implementation of kernel ILA only locally unique identifiers
  122. (LUID) are supported. LUID allows for a generic, unformatted 64 bit
  123. identifier.
  124. Identifier formats
  125. ==================
  126. Kernel ILA supports two optional fields in an identifier for formatting:
  127. "C-bit" and "identifier type". The presence of these fields is determined
  128. by configuration as demonstrated below.
  129. If the identifier type is present it occupies the three highest order
  130. bits of an identifier. The possible values are given in the above list.
  131. If the C-bit is present, this is used as an indication that checksum
  132. neutral mapping has been done. The C-bit can only be set in an
  133. ILA address, never a SIR address.
  134. In the simplest format the identifier types, C-bit, and checksum
  135. adjustment value are not present so an identifier is considered an
  136. unstructured sixty-four bit value::
  137. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  138. | Identifier |
  139. + +
  140. | |
  141. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  142. The checksum neutral adjustment may be configured to always be
  143. present using neutral-map-auto. In this case there is no C-bit, but the
  144. checksum adjustment is in the low order 16 bits. The identifier is
  145. still sixty-four bits::
  146. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  147. | Identifier |
  148. | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  149. | | Checksum-neutral adjustment |
  150. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  151. The C-bit may used to explicitly indicate that checksum neutral
  152. mapping has been applied to an ILA address. The format is::
  153. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  154. | |C| Identifier |
  155. | +-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  156. | | Checksum-neutral adjustment |
  157. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  158. The identifier type field may be present to indicate the identifier
  159. type. If it is not present then the type is inferred based on mapping
  160. configuration. The checksum neutral adjustment may automatically
  161. used with the identifier type as illustrated below::
  162. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  163. | Type| Identifier |
  164. +-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  165. | | Checksum-neutral adjustment |
  166. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  167. If the identifier type and the C-bit can be present simultaneously so
  168. the identifier format would be::
  169. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  170. | Type|C| Identifier |
  171. +-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  172. | | Checksum-neutral adjustment |
  173. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  174. Configuration
  175. =============
  176. There are two methods to configure ILA mappings. One is by using LWT routes
  177. and the other is ila_xlat (called from NFHOOK PREROUTING hook). ila_xlat
  178. is intended to be used in the receive path for ILA hosts .
  179. An ILA router has also been implemented in XDP. Description of that is
  180. outside the scope of this document.
  181. The usage of for ILA LWT routes is:
  182. ip route add DEST/128 encap ila LOC csum-mode MODE ident-type TYPE via ADDR
  183. Destination (DEST) can either be a SIR address (for an ILA host or ingress
  184. ILA router) or an ILA address (egress ILA router). LOC is the sixty-four
  185. bit locator (with format W:X:Y:Z) that overwrites the upper sixty-four
  186. bits of the destination address. Checksum MODE is one of "no-action",
  187. "adj-transport", "neutral-map", and "neutral-map-auto". If neutral-map is
  188. set then the C-bit will be present. Identifier TYPE one of "luid" or
  189. "use-format." In the case of use-format, the identifier type field is
  190. present and the effective type is taken from that.
  191. The usage of ila_xlat is:
  192. ip ila add loc_match MATCH loc LOC csum-mode MODE ident-type TYPE
  193. MATCH indicates the incoming locator that must be matched to apply
  194. a the translaiton. LOC is the locator that overwrites the upper
  195. sixty-four bits of the destination address. MODE and TYPE have the
  196. same meanings as described above.
  197. Some examples
  198. =============
  199. ::
  200. # Configure an ILA route that uses checksum neutral mapping as well
  201. # as type field. Note that the type field is set in the SIR address
  202. # (the 2000 implies type is 1 which is LUID).
  203. ip route add 3333:0:0:1:2000:0:1:87/128 encap ila 2001:0:87:0 \
  204. csum-mode neutral-map ident-type use-format
  205. # Configure an ILA LWT route that uses auto checksum neutral mapping
  206. # (no C-bit) and configure identifier type to be LUID so that the
  207. # identifier type field will not be present.
  208. ip route add 3333:0:0:1:2000:0:2:87/128 encap ila 2001:0:87:1 \
  209. csum-mode neutral-map-auto ident-type luid
  210. ila_xlat configuration
  211. # Configure an ILA to SIR mapping that matches a locator and overwrites
  212. # it with a SIR address (3333:0:0:1 in this example). The C-bit and
  213. # identifier field are used.
  214. ip ila add loc_match 2001:0:119:0 loc 3333:0:0:1 \
  215. csum-mode neutral-map-auto ident-type use-format
  216. # Configure an ILA to SIR mapping where checksum neutral is automatically
  217. # set without the C-bit and the identifier type is configured to be LUID
  218. # so that the identifier type field is not present.
  219. ip ila add loc_match 2001:0:119:0 loc 3333:0:0:1 \
  220. csum-mode neutral-map-auto ident-type use-format