HewlettPackard / PacketRusher

High performance 5G UE/gNB Simulator and CP/UP load tester.
Apache License 2.0
100 stars 21 forks source link

Containerize PacketRusher #19

Open linouxis9 opened 7 months ago

yoursunny commented 7 months ago

I tried PacketRusher with a Dockerfile like this:

FROM golang:1.21-alpine3.18 AS build
RUN cd / \
 && wget -O PacketRusher.zip https://github.com/HewlettPackard/PacketRusher/archive/c10560874c0bbd8241f75c5aaa44536b528e1d74.zip \
 && unzip -n PacketRusher.zip \
 && mv PacketRusher-* PacketRusher \
 && cd /PacketRusher \
 && env CGO_ENABLED=0 go build cmd/packetrusher.go

FROM scratch
COPY --from=build /PacketRusher/packetrusher /
ENTRYPOINT ["/packetrusher"]

It works with a mounted configuration file, but there are several complications:

linouxis9 commented 7 months ago

Hi @yoursunny;

Thank you for your suggestion!

For 1., point taken, thanks for the suggestion. In that case, automatic routes creation should probably also be disabled when VRF are disabled. Else, funny things may happen on the host :-)

For 2., the use case we were thinking was k8s with Multus attaching multiple host interfaces (or creating multiple MacVLAN interfaces) and attaching it to the PacketRusher's pod. But I agree that having to use several contiguous IPv4 addresses is not the best in any cases. The switch to eUPF's eBPF from gtp5g as the WIP PR available here https://github.com/HewlettPackard/PacketRusher/pull/47 should alleviate some of these issues but it's still WIP, and work only with a single UE for now. For PacketRusher on plain old Docker, I would recommend the usage of --net host, the usage of Docker's virtual interfaces may impact negatively the user plane performance of PacketRusher.

Thanks, Valentin