Network switch
From Free net encyclopedia
Image:Smartswitch6000.jpg A network switch is a computer networking device that connects network segments. It uses the logic of a Network bridge but allows a physical and logical star topology. It is often used to replace network hubs. A switch is also often referred to as an intelligent hub or switching hub.
Note that the term "switch" is abused in the networking industry to name many different types of devices - see Multilayer switch.
Contents |
Switch's operation
A switch can connect Ethernet, Token Ring, Fibre Channel or other types of packet switched network segments together to form a heterogeneous network operating at OSI Layer 2.
As a frame comes into a switch, the switch saves the originating MAC address and the originating port in the switch's MAC address table. The switch then selectively transmits the frame from specific ports based on the frame's destination MAC address and previous entries in the MAC address table. If the destination MAC address is unknown, for instance, a broadcast address or (for simpler switches) a multicast address, the switch simply transmits the frame out of all of the connected interfaces except the incoming port. If the destination MAC address is known, the frame is forwarded only to the corresponding port in the MAC address table. If the destination port is the same as the originating port, the frame is filtered out and not forwarded.
Switches, unlike hubs, use microsegmentation to create collision domains, one per connected segment. This way, only the NICs which are directly connected via a point-to-point link, or directly connected hubs are contending for the medium. If the switch and the equipment (other than a hub) it connects to supports full-duplex then the collision domain is eliminated entirely.
Virtual LANs can be used in switches to reduce the size of the broadcast domains and at the same time increase security.
In redundant architectures, spanning tree protocol can be used in switches to prevent loops.
Forwarding methods
There are four forwarding methods a switch can use:
- Store and forward - the switch buffers and typically, performs a checksum on each frame before forwarding it on.
- Cut through - the switch only reads up to the frame's hardware address before starting to forward it. There is no error checking with this method.
- Fragment free - a method similar to "cut through" that checks the outgoing medium is free.
- Adaptive switching - a method automatically switching between the other three modes.
Note that "cut through" switches have to fall back to "store and forward" if the outgoing port is busy at the time the packet arrives.
The two first terms are common throughout the industry; the two last terms are found in Intel literature.
A hub is a fairly unsophisticated broadcast device. Any packet entering any port is broadcast out on every port and thus hubs do not manage any of the traffic that comes through their ports. Since every packet is constantly being sent out through every port, you end up with packet collisions, which greatly impedes the smooth flow of traffic on your LAN.
A switch, on the other hand, isolates ports which means every received packet is sent out only to the port on which the target may be found (one caveat - if the proper port cannot be determined, then the switch will broadcast the packet to all ports). Essentially, a switch is a router, but one operating at the MAC level rather than the IP level. Since the switch intelligently sends packets only where they need to go, and not everywhere willy-nilly, the performance speed of your network can be greatly increased.
So do you need a switch or a hub for your SOHO network? If most of your traffic involves only a few ports, then there will be little performance gain achieved by upgrading from a hub to a switch. But if you've got more than a few machines, then a switch can give you a marked improvement in performance.
Flaws
Switches have difficulty in monitoring traffic because each port is isolated until it transmits data, and even then only the sending and receiving ports are connected.
Two popular methods that are specifically designed to allow a network manager to monitor traffic are:
- Port mirroring - the switch sends a copy of network packets to a monitoring network connection.
- SMON - "Switch Monitoring" is described by RFC 2613 and is a protocol for controlling facilities such as port mirroring.
Other methods (which could be classified as attacks) have been devised to allow snooping on another computer on the network without the cooperation of the switch:
- ARP spoofing - fooling the target computer into using your own MAC address for the network gateway, or alternatively getting it to use the broadcast MAC.
- MAC flooding - overloading the switch with a large number of MAC addresses, so that it drops into a "failopen mode".
See also
ca:Commutador cs:Switch da:Netværksswitch de:Switch (Computertechnik) es:Switch fr:Commutateur réseau ia:Commutator (rete de computatores) it:Switch he:מיתוג nl:Switch (hardware) ja:スイッチングハブ no:Switch pl:Switch pt:Comutador (redes) ru:Сетевой коммутатор sl:Omrežno stikalo fi:Kytkin (tietoliikenne) sv:Switch vi:Switch tr:Switch