Internet-Draft MAC Strings March 2026
Mansfield Expires 3 September 2026 [Page]
Workgroup:
NETMOD Working Group
Internet-Draft:
draft-sam-mac-address-as-string-00
Published:
Intended Status:
Informational
Expires:
Author:
S. Mansfield
Ericsson

MAC Address as String

Abstract

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).

Discussion Venues

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.

Status of This Memo

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.

Table of Contents

1. Introduction

MAC Address Formats in the IETF and IEEE YANG modules are different.

2. Problem Statement

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.

3. Detail

3.1. IETF Format

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";
}

3.2. IEEE Format

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";
}

4. Options

5. Security Considerations

TODO Security

6. IANA Considerations

This document has no IANA actions.

7. Informative References

[IEEE-802-1Qcw]
"IEEE Standard for Local and Metropolitan Area Networks--Bridges and Bridged Networks Amendment 36: YANG Data Models for Scheduled Traffic, Frame Preemption, and Per‐Stream Filtering and Policing", , <https://doi.org/10.1109/IEEESTD.2023.10317806>.
[RFC9911]
Schönwälder, J., Ed., "Common YANG Data Types", RFC 9911, DOI 10.17487/RFC9911, , <https://www.rfc-editor.org/rfc/rfc9911>.

Acknowledgments

TODO acknowledge.

Author's Address

Scott Mansfield
Ericsson