November 2, 2014

Layer X Devices


We’re talking networking layers folks! The layers are the subdivisions of the Open Systems Interconnection (OSI) model which characterizes the functions of the communications flow between devices, as shown in the image below.osiSo why this particular topic? As I mentioned, I’ve been busy, mainly with an office and datacenter relocation and few consults for other departments, two of which were very network heavy. If theres one thing I noticed during the many meetings and discussions for these consults, was that a lot of folks (even those who are supposed to be network savvy) have a very unclear concept of the various “layers” that networking devices have. The other thing I noticed, is that those who are clear about them, can’t explain things simply enough for those who don’t understand them, so I want to try and clear things up. Now I don’t profess to be able to simplify things sufficiently either, but lets give it a shot.

Basically the layers in the image represent how, for example, this blog appears on your computer screen.

step 7 (webserver) –[data]– step 1 <—- cable —-> step 1 –[data]– step 7 (browser)

So you request for a html page by typing in a URL on your browser, the browser takes that URL, does its conversion of the host and domain name to an IP and packs the request into a TCP packet and sends it out through your LAN cable and the packet goes through your switch and then to the ISP’s router which tells it which path to take to reach the webserver of the URL you wanted and it reaches another router where the said webserver’s network is connected, gets told to go to a particular switch where the webserver is hooked up to and since it is HTML data you are requesting, it sends it by default to port 80 of the webserver. The webserver then takes the HTML page you wanted and coverts and compresses it into some format, then packs that into a TCP packet and passes that packet back down to the HTTPd port of the webserver, up the switch its hooked onto, back to the router who tells its which path to take to get back to your browser and it will travel to the router  of your home network and down to the switch where your pc (browser) is connected to and your browser will decompress and unconvert it and display it for you to see.

Man that was tiring and confusing. Go read the above paragraph five times, if you haven’t torn your hair off by then,  you probably understand what I’m talking about. Its just a flow, so unless you intend to take an exam on this, don’t worry too much about getting confused. In any case, I only want to discuss 2 particular layers. By the way, if you are intending to take an exam on this, then for goodness sakes, get off my blog and go read a real textbook!

We hardly talk about layer 1 devices in terms of the OSI layer and layer 4-7 devices are typically for select operations (L4 – typically load balancing, L5-6 TCP issues, L7 – application). What interest us IT architects and networking folks is layers 2 and 3 because these are key in how data gets moved about in a network and how to connect various networks together. For example, you can have switches (layer 2) connect your various devices together so they can talk to each other and transfer data to each other, that is considered a “single network” or a LAN. You could set up a few of these “single networks” each with their own switch (creating a few LANs), but how would you make them talk to each other? And thats what your router (layer 3) is for. Each of those “single networks” connected to a router would enable intercommunication between the “single networks”. Based on certain routing tables or other IP logic, data is passed from one network to another.

In a simplistic nutshell:

Layer 2 devices:
– connect machines together to form a LAN
– uses ARP to convert an IP address to a MAC address
– transports data to network port where a machine with the destination MAC address is

In a building-lift analogy, switches are liftshafts, floors of the building are the network ports (which have devices connected to them), passengers are the data. Passengers (data) can go from floor to floor (network ports where devices are connected) to access different units (devices) by traveling though the liftshaft (switch), as shown below.


Layer 2 – Lift Analogy

Layer 3 devices:
– connect different networks (eg: LANs) together
– transports data from network to network, based on destination IP address

Sticking with the lift analogy, the building the lift shaft is in, is your LAN, skybridge(s) are your routers. Passengers (data) can go from floor to floor (network ports) to access units (devics) by travelling through the liftshaft (switch) and if they need to go to a unit (device) in another building (LAN), they will take the liftshaft (switch), head for the skybridge (router), go to the other building (LAN) and then take the liftshaft (switch) of that building (LAN) to get to the floor (network port) of that building (LAN) where the unit (device) is. Yeah I’d be confused too if I wasn’t the one explaining things – just look at the diagram for clarity. Its all pretty simple.


Layer 3 Skybridge Analogy

We then come to the “Layer 3 Switching Device”. This is all the rage now, as almost every SOHO (Small Office Home Office) “router” is a Layer 3 Switching Device. Why did I put the term ‘router’ in quotes? Because the terminology isn’t quite right. The similarities are there, as explained in the “About Tech” article:

“…a layer 3 switch is a high-performance device for network routing. Layer 3 switches actually differ very little from routers. A Layer 3 switch can support the same routing protocols as network routers do. Both inspect incoming packets and make dynamic routing decisions based on the source and destination addresses inside…”

however there is a clear difference. From the CiscoPress Book, “Cisco LAN Switching“, pages 451-453, authored by Kennedy Clark and Kevil Hamilton:

“…a Layer-3 switch (routing switch) is primarily a switch (a Layer-2 device) that has been enhanced or taught some routing (Layer 3) capabilities. A router is a Layer-3 device that simply does routing only…”

So “Layer 3 Switch” is essentially a marketing term, blurring the lines between the actual definition of layer 2 and layer 3 devices. Actual layer 3 devices make use of hardware, specifically “application-specific-integrated-circuits” or ASIC hardware to achieve its functionality, while the so called layer 3 switches use software to get things done.The useful thing about having software doing things, is that you can bundle other stuff with it, such as QoS, Firewalls and NAT.

So what was the problem with the vendors for our consults? They didn’t know difference between an L2, L3 and L3 switch. Our design called for an L3 switch with NAT, the vendors said they would give us the “Rolls Royce” of L3 switches, which would cover all the bells and whistles like NAT, VPN, vLANs and the like. End of the day, this “Rolls Royce” was nothing more than a “Camry” – an L2 switch with advanced monitoring and ACLs. Guess who had to start screaming at people?

Anyway, I hope the above has given some clarity (if not more confusion) to the difference between the L2, L3 and L3 switch situation – don’t get caught unaware if you’re doing a network design and most importantly, don’t get caught by me!

Comments (0)

Comments are closed.