# Networking elements

> Field reference for the Networking and Rate Limit canvas elements: request and connection timeouts, automatic retry, circuit breaking, traffic mirroring, and per-surface request throttling.

Two canvas elements control request flow between the gateway and upstream destinations. The Networking element configures timeouts, automatic retry, circuit breaking, and traffic mirroring for a specific upstream edge. The Rate Limit element caps request volume within a rolling time window.

Drop the Networking element on a Managed Agent or Transit Point request edge. Drop the Rate Limit element on the Caller → Access Point edge for inbound limiting, or on a transit point node for per-destination limiting.

## Timeouts

Caps request, connect, and idle durations. When a timeout fires, the gateway returns a timeout error to the caller.

| Field | Type | Required | Default | Description |
| Request timeout | integer (seconds) | No | 30 | Maximum seconds the gateway waits for a complete response from the upstream. |
| Connect timeout | integer (seconds) | No | 5 | Maximum seconds the gateway waits to establish the TCP connection. |
| Idle timeout | integer (seconds) | No | 90 | Maximum seconds an idle connection is held open before the gateway closes it. |

## Retry

Automatically re-issues failed requests using exponential back-off. Enable this sub-feature to reveal the configuration fields.

| Field | Type | Required | Default | Description |
| Enable automatic retries | toggle | No | Off | Activates the retry sub-feature. |
| Max attempts | integer | No | 3 | Maximum number of total attempts, including the initial request. |
| Backoff multiplier | float | No | 2 | Multiplier applied to the backoff interval on each successive retry. |
| Initial backoff | integer (ms) | No | 100 | Starting backoff duration before the first retry. |
| Max backoff | integer (ms) | No | 5000 | Upper cap for the backoff interval. |
| Retryable status codes | string | No | — | Comma-separated HTTP status codes that trigger a retry (for example 502,503,504). |

## Circuit Breaker

Opens the circuit after a threshold of failures within a rolling window, protecting the upstream from cascading load. Enable this sub-feature to reveal the configuration fields.

| Field | Type | Required | Default | Description |
| Enable circuit breaker | toggle | No | Off | Activates the circuit breaker sub-feature. |
| Failure threshold | integer | No | 5 | Number of failures within the window that trips the circuit to open. |
| Success threshold (to close) | integer | No | 3 | Number of successful probe requests required to close the circuit again. |
| Recovery timeout | integer (seconds) | No | 30 | Seconds the circuit stays open before allowing probe requests through. |
| Window size | integer (seconds) | No | 60 | Rolling time window in seconds over which failures are counted. |

## Traffic Mirroring

Duplicates a percentage of live requests to a shadow endpoint for testing or analysis. The gateway does not use or forward the shadow response to the caller.

| Field | Type | Required | Default | Description |
| Mirror traffic to shadow endpoint | toggle | No | Off | Activates the mirroring sub-feature. |
| Mirror endpoint | string (URL) | No | — | Full URL of the shadow endpoint (for example https://shadow.internal:3001). |
| Traffic percentage | integer (1–100) | No | 100 | Percentage of live requests to duplicate to the mirror. |
| Mirror timeout | integer (seconds) | No | 5 | Maximum seconds to wait for the mirror response before dropping it. Only applies when Fire-and-forget is off. |
| Fire-and-forget (async) | toggle | No | Off | When on, the gateway dispatches the mirrored request and continues immediately without waiting for the shadow response. When off, the gateway waits up to Mirror timeout before continuing, but ignores the shadow response body regardless. |

## Rate Limit element

The Rate Limit element caps the number of requests that can flow through a surface within a rolling time window. When the cap is reached, the gateway short-circuits with HTTP 429 for HTTP-style protocols, or a JSON-RPC error for MCP surfaces, before the request reaches the upstream.

Drop it on the Caller → Access Point request edge to limit inbound surface traffic. Drop it on a Transit Point node to apply a per-destination cap on outbound traffic to that specific endpoint.

| Field | Type | Required | Default | Description |
| Max requests per window | integer | Yes | 1000 | Maximum number of requests allowed within the window. |
| Window (seconds) | integer | Yes | 60 | Duration of the rolling window in seconds. |
| Burst allowance (optional) | integer | No | — | Short-spike allowance above the steady-state rate before throttling activates. |

## Related

- [Managed Agent reference](/products/affinidi-trust-fabric/agent-gateway/reference/surfaces/managed-agent.md): the upstream destination this element attaches to.

- [Transit Points reference](/products/affinidi-trust-fabric/agent-gateway/reference/surfaces/transit-points.md): Networking on individual Transit Point request edges.
