# Network Switch With QoS

## Introduction

A not so simple network switch capable of distributing quantum computation. Allows to route computation more precisely to suit your needs. Optimally you can have one Quantum Computer farm, feeding to switches, feeding to multiple machines.^{[1]}

## Construction

The network switch is a 3x3 multiblock comprising of:

- Controller: center-front
- Advanced Computer Casing: center
- Energy Hatch (1-2): any outer casing, must be ZPM or above
- Maintenance Hatch: any outer casing
- Optical Slave Connector: any outer casing
- Optical Master Connector: any outer casing
- Computer casing (minimum 0): any remaining outer casing

The network switch supports Power Pass and as such, if you edit the multi whilst this is active the multiblock will explode!

The network switch can accept multiple Master and Slave Hatches.

## Power Usage

The Network Switch with QoS uses ZPM voltage with the number of amps being calculated as `number of active slave hatches / 2`

## Usage

The ratio of distribution is calculated based on weights set as parameters. Master Hatches are assigned to parameters based on their ID, which you can get by scanning them with a tricorder.^{[2]}

The parameters have IDs of the format `A:B:I`

where:

`A`

is a group of parameters that go together (2 per group)`B`

is whether the parameter is the Destination (B=0) or the Weight (B=1). The GUI explicitly has these as labels.`I`

is the value of the parameter

The GUI has 20 inputs available, resulting in a total of maximum 10 configurable pairs of destination and associated weight. Valid destinations start from value `1`

up to `10`

. This means that, whilst you can fit more than 10 Master Hatches on the simple network switch, you will not be able to configure more than 10 of them to receive data.

The distribution of computation happens as follows:

- The incoming compute of all Slave Hatches are added together as the
`total compute`

to be distributed - The weights of all valid destinations are added into the
`total weight`

- Starting from the lowest valid destination ID, data is sent proportionally according to the
`hatch weight`

of that destination, using the formula`total compute * hatch weight / total weight`

- E.g. you configure 10 destinations with a combined weight of
`100`

, destination number 1 has a weight of 10 so it receives`total compute * 10 / 100`

= 10% of the total compute

- E.g. you configure 10 destinations with a combined weight of

Notes:

- Rounding
*may*mean the last hatch receives a tiny amount less computation that intended - Proportional distribution means that all incoming computation will be distributed