Switching Interview Questions and Answers Vol 1.0
Switching Interview Questions and Answers Vol 1.0
Switching is a process of forwarding the Ethernet frames by doing lookup on the source and
destination MAC address fields of the Ethernet frames.
A network switch is a networking device that connects devices together on a computer network
by using packet switching to receive, process, and forward data to the destination device. A
switch operates at the layer 2 of the OSI model and looks up on the Ethernet frames to forward
the frames out from relevant ports. When a switch receives a frame, it determines what end
point the frame is intended to based on mac entry table (mapped to ports where endpoints are
connected) in the switch is intended for and sends it to that endpoint only.
Ques 3. What is difference between Broadcast Storm Control and Flow Control?
Broadcast Storm Control used in scenarios where we are required to limit broadcast and
multicast traffic to acceptable levels so as to mitigate STP loops. Product manufacturers also
have provision to limit Unicast and Multicast storms.
Flow Control is used to address the condition where traffic on a link may be generated faster
than the receiver can handle it. Flow control is not intended to address issue of STP loops.
"Ethernet Flow control" is used when one end point on an Ethernet network segment
cannot cope with the rate that pockets are being sent to it.
Ques 4. What is difference between Switch and Hub?
• Forward/Filter decisions - To receive the Ethernet frames from any source device connected
to it and forward it to appropriate destination device.
• Address Learning - To learn the MAC addresses of the source and destinations connected to
it and collate all information into its MAC tables.
• VLANs - Switches are used to create virtual LAN environments at Layer 2 of the OSI model.
Loop Avoidance - It is the function of a network switch to prevent layer 2 switching loops
and broadcast storms. A network switch running STP uses following port states – Blocking,
Listening, Learning and Forwarding
Manageable switches have one or more ways, or interfaces, to modify the operation of the
switch. Common management methods include: a serial console or Command Line Interface
accessed via telnet or Secure Shell. You can manage these switches remotely and make the
configuration changes on them.
Collision domain is that part of the network where a collision can occur. A collision occurs when
two devices send a packet at the same time on the shared network segment. The packets collide
and both devices must send the packets again, which reduces network efficiency. Each hub has
only a single collision domain while number of collision domains in a switch is equal to the
number of ports on the switch.
MAC address-table also known as the CAM table sometimes is a table in the memory buffers of
the switch containing a database of the MAC addresses that the switch learns from the frames
entering the switch ports. MAC table contains mapping as to what MAC address connects to
which port and in which VLAN. You can check a MAC table on switch using command “show mac
address-table”. Entries of MAC table are aged out every 300 seconds if not refreshed before this
timer.
A switch when receives any layer 2 frame it reads what the source MAC address in the frame is
and on what port it is learnt. Switch stores the source MAC address in the MAC table as
connected to the interface on which the frame is received. Then switch will check what the
destination MAC address on the frame is. If the destination MAC address is found in the MAC
table switch forwards the frame through the port which connects to that MAC address else this
frame is sent out of all ports of the switch in an attempt to find the destination MAC address and
this is also known as unknown unicast flooding.
• Fragment Free
In Store-and-forward mode, switch waits for whole of frame to be received and at the end of
that frame, the switch will compare the last field of the datagram against its own frame-check-
sequence (FCS) calculations, to help ensure that the packet is free of physical and data-link
errors. The switch then performs the forwarding process.
In Cut-Through mode, when a frame is received, the switch copies the destination address to its
onboard buffers. The fact that the frame is forwarded as soon as the destination address is read
and the outgoing interface is determined, results in decreasing latency. However, we have
caveat here - With cut-through switching the Switch may forward bad frames.
In Fragment Free mode, the switch first checks the initial 64 bytes of a frame for fragmentation
before the frame is forwarded. This is done to avoid possible collisions. While cut-Through mode
only considers the destination mac address before forwarding the frame , Fragment free checks
the atleast 1st 64 bytes before forwarding the frame towards destination.
A switch when receives any layer 2 frame it reads what the source MAC address in the frame is
and on what port it is learnt. Switch stores the source MAC address in the MAC table as
connected to the interface on which the frame is received. Then switch will check what the
destination MAC address on the frame is. If the destination MAC address is found in the MAC
table switch forwards the frame through the port which connects to that MAC address else this
frame is sent out of all ports of the switch in an attempt to find the destination MAC address and
this is also known as unknown unicast flooding.
When the switch receives a frame that is destined for an end station that it hasn’t yet seen (not
in CAM table) , the switch will send the frame out all of the ports other than the port on which it
arrived. This process is called flooding.
Ques 14. PC is connected to switch port 23. The switch has learned the mac address of the PC.
The port is now shutdown. Will the switch retain the mac address?
The switch will immediately flush the MAC address entry from the switch instead of waiting for
300 seconds timer to expire.
MAC address is also known as layer 2 address which is burnt in the Network card of a network
device and cannot be altered. MAC address is of 48 bits or 6 bytes. Every NIC (also called LAN
card) has a hardware address that's known as a MAC, for Media Access Control. The MAC
address is sometimes referred to as a networking hardware address, the burned-in address
(BIA), or the physical address
As shown in the above diagram, MAC addresses are 12-digit hexadecimal numbers (48 bits in
length). By convention, MAC addresses are usually written in one of the following formats:
• Cut-Through and
• Fragment Free
In Store-and-forward mode, switch waits for whole of frame to be received and at the end of
that frame, the switch will compare the last field of the datagram against its own frame-check-
sequence (FCS) calculations, to help ensure that the packet is free of physical and data-link
errors. The switch then performs the forwarding process.
In Cut-Through mode, when a frame is received, the switch copies the destination address to its
onboard buffers. The fact that the frame is forwarded as soon as the destination address is read
and the outgoing interface is determined, results in decreasing latency. However, we have
caveat here - With cut-through switching the Switch may forward bad frames.
In Fragment Free mode, the switch first checks the initial 64 bytes of a frame for fragmentation
before the frame is forwarded. This is done to avoid possible collisions. While cut-Through mode
only considers the destination mac address before forwarding the frame , Fragment free checks
the atleast 1st 64 bytes before forwarding the frame towards destination.
‘Show cdp neighbors’ command can be used to fetch the details of directly connected
neighbors. This will work only for the Cisco devices.
Ques 20. A switch port operating in full duplex mode is connected to a PC operating in half
duplex. What would be the effective duplex settings for the communication?
If the both ends don’t have a common duplex setting the switch will fall back to the half-duplex
setting which is the by default for the switch.
Ques 21. A layer 2 switch has 5 PC’s connected to its ports. After restarting the switch, what
would happen to the mac-address table of the switch?
After the switch is restarted all its MAC table entries will be flushed and it will again wait to
receive the frames on its ports from the switches to learn the MAC addresses dynamically.
Ques 22. What is difference between packet switch and circuit switch network?
Ques 23. Your internet work consists entirely of Cisco devices. You have given a command
"show cdp neighbors". In the response, you get "S" under the head "Capability". What does the
letter "S" mean?
‘S’ under capability in show cdp neighbors output stands for Switch connected at far end.
The UTP cable consists of pairs of wires twisted together. This is one of the most basic methods
used to help prevent electromagnetic interference.
Ques 25. Which layer in OSI model does switch work on?
Ques 26. A 24 port switch receives a frame with destination mac-address unknown. To how
many ports will the frame be flooded?
The frame will be flooded out of 23 ports and won’t be flooded on the port from which it was
received.
Ques 27. Which LAN switching method is used in CISCO Catalyst switches?
Cut-Through Switching Mode: This mode is enabled by default. Switches operating in cut-
through switching mode start forwarding the frame as soon as the switch has read the
destination details in the packet header. A switch in cut-through mode forwards the data before
it has completed receiving the entire frame. The switching speed in cut-through mode is faster
than the switching speed in store-and-forward switching mode.
In Store-and-forward mode, switch waits for whole of frame to be received and at the end of
that frame, the switch will compare the last field of the datagram against its own frame-check-
sequence (FCS) calculations, to help ensure that the packet is free of physical and data-link
errors. The switch then performs the forwarding process.
If a Cyclic Redundancy Check (CRC) error is found, the Ethernet frame is dropped and if there is
no Cyclic Redundancy Check (CRC) error, the switch then performs the forwarding process to the
destination device.
Ques 32. Where would you use cross and straight cable?
Straight cable will be used between a switch and a router and a cross cable will be used between
switch and switch. In simple terms –
DCE to DTE
DCE to DCE
DTE to DTE
Ques 33. Which configuration mode would you use to configure a particular port on a switch?
Interface configuration mode under privilege mode will be used to configure a port on switch.
Ques 34. Which LAN switch type waits for the collision window to pass before looking up the
destination hardware address in the MAC filter table and forwarding the frame?
Ques 35. What does a switch do when a frame is received on an interface and the destination
hardware address is unknown or not in the filter table?
Switch will forward/Broadcast the frame out from all ports except the port on which it has
received the frame.
Ques 36. What is the result of segmenting a network with a bridge or switch?
Bridges break up collision domains, which would increase the number of collision domains in a
network and also make smaller collision domains.
Ques 37. If a switch receives a frame and the source MAC address is not in the MAC address
table but the destination address is, what will the switch do with the frame?
The switch will learn the source MAC address and update its MAC table and will forward the
frame to the destination port without flooding through all ports.
Ques 39. What type of RJ45 UTP cable is used between switches?
The above command allows only one host (one MAC address only) on interface to be allowed
communication via each port.
Ques 41. You have created VLAN 10 and would like to place Fast Ethernet port 0/2 in VLAN
10. Which command would you use?
• int fa0/2
Ques 43. Which LAN switch type only checks the hardware address before forwarding a
frame?
Cut-Through Switching
VTP (VLAN trunking protocol) a cisco proprietary protocol is used for the management of the
VLANs.
Ques 45. Which LAN switch method runs a CRC on every frame?
Store and forward switching will perform CRC on the frame before forwarding it.
Ques 46. You wish to configure an EtherChannel link made up of two Fast Ethernet trunk
ports without any negotiations. What command would you use when configuring the interfaces?
Channel-group 1 mode on
Ques 47. What is difference between half duplex and full duplex mode?
Full-duplex communication between two components means that both can transmit and receive
information between each other simultaneously.
In half-duplex systems, the transmission and reception of information must happen alternately.
While one point is transmitting, the other must only receive. Example Walkie-Talkie.
Ques 48. Your switch has a port status LED that is alternating between green and amber.
What could this indicate?
This condition indicates a STP loop in the switches network. When the port is Amber it is going in
blocked state and green means it is in forwarding state.
Ques 49. How does a host on an Ethernet LAN know when to transmit after a collision has
occurred?
After a collision occurs the time for forwarding the frame again is determined by a back-off
algorithm which selects a random time.
Ques 50. Which fields are contained within an IEEE Ethernet frame header?
Preamble: 7 bytes
Type: 2 bytes
FCS: 4 bytes