UPF Configuration

startup.conf

只需要将 PCI ID 配置好,VPP 就会自动纳管 Network Interface 了。

heapsize 2G
unix {
    # nodaemon
    cli-listen /run/vpp/cli.sock
    log /var/log/vpp/vpp.log
    full-coredump
    gid vpp
    exec /etc/vpp/upf.conf
}
api-trace {
    on
}
logging {
  default-syslog-log-level info
  unthrottle-time 1
}
api-segment {
  gid vpp
}

upf {
  white-list-conf /etc/vpp/white_list_conf.xml
  grey-list-conf /etc/vpp/grey_list_conf.xml
  http-header-enrichment-conf /etc/vpp/http_header_enrichment_conf.xml
  https-header-enrichment-conf /etc/vpp/https_header_enrichment_conf.xml
  # predef-conf /etc/vpp/predef_conf.xml
}

buffers {
  buffers-per-numa 32768
}
statseg {
  size 256m
}
socksvr {
    default
}
cpu {
        main-core 0
        #corelist-pfcp-threads 1
        #corelist-workers 2
        workers 2
        pfcp-threads 1
}
dpdk {
    dev 0000:00:07.0 {
              num-rx-queues 1
    }
    dev 0000:00:08.0 {
              num-rx-queues 1
    }
    dev 0000:00:06.0 {
              num-rx-queues 1
    }
    dev 0000:00:0a.0 {
              num-rx-queues 1
    }
}
plugins {
    plugin gtpu_plugin.so { disable }
    plugin ndpi_plugin.so { enable }
}

dns {
    max-ttl 120
}

PSA v4

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
upf feature FTUP support

comment{================== Ethernet Ports ===================}

comment{N4}
set int state VirtualFunctionEthernet0/7/0 up
comment{N3}
set int state VirtualFunctionEthernet0/6/0 up
comment{N6}
set int state VirtualFunctionEthernet0/8/0 up

set int mtu 1500 VirtualFunctionEthernet0/7/0
set int mtu 1500 VirtualFunctionEthernet0/6/0
set int mtu 1500 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.1.24/24

ip route add 0.0.0.0/0 table 0 via 192.168.1.1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.89 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4

PSA v6

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
comment{upf feature FTUP support}

comment{================== Ethernet Ports ===================}

comment{N4}
set int state VirtualFunctionEthernet0/7/0 up
comment{N3}
set int state VirtualFunctionEthernet0/6/0 up
comment{N6}
set int state VirtualFunctionEthernet0/8/0 up

set int mtu ip4 1500 VirtualFunctionEthernet0/7/0
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 1500 VirtualFunctionEthernet0/8/0

set int mtu ip6 9000 VirtualFunctionEthernet0/7/0
set int mtu ip6 9000 VirtualFunctionEthernet0/6/0
set int mtu ip6 9000 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24

comment{================== Ethernet Port IPv6 Address and Route ===================}

set ip6 address VirtualFunctionEthernet0/8/0 fc00::2/7

ip route add ::/0 table 0 via fc00::1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.89 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4

PSA v4v6

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
comment{upf feature FTUP support}

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/6/0 up
set int state VirtualFunctionEthernet0/8/0 up

set int mtu ip4 1500 VirtualFunctionEthernet0/7/0
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 1500 VirtualFunctionEthernet0/8/0

set int mtu ip6 9000 VirtualFunctionEthernet0/7/0
set int mtu ip6 9000 VirtualFunctionEthernet0/6/0
set int mtu ip6 9000 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.1.24/24

ip route add 0.0.0.0/0 table 0 via 192.168.1.1 VirtualFunctionEthernet0/8/0

comment{================== Ethernet Port IPv6 Address and Route ===================}

set ip6 address VirtualFunctionEthernet0/8/0 fc00::2/7

ip route add ::/0 table 0 via fc00::1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.89 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4

I-UPF v4

I-UPF 场景中,只有 PSA 会建立 PDU Session。

  • I-UPF

