> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/cdf/4.0/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/components/cdf/4.0/configuration/ext_sender.md).

# Extended CDF sender configuration

This document explains which sender parameters you can configure and how you can use them to change the throughput.

There is only one sender in CDF architecture.

To limit the sending rate, configure `sender.cdr_limit_per_cgf`, which sets the maximum number of processes that can send CDRs to a CGF at the same time.

Each CGF gets the same maximum load, so the increasing number of CGFs increases the throughput as long as the sender doesn't hit its own performance ceiling.

Another way to scale the sender performance is to increse the numbner of NATS connections. For each connection, a new pull consumer is started.
This increases the total throughput and needs more CPU core. The number of CPU cores required by the sender is 1 for every 50 connections.

The maximum load on CGF is maintained, even when using multiple connections.

This is a sample extended configuration of CDF sender.

```yaml
sender:
  enabled: true
  cdr_limit_per_cgf: 1000
  CGFs:
  -
    IP: 1.2.3.4
    port: 1234
  -
    IP: 2.3.4.5
  echo: 65000
  responseTimeout: 4000
  transportOptions:
    data:
      # -- (int) The size of socket send buffer for GTP Data Request towards CGF in bytes. The default value equals the operating system settings.
      sendBuffer: 1000
      # -- (int) The size of socket receive buffer for GTP Data Response from CGF in bytes. The default value equals the operating system settings.
      receiveBuffer: 2000

nats:
  url: nats://example.com
  bucket: abucket
  subject: asubject
  streamName: astream
  consumerName: aconsumer
  poolSize: 8

resources:
  cdf:
    limits:
      cpu: 2000m
      memory: 1280Mi

image:
  repository: registry.cennso.com/cdf_sender
  # -- Set to Chart.AppVersion by default.
  tag: "gat"
  pullPolicy: Never
logger:
  level: info
imagePullSecrets:
  - name: regcred
```

## sender.CGFs

This is the list of IP address/ports to which CDRs are sent. More CGFs allow CDF to send the maximum rate to more places. The rate increases only if CGF is the limiting factor.

## sender.responseTimeout

This is the waiting duration for GTP Response in milliseconds. The default value is `1000`.

The waiting duration must be longer than RTT (network latency + CGF delay). Otherwise, CDF resends CDRs correctly but late.
If the duration is too big, you can get a problem with GTP Prime sequence numbers, as the protocol is limited to 65,536 sequence numbers. That is 65 seconds for 1000 CDRs per second. Longer response timeout makes the sequence number be wrapped and reused. It is not possible to predict which CDR is responded.

If no CDR is responded within this time, that CGF is lost.

## sender.transportOptions.data.receiveBuffer

This is the size of socket receive buffer for GTP Data Response from CGF in bytes. The default value equals the operating system settings.

When the send buffer is too small, the receiver loses the incoming responses. This triggers resending and limits the number of new CDRs that can be sent. Even though no data is lost, the performance goes down.

## sender.echo

This is the time between sending GTP Prime Echo requests in milliseconds.

If communication with a CGF is lost, CDF will continue to send Echo request, and when it is responded, CDF will know communication is re-established. As soon as one or more CGFs go down, the CDF sender throughput will automatically be reduced to honour the capacity of the remaining CGFs, until the session is re-established.
