In the journey to mastering Layer 2 Switching and VLANs in Juniper Networks it is of the utmost importance to have a firm grasp on the mechanisms that make shared LANs possible. There are five mechanisms namely: Learning, Forwarding, Flooding, Filtering and Aging.
Bridging builds and maintains the bridge table using those mechanisms. The implementation of these mechanisms have benefits including reducing the size of a collision domain, and the likelihood of collisions. Additionally it allows you to have a bridged LAN in which you logically group interfaces of mixed types and speeds.
Recapping switch theory
A switch populates the bridge table based on the source MAC address of incoming frames and received frames from devices taking part in the bridged LAN. A switch makes forwarding decisions by comparing the destination MAC address of incoming frames to the contents of the bridge table.
Recapping Ethernet Frames
An ethernet frame is the format in which data transmission occurs between devices in a LAN at the Data Link Layer of the OSI model. A sending device will encapsulate the data it wants to transmit inside of the ethernet frame. There is some extra information included in the frame other than the “data” such as, who sent it (source mac address), where it is going (destination mac address).
Learning
The Learning mechanism is the process through which a switch obtains the MAC addresses of nodes on the network. The learned information then gets stored in the bridge table that the switch uses to forward frames.
In order to learn new MAC addresses, the switch will inspect the Ethernet header of all frames from the LAN, looking at the source MAC addresses of the sending devices. The switch then updates the bridge table, inserting an entry for the new dynamically learned MAC address along with the interface on which it was learned on, along with the time when the mac address was learned.
The port information will be used to forward traffic to it’s intended destination through the forwarding mechanism while the timestamp information is used to keep the bridge table up to date through the aging mechanism. An important thing to note is that when a switch boots up for the first time, the table is empty. (Static entries will be present however dynamically learned entries will not)
Forwarding
During communication between nodes on the LAN (eg. Device A to Device B) the switch will look up the destination MAC address (specified in the received frame) in its bridge table, and it then determines the outgoing interface port, and forwards the frame on to its destination through the designated switch port.
If the switch does not have a MAC entry in its bridge table it floods the frame out all other interfaces belonging to the same broadcast domain (VLAN) as the interface on which it was received. The frame is not sent back out the interface on which it was received.
Flooding
Switches use the flooding mechanism to determine which port a frame must be sent out to reach its destination. If the destination mac address is known, the frame is only forwarded on the port of the known address.
If the mac address is unknown, the frame is (broadcast) flooded to all ports except the one from which it originated. When an unknown destination responds to traffic that has been flooded through a switch, the switch learns the MAC address of that node and updates its bridge table with the source MAC address and ingress port.
Filtering
The filtering mechanism is used to limit traffic to an associated segment or switch port. As the number of entries in the bridge table grows, the switch pieces together a more complete picture of the individual segments, providing clarity with regards to which ports are used to forward traffic to a specific node. The information of the bridge table is used to filter traffic.
Aging
The Aging mechanism is the process by which a switch removes MAC address entries from its bridge table after a certain period. Aging takes place to prevent the bridge table from becoming too large and to free up memory.
The aging time is configured by the administrator and is typically set to 300 seconds (5 minutes). When a MAC address entry ages out, the switch will no longer forward frames to the port associated with that MAC address.
Conclusion
A switch uses 5 mechanism to perform bridging, and they include learning, forwarding, flooding, filtering, and aging. Understanding the concept of bridging will help you immensely when it is time to troubleshoot in a production environment, no matter the brand of networking equipment being used.
Description | Command |
---|---|
Show the mac address table. | show ethernet-switching table |
Disable mac address learning on an interface. | set switch-options interface ge-0/0/1 no-mac-learning |
Show the current aging interval that is globally configured. | show ethernet-switching global-information |
Setting the MAC aging time globally. | set protocols l2-learning global-mac-table-aging-time {seconds} |