Kitz Forum

Chat => Tech Chat => Topic started by: Weaver on January 14, 2018, 12:08:11 AM

Title: MAC addresses
Post by: Weaver on January 14, 2018, 12:08:11 AM
What is the 'best' or 'one true' way to write MAC addresses? Colons, hyphens or nowt? (And lowercase or uppercase or who cares?)
Title: Re: MAC addresses
Post by: burakkucat on January 14, 2018, 12:39:15 AM
I'm not sure that there is a standard . . .

Adva (FSP 150CCf-825), Dell, Watchfront (FB105) & ZyXEL all seem to use colon delimiters and upper case alphabetics.

The one Netgear device I checked used upper case alphabetics and did not use delimiters.
Title: Re: MAC addresses
Post by: Weaver on January 14, 2018, 02:26:22 AM
The FB2000-series Firebricks in their XML config use no separator, which is a nuisance.
Title: Re: MAC addresses
Post by: sevenlayermuddle on January 14, 2018, 10:11:01 AM
wikipedia has this to say, today at least:

https://en.m.wikipedia.org/wiki/MAC_address

Quote
The standard (IEEE 802) format for printing MAC-48 addresses in human-friendly form is six groups of two hexadecimal digits, separated by hyphens (-) in transmission order (e.g. 01-23-45-67-89-ab).

That is consistent with my own recollections.

I think a problem may be that there have been MAC addresses for longer than Unix Shells have been common.  Longer too, than Microsoft’s various syntaxes have mattered.   Maybe, authors of command line tools feel uncomfortable with use of the hyphenated form in command line syntax?

I’ve written Unix, Linux & Microsoft applications myself that required a command line syntax for MAC addresses.   I cannot recall the syntax I might have adopted, or the thought process applied in choosing it, but I would probably have been strongly influenced by team syntax pedants (essential and indisposable members of any development team).
Title: Re: MAC addresses
Post by: Weaver on January 14, 2018, 10:32:28 AM
In software, what happens generally about endianness of MAC addresses? (Compared with IP addresses.) Processors of course vary, but assuming that we choose to the leftmost byte the msb, do people just go with the processors's own native endianness and that's it?

Sanity check: So since most processors nowadays are little-endian (exceptions: IBM z-series mainframes, MIPS? is it? Motorola 680x0 and 680x - going back a good bit; can't remember about PowerPC) then the rightmost (last) byte which is the lsb would be lowest/first in RAM on those CPUs, the lsb in a register. That correct? Unless systems software overrides this? Or has no concept of msb-lsb?
Title: Re: MAC addresses
Post by: sevenlayermuddle on January 14, 2018, 10:46:09 AM
I do recall, endianness can be a minefield, the answer depending upon questions that are rarely asked.

From the same Wiki page...

Quote
The standard notation, also called canonical format, for MAC addresses is written in transmission bit order with the least significant bit transmitted first, as seen in the output of the ifconfig, iproute2, and ipconfig commands, for example.

However, since IEEE 802.3 (Ethernet) and IEEE 802.4 (Token Bus) send the bytes (octets) over the wire, left-to-right, with least significant bit in each byte first, while IEEE 802.5 (Token Ring) and IEEE 802.6 send the bytes over the wire with the most significant bit first, confusion may arise when an address in the latter scenario is represented with bits reversed from the canonical representation.

All clear, then? ::)