Borjis131 / docker-open5gs

Open5GS 5G Core Docker images and Docker compose deployments
GNU Affero General Public License v3.0
29 stars 15 forks source link

speed-test compose not working #8

Closed pau-alef closed 3 months ago

pau-alef commented 3 months ago

I was trying your project with packetrusher. I'm able to build and run without major issues:

$ docker compose -f compose-files/speed-test/docker-compose.yaml ps
NAME           IMAGE                                 COMMAND                  SERVICE        CREATED          STATUS                    PORTS
amf            amf:v2.7.1                            "entrypoint.sh -c /e…"   amf            19 minutes ago   Up 19 minutes             
ausf           ausf:v2.7.1                           "open5gs-ausfd -c /e…"   ausf           19 minutes ago   Up 19 minutes             
bsf            bsf:v2.7.1                            "open5gs-bsfd -c /et…"   bsf            19 minutes ago   Up 19 minutes             
db             mongo:6.0                             "docker-entrypoint.s…"   db             19 minutes ago   Up 19 minutes             0.0.0.0:27017->27017/tcp
iperf          mlabbe/iperf3:latest                  "iperf3 -s"              iperf          19 minutes ago   Up 19 minutes (healthy)   5201/tcp, 5201/udp
nrf            nrf:v2.7.1                            "open5gs-nrfd -c /et…"   nrf            19 minutes ago   Up 19 minutes             
nssf           nssf:v2.7.1                           "open5gs-nssfd -c /e…"   nssf           19 minutes ago   Up 19 minutes             
packetrusher   ghcr.io/borjis131/packetrusher:main   "/PacketRusher/packe…"   packetrusher   19 minutes ago   Up 3 minutes              
pcf            pcf:v2.7.1                            "open5gs-pcfd -c /et…"   pcf            19 minutes ago   Up 19 minutes             
smf            smf:v2.7.1                            "open5gs-smfd -c /et…"   smf            19 minutes ago   Up 19 minutes             
udm            udm:v2.7.1                            "open5gs-udmd -c /et…"   udm            19 minutes ago   Up 19 minutes             
udr            udr:v2.7.1                            "open5gs-udrd -c /et…"   udr            19 minutes ago   Up 19 minutes             
upf            upf:v2.7.1                            "entrypoint.sh -c /e…"   upf            19 minutes ago   Up 19 minutes    

After adding the subscribed into the DB,

$ ./o5gs-dbctl.sh --db_uri=mongodb://localhost:27017 showpretty
[
  {
    _id: ObjectId('666ff62f0543531185f88821'),
    schema_version: 1,
    imsi: '001011234567891',
    msisdn: [],
    imeisv: [],
    mme_host: [],
    mm_realm: [],
    purge_flag: [],
    slice: [
      {
        sst: 1,
        default_indicator: true,
        session: [
          {
            name: 'internet',
            type: 3,
            qos: {
              index: 9,
              arp: {
                priority_level: 8,
                pre_emption_capability: 1,
                pre_emption_vulnerability: 2
              }
            },
            ambr: {
              downlink: { value: 1000000000, unit: 0 },
              uplink: { value: 1000000000, unit: 0 }
            },
            pcc_rule: [],
            _id: ObjectId('666ff62f0543531185f88822')
          }
        ],
        _id: ObjectId('666ff62f0543531185f88823')
      }
    ],
    security: {
      k: '00000000000000000000000000000000',
      op: null,
      opc: '00000000000000000000000000000000',
      amf: '8000'
    },
    ambr: {
      downlink: { value: 1000000000, unit: 0 },
      uplink: { value: 1000000000, unit: 0 }
    },
    access_restriction_data: 32,
    network_access_mode: 0,
    subscriber_status: 0,
    operator_determined_barring: 0,
    subscribed_rau_tau_timer: 12,
    __v: 0
  }
]

and restarting packetrusher, this is what I get:

