Avatar of jskfan
jskfan
Flag for Cyprus asked on

How PCs communicate through L2 Switch

How PCs communicate through L2 Switch
 

I would like to know how computers communicate between each other through L2 Switch.

PC1:10.10.10.1
PC2: 10.10.10.2
PC3: 10.10.10.3

Any Expert to explain step by step, how ARP and ICMP get involded in order for  instance PC1 to ping PC2 successfully. How does the L2 switch handles that to get the ping to work ?

Thank you

l2
RoutersSwitches / Hubs

Avatar of undefined
Last Comment
Predrag Jovic

8/22/2022 - Mon
Predrag Jovic

You are already in packet tracer in simulation mode. Try to understand what is saying in the messages.
When packet is sent, which type of packet, order in which packets are sent.
:)
jskfan

ASKER
I am not using Packet tracer. Just  a picture from a web site
jskfan

ASKER
I mean how does the L2 switch map the MAC to IP address ?
for instance when PC 1 tries to  reach PC 2,   PC1 will look up  DNS to  get  the  IP address of PC2

PC1 will send a broadcast query or ARP query : What is the MAC address of IP x.x.x.x  , the Switch will register the MAC address of PC 1 , but how si it  going to fetch the MAC address of PC 2, since the switch does not know if the IP address that PC 1 is trying to reach whether it belongs to PC 2 or PC 3
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Predrag Jovic

jskfan

ASKER
I followed the steps in the link you provided.

What  I do not understand, is the first time request. for instance PC 1 tries to communicate with PC2  through L2 switch,  PC1 will broadcast its own IP and MAC addresses, the Switch will forward that out of every port except the one it has received the frame from.  

Question1: will L2 Switch registers IP and MAC address of PC1 in its table ?

question2 : When L2 switch forwards the request through other ports out, will the Frame contain Target PC Ip address ?

When Other PCs in the segment receive the Broadcast, they will verify if the IP address in the Frame matches their own IP address, if so then they  respond back to the switch with their own IP and MAC addresses in the frame, then the Switch will register the response content (IP and MAC address), and send the requested MAC address to PC1

*** I was not sure L2 switch table has  a map IP address to MAC address. I thought the Frame has only Mac address
Predrag Jovic

Question1: will L2 Switch registers IP and MAC address of PC1 in its table ?
Switch will add source MAC address into TCAM when frame is received on port (only in IN direction).
question2 : When L2 switch forwards the request through other ports out, will the Frame contain Target PC Ip address ?
L2 frame does not contain target IP address, it does contain destination MAC address ffff.ffff.ffff. Target IP address is part of ARP message. You can red some explanation and packet capture here.

L2 switches do not map IP addresses, just L2 addresses, and the only ARP table is for management VLAN (L3 switch interface).
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
in the link you provided, you stated:

<<Device that receives L2 frame will check if ARP message is addressed to it (check IP address  inside of ARP message of target device against its own IP address). In Wireshark you will see translation of ARP datagram to English as: " Who has 192.168.0.201? Tell 192.168.0.27" >>

OK So the IP address of the Target is in the ARP message which is   itself contained in the Frame.
ASKER CERTIFIED SOLUTION
Predrag Jovic

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jskfan

ASKER
Thank you
Predrag Jovic

You're welcome.
Your help has saved me hundreds of hours of internet surfing.
fblack61