What is Switching?
The function of Switching is to Switch data packets between devices on the same network.
What is Switch?
A Switch is a device which is used to connect multiple devices inside Local Area Network (LAN). Unlike hubs, switches examine each packet and process it accordingly rather than simply repeating the signal to all ports. Switches operate at Layer Two (Data Link Layer) of the OSI model.
What is the difference between a HUB, Switch & Router?
Hub is designed to connect hosts to each other with no understanding of what it is transferring. When a Hub receives a packet of data from a connected device, it broadcasts that data packet to all other ports regardless of destination port. HUB operates at Layer 1 (Physical Layer).
Switch also connects hosts to each other like a hub. Switch differs from a hub in the way it handles packets. When a switch receives a packet, it determines what hosts the packet is intended for and sends it to that hosts only. It does not broadcast the packet to all the hosts as a hub does which means bandwidth is not shared and makes the network more efficient. Switch operates at Layer 2 (Data Link Layer).
Router is different from a switch or hub since its function is to route data packets to other networks, instead of just the local network. Routers operates at Layer 3 (Network Layer).
What are the functions of a Switch?
The Switch performs three major functions:-
3.Loop avoidance by Spanning Tree Protocol.
What is Sub Interface?
To support ISL or 802.1Q routing on a Fast Ethernet interface, the router’s interface is divided into logical interfaces—one for each VLAN. These are called subinterfaces.
What is a Broadcast Domain and a Collision Domain?
Broadcast Domain - Broadcast is a type of communication, where the sending device send a single copy of data and that copy of data will be delivered to every other device in the network segment. A Broadcast Domain consists of all the devices that will receive every broadcast packet originating from any device within the network segment. All ports on a hub or a switch are by default in the same broadcast domain. All ports on a router are in the different broadcast domains and routers don't forward broadcast.
Collision Domain - is a network scenario where one particular device sends a packet on a network segment forcing every other device on that same segment to pay attention to it. At the same time, if a different device tries to transmit simultaneously, it will lead to a collision after which both devices must retransmit, one at a time. This situations is often in a hub environment, because each port on a hub is in the same collision domain. By contrast, Each port on a bridge, a switch or router is in a seperate collision domain.
Compare HUB and Switch with respect to broadcast and collision domain?
In Hub there is one collision domain and one broadcast domain.
In Switch there is multiple collision domain and one broadcast domain.
What is a MAC address Table and how a Switch will build a MAC table?
To switch frames between LAN ports efficiently, the switch maintains an address table called MAC address Table or CAM Table (Content Addressable Memory Table). When the switch receives a frame, source MAC address is learned and recorded in the CAM table along with the port of arrival, VLAN and time stamp. The switch dynamically builds the MAC address table by using the Source MAC address of the frames received. Than this table is used by switch to determine where to forward traffic on a LAN.
How Switch Learns Mac Address?
When a frame reaches to the port of a switch, the switch reads the MAC address of the source device from Ethernet frame and compares it to its MAC address table (also known as CAM (Content Addressable Memory) table). If the switch does not find a corresponding entry in MAC address table, the switch will add the address to the table with the port number at which the Ethernet frame is received.
If the MAC address is already available in the MAC address table, the switch compares the incoming port with the port already available in the MAC table. If the port numbers are different, the switch updates the MAC address table with the new port number.
How does Switch performs Forwarding function?
When a Layer2 Ethernet frame reaches a port on the Switch, it not only reads the source MAC address of the Ethernet frame as a part of learning function, but also reads the destination MAC address as a part of forwarding function. The destination MAC address is important to determine the port which the destination device is connected to.
As the destination MAC address is found on the MAC address table, the switch forwards the Ethernet frame via the corresponding port of the MAC address.
If the destination MAC address is not found in the MAC address table, the switch forwards the frame out all of its ports except the port on which the frame was received. This is known as flooding.