IP 五元组分流
MP2
的IP
五元组分流,要达到的效果是:
下发IP
五元组分流规则到UPF
后,符合分流规则的UE
流量要分流到边缘MEC
网关;删除掉IP
五元组分流规则后,原需要分流到边缘MEC
网关的流量不再分流,正常转发的DN
。
因此,对于UPF
,IP
五元组分流规则通过MP2
下发后,最重要的是动态生效,也就是UPF
需要支持动态修改FD
。
UPF MP2 IP 五元组分流流程
在
UPF
总数据结构upf_main
中增加hash
表项 hash_pdr_id_by_appid,以APPID
为key
值,存储 APPID 关联的 session PDR;在建立
Session
时,对于预定义规则,将APPID,session PDR
对应关系记录在hash_pdr_id_by_appid
中;增加
UPF
命令行,动态配置MEC FD
,动态生效在PDR ACL
,满足IP 五元组分流
动态生效。
流程图:
新增命令行
// 命令行原型
# upf mec-traffic pfd-list appid <name> fd {xxx} [precedence <>] [del <index>] [<del_all>]
// del <index> :为 pfd 索引,可以通过 show upf pfd-list 查看
// del_all : 删除该 mec APPID 下挂所有 pfd
// 新增一条 mec fd
# upf mec-traffic pfd-list appid 1030 fd {permit in ip from 172.20.231.0/24 to 192.168.2.1/32}
// 查看 pfd
# show upf pfd-list
----------------------------------------------------
app id: 1131
precedence: 0
PFD idx: 0
Flow Describe(1):V4: permit out ip from 192.168.202.0/24 to 172.20.231.0/24
URL(0):
DN(0):
Customer:(0)=
PFD idx: 1
Flow Describe(1):V4: permit in ip from 172.20.231.0/24 to 192.168.202.0/24
URL(0):
DN(0):
Customer:(0)=
----------------------------------------------------
app id: 1030
mec traffic // 注意 有 mec traffic 标识的,说明这条 pfd 是为分流到边缘的 pfd
precedence: 0
PFD idx: 0
Flow Describe(0):V4V6: permit out 0 from any 0 to any 0
URL(0):
DN(0):
Customer:(0)=
PFD idx: 1
Flow Describe(1):V4: permit in ip from 172.20.231.0/24 to 192.168.2.1
URL(0):(nil)
DN(0):(nil)
Customer:(0)=(nil)
// 删除一条 mec fd
# upf mec-traffic pfd-list appid 1030 del 1