uranus> show upf session
----------------------------------------------------
CP F-SEID: 0x00000000000000c1 (193) @ 192.168.40.53
UP F-SEID: 0x00000000000000ff (255) @ 192.168.40.89
----------------------------------------------------
CP F-SEID: 0x0000000000000002 (2) @ 192.168.40.53
UP F-SEID: 0x0000000000000100 (256) @ 192.168.40.89
Total session num = 2
  • PSA

uranus> show upf session
----------------------------------------------------
CP F-SEID: 0x00000000000000c1 (193) @ 192.168.40.53
UP F-SEID: 0x00000000000000f8 (248) @ 192.168.40.90
table_id 0 ue_ip 172.20.231.1
----------------------------------------------------
CP F-SEID: 0x0000000000000001 (1) @ 192.168.40.53
UP F-SEID: 0x00000000000000fb (251) @ 192.168.40.90
Total session num = 2

uranus> show upf session table_id 0 ue_ip 172.20.231.1
----------------------------------------------------
CP F-SEID: 0x00000000000000c1 (193) @ 192.168.40.53
UP F-SEID: 0x00000000000000f8 (248) @ 192.168.40.90
  Sx Association: 0 (prev:4294967295,next:250)
  Sx data active: 1 , detective priod: 40 s
  IMSI:466920100001101,
  DNN: default.mnc092.mcc466.gprs
PDR: 3
  Precedence: 255
  PDI:
    Fields: 0x00000104
    Source Interface: Core
    Source Interface type: 17
    UE IP address:
      IPv4 address: 172.20.231.1
  Outer Header Removal: no
  FAR Id: 546308097
  URR Ids: []  QER Ids: [4,2]
PDR: 2
  Precedence: 255
  PDI:
    Fields: 0x00000127
    Source Interface: Access
    Source Interface type: 15
    Network Instance: epc
    Local F-TEID: 805306497 (0x30000081)
            IPv4: 192.168.90.200
    UE IP address:
      IPv4 address: 172.20.231.1
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308098
  URR Ids: []  QER Ids: [4,2]
FAR: 546308097
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Access
    Network Instance: epc
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:10000081,IP:192.168.90.100
    Transport Level Marking: 0x38
FAR: 546308098
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    DEST interface Type: 17
    Transport Level Marking: 0x38
QER: 2
  QFI: 0
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 1000000kbps
  DL MBR: 1000000kbps
  UL policer MBR: 1000000kbps
  DL policer MBR: 1000000kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 4
  QFI: 1
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
BAR: 1
  Downlink Data Notification Delay: 0 ms
  Downlink Buffering Duration: 0 seconds
  Downlink Buffering Suggested Packet Count: 65535
  Suggested Buffering Packets Count: 255

I-UPF

comment{===================== VPP Features =======================}


upf enable-disable
upf log level debug
comment{upf feature FTUP support}


comment{================== Ethernet Ports ===================}


set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/6/0 up
set int state VirtualFunctionEthernet0/a/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 9000 VirtualFunctionEthernet0/a/0


set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/a/0 on


comment{================== Ethernet Port IPv4 Address and Route ===================}


set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24


ip table add 90
set interface ip table VirtualFunctionEthernet0/a/0 90
set interface ip address VirtualFunctionEthernet0/a/0 192.168.90.100/24
ip route add 0.0.0.0/0 table 90 via 192.168.90.200 VirtualFunctionEthernet0/a/0


comment{================== PFCP Endpoint ===================}


upf pfcp endpoint ip 192.168.40.89 vrf 0


comment{================== GTP-U Tunnel ===================}


upf nwi name epc vrf 0
upf nwi name upf1_n9_dl vrf 90

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.90.100 intf core nwi upf1_n9_dl TEID-Range-Indication 4

PSA

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
comment{upf feature FTUP support}

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/9/0 up
set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/8/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 9000 VirtualFunctionEthernet0/7/0
set int mtu ip4 9000 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/9/0 on
set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/9/0 192.168.40.90/24
set int ip address VirtualFunctionEthernet0/7/0 192.168.90.200/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.201.3/24

