ila.txt 12 KB

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