Skip to content

Subscribers

Each simulated UE needs a subscriber: a SUPI and its keys. A client flow that needs subscribers stops if none are given:

no subscribers configured: supply subscribers (-s), -gen-subscriber or -subscriber-seed

There are three ways to give them:

OptionSubscribersUse when
-s subscribers.yamlfrom a file, one per UE in file orderyour core already has these subscribers provisioned
-subscriber-seed <n>derived from a seed, the same every timeboth ends are rk, or you provision the core from rk subscriber generate -seed
-gen-subscriberrandom, in memorythe core under test accepts any subscriber

When more than one is given, the seed wins, then -gen-subscriber, then the file. -s together with -subscriber-seed on a client flow is a usage error.

The subscribers file

YAML
  • Keys: key and opc are 32 hex digits; sqn is 12.
  • SUPI: must look like imsi-<mcc>-<mnc>-<msin>.
  • snn: a subscriber's own snn overrides config.snn.
  • More UEs than subscribers: the extra UEs are skipped.
  • Unknown keys are refused with the file, line and key. A file can also carry the core's provisioning fields imsi, amf and method, so one file can feed both the core and rk: rk checks that imsi matches the SUPI and ignores the other two.

Seeded subscribers

-subscriber-seed <n> (decimal or 0x hex) derives every subscriber:

  • SUPI: UE number i gets MSIN -subscriber-start-msin + i. The start is 1 by default. The MSIN is zero-padded to fill the IMSI.
  • Keys: K and OPc are derived from the seed and the SUPI, so the same seed always gives the same keys. That lets an rk AMF authenticate an rk gNB's UEs with no file at all.
  • Algorithms: SQN 0, NEA0, NIA2.
  • Range: -subscriber-count bounds it (0 = unbounded).

A suite step can set its own subscriber_seed: {seed, start_msin, count}. -subscriber-seed on the command line overrides it.

Generate subscribers

rk subscriber generate writes a subscriber set to provision into your core:

Shell
FlagDefaultWhat it does
-count10how many
-mcc, -mnc901, 70the PLMN
-c <env.yaml>take the PLMN and the gNB's UE settings from an environment (not with -mcc/-mnc)
-start-msin1the first MSIN
-seedderive keys from a seed, as -subscriber-seed does; random keys otherwise
-formatrunikrunik (the -s file), core (CSV), open5gs (a mongoimport JSON array), free5gc (a curl script)
-ciphering, -integrityNEA0, NIA2algorithms, runik format only
-output-filesubscribers.yaml, .csv, .json or .shwhere to write
-forceoverwrite an existing file

The file is written readable by its owner only (mode 0600). rk subscriber generate needs no licence.