ip route add 0.0.0.0/0 table 0 via 192.168.201.1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.90 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.90 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.90.200 intf access nwi epc TEID-Range-Indication 4

UL CL 本地分流方案 v4

UL CL 场景中,I-UPF(PSA1 合设)、PSA2 都会建立 PDU Session。

  • I-UPF/PSA1

uranus> show upf session
----------------------------------------------------
CP F-SEID: 0x0000000000000041 (65) @ 192.168.40.53
UP F-SEID: 0x00000000000000ff (255) @ 192.168.40.89
table_id 0 ue_ip 172.20.231.1
----------------------------------------------------
CP F-SEID: 0x0000000000000001 (1) @ 192.168.40.53
UP F-SEID: 0x0000000000000100 (256) @ 192.168.40.89
Total session num = 2

uranus> show upf session table_id 0 ue_ip 172.20.231.1
----------------------------------------------------
CP F-SEID: 0x0000000000000041 (65) @ 192.168.40.53
UP F-SEID: 0x00000000000000ff (255) @ 192.168.40.89
  Sx Association: 0 (prev:4294967295,next:255)
  Sx data active: 1 , detective priod: 0 s
  IMSI:466920100001101,
  DNN: default.mnc092.mcc466.gprs
PDR: 3
  Precedence: 1
  PDI:
    Fields: 0x0000012f
    Source Interface: Core
    Source Interface type: 15
    Network Instance: upf1_n9_dl
    Local F-TEID: 1073741827 (0x40000003)
            IPv4: 192.168.90.100
    UE IP address:
      IPv4 address: 172.20.231.1
    SDF Filter:
      V4V6: permit out ip from any to any
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308129
  URR Ids: []  QER Ids: [4,2]
PDR: 32771
  Precedence: 1
  PDI:
    Fields: 0x0000010c
    Source Interface: Core
    Source Interface type: 17
    UE IP address:
      IPv4 address: 172.20.231.1
    SDF Filter:
      V4V6: permit out ip from any to any
  Outer Header Removal: no
  FAR Id: 546308129
  URR Ids: []  QER Ids: [4,2]
PDR: 2
  Precedence: 1
  PDI:
    Fields: 0x0000012f
    Source Interface: Access
    Source Interface type: 11
    Network Instance: epc
    Local F-TEID: 1073741827 (0x40000003)
            IPv4: 192.168.30.99
    UE IP address:
      IPv4 address: 172.20.231.1
    SDF Filter:
      V4V6: permit out ip from any to any
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308128
  URR Ids: []  QER Ids: [4,2]
PDR: 5
  Precedence: 255
  PDI:
    Fields: 0x00000127
    Source Interface: Core
    Source Interface type: 15
    Network Instance: upf1_n9_dl
    Local F-TEID: 1073741827 (0x40000003)
            IPv4: 192.168.90.100
    UE IP address:
      IPv4 address: 172.20.231.1
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308097
  URR Ids: []  QER Ids: [6,2]
PDR: 4
  Precedence: 255
  PDI:
    Fields: 0x00000127
    Source Interface: Access
    Source Interface type: 11
    Network Instance: epc
    Local F-TEID: 1073741827 (0x40000003)
            IPv4: 192.168.30.99
    UE IP address:
      IPv4 address: 172.20.231.1
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308099
  URR Ids: []  QER Ids: [6,2]
FAR: 546308097
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Access
    Network Instance: epc
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:000000d9,IP:192.168.30.100
    Transport Level Marking: 0x38
FAR: 546308098
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    DEST interface Type: 17
    Transport Level Marking: 0x38
FAR: 546308099
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    Network Instance: upf1_n9_dl
    DEST interface Type: 15
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:70000001,IP:192.168.90.200
    Transport Level Marking: 0x38
FAR: 546308128
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    DEST interface Type: 17
    Transport Level Marking: 0x38