amf           | 06/17 08:40:36.845: [amf] INFO: gNB-N2[10.33.33.14] connection refused!!! (../src/amf/amf-sm.c:809)
amf           | 06/17 08:40:36.845: [amf] INFO: [Removed] Number of gNBs is now 0 (../src/amf/context.c:1263)
packetrusher exited with code 0
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="Selecting 10.33.33.8 for host amf.open5gs.org as AMF's IP address"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="Selecting 10.33.33.14 for host gnb.packetrusher.org as gNodeB's N3/Data IP address"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="Loaded config at: /PacketRusher/config/packetrusher.yaml"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="PacketRusher version 1.0.1"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg=---------------------------------------
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER] Starting test function: Testing an ue attached with configuration"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="Selecting 10.33.33.14 for host gnb.packetrusher.org as gNodeB's N2/Control IP address"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER][UE] Number of UEs: 1"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER][UE] disableTunnel is false"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER][GNB] Control interface IP/Port: 10.33.33.14/38412~"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER][GNB] Data interface IP/Port: 10.33.33.14/2152"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[TESTER][AMF] AMF IP/Port: 10.33.33.8/38412"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg=---------------------------------------
amf           | 06/17 08:40:37.238: [amf] INFO: gNB-N2 accepted[10.33.33.14]:38412 in ng-path module (../src/amf/ngap-sctp.c:113)
amf           | 06/17 08:40:37.238: [amf] INFO: gNB-N2 accepted[10.33.33.14] in master_sm module (../src/amf/amf-sm.c:757)
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB] SCTP/NGAP service is running"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB] Initiating NG Setup Request"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][SCTP] Receive message in 0 stream\n"
amf           | 06/17 08:40:37.250: [amf] INFO: [Added] Number of gNBs is now 1 (../src/amf/context.c:1236)
amf           | 06/17 08:40:37.250: [amf] INFO: gNB-N2[10.33.33.14] max_num_of_ostreams : 2 (../src/amf/amf-sm.c:796)
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][NGAP] Receive NG Setup Response"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][AMF] AMF Name: open5gs-amf0"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][AMF] State of AMF: Active"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][AMF] Capacity of AMF: 255"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 001 mnc:01"
packetrusher  | time="2024-06-17T08:40:37Z" level=info msg="[GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:000001"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[TESTER] TESTING REGISTRATION USING IMSI 1234567891 UE"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB] Received incoming connection from new UE"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE] Initiating Registration"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE] Switched from state 0 to state 1"
amf           | 06/17 08:40:38.246: [amf] INFO: InitialUEMessage (../src/amf/ngap-handler.c:401)
amf           | 06/17 08:40:38.247: [amf] INFO: [Added] Number of gNB-UEs is now 1 (../src/amf/context.c:2662)
amf           | 06/17 08:40:38.247: [amf] INFO:     RAN_UE_NGAP_ID[1] AMF_UE_NGAP_ID[3] TAC[1] CellID[0x8000] (../src/amf/ngap-handler.c:562)
amf           | 06/17 08:40:38.247: [amf] INFO: [suci-0-001-01-0000-0-0-1234567891] Unknown UE by SUCI (../src/amf/context.c:1844)
amf           | 06/17 08:40:38.247: [amf] INFO: [Added] Number of AMF-UEs is now 1 (../src/amf/context.c:1621)
amf           | 06/17 08:40:38.248: [gmm] INFO: Registration request (../src/amf/gmm-sm.c:1214)
amf           | 06/17 08:40:38.248: [gmm] INFO: [suci-0-001-01-0000-0-0-1234567891]    SUCI (../src/amf/gmm-handler.c:172)
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][SCTP] Receive message in 1 stream\n"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][NGAP] Receive Downlink NAS Transport"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS] Message without security header"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS] Receive Authentication Request"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS][MAC] Authenticity of the authentication request message: OK"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS][SQN] SQN of the authentication request message: VALID"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS] Send authentication response"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE] Switched from state 1 to state 2"
udr           | 06/17 08:40:38.271: [dbi] ERROR: mongoc_collection_update() failure: Cannot apply $inc to a value of non-numeric type. {_id: ObjectId('666fe78d0c20b6175ba26a13')} has the field 'sqn' of non-numeric type string (../lib/dbi/subscription.c:272)
udr           | 06/17 08:40:38.271: [udr] FATAL: [imsi-001011234567891] Cannot increment SQN (../src/udr/nudr-handler.c:216)
udm           | 06/17 08:40:38.272: [udm] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/udm/nudr-handler.c:282)
ausf          | 06/17 08:40:38.273: [ausf] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/ausf/ue-sm.c:160)
amf           | 06/17 08:40:38.274: [gmm] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/amf/gmm-sm.c:1826)
amf           | 06/17 08:40:38.274: [amf] WARNING: [suci-0-001-01-0000-0-0-1234567891] Registration reject [9] (../src/amf/nas-path.c:205)
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][SCTP] Receive message in 1 stream\n"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][SCTP] Receive message in 1 stream\n"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][NGAP] Receive Downlink NAS Transport"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[UE][NAS] Message without security header"
packetrusher  | time="2024-06-17T08:40:38Z" level=error msg="[UE][NAS] Receive Registration Reject"
packetrusher  | time="2024-06-17T08:40:38Z" level=error msg="[UE][NAS] UE received a 5GMM Failure, cause: UE identity cannot be derived by the network"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][NGAP] Receive UE Context Release Command"
amf           | 06/17 08:40:38.289: [amf] INFO: UE Context Release [Action:3] (../src/amf/ngap-handler.c:1696)
amf           | 06/17 08:40:38.289: [amf] INFO:     RAN_UE_NGAP_ID[1] AMF_UE_NGAP_ID[3] (../src/amf/ngap-handler.c:1697)
amf           | 06/17 08:40:38.289: [amf] INFO:     SUCI[suci-0-001-01-0000-0-0-1234567891] (../src/amf/ngap-handler.c:1701)
amf           | 06/17 08:40:38.289: [amf] INFO: [Removed] Number of gNB-UEs is now 0 (../src/amf/context.c:2669)
amf           | 06/17 08:40:38.289: [amf] INFO: [Removed] Number of AMF-UEs is now 0 (../src/amf/context.c:1718)
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB] Initiating UE Context Complete"
packetrusher  | time="2024-06-17T08:40:38Z" level=warning msg="[UE][1234567891] Stopping UE as communication with gNB was closed"
packetrusher  | time="2024-06-17T08:40:38Z" level=info msg="[GNB][NGAP] Releasing UE Context, cause: nas: Normal release"

