3

I've always read, the router is a layer 3 device, the switch is a layer 2 device, the hub and repeater are layer 1 devices and so on with other devices.

But what does this mean? When I started studying this topic, about 2 months ago, I thought I had understood it, and had defined it as

A layer N device is a device that implements up to layer N of the OSI model and whose main function occurs in that layer N.

So I liked that definition, because I made sense of it.

For example, for a router, it implemented layers 1, 2 and 3 and its main function occurred at the network layer.

However, some time later, I asked myself the question:

If the router implements layers 1,2 and 3 this means that it has to perform all the functions that are executed in layer 1, in layer 2 (framing, error correction/detection, MAC, etc.) and also the functions Layer 3 (Routing, subnetting, etc.)

On the other hand, the Switch implements layer 1 and 2.

So my inference was that the Router would perform all the functions that the Switch does and more, because it implements more layers.

So why would we want a switch, hub or repeater when we have a router that implements the same layers and more?

I know that in reality this is not the case, but it is difficult for me to see what concepts I am confusing and where my definitions are failing.

Thank you very much in advance.

2
  • Where does it forward datagrams? Layer-1 forwards bits at layer-1 from one end of a link to another. Bridges (switches are bridges) forward layer-2 datagrams (frames) in the layer-2 domain. Routers forward layer-3 datagrams (packets) between networks. Routers do not forward frames, they strip off the frame to forward the packets and build a new frame for the next network.
    – Ron Maupin
    Jun 10, 2021 at 22:38
  • Did any answer help you? if so, you should accept the answer so that the question does not keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer.
    – Ron Maupin
    Dec 23, 2021 at 20:07

2 Answers 2

3

Implementing layers and providing certain functions for layers are different things.

A router forwards at (based on information from) L3. It also uses L2 and L1, necessarily. Although some routers can forward at L2 as well they often do so differently from a switch.

A switch (multi-port bridge) forwards at (based on information from) L2. It also uses L1, necessarily. A simple switch has no concept of layers 3+.

A layer-3 switch can additionally forward at L3. It's still also a layer-2 switch. The main difference from a router is the often limited feature set (no NAT especially) and that a layer-3 switch generally forwards in hardware.

A multi-layer switch may provide various functions for upper layers, blurring the distinction from a (hardware) router almost entirely.

A NIC is also a layer-2 device but it doesn't forward anything, even if it's got multiple ports.

A repeater (hub) is a simple layer-1 device. It forwards bits/symbols from any port to all the others. Apart from that it has no forwarding logic, no buffering and no idea what happens at layers 2+.

1

The choice of device depends on what is needed for the topology.

Also, as a practical matter, routing functions add significantly to the cost of the device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.