FAR: 546308129
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Access
    Network Instance: epc
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:000000d9,IP:192.168.30.100
    Transport Level Marking: 0x38
QER: 2
  QFI: 0
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 1000000kbps
  DL MBR: 1000000kbps
  UL policer MBR: 1000000kbps
  DL policer MBR: 1000000kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 4
  QFI: 1
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 5
  QFI: 1
  RQI: 0
  UL Gate: 1 == [CLOSED]
  DL Gate: 1 == [CLOSED]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 6
  QFI: 1
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
  • PSA2

uranus> show upf session
----------------------------------------------------
CP F-SEID: 0x0000000000000002 (2) @ 192.168.40.53
UP F-SEID: 0x00000000000000ed (237) @ 192.168.40.90
----------------------------------------------------
CP F-SEID: 0x0000000000000041 (65) @ 192.168.40.53
UP F-SEID: 0x00000000000000e3 (227) @ 192.168.40.90
table_id 0 ue_ip 172.20.231.1
Total session num = 2

uranus> show upf session table_id 0 ue_ip 172.20.231.1
----------------------------------------------------
CP F-SEID: 0x0000000000000041 (65) @ 192.168.40.53
UP F-SEID: 0x00000000000000e3 (227) @ 192.168.40.90
  Sx Association: 0 (prev:4294967295,next:236)
  Sx data active: 0 , detective priod: 40 s
  IMSI:466920100001101,
  DNN: default.mnc092.mcc466.gprs
PDR: 3
  Precedence: 1
  PDI:
    Fields: 0x0000010c
    Source Interface: Core
    Source Interface type: 17
    UE IP address:
      IPv4 address: 172.20.231.1
    SDF Filter:
      V4V6: permit out ip from any to any
  Outer Header Removal: no
  FAR Id: 546308129
  URR Ids: []  QER Ids: [4,2]
PDR: 2
  Precedence: 1
  PDI:
    Fields: 0x0000012f
    Source Interface: Access
    Source Interface type: 15
    Network Instance: epc
    Local F-TEID: 1879048193 (0x70000001)
            IPv4: 192.168.90.200
    UE IP address:
      IPv4 address: 172.20.231.1
    SDF Filter:
      V4V6: permit out ip from any to any
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308128
  URR Ids: []  QER Ids: [4,2]
PDR: 5
  Precedence: 255
  PDI:
    Fields: 0x00000104
    Source Interface: Core
    Source Interface type: 17
    UE IP address:
      IPv4 address: 172.20.231.1
  Outer Header Removal: no
  FAR Id: 546308097
  URR Ids: []  QER Ids: [6,2]
PDR: 4
  Precedence: 255
  PDI:
    Fields: 0x00000127
    Source Interface: Access
    Source Interface type: 15
    Network Instance: epc
    Local F-TEID: 1879048193 (0x70000001)
            IPv4: 192.168.90.200
    UE IP address:
      IPv4 address: 172.20.231.1
    QFI: 1
  Outer Header Removal: GTPU/UDP/IP
  FAR Id: 546308098
  URR Ids: []  QER Ids: [6,2]
FAR: 546308097
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Access
    Network Instance: epc
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:40000003,IP:192.168.90.100
    Transport Level Marking: 0x38
FAR: 546308098
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    DEST interface Type: 17
    Transport Level Marking: 0x38
FAR: 546308128
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Core
    DEST interface Type: 17
    Transport Level Marking: 0x38
FAR: 546308129
  Apply Action: 00000002 == [FORWARD]
  Forward:
    Destination Interface: Access
    Network Instance: epc
    Outer Header Creation: [GTP-U/UDP/IPv4],TEID:40000003,IP:192.168.90.100
    Transport Level Marking: 0x38
QER: 2
  QFI: 0
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 1000000kbps
  DL MBR: 1000000kbps
  UL policer MBR: 1000000kbps
  DL policer MBR: 1000000kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 4
  QFI: 1
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 5
  QFI: 1
  RQI: 0
  UL Gate: 1 == [CLOSED]
  DL Gate: 1 == [CLOSED]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