Thanks for your time on this

Borjis131 commented 3 months ago

Hi @pau-alef, I suspect it has something to do with the way that you added the subscriber.

This lines right here are telling you that there is some issue regarding the sqn:

udr           | 06/17 08:40:38.271: [dbi] ERROR: mongoc_collection_update() failure: Cannot apply $inc to a value of non-numeric type. {_id: ObjectId('666fe78d0c20b6175ba26a13')} has the field 'sqn' of non-numeric type string (../lib/dbi/subscription.c:272)
udr           | 06/17 08:40:38.271: [udr] FATAL: [imsi-001011234567891] Cannot increment SQN (../src/udr/nudr-handler.c:216)
udm           | 06/17 08:40:38.272: [udm] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/udm/nudr-handler.c:282)
ausf          | 06/17 08:40:38.273: [ausf] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/ausf/ue-sm.c:160)
amf           | 06/17 08:40:38.274: [gmm] ERROR: [suci-0-001-01-0000-0-0-1234567891] HTTP response error [500] (../src/amf/gmm-sm.c:1826)
amf           | 06/17 08:40:38.274: [amf] WARNING: [suci-0-001-01-0000-0-0-1234567891] Registration reject [9] (../src/amf/nas-path.c:205)

Checking my subscriber data with open5gs-dbctl gives me the following output:

[
  {
    _id: ObjectId("663cbc9d2a35e770557cbb86"),
    schema_version: 1,
    imsi: '001011234567891',
    msisdn: [],
    imeisv: '1110000000000000',
    mme_host: [],
    mm_realm: [],
    purge_flag: [],
    slice: [
      {
        _id: ObjectId("663cbc9d2a35e770557cbb88"),
        sst: 1,
        sd: '000001',
        default_indicator: true,
        session: [
          {
            qos: { arp: [Object], index: 9 },
            ambr: { downlink: [Object], uplink: [Object] },
            _id: ObjectId("663cbc9d2a35e770557cbb87"),
            name: 'internet',
            type: 3,
            pcc_rule: []
          }
        ]
      },
      {
        _id: ObjectId("6643769567bfb10012bb88a9"),
        sst: 1,
        sd: '000002',
        session: [
          {
            qos: { arp: [Object], index: 5 },
            ambr: { downlink: [Object], uplink: [Object] },
            _id: ObjectId("6643769567bfb10012bb88aa"),
            name: 'internet',
            type: 3,
            pcc_rule: []
          }
        ]
      }
    ],
    security: {
      k: '00000000000000000000000000000000',
      op: null,
      opc: '00000000000000000000000000000000',
      amf: '8000',
      sqn: Long("1505")
    },
    ambr: {
      downlink: { value: 1000000000, unit: 0 },
      uplink: { value: 1000000000, unit: 0 }
    },
    access_restriction_data: 32,
    network_access_mode: 0,
    subscribed_rau_tau_timer: 12,
    __v: 0,
    operator_determined_barring: 0,
    subscriber_status: 0
  }
]

I can see that the field sqn: Long("1505") is missing in your schema. I don't know if you are running an outdated version of the open5gs-dbctl script utility or if that is my case.

I suggest you to remove all the data from the database with:

# substitute {imsi} with your data
./open5gs-dbctl remove {imsi}

Then, download the latest version of the script from the Open5GS repository and add the subscribers again. Then repeat the test to see the output.

And a small tip: You can use the open5gs-dbctl command without specifying the --db_uri=mongodb://localhost:27017, it uses localhost and port 27017 as default

Borjis131 commented 3 months ago

Closing due to inactivity. I hope the problem was fixed and if not, please open a new issue.