There are many types of devices that implement Ethernet like switches, hubs or routers. The early networks were using hubs to connect devices between each other. This implementation had some problems because all devices shared a common medium so collisions were frequent. This is why switches where invented, they are used to separate collision domains. Switches uses one port for each device and data is sent from one point to another directly without interfering with other devices.
MAC address is used to uniquely identify each device in a network. The source and destination MAC addresses are added when a packet is encapsulated into a frame. A MAC address is made of 48 bits composed of two parts. The first part (24 bits) identifies the company that produced the equipment and the last 24 bits are used to uniquely identify a device. Open a command prompt and type getmac to see the MAC addresses for the network devices attached to your computer (on a Windows OS):
first 6 hexadecimal digits (AC-16-2D) - manufacturer
last 6 hexadecimal digits (0D-49-B3) - device unique id
The MAC address is referred to as the burned-in address because it is written in the ROM (Read Only Memory) of a network device. By reading the MAC address, devices know where a frame must be sent. Read more about MAC address: http://en.wikipedia.org/wiki/MAC_address, about MAC http://en.wikipedia.org/wiki/Media_access_control and about LLC http://en.wikipedia.org/wiki/Logical_link_control.
In Ethernet implementations communications ca be either unicast, multicast or broadcast. I have already talked about these in a past post.
Hubs where used in an early implementation of networks. They were replaced by switches because of many factors. I've already told you that by using hubs all devices share the same medium so collisions can occur. The scalability (http://en.wikipedia.org/wiki/Scalability) is also affected because by adding devices in a hub network, the bandwidth is increasingly reduced. Another factor is that latency is increased and networks can be easily affected by devices that stop operating.
By using switches networks were highly improved. Communication between devices are made full-duplex, bandwidth is dedicated for each device, collision domains are segmented and networks can be easily expanded. Switches use MAC address tables to store addresses that are needed to communicate between devices. When a frame arrives, the switch decapsulates the frame, reads the MAC address and then forwards the frame to the next switch or to the destination. If the MAC address is not stored in the address table, it is added for a later transmission. Read more on http://en.wikipedia.org/wiki/Network_switch. A switch has some important functions:
Learning - A switch has the capacity to learn and store MAC addresses when they arrive.
Flooding - When a frame arrives, the switch checks it's MAC table. If the destination MAC address is not found then the switch sends the frame trough all interfaces.
Aging - After a certain idle period, if no communication is made, the MAC addresses stored in the address table are deleted.
Forwarding - A switch sends a certain frame to the corresponding exit interface based on the destination MAC address.
Filtering - A switch can make decisions based on the rules created for that frame. It can drop a frame if it's corrupted, it can block a certain frame, etc.
When frames are sent between devices, destination MAC addresses must be added. To get a certain MAC address, devices use the ARP protocol. The Address Resolution Protocol maps the MAC address with the IP address of a certain equipment. ARP uses broadcast to sent and receive messages about MAC addresses. If a frame is destined to a remote device, the frame is sent to the default gateway. This next image will make you understand how ARP works:
To display the MAC entries from the arp table of a windows workstation type arp -a:
An entry in the arp table has the following elements:
Internet Address - devices IP addresses
Physical Address - the corresponding MAC addresses
Type - how did the device learned about that entry (static or dynamic).
Read more about ARP here: http://en.wikipedia.org/wiki/Address_Resolution_Protocol.
That's it folks for this post, I wish you all the best.