1 PC Sends a Frame to the Switch
When a host first connects to a network, it attempts to communicate with a router to obtain an IP addresses.
It creates a packet with a broadcast IP address, then encapsulates the packet into a frame with a broadcast MAC address. This frame is then sent to all hosts.
The MAC address used to broadcast a frame to all hosts is all ones (FF:FF:FF:FF:FF:FF).
2 Switch Receives Frame
When the switch receives this frame, it uses its routing table to associate the host's MAC address with the interface that received the frame.
Remember the frame sent to the Dynamic Host Configuration Protocol (DHCP) server in the router contains the source MAC address.
3 Switch Broadcasts Frame to all Nodes
The MAC in the switch sees this is a broadcast frame, so the switch forwards the frame to all hosts connected to it.
4 Router Sends Reply to PC
When the switch receives the reply from the router, it associates the router’s MAC address with the interface that received the frame.
5 Switch Forwards Frame to PC
The switch looks at this frame to find the destination MAC address and sees that it is already in its routing table. The frame is then forwarded to the appropriate port. No other port will see this frame.