edgecomllc / eupf

5G User Plane Function (UPF) based on eBPF
Apache License 2.0
99 stars 19 forks source link

Add simple slicing scenario support for open5gs #323

Closed PapaySail closed 1 year ago

PapaySail commented 1 year ago

From eupf created by pirog-spb: edgecomllc/eupf#319

WHO: MNO & Buisness customer WHAT: MNO deploys separete slice for specific customer in order to provide independent network connectivity to customer's local resources. WHY: APN routing is limited and complicated for MNO and requires equipment reconfiguration. Slicing looks more convenient and easy to deploy.

Configure deployment of slicing scenario with additional eUPF in separate slice. Choose slice based on specific STT/SD.

DoD:

PapaySail commented 1 year ago

Target schema: Ext slice selection with SMF image

ℹ Referenced article Select UPF based on S-NSSAI: Open5GS (SMF1 + UPF1) & (SMF2 + UPF2)

with schema

![image](https://github.com/s5uishida/open5gs_5gc_ueransim_snssai_upf_sample_config/blob/main/images/network-overview.png?raw=true)

PapaySail commented 1 year ago

Gradiant / openverso-charts current configs slice parameters: 5gSA-values.yaml

amf:
  config:
# ...
    plmnList:
      - plmn_id:
          mcc: "999"
          mnc: "70"
        s_nssai:
          - sst: 1
            sd: "0x111111"

nssf:
  config:
    nsiList:
      - nrf:
          hostname: ""  # if empty default is autogenerated open5gs svc fullname
          port: 7777
        sst: 1
        sd: "0x111111"

populate:
  enabled: true
  initCommands:
  - open5gs-dbctl add_ue_with_slice 999700000000001 465B5CE8B199B49FAA5F0A2EE238A6BC E8ED289DEBA952E4283B54E88E6183CA internet 1 111111
  - open5gs-dbctl add_ue_with_slice 999700000000002 465B5CE8B199B49FAA5F0A2EE238A6BC E8ED289DEBA952E4283B54E88E6183CA internet 1 111111

smf:
  config:
    subnetList:
      - addr: 10.45.0.1/16
        dnn: internet
      - addr: 2001:db8:cafe::1/48
        dnn: internet
    pcrf:
      enabled: false
    upf:
      pfcp:
        hostname: edgecomllc-eupf-universal-chart
        port: 8805

So, will be needed to add for smf.config first slice only:

    info:
      - s_nssai:
          - sst: 1
            sd: 111111
            dnn:
              - internet
        tai:
          - plmn_id:
              mcc: 999
              mnc: 70
            tac: 1

nssf.yaml

nssf:
  nsi:
    - name: open5gs-nrf-sbi
      port: 7777
      s_nssai:
        sst: "1"
        sd: "0x111111"
PapaySail commented 1 year ago

I will add new: SMF2:

UPF2:

PapaySail commented 1 year ago

configured slices in docs/examples/open5gs/open5gs.yaml ✔ Started Open5GS with original UPF + UERANSIM successfully. Command:

helm upgrade --install `
   open5gs openverso/open5gs `
   --values docs/examples/open5gs/open5gs.yaml `
   --set upf.enabled=true `
   --set smf.config.upf.pfcp.hostname="" `
   -n open5gslice `
   --version 2.0.9 `
   --wait --timeout 100s --create-namespace

helm upgrade --install `
   ueransim openverso/ueransim-gnb `
   --values docs/examples/open5gs/ueransim-gnb.yaml `
   -n open5gslice `
   --version 0.2.5 `
   --wait --timeout 100s --create-namespace

Created new values file eupf2-rout-static.yml for eUPF2:

✔ Created new values file smf2slice-open5gs.yaml and started + UE connected to slice 2:

helm upgrade --install `
   smf2 openverso/open5gs-smf `
   --values docs/examples/open5gs/smf2slice-open5gs.yaml `
   -n open5gslice `
   --version 2.0.10 `
   --wait --timeout 100s 

helm upgrade --install -n open5gslice ueransim-ues openverso/ueransim-ues `
   --values docs/examples/open5gs/ueransim-ue2.yaml `
   --wait --timeout 100s 
✔ eUPF2 log:

```prolog 2023/07/11 18:07:59 Received 603 bytes from 10.233.78.94:8805 2023/07/11 18:07:59 Handling PFCP message from 10.233.78.94:8805 2023/07/11 18:07:59 Got Session Establishment Request from: 10.233.78.94. 2023/07/11 18:07:59 Session Establishment Request: CreatePDR ID: 1 FAR ID: 1 QER ID: 1 URR ID: 1 Source Interface: 1 UE IPv4 Address: 10.46.0.2 CreatePDR ID: 2 Outer Header Removal: 0 FAR ID: 2 QER ID: 1 Source Interface: 0 TEID: 2 Ipv4: 10.233.48.123 Ipv6: CreatePDR ID: 3 Outer Header Removal: 0 FAR ID: 1 QER ID: 1 Source Interface: 3 CreatePDR ID: 4 Outer Header Removal: 0 FAR ID: 3 Source Interface: 0 TEID: 2 Ipv4: 10.233.48.123 Ipv6: SDF Filter: permit out 58 from ff02::2/128 to assigned CreateFAR ID: 1 Apply Action: [12 0] BAR ID: 1 CreateFAR ID: 2 Apply Action: [2 0] Forwarding Parameters: Network Instance: internet CreateFAR ID: 3 Apply Action: [2 0] Forwarding Parameters: Network Instance: internet Outer Header Creation: &{OuterHeaderCreationDescription:256 TEID:1 IPv4Address:10.233.78.94 IPv6Address: PortNumber:0 CTag:0 STag:0} CreateQER ID: 1 Gate Status DL: 0 Gate Status UL: 0 Max Bitrate DL: 1073741 Max Bitrate UL: 1073741 QFI: 1 CreateURR ID: 1 Measurement Method: 2 Volume Threshold: &{Flags:1 TotalVolume:104857600 UplinkVolume:0 DownlinkVolume:0} BAR ID: 1 2023/07/11 18:07:59 Saving FAR info to session: 1, {Action:12 OuterHeaderCreation:0 Teid:0 RemoteIP:0 LocalIP:0 TransportLevelMarking:0} 2023/07/11 18:07:59 EBPF: Put FAR: internalId=0, qerInfo={Action:12 OuterHeaderCreation:0 Teid:0 RemoteIP:0 LocalIP:0 TransportLevelMarking:0} 2023/07/11 18:07:59 WARN: No OuterHeaderCreation 2023/07/11 18:07:59 Saving FAR info to session: 2, {Action:2 OuterHeaderCreation:0 Teid:0 RemoteIP:0 LocalIP:0 TransportLevelMarking:0} 2023/07/11 18:07:59 EBPF: Put FAR: internalId=1, qerInfo={Action:2 OuterHeaderCreation:0 Teid:0 RemoteIP:0 LocalIP:0 TransportLevelMarking:0} 2023/07/11 18:07:59 Saving FAR info to session: 3, {Action:2 OuterHeaderCreation:1 Teid:1 RemoteIP:1582229770 LocalIP:1800333578 TransportLevelMarking:0} 2023/07/11 18:07:59 EBPF: Put FAR: internalId=2, qerInfo={Action:2 OuterHeaderCreation:1 Teid:1 RemoteIP:1582229770 LocalIP:1800333578 TransportLevelMarking:0} 2023/07/11 18:07:59 Saving QER info to session: 1, {GateStatusUL:0 GateStatusDL:0 Qfi:1 MaxBitrateUL:1073741000 MaxBitrateDL:1073741000 StartUL:0 StartDL:0} 2023/07/11 18:07:59 EBPF: Put QER: internalId=0, qerInfo={GateStatusUL:0 GateStatusDL:0 Qfi:1 MaxBitrateUL:1073741000 MaxBitrateDL:1073741000 StartUL:0 StartDL:0} 2023/07/11 18:07:59 EBPF: Put PDR Downlink: ipv4=10.46.0.2, pdrInfo={OuterHeaderRemoval:0 FarId:0 QerId:0} 2023/07/11 18:07:59 EBPF: Put PDR Uplink: teid=2, pdrInfo={OuterHeaderRemoval:0 FarId:1 QerId:0} 2023/07/11 18:07:59 EBPF: Put PDR Uplink: teid=3, pdrInfo={OuterHeaderRemoval:0 FarId:0 QerId:0} 2023/07/11 18:07:59 WARN: SDF Filter is not supported yet. Ignore PDR 2023/07/11 18:07:59 Received 70 bytes from 10.233.78.94:8805 2023/07/11 18:07:59 Handling PFCP message from 10.233.78.94:8805 2023/07/11 18:07:59 Got Session Modification Request from: 10.233.78.94. 2023/07/11 18:07:59 Finding association for 10.233.78.94 2023/07/11 18:07:59 Finding session 2 2023/07/11 18:07:59 Session Modification Request: UpdateFAR ID: 1 Apply Action: [2 0] Update forwarding Parameters: Network Instance: internet Outer Header Creation: &{OuterHeaderCreationDescription:256 TEID:2 IPv4Address:10.233.78.79 IPv6Address: PortNumber:0 CTag:0 STag:0} 2023/07/11 18:07:59 Updating FAR info: 1, {FarInfo:{Action:2 OuterHeaderCreation:1 Teid:2 RemoteIP:1330571530 LocalIP:1800333578 TransportLevelMarking:0} GlobalId:0} 2023/07/11 18:07:59 EBPF: Update FAR: internalId=0, farInfo={Action:2 OuterHeaderCreation:1 Teid:2 RemoteIP:1330571530 LocalIP:1800333578 TransportLevelMarking:0} 2023/07/11 18:08:02 Received 16 bytes from 10.233.78.94:8805 2023/07/11 18:08:02 Handling PFCP message from 10.233.78.94:8805 2023/07/11 18:08:02 Got Heartbeat Request with TS: 2023-07-11 16:52:57 +0000 UTC, from: 10.233.78.94 2023/07/11 18:08:02 Sent Heartbeat Response to: 10.233.78.94 2023/07/11 18:08:03 Sent Heartbeat Request to: 10.233.78.94 2023/07/11 18:08:03 Received 16 bytes from 10.233.78.94:8805 2023/07/11 18:08:03 Handling PFCP message from 10.233.78.94:8805 2023/07/11 18:08:03 Got Heartbeat Response with TS: 2023-07-11 16:52:57 +0000 UTC, from: 10.233.78.94 2023/07/11 18:08:08 Sent Heartbeat Request to: 10.233.78.94 2023/07/11 18:08:08 Received 16 bytes from 10.233.78.94:8805 2023/07/11 18:08:08 Handling PFCP message from 10.233.78.94:8805 2023/07/11 18:08:08 Got Heartbeat Response with TS: 2023-07-11 16:52:57 +0000 UTC, from: 10.233.78.94 ```

PapaySail commented 1 year ago

https://github.com/open5gs/open5gs/blob/8535ceab8c54ead054134e6a19601851bcc6a810/configs/open5gs/smf.yaml.in#L451C8-L451C8

<SMF Selection - 5G Core only>

1. SMF sends SmfInfo(S-NSSAI, DNN, TAI) to the NRF

2. NRF responds to AMF with SmfInfo during NF-Discovery.

3. AMF selects SMF based on S-NSSAI, DNN and TAI in SmfInfo.

#

Note that if there is no SmfInfo, any AMF can select this SMF.

#

o S-NSSAI[SST:1] and DNN[internet] - At least 1 DNN is required in S-NSSAI

smf:

info:

- s_nssai:

- sst: 1

dnn:

- internet

#

o S-NSSAI[SST:1 SD:009000] and DNN[internet or ims]

smf:

info:

- s_nssai:

- sst: 1

sd: 009000

dnn:

- internet

- ims

#

o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:99970 TAC:1]

smf:

info:

- s_nssai:

- sst: 1

dnn:

- internet

tai:

- plmn_id:

mcc: 999

mnc: 70

tac: 1