QER: 6
  QFI: 1
  RQI: 0
  UL Gate: 0 == [OPEN]
  DL Gate: 0 == [OPEN]
  UL MBR: 0kbps
  DL MBR: 0kbps
  UL policer MBR: 0kbps
  DL policer MBR: 0kbps
  UL GBR: 0kbps
  DL GBR: 0kbps
  Averaging Window: 1000 ms
BAR: 1
  Downlink Data Notification Delay: 0 ms
  Downlink Buffering Duration: 0 seconds
  Downlink Buffering Suggested Packet Count: 65535
  Suggested Buffering Packets Count: 255

PCF predefined-sm-policy-rules.xml

配置基于 PCC Rule 的 Traffic Routing(分流)规则。

# 配置 tcList  FlowList 的关系。
<pcc pccRuleId="pcc11_3_1" flowListId="flowList0" precedence="1" qosListId="qosList6" tcListId="tcList11" />

# 配置 Traffic Routing 的目标 DNAI。
<tc tcId="tc11" dnai="89"/>

SMF upf.xml

为 DNN 配置响应的 DNAI。

    <dnn-list size="1">
        <dnn name="default">
            <nssai-list size="1">
                <nssai value="0x1" />
            </nssai-list>
            <ssc-list size="1">
                <ssc value="1"/>
            </ssc-list>
            <dnai-list size="2">
                <dnai value="89">
                    <up-list size="1">
                        <up ip="192.168.40.89"/>
                    </up-list>
                </dnai>
                <dnai value="90">
                    <up-list size="1">
                        <up ip="192.168.40.90"/>
                    </up-list>
                </dnai>
            </dnai-list>
        </dnn>
    </dnn-list>

I-UPF/PSA1

comment{===================== VPP Features =======================}


upf enable-disable
upf log level debug
comment{upf feature FTUP support}


comment{================== Ethernet Ports ===================}


set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/6/0 up
set int state VirtualFunctionEthernet0/8/0 up
set int state VirtualFunctionEthernet0/a/0 up


upf gtpu-tunnel-mtu 1400
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 1500 VirtualFunctionEthernet0/8/0
set int mtu ip4 9000 VirtualFunctionEthernet0/a/0


set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on
set interface reassembly VirtualFunctionEthernet0/a/0 on


comment{================== Ethernet Port IPv4 Address and Route ===================}


set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24

comment{N6}
set int ip address VirtualFunctionEthernet0/8/0 192.168.1.24/24
ip route add 0.0.0.0/0 table 0 via 192.168.1.1 VirtualFunctionEthernet0/8/0

comment{N9}
ip table add 90
set interface ip table VirtualFunctionEthernet0/a/0 90
set interface ip address VirtualFunctionEthernet0/a/0 192.168.90.100/24
ip route add 0.0.0.0/0 table 90 via 192.168.90.200 VirtualFunctionEthernet0/a/0


comment{================== PFCP Endpoint ===================}


upf pfcp endpoint ip 192.168.40.89 vrf 0


comment{================== GTP-U Tunnel ===================}


upf nwi name epc vrf 0
upf nwi name upf1_n9_dl vrf 90

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.90.100 intf core nwi upf1_n9_dl TEID-Range-Indication 4

PSA2

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
comment{upf feature FTUP support}

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/9/0 up
set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/8/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 9000 VirtualFunctionEthernet0/7/0
set int mtu ip4 9000 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/9/0 on
set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/9/0 192.168.40.90/24
set int ip address VirtualFunctionEthernet0/7/0 192.168.90.200/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.201.3/24

ip route add 0.0.0.0/0 table 0 via 192.168.201.1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.90 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.90 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.90.200 intf access nwi epc TEID-Range-Indication 4

单 UPF 多 DN 精确路由方案

一个 UPF 对应两个 DNN,需要在 UPF 上配置两个 N6,这两个 N6 处于不同的 NWI。以两个物理 N6 为例,也可以换成虚拟的。

