cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
882
Views
0
Helpful
5
Replies

ARP vs layer2 switch

nitinquiet
Level 1
Level 1

As per my understanding ARP works on Layer3 and switch only check layer2 header to process packets.

I am wondering if there is case in which there is only pure L2 environment, how communication will happen between two PC without ARP.

 

PC1 10.10.10.10/24  mac 11---------Pure L2 switch------------- mac 22 ----PC2 10.10.10.11/24

 

How switch will build mac table

5 Replies 5

Jon Marshall
Hall of Fame
Hall of Fame

 

Assuming no previous communication, PC1 sends arp for PC2 and switch sees mac address of PC1 on that port. 

 

Then switch floods packet out of all other ports and PC2 receives it, responds at which point switch now learns the mac address and port of PC2. 

 

Both PCs needs to map the other's IP address to a mac address but a L2 switch has no need to use the IPs. 

 

Jon

If both PC are in different subnet then how switch will learn each other mac address?

Does PC1 cannot communicate to PC2 without router?

 

 

 

If the PCs are in different subnets then you need a L3 device to route between them. 

 

Jon

If the computer are on different subnets, PC1 knows this by looking at its IP, subnet mask and the destination address. Then PC1 will send an ARP request for the MAC address of its configured default gateway(the router) and using Layer 2(MAC addresses) it will then send the packet to the router.
The router will then know where to send the packet for PC2.

Joseph W. Doherty
Hall of Fame
Hall of Fame
In a pure L2 (Ethernet) environment, hosts would only communicate using MACs (which also happens in a L3 environment too). Without ARP, the question arises how one host would "know" the MAC of the other. Well, two ways come to mind, first each host has that information precoded, or second, a host uses an Ethernet broadcast. The receiving host could respond via Ethernet broadcast too, but it would normally use the received frame's source MAC and respond Ethernet unicast.

To your later question, if the hosts are on different subnetworks, what do you mean, as networks imply L3. If those networks are on the same "wire", the above still would work. If they were separated by a router, by default, a router will not forward L2. However, if they were on different "wires", but connected via a L2 bridge, the bridge would forward any broadcast or unknown unicast MAC. (BTW, a "L2 switch" is a multi-port bridge.)
Review Cisco Networking for a $25 gift card