What is UDLD and why it is required?
UDLD is a Layer 2 protocol that enables devices connected through fiber-optic or twisted-pair Ethernet cables to monitor the physical configuration of the cables and detect when a unidirectional link exists. All connected devices must support UDLD for the protocol to successfully identify and disable unidirectional links. When UDLD detects a unidirectional link, it administratively shuts down the affected port and alerts you. Unidirectional links can cause a variety of problems, including spanning-tree topology loops.
Explain about three functions of a Switch .

There are three distinct functions of layer 2 switching : address learning, forward/filter decisions, and loop avoidance.

Address learning :
Layer 2 switches and bridges remember the source hardware address of each frame received on an interface, and they enter this information into a MAC database called a forward/filter table.

Forward/filter decisions :
When a frame is received on an interface, the switch looks at the destination hardware address and finds the exit interface in the MAC database. The frame is only forwarded out the specified destination port.

Loop avoidance :
If multiple connections between switches are created for redundancy purposes, network loops can occur. Spanning Tree Protocol is used to stop network loops while still permitting redundancy.

Define Root bridge.

The root bridge is the bridge with the best bridge id. With STP, the key is for all the switches in the network to elect a root bridge that becomes the focal point in the network. All other decisions in the network – such as which port is to be blocked and which port is to be put in forwarding mode – are made from the perspective of this root bridge.

Define BPDU.

BPDU : All the switches exchange information to use in the selection of the root switch as well as in subsequent configuration of the network. Each switch compares the parameters in the Bridge protocol Data Unit that it sends to one neighbor with the one that it receives from another neighbor.

Define Bridge ID.

The bridge ID is how STP keeps track of all the switches in the network. It is determined by a combination of the bridge priority (by default 32,768) and the base MAC address. The bridge with the lowest bridge ID becomes the root bridge in the network.