| Internet-Draft | MAC Strings | March 2026 |
| Mansfield | Expires 3 September 2026 | [Page] |
IETF and IEEE 802.1 have different patterns for mac addresses in their respective YANG types modules. Therefore equivalent mac addresses may or may not match if a mac-address that uses the IETF datatype is compared to a mac-address that uses the IEEE datatype (and vise-versa).¶
This note is to be removed before publishing as an RFC.¶
Source for this draft and an issue tracker can be found at https://github.com/samans/draft-sam-mac-address-as-string.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 3 September 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
MAC Address Formats in the IETF and IEEE YANG modules are different.¶
The IETF YANG module [RFC9911] and IEEE YANG [IEEE-802-1Qcw] module use a datatype of String to store MAC Addresses. The issue is that the IETF and IEEE use different patterns and have different canonical forms, which leads to a situation where equivalent MAC Addresses will not match.¶
This internet-draft is meant to document the issue, raise awareness, and identify potential solutions.¶
For example, the following MAC Address is in IETF Canonical Format¶
90-10-00-01-02-AA¶
For example, the following MAC Address is in IEEE Canonical Format¶
90:10:00:01:02:aa¶
The MAC Address are equivalent, but will not match if used in an XPATH, or as a key, or any string comparison.¶
There are several potential trouble spots in published IETF YANG modules.¶
The IETF Format (from ietf-yang-types@2013-07-15.yang) used in the mac-address typedef is found below.¶
typedef mac-address {
type string {
pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
}
description
"The mac-address type represents an IEEE 802 MAC address.
The canonical representation uses lowercase characters.
In the value set and its semantics, this type is equivalent
to the MacAddress textual convention of the SMIv2.";
reference
"IEEE 802: IEEE Standard for Local and Metropolitan Area
Networks: Overview and Architecture
RFC 2579: Textual Conventions for SMIv2";
}
¶
The IEEE Format used in the mac-address typedef is found below.¶
typedef mac-address {
type string {
pattern "[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}";
}
description
"The mac-address type represents a MAC address in the canonical
format and hexadecimal format specified by IEEE Std 802. The
hexadecimal representation uses uppercase characters.";
reference
"3.1, 8.1 of IEEE Std 802";
}
¶
Create a new mac-address type and deprecate the mac-address types in IETF and IEEE types files.¶
Modify the mac-address patterns in both IETF and IEEE to be inclusive of everything, and fix the descriptions to warn the implementers about the issue with equivalence.¶
Add something to the YANG language that will provide a way to indicate an "equivalence" pattern.¶
Do what SMNP did, abandon strings and store the MAC Address as 6 octets and provide the ability to use a display hint style facility.¶
Do Nothing¶
Some other brilliant solution?¶
TODO Security¶
This document has no IANA actions.¶
TODO acknowledge.¶