Final answer:
Switches and bridges learn device locations by recording the source MAC address when a packet enters a port and using it to build a MAC address table for efficient data forwarding.
Step-by-step explanation:
Switches and bridges learn where devices are located on a network by using a mechanism known as the learning, or MAC learning. When a data packet enters a port, the switch or bridge records the source MAC address from the data packet's header, not the destination MAC address. Each device on the network has a unique MAC address which the switch or bridge uses to build a MAC address table. The MAC address table maps each MAC address to the corresponding port on the switch or bridge, allowing the device to effectively forward data packets to the correct destination.
Therefore, the correct statement is: when a data packet enters a port, the source MAC address is copied from the data packet header. This learning process ensures efficient network operation by limiting data transmission only to the destination port associated with the destination device's MAC address.