> For the complete documentation index, see [llms.txt](https://docs.cennso.com/test-tools/sgw-sim/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/test-tools/sgw-sim/latest/configuration/pgw.md).

# Packet Gateway configuration

You can configure a simulation for Packet Gateway (PGW) using the **pgw** configuration section that contains all parameters required for such a simulation:

| Parameter | Default | Description |
|:---|:---|:---|
| instances | `[]` | List of addresses for PGWs to connect |
| instances.name | `""` | Optional name of the PGW instance. The `connect` and `probe_session` behaviours use this name in the **pgw** parameter to pin their sessions to this PGW. Names must be unique. Requires the `sgwsimulatorv2` binary. |
| instances.s5c_ip | `""` | SMC address |
| instances.timeout | `"10s"` | Response timeout |

See the example of the PGW configuration:

```yaml
pgw:
  instances:
  - s5c_ip: 192.0.2.55
    timeout: 20s
```

## Multiple PGWs

The `sgwsimulatorv2` binary connects to every PGW listed in **instances** on start.
Each new session goes to a randomly selected PGW, unless its behaviour pins the session to a named PGW with the **pgw** parameter.
See the `connect` and `probe_session` behaviours in [User equipment configuration](https://docs.cennso.com/test-tools/sgw-sim/latest/configuration/ue.md).
The simulator stops with an error when **instances** is empty, when two instances have the same name, or when a behaviour references a name that no instance has.

The following configuration defines two named PGWs:

```yaml
pgw:
  instances:
  - name: pgw-de
    s5c_ip: 192.0.2.55
  - name: pgw-us
    s5c_ip: 192.0.2.56
```
