Showing posts with label mac address table. Show all posts
Showing posts with label mac address table. Show all posts

Thursday, 23 August 2018

Switching Concept in Networking and Telecommunications

The switch frame forwarding is common in networking and telecommunication. Different types of switches are used in networking(LAN, WAN, and PSTN). The basic concept of switching decision is based on the following two criteria.



  • Ingress port

  • Destination address


The traffic forwarding decision is completed in relation to the traffic flow. The term ingress is used to explain where a frame enters to the device on a particular port. The term egress is used to describe the frames leaving the device from the particular port. When a switch makes a frame forwarding decision, it is based on the ingress port and the address of the destination host.  The networking switch maintains a MAC address table. The table is used to decide how to forward traffic through the switch. The figure below illustrates the switch MAC address table.



  • If a data enters to switch port 1 and the message has a destination address of DB-CD-AC-3D-26-25, then the switch forwards the data out to port 7.

  • If a data enters to switch port 6 and the message has a destination address of C3-A3-A2-35-A6-66, then the switch forwards the data out port 8.

  • If a data enters switch port 2 and has a destination address of EE-01-A1-AF-00-01, then the switch forwards the data out port 1.


The network switch has only one intelligence, the ability to maintain MAC address and table make a decision to forward traffic based on the ingress port and the destination address of the message. Every switch has only one master table that describes an association between address and port. The Cisco switches forward Ethernet frames based on the destination MAC address of the frames.



The concept of Dynamically Populating a MAC Address Table


Network Switches use MAC address table to forward network traffic towards destination through the proper port. It is necessary for a switch to know which port to use to transmit data. The switch must first learn which devices exist on each port. When the switch learns the devices connected to each port, its prepare MAC address. The table also called content addressable memory (CAM) table. The CAM is a memory which is used in high-speed searching applications. The switches decide how to handle incoming data frames by maintaining the table of MAC addresses. The switch builds MAC address table by reading the MAC address of each device connected to the port of a switch and then uses MAC address table to send frames destined for a particular out the specific port which has been assigned to that device. The switch populates the table of the MAC address based on the source MAC addresses.


When a switch receives an incoming frame with a destination MAC address, if the destination MAC address not available in the table, the switch forwards the frame out of all ports except for the ingress port of the frame, this technique called flooding of data.  When destination device responds, the switch adds the source MAC address of the frame and the port where the just received to the MAC address table. Network, where multiple switches are interconnected, The MAC address table contains multiple addresses for a single port. The switch kept MAC address for a specific time, the aging time is five minutes for a single host entry. The steps below describe the process of the building MAC address table.   


The following steps describe the process of building the MAC address table:



  • The switch receives a frame from Host 1 on Port 1, the MAC address table is empty (Figure 1).




  • The switch examines the MAC address of the source (Host 1) and compares it to the MAC address table.

  • If the address is not found in the MAC address table, it associates the MAC address of host 1 with port 1 (ingress port) in the MAC address table. (Figure 2)




  • If the MAC address already exists in the table, it resets the aging timer for an entry.

  • when the switch has recorded the source address information in the MAC table then switch examines the destination MAC address.

  • If the destination address is not already recorded in the MAC table or if it’s a broadcast MAC address containing all Fs, the switch floods the data frame to all ports, except the ingress port (Figure 3).




  • The destination Host (Host 4) will reply to the frame with a unicast frame addressed to Host 1 (Figure 4). The switch enters the source MAC address of Host 4 and the port number of the ingress port into the address table. The destination address (Host 1) of the frame and its associated egress ports found in the MAC address table.




  • The switch now complete entries for host 1 and host 4 and they can now forward frames between these source and destination devices without flooding. 

Sunday, 19 March 2017

Switch Fundamentals - Learning MAC Address

An Ethernet switch is a Layer 2 (data link layer) device, therefore switch uses MAC addresses to make forwarding decisions. It is completely unaware of the protocol being carried in the data portion of the frame, such as an IPv4 packet. The switch makes its forwarding decisions based only on the Layer 2 Ethernet MAC addresses.


Not like an Ethernet hub that repeats bits out all ports except the incoming port, an Ethernet switch consults a MAC address table to make a forwarding decision for each frame. The MAC address table is sometimes referred to as a content addressable memory (CAM) table.


Learning MAC Address Table


The switch automatically builds the MAC address table by examining the source MAC address of the frames received on any port. The switch forwards frames by searching for a match between the destination MAC address in the frame and an entry in the MAC address table. The following process is performed on each Ethernet frame that enters a switch.


Learning the Source and destination MAC Addresses


Every frame that enters a switch it any port is checked for new information to learn. It does this by examining the frame’s source MAC address and port number where the frame entered the switch.


If the source MAC address does not exist, it is added to the table along with the incoming port number. See table in the movie, PC-1 is sending an Ethernet frame to PC-6. The switch adds the MAC address for PC-1 to the table against port-1. If the destination MAC address is on the table, it will forward the frame out the specified port. As you can see in the table there is no mac address entry so the switch will flood the packet to all ports except incoming port. All other will discard the packet and PC-6 will reply. When PC-6 Reply switch will add mac address of PC 6 which is on port-6.By this method, the switch will add all mac addresses against each port. If the destination MAC address is a broadcast or a multicast, the frame is also flooded out all ports except the incoming port.


If the source MAC address does exist, the switch updates the refresh timer for that entry. By default, most Ethernet switches keep an entry in the table for 5 minutes. If the source MAC address does exist in the table but on a different port, the switch treats this as a new entry. The entry is replaced using the same MAC address but with the more current port number.