MAC Addresses, IP Addresses and Routers

Protocols

Communication between connections on the Internet is governed by rules known as protocols. A protocol is an agreed-upon set of rules that specify the behavior of a system.
The communication protocols used in the Internet are open, also called nonproprietary, which allows users to easily connect additional computing devices to the Internet.
An open (nonproprietary) protocol is one that is not owned by any particular company and not limited to a particular company's products. The protocols in the Internet stack are open so that any computing device can follow the protocol to join the global network.

MAC Address

For devices to communicate with each other, we need a way for devices to identify each other.
A network interface card (NIC) on a computer contains a unique hardware address, or physical address, called the MAC address. MAC stands for media access control.
Every device that can make WiFi, ethernet or bluetooth connections has a MAC address: laptops, phones, bluetooth speakers, a smart fridge, tablets, and so on.
A MAC address is 6 bytes or 48 bits in length. It is displayed in 12 hexadecimal digits.
A green circuit board with a metal bracket at one end holding an Ethernet socket: a network interface card that plugs into a computer.
A network interface card. Its MAC address is printed on the sticker: 000E0CB7354B, or 00-0E-0C-B7-35-4B. 00-0E-0C is one of Intel's vendor prefixes. Photo: ktims, public domain, via Wikimedia Commons.

What a MAC address does not tell you

The MAC address provides the physical address for the NIC, but it provides no information as to its network location. It does not say which LAN the device is on, or which building, city or country the network is in.
The Internet Protocol (IP) address provides worldwide addressing that identifies the computer's local network.
An IP address is a network address, or logical address, of a computer. It can be IPv4 or IPv6. Both IPv4 and IPv6 are in use today.
This is like a street address for your home or school. A street address tells you where to go, which is exactly what a MAC address refuses to tell you.

Switch versus Router

A switch is a networking device that facilitates communication within a local area network using source and destination MAC addresses. A switch is responsible for hop-to-hop delivery, which means getting the data across one link to the next device along. A data unit sent by a switch is a frame.
A router is a networking device that facilitates communication between networks using source and destination IP addresses. Routers are responsible for end-to-end delivery, which means getting the data the whole way from the original sender to the final receiver. No single router does that alone. Each one passes the packet on toward the destination network, and the routers along the way complete the trip between them. A data unit sent by a router is a packet.
SwitchRouter
Where it worksWithin one local area networkBetween networks
Which addresses it readsSource and destination MAC addressesSource and destination IP addresses
What it is responsible forHop-to-hop deliveryEnd-to-end delivery, shared with the other routers on the way
What its data unit is calledA frameA packet
The figure puts both devices in one picture. Inside each network, a switch delivers frames using MAC addresses. The router sits where the two networks meet and forwards packets using IP addresses. It has an IP address in each network it joins.
Two networks: a switch inside each, a router between. Network 1: every address starts 192.0.2. In it, a laptop with IP 192.0.2.10 and MAC 00-AA-00-B6-7A-50 is joined by a frame link to a switch that reads MAC addresses. A link carrying the packet inside a frame joins that switch to a router with addresses 192.0.2.1 and 198.51.100.1, which reads IP addresses. The router has an address in each network it joins. A link carrying the packet inside a frame joins the router to network 2: every address starts 198.51.100. In it, a switch that reads MAC addresses is joined by a frame link to a printer with IP 198.51.100.20 and MAC 3C-52-82-1A-07-F4. Switch: works inside one network, reads MAC addresses. Router: joins networks, reads IP addresses.