The need for addressing
Consider sending a letter through the post. The address you use is not only globally unique but also constructed in a hierarchical way to facilitate delivery.
For example, an address comprises, the name of the recipient, their house number and street name, the town in which this street is located, the region in which the town is located and the country in which the region is located. The postal company then routes the letter based on the country, region, town, street and house fields. Within the house, the occupants use the name field to determine who the letter is for. If we are going to send data through a global network then we need the equivalent of this global addressing system.
Layer 2 (MAC) addresses are assigned to network interface cards and, whilst globally unique, they are not hierarchical. If you looked at two MAC addresses then you would not be able to determine whether these two addresses were assigned to machines that were on the same LAN or in totally different countries.
Layer 3 addressing is therefore designed to introduce a hierarchy to aid routing on a global scale.
Therefore any device that uses a layer 3 protocol (IP etc) must be assigned a globally unique layer 3 address in addition to its layer 2 MAC address. This is true for user devices, routers, servers – everything that operates a layer 3 protocol.