Skip to content

parhamds/5G-Projects.West-LB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

West-LB

West-LB actually is used for load balancing the data of user equipment and give it to the responsible UPFs. West-LB load balances the GTP-U encapsulated traffic which are generated by user equipment and encapsulated by gNB and destined to the UPFs. this component is built with two Kubernetes resources which are Pod and Service. Like other components its Pod contains a container which is running an app written in Golang. this app runs an HTTP Server, which is responsible for handling requests from UPFs. UPFs may send two kinds of requests to West-LB:

  1. when a UPF is deployed, register itself to West-LB through HTTP POST request sending some info which are used to correctly route packets of user equipment toward UPFs. So, in this way West-LB knows how many active UPFs there are.

  2. when a UPF receives a Session Establishment Request, sends the IP address of associated user equipment to West-LB and East-LB. in this way West-LB knows each UE is assigned to which UPF, so it adds an iptables rule for that specific UE to mark the packets of that user equipment. This iptables rule matches UE’s IP with u32 extension. The reason of using u32 extension is that the data of UE is sent from gNB to UPF in GTP-U encapsulated form, and iptables does not have any direct method to match based on elements of GTP-U header. So, with u32 we can match specific bytes of the header with a certain value which is IP of user equipment. Action of these iptables rules is just adding a mark to the packets that are used to correctly routing the packet using Policy-Based Routing.

Config of West-LB for each interface

$ echo 101 lb-UPF101 >> /etc/iproute2/rt_tables
$ IP rule add fwmark 101 table lb-UPF101
$ IP route add 192.168.252.3 dev UPF101 table lb-UPF101
$ iptables -t mangle -A PREROUTING -d 192.168.252.3 -p udp --dport 2152 -m u32 --u32 "56&0xffffffff=0xacfa0001" -j MARK --set-mark 101
  • lb-UPF101: rt_table name
  • UPF101: interface of West-LB connected to UPF101
  • Bytes 56-59 contains UE’s IP address
  • ACFA0001 is HEX of 172.250.0.1

About

Access-LB component of Virtual-UPF

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published