brintos

brintos / linux-shallow public Read only

0
0
Text · 11.7 KiB · 5ac0a62 Raw
297 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3===================================4Identifier Locator Addressing (ILA)5===================================6 7 8Introduction9============10 11Identifier-locator addressing (ILA) is a technique used with IPv6 that12differentiates between location and identity of a network node. Part of an13address expresses the immutable identity of the node, and another part14indicates the location of the node which can be dynamic. Identifier-locator15addressing can be used to efficiently implement overlay networks for16network virtualization as well as solutions for use cases in mobility.17 18ILA can be thought of as means to implement an overlay network without19encapsulation. This is accomplished by performing network address20translation on destination addresses as a packet traverses a network. To21the network, an ILA translated packet appears to be no different than any22other IPv6 packet. For instance, if the transport protocol is TCP then an23ILA translated packet looks like just another TCP/IPv6 packet. The24advantage of this is that ILA is transparent to the network so that25optimizations in the network, such as ECMP, RSS, GRO, GSO, etc., just work.26 27The ILA protocol is described in Internet-Draft draft-herbert-intarea-ila.28 29 30ILA terminology31===============32 33  - Identifier34		A number that identifies an addressable node in the network35		independent of its location. ILA identifiers are sixty-four36		bit values.37 38  - Locator39		A network prefix that routes to a physical host. Locators40		provide the topological location of an addressed node. ILA41		locators are sixty-four bit prefixes.42 43  - ILA mapping44		A mapping of an ILA identifier to a locator (or to a45		locator and meta data). An ILA domain maintains a database46		that contains mappings for all destinations in the domain.47 48  - SIR address49		An IPv6 address composed of a SIR prefix (upper sixty-50		four bits) and an identifier (lower sixty-four bits).51		SIR addresses are visible to applications and provide a52		means for them to address nodes independent of their53		location.54 55  - ILA address56		An IPv6 address composed of a locator (upper sixty-four57		bits) and an identifier (low order sixty-four bits). ILA58		addresses are never visible to an application.59 60  - ILA host61		An end host that is capable of performing ILA translations62		on transmit or receive.63 64  - ILA router65		A network node that performs ILA translation and forwarding66		of translated packets.67 68  - ILA forwarding cache69		A type of ILA router that only maintains a working set70		cache of mappings.71 72  - ILA node73		A network node capable of performing ILA translations. This74		can be an ILA router, ILA forwarding cache, or ILA host.75 76 77Operation78=========79 80There are two fundamental operations with ILA:81 82  - Translate a SIR address to an ILA address. This is performed on ingress83    to an ILA overlay.84 85  - Translate an ILA address to a SIR address. This is performed on egress86    from the ILA overlay.87 88ILA can be deployed either on end hosts or intermediate devices in the89network; these are provided by "ILA hosts" and "ILA routers" respectively.90Configuration and datapath for these two points of deployment is somewhat91different.92 93The diagram below illustrates the flow of packets through ILA as well94as showing ILA hosts and routers::95 96    +--------+                                                +--------+97    | Host A +-+                                         +--->| Host B |98    |        | |              (2) ILA                   (')   |        |99    +--------+ |            ...addressed....           (   )  +--------+100	       V  +---+--+  .  packet      .  +---+--+  (_)101   (1) SIR     |  | ILA  |----->-------->---->| ILA  |   |   (3) SIR102    addressed  +->|router|  .              .  |router|->-+    addressed103    packet        +---+--+  .     IPv6     .  +---+--+        packet104		   /        .    Network   .105		  /         .              .   +--+-++--------+106    +--------+   /          .              .   |ILA ||  Host  |107    |  Host  +--+           .              .- -|host||        |108    |        |              .              .   +--+-++--------+109    +--------+              ................110 111 112Transport checksum handling113===========================114 115When an address is translated by ILA, an encapsulated transport checksum116that includes the translated address in a pseudo header may be rendered117incorrect on the wire. This is a problem for intermediate devices,118including checksum offload in NICs, that process the checksum. There are119three options to deal with this:120 121- no action	Allow the checksum to be incorrect on the wire. Before122		a receiver verifies a checksum the ILA to SIR address123		translation must be done.124 125- adjust transport checksum126		When ILA translation is performed the packet is parsed127		and if a transport layer checksum is found then it is128		adjusted to reflect the correct checksum per the129		translated address.130 131- checksum neutral mapping132		When an address is translated the difference can be offset133		elsewhere in a part of the packet that is covered by134		the checksum. The low order sixteen bits of the identifier135		are used. This method is preferred since it doesn't require136		parsing a packet beyond the IP header and in most cases the137		adjustment can be precomputed and saved with the mapping.138 139Note that the checksum neutral adjustment affects the low order sixteen140bits of the identifier. When ILA to SIR address translation is done on141egress the low order bits are restored to the original value which142restores the identifier as it was originally sent.143 144 145Identifier types146================147 148ILA defines different types of identifiers for different use cases.149 150The defined types are:151 152      0: interface identifier153 154      1: locally unique identifier155 156      2: virtual networking identifier for IPv4 address157 158      3: virtual networking identifier for IPv6 unicast address159 160      4: virtual networking identifier for IPv6 multicast address161 162      5: non-local address identifier163 164In the current implementation of kernel ILA only locally unique identifiers165(LUID) are supported. LUID allows for a generic, unformatted 64 bit166identifier.167 168 169Identifier formats170==================171 172Kernel ILA supports two optional fields in an identifier for formatting:173"C-bit" and "identifier type". The presence of these fields is determined174by configuration as demonstrated below.175 176If the identifier type is present it occupies the three highest order177bits of an identifier. The possible values are given in the above list.178 179If the C-bit is present,  this is used as an indication that checksum180neutral mapping has been done. The C-bit can only be set in an181ILA address, never a SIR address.182 183In the simplest format the identifier types, C-bit, and checksum184adjustment value are not present so an identifier is considered an185unstructured sixty-four bit value::186 187     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+188     |                            Identifier                         |189     +                                                               +190     |                                                               |191     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+192 193The checksum neutral adjustment may be configured to always be194present using neutral-map-auto. In this case there is no C-bit, but the195checksum adjustment is in the low order 16 bits. The identifier is196still sixty-four bits::197 198     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+199     |                            Identifier                         |200     |                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+201     |                               |  Checksum-neutral adjustment  |202     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+203 204The C-bit may used to explicitly indicate that checksum neutral205mapping has been applied to an ILA address. The format is::206 207     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+208     |     |C|                    Identifier                         |209     |     +-+                       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+210     |                               |  Checksum-neutral adjustment  |211     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+212 213The identifier type field may be present to indicate the identifier214type. If it is not present then the type is inferred based on mapping215configuration. The checksum neutral adjustment may automatically216used with the identifier type as illustrated below::217 218     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+219     | Type|                      Identifier                         |220     +-+-+-+                         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+221     |                               |  Checksum-neutral adjustment  |222     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+223 224If the identifier type and the C-bit can be present simultaneously so225the identifier format would be::226 227     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+228     | Type|C|                    Identifier                         |229     +-+-+-+-+                       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+230     |                               |  Checksum-neutral adjustment  |231     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+232 233 234Configuration235=============236 237There are two methods to configure ILA mappings. One is by using LWT routes238and the other is ila_xlat (called from NFHOOK PREROUTING hook). ila_xlat239is intended to be used in the receive path for ILA hosts .240 241An ILA router has also been implemented in XDP. Description of that is242outside the scope of this document.243 244The usage of for ILA LWT routes is:245 246ip route add DEST/128 encap ila LOC csum-mode MODE ident-type TYPE via ADDR247 248Destination (DEST) can either be a SIR address (for an ILA host or ingress249ILA router) or an ILA address (egress ILA router). LOC is the sixty-four250bit locator (with format W:X:Y:Z) that overwrites the upper sixty-four251bits of the destination address.  Checksum MODE is one of "no-action",252"adj-transport", "neutral-map", and "neutral-map-auto". If neutral-map is253set then the C-bit will be present. Identifier TYPE one of "luid" or254"use-format." In the case of use-format, the identifier type field is255present and the effective type is taken from that.256 257The usage of ila_xlat is:258 259ip ila add loc_match MATCH loc LOC csum-mode MODE ident-type TYPE260 261MATCH indicates the incoming locator that must be matched to apply262a the translaiton. LOC is the locator that overwrites the upper263sixty-four bits of the destination address. MODE and TYPE have the264same meanings as described above.265 266 267Some examples268=============269 270::271 272     # Configure an ILA route that uses checksum neutral mapping as well273     # as type field. Note that the type field is set in the SIR address274     # (the 2000 implies type is 1 which is LUID).275     ip route add 3333:0:0:1:2000:0:1:87/128 encap ila 2001:0:87:0 \276	  csum-mode neutral-map ident-type use-format277 278     # Configure an ILA LWT route that uses auto checksum neutral mapping279     # (no C-bit) and configure identifier type to be LUID so that the280     # identifier type field will not be present.281     ip route add 3333:0:0:1:2000:0:2:87/128 encap ila 2001:0:87:1 \282	  csum-mode neutral-map-auto ident-type luid283 284     ila_xlat configuration285 286     # Configure an ILA to SIR mapping that matches a locator and overwrites287     # it with a SIR address (3333:0:0:1 in this example). The C-bit and288     # identifier field are used.289     ip ila add loc_match 2001:0:119:0 loc 3333:0:0:1 \290	 csum-mode neutral-map-auto ident-type use-format291 292     # Configure an ILA to SIR mapping where checksum neutral is automatically293     # set without the C-bit and the identifier type is configured to be LUID294     # so that the identifier type field is not present.295     ip ila add loc_match 2001:0:119:0 loc 3333:0:0:1 \296	 csum-mode neutral-map-auto ident-type use-format297