S
S
Stanislav Timoshko2020-12-21 18:30:32
Computer networks
Stanislav Timoshko, 2020-12-21 18:30:32

How do nodes communicate through a switch?

Everywhere it is written that the switch operates at the second level of the OSI model, that is, it operates with MAC addresses. It also indicates that it is used to combine the nth number of nodes into a network. Then the question arises, how can packets from one node reach another located on the same network? Then, it turns out, the sending host needs to know the MAC address of the receiving host. He doesn't seem to be able to know this.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Armenian Radio, 2020-12-21
@gbg

Ask the second question separately, otherwise it will be a violation of local rules .
To find out the MAC of the second machine, before sending the packet, the first machine makes a request via the ARP protocol, which in Russian sounds like "which machine has IP XYZQ? answer the machine xyzq"
After that, having learned the MAC by IP, the machine can send packets to the right place .

I
Igor, 2020-12-21
@DMGarikk

Then the question arises, where do local IPs come from, if it is, as it were, a switch.

home access point (this is the thing that has a wan port and several 'normal' ports) - a router is a router (router), a switch (switch) is another device (you just described it correctly) it has only ordinary ports (We will not delve into their industrial variations)
In order not to cause unnecessary confusion, I will formulate this way, without details, a router can perform the functions of a switch. and in the home network, it (the router) assigns IP addresses via DHCP

V
vreitech, 2020-12-21
@fzfx

> Then the question arises, where do local IPs come from
there - where is this?
if we are talking about a home local network, they are registered by the owner of the PC with their hands or assigned by the DHCP server of the router.

D
Dmitry Shitskov, 2020-12-21
@Zarom

To the second question, in a simple way, I would answer like this.
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. But there are fewer and fewer such simple pieces of iron.

Z
Zzzz9, 2020-12-22
@Zzzz9

Then, it turns out, the sending host needs to know the MAC address of the receiving host. He doesn't seem to be able to know this.

If we are talking about a local network, they know the recipient perfectly. Does the switch send an ethernet packet to the port corresponding to the destination MAC address, unlike the ethernet hub? which sends ethernet packets to all its ports.
Then the question arises, how can packets from one node reach another located on the same network?

The ethernet packet header contains the destination address and the sender address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question