So you have your home network, with your computer,network connected printer, smart appliances, all connected to your router.
Have you ever wondered how your computer knowsto send your document to your printer and not your light bulb? Let’s take a look… Please note: This video simplifies some conceptsfor easier understanding.
If you need an accurate documentation, please see the descriptionbelow for links. The Internet is comprised of multiple layers,and today we are talking about one of the lowest ones, Ethernet.
If you don’t know what this means, that’sfine, just tag along and it will all become clear. To understand how your local network workswe need to go back in time about 30 years. Back in those days computing hardware wasrather expensive.
Instead of the current setup where we plugeverything into a router, a much different system was in use. All network-connected hardware had to be linkedup to one long coaxial cable.
At any given time, only one device could senddata over the network, so the system had to be designed around that. When a computer wanted to send some data,it first had to “shout” a special set of bits on the network, which basically equatesto “everybody please be quiet, I want to send something”. If two devices did this at the same time,they would detect this conflict and wait a random amount of time before trying again.
This initial sequence of bits is called thepreamble. Once a device has successfully gotten theirpreamble out, they could then send data over the network. In order to ensure that every device getsa chance to send data, the amount of data they could send was limited.
If they wanted to send more data, they wouldhave to split it up into multiple pieces called Ethernet frames and send them one by one. To locate their target, every network devicehas a unique number, called a Media Access Control Address, or MAC for short.
MAC prefix are assigned to hardware vendors,and each network chip or card gets a globally unique address. These MAC addresses were used in Ethernet,much like addresses on envelopes. After the preamble and a short pause calledthe Start Frame Delimiter, devices had to send the MAC address of the target computer,followed by their own MAC.
If they didn’t know the destination MAC,or they wanted to send something to every machine on the network, they could use thespecial broadcast MAC of all F’s.
This enabled machines to advertise services,such as print availability or file shares, to other devices. Regardless of the destination MAC, however,these Ethernet frames may in some cases be sent to all machines on the network. In other words, you cannot rely on the correctMAC address for security.
This is true even with high end datacenterequipment. Following the MAC addresses, the Ethernetframe must also contain one more field, called an Ethertype. This field is a bit tricky, because it canbe used for two different purposes. If the number in this field is 1500 or lower,it indicates the total length of the Ethernet frame.
If it is 1536 or higher, it indicates thetype of data contained within this Ethernet frame. Nowadays it is typically used to indicatethe contents of the frame rather than the length. After all this addressing information, weare now finally able to send some data over the network.
On a typical setup, this information is limitedto 1500 bytes, which is followed by a so-called checksum. The checksum verifies that the contents ofthe frame have not been corrupted in transport. That’s it! The frame is now sent, and after 12 bytesof silence, the race for the preambles can begin again and more data can be sent.
If we come back to the present, not much haschanged. Sure, we have dedicated cables for our devicesand we have smart switches and routers that can communicate with multiple devices at thesame time, but the Ethernet protocol hasn’t changed much.
Apart from some carrier-grade networks, westill use the same frame structure for our local communication. If you want to take a look at Ethernet inaction, I recommend you install a program called Wireshark, which lets you take a lookat all the traffic on your own computer. As you may notice, Ethernet is a local networkonly.
It doesn’t provide us with any means tocommunicate with devices outside our own environment. That is the task of IP, a protocol that sitson top of Ethernet.