omec-project / smf

10 stars 34 forks source link

IMSI Receives Incorrect IP From Device Group #227

Open markbeierl opened 8 months ago

markbeierl commented 8 months ago

I have created:

On UE attach, both subscribers receive IP addresses from the same subnet range.

Steps to Reproduce

Provision Data

To make this easier to reproduce, I used curl directly against the webconsole container.

Subscribers

for IMSI in `seq 81 82`; do 
  curl -v ${WEBUI_IP}:5000/api/subscriber/imsi-2089301000074${IMSI} \
  --header 'Content-Type: text/plain' \
  --data "{
    \"UeId\":\"2089301000074${IMSI}\",
    \"opc\":\"981d464c7c52eb6e5036234984ad0bcf\",
    \"key\":\"5122250214c33e723a5dd523fc145fc0\",
    \"sequenceNumber\":\"16f3b3f70fc2\"
  }"
done

Device Groups

curl -v ${WEBUI_IP}:5000/config/v1/device-group/DG-1 \
--header 'Content-Type: application/json' \
--data '{
    "imsis": [
        "208930100007481"
    ],
    "site-info": "site-1",
    "ip-domain-name": "domain1",
    "ip-domain-expanded": {
        "dnn": "internet",
        "ue-ip-pool": "172.1.0.0/16",
        "dns-primary": "8.8.8.8",
        "mtu": 1348,
        "ue-dnn-qos": {
            "dnn-mbr-uplink":   10,
            "dnn-mbr-downlink": 10,
            "bitrate-unit": "mbps",
            "traffic-class": {
                "name": "platinum",
                "arp": 6,
                "pdb": 300,
                "pelr": 6,
                "qci": 8
            }
        }
    }
}'
curl -v ${WEBUI_IP}:5000/config/v1/device-group/DG-2 \
--header 'Content-Type: application/json' \
--data '{
    "imsis": [
        "208930100007482"
    ],
    "site-info": "site-2",
    "ip-domain-name": "domain2",
    "ip-domain-expanded": {
        "dnn": "internet",
        "ue-ip-pool": "172.2.0.0/16",
        "dns-primary": "8.8.8.8",
        "mtu": 1348,
        "ue-dnn-qos": {
            "dnn-mbr-uplink":   20,
            "dnn-mbr-downlink": 20,
            "bitrate-unit": "mbps",
            "traffic-class": {
                "name": "platinum",
                "arp": 6,
                "pdb": 300,
                "pelr": 6,
                "qci": 8
            }
        }
    }
}'

Slices

curl -v ${WEBUI_IP}:5000/config/v1/network-slice/Slice-1 \
--header 'Content-Type: application/json' \
--data '
{
  "SliceName": "Slice-1",
  "slice-id": {
    "sst": "1",
    "sd": "010203"
  },
  "site-device-group": [
    "DG-2",
    "DG-1"
  ],
  "site-info": {
    "site-name": "demo",
    "plmn": {
      "mcc": "208",
      "mnc": "93"
    },
    "gNodeBs": [
      {
        "name": "gnbsim-gnbsim-gnbsim",
        "tac": 1
      }
    ],
    "upf": {
      "upf-name": "upf.mgmt",
      "upf-port": "8805"
    }
  }
}'

Connect a UE

Using UERANSIM, I connected the gNB simulator, then proceeded to connect subscriber 1. The following was observed in the SMF log

2024-02-28T20:41:51.466Z [smf] 2024-02-28T20:41:51Z [INFO][SMF][PduSess][imsi-208930100007481][1][urn:uuid:a5da504c-e8a7-49a1-b096-d1392de9c811] PDUSessionSMContextCreate, IP alloc success IP[172.2.0.1]

IP allocation on the UESIM confirms receipt of this address:

[2024-02-28 20:41:51.556] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 172.2.0.1] is up.

Attachments

SCTP pcaps for the two IMSIs showing the setup, confirming that other values such as the AMBR do correspond to the correct device groups.

imsi-82.pcapng.gz imsi-81.pcapng.gz

ghislainbourgeois commented 8 months ago

I will give a go at this one.

ghislainbourgeois commented 8 months ago

For documentation purposes, it seems that the DNN names must be different for each device group, otherwise the last one will overwrite the other in the SMF.

markbeierl commented 8 months ago

I can confirm that setting the DNN to different names does work. This poses some challenges:

onf-bot commented 7 months ago

This issue has been stale for 30 days and will be closed in 5 days. Comment to keep it open.

thakurajayL commented 7 months ago

I think both @markbeierl and @ghislainbourgeois are right. Keeping separate DNN would work but

  1. at the cost of UE should request separate DNN.
  2. UPF should server more than one DNN. else we get limited to single Device Group per Slice and effectively single Pool within slice.

I remember other way of looking at it,

  1. SMF selection is done using Slice ID & DNN.
  2. At SMF Slice+DNN combination should use same Pool. i.e shared pool.

Using same Pool and enforcing at Webconsole pod is the option in current situation...

Other long term solution could be

  1. Update Slice API to take Pool details at the top so it looks clean about how Pools can be shared among multiple device groups.
github-actions[bot] commented 3 months ago

This issue has been stale for 120 days and will be closed in 15 days. Comment to keep it open.