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?

  • @[email protected]
    link
    fedilink
    188 months ago

    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.

      • @Pohl
        link
        10
        edit-2
        8 months ago

        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.

      • Superb
        link
        fedilink
        English
        5
        edit-2
        8 months ago

        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

          • Superb
            link
            fedilink
            English
            68 months ago

            Yeah the line can get pretty ambiguous. In general I try to use the device with the least complexity that still gets the job done

            • @[email protected]
              link
              fedilink
              English
              88 months ago

              No, a modem modulates and demodulates a signal. Basically, they’re a converter. For example, to send your Ethernet traffic over coax. They don’t often understand or care about what’s in an Ethernet frame.

        • @[email protected]OP
          link
          fedilink
          -28 months ago

          Isn’t there some overlap between NAT, DHCP and DNS, they feel like they should be the same thing? Or am I oversimplifying it? Because DHCP is assigning IP addresses, DNS is looking up IP addresses and NAT is saying that IP address points there 👉🏾

          • @FutileRecipe
            link
            68 months ago

            Isn’t there some overlap between NAT, DHCP and DNS, they feel like they should be the same thing?

            Absolutely no overlap. Now, can a conventional home router do all those? Typically NAT and DHCP, but not too often DNS (except to point at a real DNS). That’s like saying “isn’t there overlap between milk and eggs? I mean, sure, they deal with animals and stored in the fridge, but used for different purposes.”

            Because DHCP is assigning IP addresses, DNS is looking up IP addresses and NAT is saying that IP address points there 👉🏾

            Sure, they deal with IP addresses and some devices (home routers) can do 2-3 of those fuctions, but that doesn’t mean they overlap. I can read a book (IP) and my book (IP) can be stored in a book bag or on a book shelf, but that doesn’t mean myself, the bookbag, and the bookshelf overlap.

      • @[email protected]
        link
        fedilink
        English
        58 months ago

        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.

  • @[email protected]
    link
    fedilink
    English
    68 months ago

    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.

  • @[email protected]
    link
    fedilink
    English
    28 months ago

    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.

  • Brownian Motion
    link
    1
    edit-2
    8 months ago

    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.

    • @[email protected]OP
      link
      fedilink
      18 months ago

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

      • Brownian Motion
        link
        1
        edit-2
        8 months ago

        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/

        • @bigredgiraffe
          link
          18 months ago

          While most of this is true sometimes, in the spirit of learning I wanted to point a few things out. So in an IP network a router by definition only has one function, connecting two layer 3 networks. Switches and routers are not similar at all because they do not operate at the same layer of the OSI model and do not require each other to function. By definition a router does not really need Ethernet the protocol at all in many situations and definitely doesn’t need to have any type of WAN connection. Now all of that said, many consumer “router” devices are really a combination of the services of several devices used in a large network (usually including a router, firewall, access point, and sometimes other basic IP services like DHCP or a DNS forwarder) so it gets pretty murky.

          Another thing is that in larger networks the actual transport (like Ethernet the protocol) or physical medium (Ethernet the cable like cat5/6 or fiber optic) are not related outside of the way that they are configured. What I mean by that is you can run Ethernet the protocol over a fiber optic cable if you want but you can also use the same physical cable type in other situations for other protocols as well (fibre channel storage on OM4 fiber as an example here), the cable does not dictate it directly in most situations. Another example here is ADSL the protocol being delivered over a cat5 cable. Anyway, I hope at least some of that was helpful!

          • Brownian Motion
            link
            08 months ago

            I’ve never seen ADSL (Asymmetric Digital Subscriber Line) delivered over anything other than a phone line (Cat nothing, and usually RJ11 or RJ12 termination). That is what it was designed for.

            Both a consumer router, and a L3 switch have a routing table in order to decide how each IP packet will be forwarded through the device. For that to work both a L3 switch and a Router support dynamic routing protocols such as OSPF, RIP etc, or statically configured routes.

            The primary use case for a router is WAN connectivity, as I stated. For almost 99% of cases, including failover/redundancy, router connect the WAN network to the beginning of the internal network.

            And yes, routers do operate at the same OSI layer, as I said, L3. If they didn’t they could not have a routing table and decide how traffic is forwarded (remember routers still have multiple LAN ports, whilst unmanaged they still have the ability to decide what goes where.

            • @bigredgiraffe
              link
              18 months ago

              So phone line when it’s 2 pair UTP is also known as Cat3 and you actually brought up something else interesting, the connector also doesn’t determine what the cable is doing either, you can use an RJ45 connector with cat3 cable and the right pins populated to pass Ethernet (up to 1000FX if I remember right) just as you can use 2 pair of a cat5 cable to replace cat3 cable in a pinch.

              Back to switches though, a L3 switch is called that (or called a multi-layer switch) because it’s performing functions at multiple layers, I’m just trying to make the distinction that a switch and functions involved in switching does not operate at nor use any parts of the L3 protocol stack as switches do not view network traffic in packets but instead operate using and physical addresses and frames. The same physical device may do both but its import to understand that the device is using different components and logic to perform both functions (for example, a switch forwards frames based on the MAC/CAM table), the reason this is important is that it helps understand how things like VLANs work. Also, while I would agree that in the consumer space a router is 99% for a WAN connection that is definitely not true for routers (or even routing) as a whole, there are way more reasons to use a router between two private networks than just between a private network and the internet (which is what I assume you mean by WAN but that is also not always true).

              • Brownian Motion
                link
                08 months ago

                Firstly Its not cat 3. I’ve never seen that in a telephony installation. Its 4 core flat ribbon or just 4 core. Neither are twisted. Secondly, with 2 “pairs” the best you can do is 100mb/s, as in 10MB/s. Thirdly an L3 Switch DOES use the L3 protocol stack - that is where ROUTING and the routing table happens. OSPF, EIGRP, RIPv2, IS-IS, BGP are all LAYER 3 protocols.

                I think you need to go back to school.

                https://en.wikipedia.org/wiki/Open_Shortest_Path_First

                OSPF is a layer 3 protocol. If a layer 2 switch is between the two devices running OSPF, one side may negotiate a speed different from the other side. This can create an asymmetric routing on the link (Router 1 to Router 2 could cost ‘1’ and the return path could cost ‘10’), which may lead to unintended consequences.

                • @mitchconnor
                  link
                  08 months ago

                  I like how we are arguing over old stuff that basically doesn’t matter. Do you want to also mention token ring for an achtually statement?

                  Cat 3 cable can be used in telephony as referenced here https://en.wikipedia.org/wiki/Category_3_cable but it kind of really doesn’t matter for the original poster does it?

                  You are right that switches can operate at L3 if you have an L3 switch. You can also disable it and make it into this lobotomized brick that just forwards packets based on the CAM table. Guess what layer that operates at? Guess what protocols literally don’t matter for forwarding packets that are on the same L2 network?

                  @bigredgiraffe is pointing out the distinction between L2 and L3 devices within a network for someone that is learning networking. He is making the clear distinction that NEEDS to be made for someone learning. Not all switches are layer 3, not all switches have layer 3 enabled because they have the feature set, not all networks are created equally.

                  Maybe instead of helping this guy learn about the distinction between layers, justifications, etc. you can just tell him every switch is L3, uses an overlay, and runs 3-5 routing protocols all redistributing routes to other overlays.