1

According to TCP/IP model router works at Layer 3. But when data has to be transmitted to different network it is based on IP address but hop-to-hop transmission is based on MAC address.

That means the router uses both MAC and IP address for transmission of packet, so why do we consider router to work at Layer 3 only?

Why can't we say router works both at Layer 2 and Layer 3?

3
  • A router's basic function is located on the network layer (L3). Of course, it also uses underlying layers 2 and 1.
    – Zac67
    Commented Sep 29, 2021 at 8:49
  • 1
    It is better to say routing is a layer 3 function. An actual router uses layers 1,2,and 3 to send data. Layers 1and2 have no concept of routing.
    – Ron Trunk
    Commented Sep 29, 2021 at 8:57
  • Not all layer-2 protocols use MAC addressing. For example, the common DSL uses PPP, which has no addressing because there is only one other devices on the link, so when the router strips off the layer-2 frame with MAC addressing, it must build a new, PPP layer-2 frame for the next interface.
    – Ron Maupin
    Commented Sep 29, 2021 at 12:32

1 Answer 1

1

Why can't we say router works both at Layer 2 and Layer 3?

This is implied. Basically, when we say that a device works on layer N, we actually means that the device implements all layers up to including layer N of the model, and its main functionality is in layer N.

The logic is as follows. The role of a device, that interacts with a network, is to send "data" outside of the device (i.e., "data" will eventually ends on the cable/air) and receive "data" from the network (i.e., receive data from the cable/air).

Since the device is "obviously" communicating with "the outside", it is implied that the device needs whole stack, starting from physical layer, then data link layer, and so on. For "textbook" routers this ends in layer 3 (at least for the data plane). For "textbook" hosts it ends with layer 4 inside OS and in application layer outside.

To put it in the opposite direction. Layer N cannot send (or receive) data without Layer N-1. For router as an example, layer 3 cannot send data without layer 2, layer 2 cannot send data without layer 1. And since it is clear that the data needs to be eventually sent, it is obvious that the presence of layer 3 implies presence of layers 2 and 1.

1
  • 1
    More generally, you could say layer N doesn't work without layer N-1, with the exception of the not/poorly implemented layers 5&6 and layer 1, of course.
    – Zac67
    Commented Sep 29, 2021 at 11:43

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