what do network switches do

641 views

what do network switches do

In: Technology

6 Answers

Anonymous 0 Comments

A network switch makes sure that a layer-2 data packet is sent to the target destination. There are 7 layers in total, and a switch operates on the 2nd layer. In order to understand what this means you’ll need a bit of context.

Devices communicate by means of electromagnetic current “traveling” through a medium such as a wire. This is the simplest form of communication: you put current on the wire and everything connected to the wire will be able to “see” this. This is layer 1. Most commonly known hardware component is a hub, e.g. a USB hub.

In layer 2 we agree on a language with which we put current on the wire. For example, you could use Morse code to signal a message across the wire. Think of it as sending a letter to someone: you write your message using letters on a piece of paper, you put it in an envelope and write the destination address on the front, and your address on the back. This is exactly how layer 2 works. The letter is the payload and the envelope the metadata. There is also some message sequence and error correction info present in case an error would occur on layer 1 (e.g. communication is interrupted).

A switch’s job is to make sure that a data packet is received by the target destination, not by other clients. A switch usually is clever enough to know on which wire a destination is located. It might keep this information in memory so that it is not required to broadcast each packet over all connected wires.

At this point you could wonder why on earth we need a layer 3. Well, that’s because the MAC layer is a good candidate for local networks, aka intranets. It is very efficient and loses minimal cycles on overhead. When you have many of these intranets you might want to connect them and create an internet, but you’ll need additional features to ensure stable and performant communications. That’s where routers come into play. A router is also a switch, but it provides more functionality such as: a firewall, port forwarding, NAT, etc. But this is out of scope here.

Higher levels do not necessarily require specific hardware components, but they could. Layer 7 is what is called the “Application” layer. Sometimes routers provide features to block certain outgoing addresses, this can be done on Layer 7, e.g. in case you would like to restrict access to a specific website.

If you are in a store and unsure whether or not to buy a switch or a router, then you’ll probably need a router.

You are viewing 1 out of 6 answers, click here to view all answers.