Skip Navigation
homelab @lemmy.ml sabreW4K3 @lazysoci.al

WTF is up with switches?

cross-posted from: https://lazysoci.al/post/12597342

Okay, I've been watching lots of YouTube videos about switches and I've just made myself more confused. Managed versus unmanaged seems to be having a GUI versus not having a GUI, but why would anyone want a GUI on a switch? Shouldn't your router do that? Also, a switch is like a tube station for local traffic, essentially an extension lead, so why do some have fans?

30
30 comments
  • it depends what you need it. If you want a "stupid" tube station for local traffic, then you want unmanaged. It needs less power. If you instead want to have multiple VLANs, which are separate virtual networks inside your network, you need managed. Then from the GUI you say "port 8-12 are for VLAN 5 which is 10.0.0.1/8 and does not have internet access, rest is normal LAN". If then the switch has lots of fast ports, then it needs lots of power to manage the communication, more power means more hot, and more fans.

    • So can't a router do the VLAN stuff?

      • Your question exposes a language problem.

        A router cannot do that. A router connects two networks together and routs traffic between them. That is it.

        A home “router” is a combination device that includes a router, a wireless access point, maybe a modem, a managed switch, a dhcp server, a firewall, and more.

        If you need a managed switch with more than 4 ports… you buy a managed switch. It is simple.

      • Think a large office space or industrial application with several hundred (or thousands) of hosts connected to the network. Some of them need to be isolated from the internet and/or rest of the network, some need only access to the internet, some need internet and local services and so on.

        With that kind of setup you could just run separate cables and unmanaged switches for every different type of network you have and have the router manage where each of those can talk to. However, that would be pretty difficult to change or expand while being pretty expensive as you need a ton of hardware and cabling to do it. Instead you use VLANs which kinda-sorta split your single hardware switch into multiple virtual ones and you can still manage their access from a single router.

        If you replace all the switches with routers they're quite a bit more expensive and there's not too many routers with 24 or 48 ports around. And additonally router configuration is more complex than just telling the switch that 'ports 1-10 are on vlan id 5 and ports 15-20 are on id 8'. With dozens of switches that adds up pretty fast. And while you could run most routers as a switch you'll just waste your money with that.

        VLANs can be pretty useful in home environment too, but they're mostly used in bigger environments.

      • A router usually can do all that but it also does a whole lot more, like NAT, DHCP, etc. Sometimes you need a just a switch that understands VLANs and link aggregation

  • Quick Primer - Ethernet is a bus protocol, multiple devices can be on the same electrical cables. Although the vast majority of ethernet you will see is point-to-point links, it's important to remember this

    • Hub (layer 1 - it could just be a cable) - Everything can be seen by everyone, every packet goes everywhere. (Hard to buy a hub nowadays everyone sells switches)
    • Switch (layer 2 ethernet address aware) - Packets are only delivered to the ports of the switch with the corresponding hardware address. So Traffic from port 2 - to port 14 only goes on those two ports, and doesn't get seen by all the other computers, this reduces congestion
    • Router (layer 3, IP address aware) - apply rules at the IP level to determine what goes where, i.e. the send traffic to the internet, or deny traffic from the printer to the internet.

    The more logic, switching, throughput, and power delivery something has, the more energy it consumes and the more heat it needs to dissipate.

    Managed Switch - Allow for fine grained control of ports, which traffic goes where, manually turning things on and off, vlans, etc... more then just a MAC address lookup table.

    The interface for switches and routers can be serial ports and CLI, all the way to fancy web guis. Usually the more pretty the interface the less flexible it is and the more basic the functionality it delivers.

    • Thanks for the primer. Posts like this mean so much to me. Honestly, thank you.

  • As a networking professional, I'll just say: it gets worse the more you look at it.

    I think others have covered most of what you wanted to know, but ask me any follow up questions that might still be lingering.

  • L2/L3 (managed) switches can do things like LAGG (link aggregation) so you can use multiple ports to combine traffic. This is the main reason (oh and the other end has to understand LAGG too for it to work.) It has nothing to do with VLAN or any of that shit (port based VLAN is though)

    The other things are doing QOS at the switch (mainly for more complex environments) and stuff like that.

    Sure, L2/L3 switches offer DHCP/DNS/VLAN/Monitoring/network security but these are not generally used these days (firewall has it covered). But there is still Multicast/Spanning tree etc that are useful.

    • So now I'm struggling to figure out what the router actually does. Since all the complexity seems to happen at the switch level.

      • Some of what others have posted is correct, and others are misleading.

        A router is a device that can take your WAN connection (be it ADSL/ADSL2/coax/fibre) and convert the signal WITH a built in MODEM for that particular signal to usable network data (ie packets on RJ45). In the case of fibre, you might even need a fibre-RJ45 converter even before the router.

        These routers are often collection of devices to make it convenient to consumers. They will often have a small unmanaged switch of 4 ports, probably WIFI of some flavour, a SIMPLE firewall/DHCP/QoS ability. Routers are sometimes required because what the ISP sends you is not straight "internet", it might be encapsulated in PPP or similar, and may require you to use credentials to access as well.

        Routers have a lot in common to a L3 switch, an fact they basically are the same with one key difference, which is what I first said - a Router device supports different types of WAN interfaces, a L3 switch only deals with RJ45/Fibre type ports.

        A proper network would generally be: Internet - Router - Firewall - L2/L3 Switch ---- clients

        The link below ignores the firewall because its focusing on what the devices are, but it would be after the router and before the first switch.

        https://www.networkstraining.com/router-vs-switch-in-networks/

30 comments