Devices

Device Information: Switches

This page explains the switch's properties and functions as implemented by Packet Tracer 3.2.

A switch has multiple ethernet or fiber ports.
A switch uses STP to break loops in a switching network.

- Packet Tracer does not simulate the full STP process. It simply breaks layer 2 loops by using a depth-first searching algorithm.

A switch supports multiple VLANs.

- Frames cannot go across VLANs.
- Each port can be configured to be an access port.
  - Each access port can be assigned to one VLAN.
- Each port can be configured to be a trunk port.
  - Each trunk port can have multiple VLANs.
  - A trunk port can be used to send frames to and from VLANs that are assigned to it.
  - When a switch sends a frame over a trunk port:
    - It adds a tag to the frame specifying which VLAN the frame belongs to.
  - When a switch receives a frame from a trunk port:
    - It removes the tag that is on the frame, and
    - It uses the tag to determine which VLAN to send the frame out to

A switch keeps a MAC table for each VLAN.

- An entry in a MAC table associates a device's MAC address to a port on the switch.
- A switch builds its MAC tables by listening to other devices sending frames.
  - When a switch receives a frame from a port, it creates an entry with the frame's source address and the receiving port, and adds that entry to the receiving VLAN's MAC table.

When a switch receives a layer 2 unicast frame (view the frame processing flowchart):

- It checks if the receiving port is an access port.
  - If the receiving port is an access port, then checks if the frame is a tagged frame.
    - If the frame is a tagged frame, then drops the frame.
    - If the frame is not a tagged frame, then marks the receiving port's access VLAN as the receiving VLAN.
    - If the receiving port is not an access port, then checks if the frame is a tagged frame.
      - If the frame is not a tagged frame, then drops the frame.
      - If the frame is a tagged frame, then extracts the VLAN number from tag and marks it as the receiving VLAN.
      - It checks if the receiving VLAN is a member of the receiving trunk port.
        - If it is not a member, then drops the frame.
- It checks if the frame's destination MAC address is the broadcast address.
  - If the frame's destination MAC address is the broadcast address, then sends the frame out to all ports in the receiving VLAN except the receiving one.
  - If the frame's destination MAC address is not the broadcast address, then looks up the destination MAC address in the receiving VLAN's MAC table.
    - If a matching entry is not found in the MAC table, then sends the frame out to all ports in the receiving VLAN except the receiving one.
    - If a matching entry is found, then checks if the outgoing port is the same as the receiving port.
      - If the outgoing port is the same as the receiving port, then drops the frame.
      - If the outgoing port is not the same as the receiving port, then forwards the frame out that port.