I know that MAC address has to be unique.
Strictly speaking it only has to be unique on the local network. The way this was supposed to be ensured was by making the default MAC address of devices globally unique. This was acheived through splitting the address into a vendor part and then a part that could be assigned by the vendor.
In practice some vendors are sloppier about this than others. Most VM software and at least one hardware vendor assign addresses randomly from within a vendor ID (which may or may not actually belong to the vendor in question) and just work on the assumption that the number of devices on a network will be small enough that MAC collisions are unlikely.
It has 6 elements - k. And it chooses from 36 chars (A-Z,0-9) - n. It means that there are nk combinations.
A MAC address is a 48 bit binary number, conventionally written as six hexadecimal numbers each with two digits.
So that gives 2^48 addresses, however not all of them are usable for a few reasons.
- Two bits are special, one indicates whether an address is "local" or "global", the other indicates whether it is unicast or multicast.
- MAC addresses were traditionally allocated to a vendor in blocks of 224. Most vendors will never use that many leading to lots of wasted addresses. Smaller blocks are now available but only in a very limited range of sizes, so there is still a lot of wastage.
The IEEE has some concerns about the possibility of MAC address exhaustion, mainly driven by applications that assign large numbers of MAC adddresses to the same device. New applications that don't need backwards compatibility are strongly advised to use EUI-64 instead.