# Predefined Networking Protocols

```@raw html
<style>
    .content table td {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
</style>
```

The submodule `QuantumSavory.ProtocolZoo` provides reusable networking
protocols, including their discrete-event control flow.

## What ProtocolZoo Is For

`ProtocolZoo` contains ready-to-run protocol components such as entanglers,
swappers, trackers, consumers, and switch-like controllers.

These are not just code samples. They are structured `AbstractProtocol`
implementations meant to be launched inside a simulation with `@process`.

```julia
prot = EntanglerProt(sim, net, 1, 2)
@process prot()
```

This matters because the protocol object packages:

- the simulation handle,
- the network it acts on,
- the node or nodes it belongs to,
- and the parameters controlling its behavior.

That packaging is what makes protocols easier to reuse and compare than a large
free function with many arguments.

## How Protocols Compose

Protocols in `ProtocolZoo` are designed to compose through the same metadata and
messaging interfaces available to user-written code.

In practice, that means one protocol can:

- generate entanglement and tag the resulting slots,
- another protocol can query those tags and perform a swap,
- and a tracker or consumer can react to the resulting metadata updates.

This is the practical point of the protocol layer: reusable control logic that
does not depend on bespoke peer-to-peer wiring.

## Visualization Hooks

Some protocols also expose richer visualization through `show` methods.
`EntanglerProt`, for example, can render protocol-specific summaries in HTML or
PNG form.

Those displays are not part of the protocol logic itself, but they are useful
for debugging configuration and inspecting the expected behavior of a protocol
before embedding it into a larger simulation.

## Typical Contents

The current `ProtocolZoo` includes:

- entanglement generation and swapping protocols,
- metadata tracking helpers,
- consumer and cutoff protocols,
- switch-style protocols,
- and QTCP-related controllers and message types.

The autodocs below are the exact API reference.

## Autogenerated API list for `QuantumSavory.ProtocolZoo`

```@autodocs
Modules = [QuantumSavory.ProtocolZoo, QuantumSavory.ProtocolZoo.Switches, QuantumSavory.ProtocolZoo.QTCP, QuantumSavory.ProtocolZoo.MBQCEntanglementDistillation]
Private = false
```
