/

dronkers.dev

dronkers.dev logo

The Internet: Under the Hood, Part 2

2021-09-30

1's & 0's

The TCP/ IP model we explored in the last post does not address physical interfaces directly, rather is assumes a working network infrastructure. Still, an elementary idea of what happens with the actual bits will help inform our understanding of the higher-level layers later on. So, let's explore this unofficial layer before we get into the Link layer.

If you drill down through all of the networking abstractions, you'll find that data, in the form of 1's and 0's, is ultimately transported via radio waves, light signals and electrical signals, each of which is bound by the laws of physics. These laws determine the upper bounds of how fast data can move and in what capacity. The term latency is used to refer to the time it takes a unit of data to travel from point A to point B, usually measured in milliseconds. The term bandwidth is used to refer to the amount of data that can be sent in a given unit of time, usually seconds.

To use the classic road analogy, latency is like the speed limit - it specifies the maximum speed of each car traversing the thoroughfare. Bandwidth can be thought of as the number of lanes on a given highway - i.e. a one lane county road can only accommodate, you guessed it, one car at a time. At the other extreme, the Katy Freeway in Texas has 26 (!) lanes in certain parts, and is therefore able to accommodate 26 cars at the same time.

Here, we should note that the the journey of a piece of data from one point to another is rarely, if ever, direct. Rather, The data's journey will consist of several "hops" between different nodes, or routers, along the way. To see for yourself, open your terminal and type in the command traceroute followed by your favorite website.

Screen Shot 2021-09-30 at 10.11.31 AM.png

Pretty cool, right? traceroute tells us not only each IP hop along the way to our ultimate destination, it also tells us the latency of each path. But I digress. This is all a way of saying that latency (and bandwidth) are not static, but instead fluctuate based on what the realities of the current path are.

The Link Layer

Recall from the first post in this series the local area network (LAN). We know that a LAN is essentially a group (2+) of computers physically connected to each other through one form or another. But how does a piece of data know where to go on the LAN? Simply having these devices physically connected to each other isn't sufficient for them to communicate. They don't know how to communicate as they haven't established any rules for communication. That's where the Link layer and its protocols come in to play.

The Link layer represents the first interface between the physical realm and the more logical abstraction layers above. This layer contains various hardware addressing protocols which allow for the transmission of data between devices that are physically connected to each other. The most common protocol at this layer is the ethernet protocol.

Screen Shot 2021-09-30 at 11.32.57 AM.png

The Ethernet Protocol

You've probably heard of an ethernet cable before. In fact there is probably one sticking out of your home router this very second. The workings of this little cable, among other networking devices, is governed by the the ethernet protocol.

There are two main concepts we'll focus on in this section: framing and addressing.

Ethernet frames are a Protocol Data Unit and encapsulate data from the Internet layer above. Recall from earlier that at the physical layer, data travels in the form of bits (1's and 0's). Ethernet frames introduce logical structure to this binary data. Frames essentially help identify which bits constitute the metadata (headers/ footers) and which bits constitute the data payload.

Common information included in frame metadata includes (assuming IEEE 802.3 standard):

  • Source & Destination MAC addresses: more on these below
  • Length: indicates the size of the data payload
  • DSAP, SSAP: identify the protocol used for the data payload
  • Control: helps to facilitate flow control
  • Frame Check Sequence (FCS): this helps detect errors

Screen Shot 2021-09-30 at 12.05.11 PM.png

MAC Addresses are the critical pieces of information that direct an ethernet frame between devices. These addresses are assigned to machines by their manufacturers and are often referred to as "burned-in" addresses to signify their permanence. MAC addresses are formatted as a sequence of six two-digit hexadecimal numbers such as D8:D3:85:EB:12:E3. A record of the MAC address for each device on a LAN is kept in a table by a switching device.

Though well-suited for a LAN, this system of addressing has trouble scaling. Imagine what a single table containing every MAC address in the world would look like. Even if a single table were capable of listing every conceivable address, because MAC addresses are inherently flat, as opposed to hierarchical, the computing power required for looking up a given address would be extremely inefficient and slow. Luckily, the Internet Protocol is well suited for this very job, but that's for the next post.

Wrapping Up

In this post we discussed the physical nature of data at the lowest level of the TCP/ IP networking model as well as the characteristics of the Link layer and the most prevalent protocol at this layer, ethernet. We also discussed the two major components of an ethernet frame: metadata and the data payload. Lastly we briefly touched on MAC addressing and how this system is well-suited to a LAN. In the next post, I'll explore the Internet layer of the TCP/ IP model and the Internet Protocol (IP). Thanks for reading!