HewlettPackard / PacketRusher

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

Crash while running custom scenario #131

Open himanshu3 opened 4 days ago

himanshu3 commented 4 days ago

I built PacketRusher and was able to test free5GC successfully but while trying custom scenario (without making any modification to scenarios/sample/sample.go) it crashes. Following are the steps:

1) build custom scenario wasm using scenarios/build.sh 2) from $PACKET_RUSHER_HOME execute: sudo ./packetrusher custom-scenario --scenario ./scenarios/sample.go.wasm

Following are the logs: INFO[0000] Selecting 10.73.73.150 for host 10.73.73.150 as AMF's IP address INFO[0000] Selecting 10.71.71.113 for host 10.71.71.113 as gNodeB's N3/Data IP address INFO[0000] Selecting 10.71.71.113 for host 10.71.71.113 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/user1/code/PacketRusher/config/config.yml INFO[0000] [GNB] SCTP/NGAP service is running INFO[0000] [GNB] Initiating NG Setup Request INFO[0000] [GNB][SCTP] Receive message in 0 stream INFO[0000] [GNB][NGAP] Receive NG Setup Response INFO[0000] [GNB][AMF] AMF Name: AMF INFO[0000] [GNB][AMF] State of AMF: Active INFO[0000] [GNB][AMF] Capacity of AMF: 255 INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 315 mnc:010 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [GNB] UE MCC: 315 MNC: 010 FATA[0001] func[env.pduSessionRequest] param[1] is unsupported: uint8

I even tried changing argument type of pduSessionRequest in scenarios/sample/sample.go 1) from func pduSessionRequest(uint32, uint32) to func pduSessionRequest(uint32, uint8) 2) for pduSessionId:=uint8(1); pduSessionId<2; pduSessionId++ { fmt.Println("Hi, I'm an UE that wants to request PDU Session id: ", pduSessionId) pduSessionRequest(ueId, pduSessionId) }

but again same result.

I am not sure, if I am missing something here or is it a bug?

linouxis9 commented 4 days ago

Hi @himanshu3,

Thanks a lot for testing the custom scenario WebAssembly feature! The project has evolved quite a lot since I've started working on this feature and I had not the time to work on it, it's very likely it has not kept with the latest changes. While I fix this bug, I would recommend you to write your custom scenario by editing the PacketRusher's main scenario directly in PacketRusher's Go source here: https://github.com/HewlettPackard/PacketRusher/blob/32a08fa9fb2d83b654628b5187a0244a66b737b2/internal/common/tools/tools.go#L112

I hope it helps!

Cheers, Valentin

himanshu3 commented 4 days ago

Thanks for pointing to PacketRusher/internal/common/tools/tools.go