top of page

Know Your LAN (Part Three)

Local Area Network, or LAN for short. The whole Internet is based on the concept of LANs, literally.

Part One - What is a Switch

Part Two - How and what does the Switch do?

Part Three - Advanced explanation of the Switch from a Network Engineering viewpoint. (You are here)

As someone who always preferred Switching over Routing, I always looked at switches as these beautiful pieces of hardware that you will basically interact with way more than a Router.

First of all, lets get something out of the way. The Switch works at the first 2 layers of the OSI (Open System Interconnection) model, or the first layer in the TCP/IP model. This means that a normal switch usually operates on the Physical Layer and Data Link Layer.

I will not be explaining the OSI model here, but I will give a brief explanation of the first two layers as that is the topic of this post.

On this blog I will most likely never end up explaining anything at the Session Layer and above, only up until the Transport Layer. But for today, we will be covering only the first two layers.

The Physical Layer is self explanatory, that's your wires, signals etc... And roughly 70% of all network issues surprisingly, happen at the physical layer and not above. For example: Someone trips over the wires and disconnects them, someone sits over a cable for too long damaging it and much, much more.

Unfortunately for you, me and pretty much everyone... This type of problem can sometimes be extremely hard to detect, making it the most difficult to recognize but the easiest to fix. There will be a completely separate post explaining the Physical Layer in detail, which will also include a small history lesson about the old days of IT.

Data Link Layer is responsible for slightly higher level stuff. You will notice the word "Frame" is written next to that layer in the picture above. When your PC sends any type of information, the first thing that is created is something called a Frame. In a LAN you can communicate with no more than a Frame, which contains basically your MAC address, the destination's MAC address, the data you want to send and something called "CRC Checksum". CRC stands for Cyclic Redundancy Check, it's basically an error detection mechanism. Some of you may be wondering "Why and how?!".

Good question! The "Why" is simple really... Sometimes when data travels through a cable, it reaches its destination in a not-exactly-tip-top shape, which results in corrupted data etc... As for "How", if the acronym MD5 means anything to you, then you've probably already guessed the answer.

If not, here is the simple explanation of it:

CRC is an insecure hashing function, which is designed to detect accidental changes in your data as it travels. If you don't know what hashing is and how hashing helps confirm data integrity, then stick around for later posts explaining the basics of hashing.

Keep in mind that I intentionally said "your normal switch". There are such things as Layer 3 Switches. Normally, a Router operates at the third layer. However a Layer 3 Switch can also do that! Which begs the question "Why would I ever use a Router then?". Answering that question is a little bit more complicated... It all depends on the design and requirements of a network.

Usually a Layer 3 Switch is faster than a Router, however it also lacks certain features that Routers may provide. Routers are specifically made to route traffic to foreign networks. Layer 3 Switches also lack the WAN capabilities of a Router. But this is a topic left for another time.

You will notice that the Data Link Layer has two sub layers! The MAC and LLC sub layers. The MAC (Media Access Control) layer is simple. It works with MAC addresses in the network etc... The LLC (Logical Link Control) is where the more complicated and beautiful stuff happens. LLC is responsible for managing the traffic. It is responsible for error detection (remember the CRC?) and it can also assign sequence numbers to Frames, in order to keep the order of which the frames must be delivered in check.

So in a more detailed fashion, here is what actually happens when you send data to another PC in your local network. The source PC creates a frame which houses the data, sends this away to the switch. The Switch then interprets only the destination MAC address, IF it finds the PC in question it just sends your data to that specific PC. If not, it sends out something called an ARP (Address Resolution Protocol) request through which it recognizes all the PCs connected to it. If it finds the PC in quest, it simply forwards it normally, if not, it drops the frame.

And that's it! Now you know how the Switch operates on a slightly higher level. This is of course not even close to the full potential of the Switch. We haven't covered anything related to VLANs, STP, VTP, Forwarding Methods and more. But this is a good start to introduce you to the basics of the more advanced stuff.

I apologize for not posting for such a long time, faculty exams were brutal. But I should be back up and running soon.

My next post will explain how you can upgrade your simple home router into a much stronger Router!

bottom of page