Network Working Group T. Narten
Request for Comments: 2469 C. Burton
Category: Informational IBM
December 1998
A Caution On The Canonical Ordering Of Link-Layer Addresses
Narten & Burton Informational [Page 1]
RFC 2469 Canonical Ordering Of Link-Layer Addresses December 1998 1. IntroductionProtocols such as ARP [ARP] and ND [DISCOVERY] have data fields that contain link-layer addresses. In order to interoperate properly, a sender setting such a field must insure that the receiver extracts those bits and interprets them correctly. In most cases, such fields must be in "canonical form". Unfortunately, not all LAN adaptors are consistent in their use of canonical form, and implementations may need to explicitly bit swap individual bytes in order to obtain the correct format.
2. Canonical Form
Canonical form (also known as "LSB format" and "Ethernet format") is the name given to the format of a LAN adapter address as it should be presented to the user according to the 802 LAN standard. It is best defined as how the bit order of an adapter address on the LAN media maps to the bit order of an adapter address in memory: The first bit of each byte that appears on the LAN maps to the least significant (i.e., right-most) bit of each byte in memory (the figure below illustrates this). This puts the group address indicator (i.e., the bit that defines whether an address is unicast or multicast) in the least significant bit of the first byte. Ethernet and 802.3 hardware behave consistently with this definition.
1st bit appearing on LAN (group address indicator)
|
On LAN: 01001000 00101100 01101010 00011110 01011001 00111101
In memory, MSB format: 01001000 00101100 01101010 00011110 01011001 00111101
Narten & Burton Informational [Page 2]
RFC 2469 Canonical Ordering Of Link-Layer Addresses December 1998
The implication of this inconsistency is that addresses extracted from adaptors, assigned to adaptors, or extracted from link-layer packet headers obtained from adaptors may need to be bit-swapped to put them into canonical form. Likewise, addresses in canonical form that are handed to adaptors (e.g., to set an address, to specify a destination address in a link-layer header, etc.) may need to be bit-swapped in order for the adaptor to process the request as expected.3. Implementors Beware: Potential Trouble Spots 3.1. Neighbor Discovery in IPv6All of the IPv6 over specific link layers documents specify that link-layer addresses must be transmitted in canonical order [IPv6- ETHER, IPv6-FDDI, IPv6-TOKEN]. As far as the authors can tell, all Ethernet LAN adaptors use canonical order and no special processing by implementations is needed. In contrast, some FDDI and all Token Ring adaptors appear to use non-canonical format. Implementors must insure that any addresses that appear in link-layer address options of Neighbor Discovery [DISCOVERY] messages are sent in canonical order and that any link-layer addresses extracted from ND packets are interpreted correctly on the local machine and its adaptors.
3.2. IPv4 and ARP
Ethernet addresses that appear in ARP packets are in canonical order. In contrast, when running ARP over Token Ring, the de facto practice is to transmit addresses in non-canonical order. Because all Token Ring adaptors assume non-canonical ordering, no interoperability problems result between communicating nodes attached to the same Token Ring.
4. Security Considerations
There are no known security issues raised by this document.
Narten & Burton Informational [Page 3]
RFC 2469 Canonical Ordering Of Link-Layer Addresses December 1998 5. References[ARP] Plummer, D., "An Ethernet Address Resolution Protocol",
6. Authors' Addresses
Thomas Narten IBM Corporation 3039 Cornwallis Ave. PO Box 12195 Research Triangle Park, NC 27709-2195
Narten & Burton Informational [Page 4]
RFC 2469 Canonical Ordering Of Link-Layer Addresses December 1998 7. Full Copyright StatementCopyright (C) The Internet Society (1998). All Rights Reserved.