What is Network Switch?
Switches are network devices that are used to join two or more computer devices in a network.
Why is Network Switch used?
Network switches are used to create or setup a network. As various devices connect to this switch, you can create your own small or big network. A switch has a fixed number of ports ( 4 port switch, 8 port switch, 12 port switch, 16 port switch, 24 port switch, 48 port switch ) and the same number of LED’s for the users to check which ports are working.
If you want to create a small local network at your home to play games or share data, you can use a 4 port switch or 8 port switch.
Image of Network – Switch.
How does a Network switch work?
Unlike the hub, the switch is not a dumb device. Switches have the tendency to ‘learn’ from the traffic flowing through the network. It has the ability to learn where certain addresses are located. Once switch knows the location of a particular device, if a data packet comes for that device, it learns from its experience and forwards it to that device only.
It checks whether that device is connected or not. If connected it only sends it to that particular machine, thus saving the traffic in the network, which makes your network more efficient.
Switches have a table which records IP and MAC addresses of all the connected devices.
NOTE : Switches do not have the routing table. It has a table of MAC addresses of connected devices.
So how does it learn? When a packet arrives for Machine A, the switch remembers the sender’s location. It has received this for the first time, so it sends it to all connected devices.
Machine A, for which the packet was intended for, responds to switch. The switch does not broadcast this response since it has learned the location of the device which sent the incoming packet at first place, it directly sends the response there.
Now the switch knows where the sender is.
So when machine A responds, it sends the message to the sender.
Next time if a message arrives for Machine A, the switch will directly send it to Machine A.
- Now if Computer B wants to send some packets to Computer A, the switch knows where Computer A is. So it will directly send to Computer A and note down where Computer B is located.
- Say Computer C wants to communicate with Computer B, so when Computer C sends a packet it directly goes to Computer B because the switch knows Computer B’s location, and this time switch notes down Computer C’s location.
- Same goes on when Computer D tries to connect to Computer A, Computer B or Computer C, and switch remembers the location of Computer D.
This helps in reducing the traffic over network thus directly increasing the performance of the network.