Monday, February 10, 2014

What is a MAC address ? /How switch process Unicast, Multicast & Broadcast frames ?



Different type of frames a switch will receive:

            The three types of frames a switch can receive are Unicast frame, Broadcast frame & Multicast frame. The frame types are derived based on the destination MAC address in a frame.
            So in order to understand the different type of frames, we first need learn few things about the MAC addresses.

What is a MAC address ?
           
            We all know that every device, it may be a Workstation, Server, Switch, Router or any other network devices which are connected to other devices communicate with the help of a Network Interface Card which have an RJ-45 interface.
            The MAC (Media Access Control) address is a 48 bit (6 byte) unique address assigned by the manufacturer of the NIC card, this address will be unique globally (that means in the entire world there cannot be two NIC cards with the same MAC address even though they are manufactured by various manufacturers). The manufacturers of the NIC cards will follow the MAC numbering structure defined by the IEEE (Institute of Electrical & Electronics Engineers), which ensures that MAC address are unquie globally.
            The MAC address is burned into the ROM of the NIC card permanently, that is the reason people refere MAC address as BIA (Burned In Address), Physical/Hardware address.

Format of the MAC address:
           
            It is a 48 bit (6 byte) address with 12 hexadecimal digits. It can be represented in any of the below three formats:
            AB:CD:EF:A1:B2:C3
            AB-CD-EF-A1-B2-C3
            ABCD.EFA1.B2C3
Most of the network equipments use the last format. In the six groups of hexadecimal format (first two formats) each group is equal to one byte/octet, so total 6 bytes/octets. The first 6 digits/three octets are known as OUI (Organizationally Unique Identifier) because they identify the organization that manufactured the NIC card. The next three octets are used by the manufacturer to create unique mac addresses and  burn them into NIC cards.
            So the address space of the MAC address is : 248 addresses.
 Types of MAC address seen in the destination fields:

            The destination field can contain three types of MAC address.
  1. MAC address of a device
  2. MAC address to which a group of devices will listen
  3. MAC address to which all the devices will listen

MAC address of a device/host:
            A frame whose destination field have the MAC address of a single device/host is called as a Unicast frame.

MAC address of a group of device:
            A frame whose destination field have the multicast mac address is called as a Multicast frame.
            Multicast is nothing but a group of devices which will listen to a single MAC address. That is nothing but the devices in a multicast group will accept all the frames that are sent to that group’s mac address (a multicast address).
            For example, the mac address: 01-00-0C-CC-CC-CC is an address for the devices that run VLAN trunking protocol. So if a device wants to send a VTP message to all the VTP devices then it will just send it to that address then all the devices that are running VTP will accept the frame.

MAC address to which all the devices will listen:
            A frame whose destination field has this MAC address: FFFF.FFFF.FFFF is called as a broadcast frame. The broadcast frame will be received by all the devices connected to a switch.

Operational difference between the frames:

Unicast frames:
            Unicast means sending information to a single device. So if a device wants to send some information to 10 devices, then with unicast the source device has to send separate frame to each device, so it will create & send 10 frames with different destination MAC address.

Broadcast frames:
            Broadcast means sending information to all the devices. So if a device wants to send some information to 10 devices, then with broadcast the source device will send a single frame to the destination address: FFFF.FFFF.FFFF, then all the devices in the segment will receive that frame.

Multicast frames:
            Multicast means sending information to only a group of/selected devices. So if a device wants to send some information to 5 devices out of all the remaining devices, then with Multicast the source device will send a single frame to the group’s address (multicast address), then the devices only in that group will receive the frame.

How switch process the three types of frames?

Unicast frame: When a switch receives a unicast frame i.e. a frame that is destined to a single device. The switch will compare the destination MAC to its CAM table, if an entry is found it will forward it to the port to which the destination mac is associated/mapped to.
            If the destination MAC address is not found then the switch will flood the frame to all the active ports, then whichever the device’s mac matches the destination MAC it will reply back to the source machine, then the switch will associate the source MAC address from the reply frame to the port on which it received the reply frame.   

Broadcast frame: Whenever a switch sees FFFF.FFFF.FFFF address in the destination field of the frame, then it will send the frame to all of its active ports.

Multicast frame: Whenever a switch sees a multicast address (ex VTP multicast address: 01-00-0C-CC-CC-CC) in the destination field, it will flood the frame to all the active ports just as it does for the broadcast frame.
            But the difference here is the ports which are configured to accept these multicast messages will only process the frame and all other devices will ignore the frame.
               The multicast range of MAC addresses defined by IEEE are between 0100.5E00.0000 to 0100.5E7F.FFFF.

Why switch will flood the multicast messages to all the active ports?

            The reason is the multicast address will never been seen in a frames source mac filed and since switch learns the mac address only from the source mac field, they don’t have entries in their CAM table for multicast addresses, hence they’ll flood the frame just as broadcast.

            In the next post we will discuss about “How the switch was born?”

No comments:

Post a Comment