Switches in Local Networks

Now let’s learn what switches are and how to use them in a local network.

A switch enables the connection of multiple devices to the same network.

Note that each network interface to the switch has its own dedicated PHY responsible for driving the signals on each wire.

switch.png

The uplink port on a switch is the same as the regular ports except that the transmit (Tx) and receive (Rx) signals are reversed. This means a crossover cable is not required to connect one switch to another. Most new switches have Auto-MDIX interfaces which automatically switch the Tx and Rx signals if needed.

Switches Inside Routers

Most routers for homes and small business have a built-in switch.

switch_router.png

Switches use MAC Addresses

We’ve seen how routers use IP addresses to address hosts on the network. Switches don’t have the intelligence to use IP addresses. They instead use something called a Media Access Controller (MAC) address.

switch_mac.png

A switch uses a Media Access Controller (MAC) to forward and filter data based on a host’s MAC address, not its IP address.

The MAC controls Layer 2 network functions. It forwards and filters frames based on their MAC addresses.

Every network host has two addresses:
1) IP Address (Layer 3 virtual address)
2) MAC Address (Layer 2 physical address)

A switch has a MAC, but no MAC address. It is transparent to the network. It is never the final destination for network traffic, so it doesn’t need a MAC address. A router, on the other hand, has two MAC addresses, one used for the local area network (LAN), and one used for the Internet or wide area network (WAN).

  • Switches are referred to as Layer 2 devices because they work with Layer 2 (MAC) addresses only. routers are referred to as Layer 3 devices because they work with Layer 3 (IP) addresses only.
  • The MAC is responsible for generating the frames that will be sent to the network and receiving frames that come in from the network. Frames that are received on a network node that doesn't contain the node’s MAC address or MAC broadcast address (FF:FF:FF:FF:FF:FF) are not forwarded up to Layer 3.
  • The MAC allows multiple devices to access the same physical network using Carrier Sense Multiple Access with Collision Detection (CSMA/CD (Ethernet)), or Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA (WLAN)).
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.