S
S
Stanislav Timoshko2020-12-21 20:28:42
Computer networks
Stanislav Timoshko, 2020-12-21 20:28:42

Addressing in a network organized by a switch. How does it work?

Everywhere they write that home routers distribute traffic between two networks - the global WAN and the local LAN. And they say that the LAN network (all other ports) is created by a switch that is included in the router device. Then the question arises, where do local IPs come from, if it is, as it were, a switch. It should also work at the second level of the OSI model, and it can only have MAC addresses.
In principle, the issue of addressing packets in a network organized by a switch is not clear. He, in theory, should forward packets only knowing the destination MAC address.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2020-12-21
@MooTs

A device used in a home network consists of a switch, a router, and a DHCP server and performs the functions of all of these devices.
DHCP distributes IP addresses and routing and name resolution settings to the entire network
The router operates on L3, implementing NAT
The switch operates on L2

D
Dmitry Shitskov, 2020-12-21
@Zarom

The simplest home router (router), in fact, can be represented as a switch for several ports + the router itself, which is internally connected to this switch.
If we consider the operation of such a device, then the interaction within the local network between devices will be exactly the same as when using a switch - one device will send a broadcast ARP request (who has) to receive and another device will respond to it within this broadcast range, reporting your MAC. Routing will not work.
In case of interaction outside the local subnet, the device will send a request to the default gateway without trying to find out the recipient's MAC. default gateway, i.e. the router will decide where to forward the packet based on the IP address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question