A
A
Alexander Zubov2016-12-18 19:56:03
Computer networks
Alexander Zubov, 2016-12-18 19:56:03

How does switching work?

I’m studying switching, the question is this, for example, there is a network, it has a 1-switch, in a computer, they are only connected and now the 1st packet will be sent, 1-pc has ip 192.168.10.1 second 192.168.10.2
from the second pc to the first we send a ping, what happens next?
as I understood:
all this (ping, icmp, etc.) is encapsulated in a ethernet frame on the sender's computer, there is also the recipient's IP and the sender's IP, then it is all digested into bits and flies to the switch, which in turn finds out that the request has arrived 10.1 and knows that it should be sent to 10.2, it compares the arp table in order to find out which poppy it is attached to and when it finds out it sends it to the right place in bits, right? or it sends to all PCs in this subnet and each PC checks its IP with the IP of the recipient that is specified in the ethernet frame and if it does not kill or accept it, right? ato I got confused)))

Answer the question

In order to leave comments, you need to log in

5 answer(s)
W
Wexter, 2016-12-18
@Wexter

linkmeup.ru/blog/13.html

M
Max, 2016-12-18
@MaxDukov

the switch (aka the switch) works at the 2nd OSI level, there it is still far from IP. The switch respects MAC addresses

I
Igor, 2016-12-18
@DMGarikk

it compares the arp table in order to find out which poppy it is attached to and when it finds out it sends it to the right place in bits, right?

that's right
The second option with "sends all PCs on this subnet" is from the ancient times of 10Base when there were hubs instead of switches

C
Cool Admin, 2016-12-19
@ifaustrue

PC 1 tries to send the first packet.
The data packet is packed into IP. Headers are inserted, among which are the IP address of the sender and recipient.
The packet is packed into a frame and then ethernet realizes that it does not know to whom the packet is intended, since there is no poppy address in the cache.
A broadcast request is formed using the protocol reverse arp "who is 192.168.02"
The remote PC receives such a frame and responds with a unicast "I am 192.168.0.2"
Since the answer comes, we know its poppy address.
We finish the formation of the initial frame, first writing down the recipient's poppy address, and then ours.
Let's send the packet to the network.

A
Alexander, 2016-12-19
@Adorne

I could be wrong, but it seems that if the switching table (containing the correspondence of MAC addresses and interfaces) is empty, the frame is sent to all ports, except from where it came from. The hosts respond, from the frames that arrived from them, the MAC values ​​are taken and written to the table. If there is already a record for this MAC, then the frame is sent to the corresponding port.
The switch does not care about IP addresses if it is not L3 and the hosts are in the same broadcast domain, it only cares about MAC addresses, so the frame in this case is parsed only to L2 and the ARP table is also not kept as unnecessary. This is the lot of hosts and routers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question