Compare commits
3 Commits
b2a7c4c54a
...
5ae1f6eae3
Author | SHA1 | Date | |
---|---|---|---|
5ae1f6eae3 | |||
6bf87bac98 | |||
d3c14fbe3c |
98
1.txt
98
1.txt
@@ -41,7 +41,8 @@ With all of that being said, let's jump straight in!
|
||||
|
||||
PART 1
|
||||
|
||||
Here we are, the physical layer! It's dark, dirty and grimy, and there's a distinct smell of solder in the air. It doesn't seem like much, but this, my friends, is where it all begins.
|
||||
Here we are, the physical layer! It's dark, dirty and grimy, and there's a distinct smell of solder in the air (I don't think they get many visitors).
|
||||
It doesn't seem like much, but this, my friends, is where it all begins.
|
||||
|
||||
The physical layer is honestly the least 'networking-esque' of the layers. Think of it as the foundation for our OSI layer: data can't be transferred through networks, and indeed,
|
||||
networks wouldn't exist, if we didn't have the hardware to create them. The physical layer encompasses the actual cables and wires through which information flows. This is also where
|
||||
@@ -89,8 +90,8 @@ means, is that the NIC only receives data wirelessly. But, all the same, every n
|
||||
through a NIC.
|
||||
|
||||
But how does the data reach your NIC? Every NIC is identifiable by a certain address. This address is 'burned in' during the manufacturing process, and is globally unique (your NIC
|
||||
is the only one in the world with that address). This address is known as a MAC address (not to be confused with the more well-known IP address). A MAC address is a physical address,
|
||||
which means that it a) never changes, and b) refers to a specific device.
|
||||
is the only one in the world with that address). This address is known as a MAC, or Media Access Control address (not to be confused with the more well-known IP address). A MAC address
|
||||
is a physical address, which means that it a) never changes, and b) refers to a specific device.
|
||||
|
||||
A MAC consists of 48 bits, although it is often written in hexadecimal. This results in 12 hexadecimal digits. The address is separated into six groups of two (separated by colons),
|
||||
with the first three groups identifying the manufacturer of the NIC, and the next six groups identifying the device itself.
|
||||
@@ -106,5 +107,94 @@ Every manufacturer has an OUI assigned to them by the IEEE (Institute of Electri
|
||||
A simple Google search will provide you with this information.
|
||||
|
||||
|
||||
Now, let's tie this back into encapsulation. With every step in the encapsulation process (ie. with every layer that the data goes down), the layer adds relevant information to the data,
|
||||
Now, let's tie this back into encapsulation. With every step in the encapsulation process (ie. with every layer that the data goes down), that layer adds relevant information to the data,
|
||||
that will help the data be sent to the correct destination.
|
||||
|
||||
So, when the data link layer (the second layer) receives data, in the form of a 'packet', from the third layer (we count the layers starting from the bottom), it adds certain information
|
||||
to it as well. Specifically, it adds a header (which is inserted before the packet) and a trailer (which is inserted after the packet).
|
||||
|
||||
INSERT IMAGE HERE
|
||||
|
||||
The header consists of four fields:
|
||||
Frame Start - This field indicates the start of a frame (a frame is really just a grouping of bits).
|
||||
Addresses - This field contains the source and destination MAC addresses.
|
||||
Type - This identifies the layer 3 protocol that the data uses (more on this later).
|
||||
Control - This field contains information that's used for flow control, essentially determining the priority of the packet.
|
||||
|
||||
The trailer consists of two fields:
|
||||
Error detection - This field contains a checksum (a mathematical hash) of the data in the frame. This can be used to ensure that the data wasn't corrupted on the way.
|
||||
Frame stop - This field indicates the end of the frame.
|
||||
|
||||
The purpose of a MAC address is simple: at the very basic level, devices need to send data to each other. However, they don't know each other's IP addresses, because all they know is
|
||||
which <i>physical</i> devices are connected to them. Therefore, the IP address needs to be converted into a physical (i.e. MAC) address, so that the data can actually be sent to
|
||||
the correct device. This IP-to-MAC conversion is done using a protocol called ARP (Address Resolution Protocol). More on that later.
|
||||
|
||||
Now, let's focus on an important question, one that you're probably wondering about: it's all fine and dandy that devices can use MAC addresses to communicate, but what if there are more
|
||||
than two devices on a network? I can't connect a single device to multiple devices, can I?
|
||||
|
||||
As it turns out, you can. Certain devices, called network switches, or just 'switches' for short, are built for this exact purpose. They have rows of ethernet ports (sometimes upwards of
|
||||
30), and are used as a central 'hub' for the devices on a network. They can receive incoming connections from one port, and forward them to another, based on the destination MAC
|
||||
address. A switch maintains a list of ports, and the MAC addresses of the devices connected to those ports. This is called a
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
This way, a single switch can essentially connect a network together, providing internal communication.
|
||||
|
||||
INSERT IMAGE HERE
|
||||
|
||||
Now, let's journey further upward - I can already hear the noise and commotion...
|
||||
|
||||
|
||||
LAYER 3:
|
||||
|
||||
So, here we are, the network layer! This is where the magic happens, for the most part. It's also the busiest layer of the OSI model. Tons of packets flying around in all directions,
|
||||
heading, unceasingly, to their destination.
|
||||
|
||||
This is probably the layer that most people are familiar with. If you've ever heard the term 'IP address', you have at least some idea of the work that this layer does.
|
||||
|
||||
So, communication using MAC addresses works pretty well, for short distances. If you're connected to a single other device, you just send the data to them, and if you're part of a larger
|
||||
network, you send the data to the switch, which looks up the port in its table,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user