NOTE:N6 GTP-U 不需要显示配置。

comment{===================== VPP Features =======================}

upf enable-disable
upf log level debug
upf feature FTUP support

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/6/0 up
set int state VirtualFunctionEthernet0/8/0 up
set int state VirtualFunctionEthernet0/b/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 9000 VirtualFunctionEthernet0/8/0
set int mtu ip4 9000 VirtualFunctionEthernet0/b/0

set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on
set interface reassembly VirtualFunctionEthernet0/b/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24

comment{N6-1}
ip table add 61
set interface ip table VirtualFunctionEthernet0/8/0 61
set interface ip address VirtualFunctionEthernet0/8/0 192.168.1.24/24
ip route add 0.0.0.0/0 table 61 via 192.168.1.1 VirtualFunctionEthernet0/8/0

comment{N6-2}
ip table add 62
set interface ip table VirtualFunctionEthernet0/b/0 62
set interface ip address VirtualFunctionEthernet0/b/0 192.168.201.4/24
ip route add 0.0.0.0/0 table 62 via 192.168.201.1 VirtualFunctionEthernet0/b/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.89 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0
upf nwi name default_n6 vrf 61
upf nwi name private_n6 vrf 62

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4

DNN 本地分流方案

UPF1

comment{===================== VPP Features =======================}

upf enable-disable
upf log level debug
comment{upf feature FTUP support}

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/7/0 up
set int state VirtualFunctionEthernet0/6/0 up
set int state VirtualFunctionEthernet0/8/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 1500 VirtualFunctionEthernet0/6/0
set int mtu ip4 9000 VirtualFunctionEthernet0/8/0

set interface reassembly VirtualFunctionEthernet0/7/0 on
set interface reassembly VirtualFunctionEthernet0/6/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/7/0 192.168.40.89/24
set int ip address VirtualFunctionEthernet0/6/0 192.168.30.99/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.1.24/24

ip route add 0.0.0.0/0 table 0 via 192.168.1.1 VirtualFunctionEthernet0/8/0

comment{================== Ethernet Port IPv6 Address and Route ===================}

set ip6 address VirtualFunctionEthernet0/8/0 fc00::2/7

ip route add ::/0 table 0 via fc00::1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.89 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.89 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.99 intf access nwi epc TEID-Range-Indication 4

comment{================== DNS plugin ===================}

binary-api dns_name_server_add_del 114.114.114.114
binary-api dns_enable_disable

UPF2

comment{===================== VPP Features =======================}

upf enable-disable
upf log level info
upf feature FTUP support

comment{================== Ethernet Ports ===================}

set int state VirtualFunctionEthernet0/a/0 up
set int state VirtualFunctionEthernet0/9/0 up
set int state VirtualFunctionEthernet0/8/0 up

upf gtpu-tunnel-mtu 1400
set int mtu ip4 9000 VirtualFunctionEthernet0/a/0
set int mtu ip4 9000 VirtualFunctionEthernet0/9/0

set interface reassembly VirtualFunctionEthernet0/a/0 on
set interface reassembly VirtualFunctionEthernet0/9/0 on
set interface reassembly VirtualFunctionEthernet0/8/0 on

comment{================== Ethernet Port IPv4 Address and Route ===================}

set int ip address VirtualFunctionEthernet0/a/0 192.168.30.102/24
set int ip address VirtualFunctionEthernet0/9/0 192.168.40.90/24
set int ip address VirtualFunctionEthernet0/8/0 192.168.201.3/24

ip route add 0.0.0.0/0 table 0 via 192.168.201.1 VirtualFunctionEthernet0/8/0

comment{================== PFCP Endpoint ===================}

upf pfcp endpoint ip 192.168.40.90 vrf 0

comment{================== GTP-U Tunnel ===================}

upf nwi name epc vrf 0

upf gtpu endpoint ip 192.168.40.90 intf cp nwi epc TEID-Range-Indication 4
upf gtpu endpoint ip 192.168.30.102 intf access nwi epc TEID-Range-Indication 4