Tips and Concepts

Concept

 
 Layer-2 Resolving         Tips and Concepts

Let take a look how a cisco switch build its MAC address table and workstation finding each other.

Small network with 5 client computers and 2 servers.  All clients and server have static IP addresses as follows:

Let’s assume the switch just powered up; its mac address-table will be empty as no host has transmitted any data.

 
   
Optimize OSPF /30 network  
Layer-2 Resolving  
Data Encapsulation  
"Fish-Mo" of AD  
Layer-2 Redundancy  
Using /31 Subnet  
FSMO: Inf Master and GC  
   
   
   
   

CCNA

Let’s take a detailed look at when Client1 needs to ping Client4 using a hostname.

1.
Client1 will send a request to the DNS server for Client4’s IP address. Client1 does know the IP address of the DNS server but it does not know the MAC address of the DNS server. Client1 sends an ARP out to 192.168.1.5 asking for the MAC address. The destination MAC of the ARP will be FF:FF:FF:FF:FF:FF.
At this time, the Switch will learn the MAC address of Client1 from the source MAC address of the ARP frame.
When the ARP needs to resolve a given IP address to Ethernet address, it broadcasts an ARP request packet. The ARP request packet contains the source MAC address, the source IP address and the destination IP address. Each host in the local network receives this packet. The host with the specified destination IP address sends an ARP reply packet to the originating host with its IP address.
2.
DNS Server will send a reply back to Client1 with the IP address of Client4.
The return frame from the DNS server will be a unicast all the way, because the DNS knows the IP and MAC address of Client1.
By this time, the Switch will add the MAC address of the DNS to its MAC table and will only forward the frame to Client1 port since it already knows where Client1 is.
3.
Client1 will send an ARP out to the IP address of Client4 and request for its MAC address.
Again, the destination ARP MAC address will be FF:FF:FF:FF:FF:FF and will be forwarded out to all ports (including the port of the DNS Server), except for the source port of Client1.
4.
Client4 will send back its MAC address to Client1.
Now the Switch will add Client4’s MAC address to its MAC table.
5.
Client1 will send 4 ping packets to Client4.
The frame now will go from the Client1 port to the Client4 port.

Cisco

As you can see the switch has learned 3 MAC addresses and its port.
If Client1 is now trying to ping Client5, the same thing will start, except when a DNS request takes place. Client1 will remember the MAC address of the DNS server, and the Switch will only forward ping to Port #2.