


Switches are layer-2 devices, and they use MAC addresses to create a table of which host is connected to which switch interface. MAC addresses are layer-2 addresses, and they are used to deliver layer-2 frames on a LAN. You don't want to replace or upgrade all your layer-2 devices each time you want to run a different layer-3 protocol. IPv4, the most used, but not the only, layer-3 protocol, uses 32-bit addresses, but it is being replaced with IPv6, which uses 128-bit addresses. There are also multiple layer-3 protocols. Of those that use MAC addresses, some use 48-bit MAC addresses, and some use 64-bit MAC addresses. Layer-2 has many protocols, some of which use MAC addresses, and some which don't. Also, don't assume that there is only one protocol for each layer.
