> For the complete documentation index, see [llms.txt](https://capcap-1.gitbook.io/capcap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://capcap-1.gitbook.io/capcap/readme/networking/switch.md).

# Switch

**Key Concepts:**

* **Switches vs. Hubs:**
  * A **hub** is described as "dumb" because it repeats incoming electrical signals out to every connected port, leading to security risks and network traffic inefficiency.
  * A **switch** is "smart"; it learns the unique identifiers of connected devices and directs traffic only to the specific destination port, improving performance and security.
* **The Role of Addresses:**
  * **MAC Address (Layer 2):** Every device has a unique, "burned-in" MAC address. Switches use these to identify devices on the network.
  * **IP Address (Layer 3):** Used for end-to-end communication, but switches generally operate at Layer 2 and do not rely on IP addresses for forwarding decisions.
* **How Switches Work:**
  * Switches maintain a **CAM table** (*Content Addressable Memory*), which maps specific MAC addresses to physical switch ports. This allows the switch to know exactly where a device is located.
* **Terminology:**
  * When data moves across the network via a switch (Layer 2), it is technically referred to as a **frame**.
  * When data is processed at Layer 3 (involving IP addresses), it is referred to as a **packet**.
* **Wireless Access Points:**
  * While they act as an extension of the network, wireless access points often behave more like hubs by broadcasting traffic, which is why hardwired Ethernet connections are generally preferred for performance.

**Practical Skills:**

* **Cisco Packet Tracer:** A simulation tool used to visualize network traffic at the packet/frame level.
* **First Cisco CLI Command:**
  * To view the switch's learned MAC address-to-port mappings, use the command: `show mac-address-table`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://capcap-1.gitbook.io/capcap/readme/networking/switch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
