4 ms·
A Layer 2 switch is something that works on the data link layer. A normal Ethernet switch falls into this category and the switching is done by MAC address. A
by Avernar 9y ago
A Layer 2 switch is something that works on the data link layer. A normal Ethernet switch falls into this category and the switching is done by MAC address.
A layer 3 switch is something that works on the network layer. It switches using the IP address.
A layer 3 switch is not a router. It does not switch based on the subnet/network mask. It just remembers which IP is on which port just like an Ethernet switch remembers which MAC address is on which port.
- icedchai 9y agoLayer 3 switches have routing / forwarding tables... They qualify as routers.
- Avernar 9y agoWhich proves my point. Real world stuff rarely fits neatly into theoretical models/categories. Real world Layer 3 Switches are a hybrid between a router and a pure layer 3 switch. In fact they're just a really fast router. A normal edge router switches based on IP and a bunch of extra rules. These extra rules range from firewall stuff to QoS. These extra rules need software to process. A core router is what is now called a Layer 3 Switch. It just cares about the IP address and because of that can be done in hardware making it really fast. It's still a router because as you said it still has routing tables based on networks and subnets. I don't think anyone makes a true (non-router) layer 3 switch. The only use case I can think of would be a campus wide WiFi network.
- jlgaddis 9y ago"switching" is a layer 2 term. At layer 2, frames are switched. At layer 3, packets are routed. An edge router routes, based upon the destination IP adress (unless you have policies that cause a packet to be sent elsewhere). Layer 3 implies routing, by the way. A "pure layer 3 switch" is called a router.
- Avernar 9y agoAgain, theory and reality rarely line up neatly. A switch moves packets between devices inside a network and a router moves packets between networks. Calling one a frame and one a packet is splitting hairs and irrelevant to whether something is a router or a switch. Using a *BSD/Linux box I can make a L2 router. I can also make an real (non routing) L3 switch. And since "pure layer 3 switch" is my made up term I think I get to define what it means, thank you very much. It's something that doesn't route, or in other words, you can have the same network (i.e. subnet) on multiple ports. Then we get into the definition of a network. Is it a building, a department, or how about multiple buildings all over the world? Or how about the network of a backbone provider? Their core "routers" are really switches as they pass packets to other devices inside their network. And the network gear manufacturers are muddying things even more. Their definition of routing or switching is whether it's done in software or hardware. That's why they're calling some of their equipment a Layer 3 Switch. As I said, that really is just a fast router based on the above definition. The easiest way to distinguish switching vs routing is whether the packets move to the same or different subnet. It's a good rule of thumb but there are always exceptions. You can take an L2 switch and replace it with an L3 switch on your network and everything IP based will work as if nothing had happened. You'd just get less broadcast traffic.
- jlgaddis 9y ago> The data link layer is concerned with local delivery of frames ... [0] > The network layer is responsible for packet forwarding including routing ... [1] IP operates at layer 3. Layer 3, by definition, implies routing. > Their definition of routing or switching is whether it's done in software or hardware. No. No, it's not. I think that, in general, you kinda sorta know what you're talking about (although you've got a few things incorrect) but the way you keep screwing up basic terminology really makes me wonder. In networking, router, switch, frame, and packet are all clearly defined -- as are the various layers and the PDUs involved at each of them -- and mean specific things but you can call 'em whatever you want to, I suppose. [0]: https://en.wikipedia.org/wiki/Data_link_layer https://en.wikipedia.org/wiki/Data_link_layer [1]: https://en.wikipedia.org/wiki/Network_layer https://en.wikipedia.org/wiki/Network_layer
- Hikikomori 9y agoSwitching = forwarding by looking at l2 headers Routing = forwarding by looking at l3 headers It does not matter one bit if above is done in software or an ASIC/FPGA/NPU, what the device looks at to perform it's forwarding decision is what matters, so one device may not just fit neatly into one OSI layer. Layer 3 switch is mainly a marketing term, it's nonsense really. The devices that fits into that category are what would classically be switches (many ethernet ports, small buffers, cheap) but with full routing capabilities. Routers can be either software or hardware based. Software routers mainly make up the low-end offers from vendors, rich in features and cheap. Hardware routers that use ASIC/NPU's make up low-ish end to the very high end. Any router that ISP's use in their backbone will be the very high end and do all forwarding in hardware, have all QoS features in hardware, etc.