Node simulation

Sniffing MQTT messages sent and received by my LoRa gateway I got something like this for a node with devEUI 0101010101180009:

JOIN
14.01.2019 15:16:11 gateway/00800000a0002529/rx {“rxInfo”:{“mac”:“00800000a0002529”,“timestamp”:2146307260,“frequency”:869100000,“channel”:1,“rfChain”:0,“crcStatus”:1,“codeRate”:“4/5”,“rssi”:-55,“loRaSNR”:9,“size”:23,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“board”:0,“antenna”:0},“phyPayload”:“AAEBAQEBAQEBCQAYAQEBAQEoqmki/UU=”}
14.01.2019 15:16:12 gateway/00800000a0002529/tx {“token”:55006,“txInfo”:{“mac”:“00800000a0002529”,“immediately”:false,“timestamp”:2151307260,“frequency”:869100000,“power”:14,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“codeRate”:“4/5”,“iPol”:true,“board”:0,“antenna”:0},“phyPayload”:“IGpbtmajszwQXLfAmbSCDDk=”}
14.01.2019 15:16:12 gateway/00800000a0002529/ack {“mac”:“00800000a0002529”,“token”:55006}

DATA
14.01.2019 15:18:42 gateway/00800000a0002529/rx {“rxInfo”:{“mac”:“00800000a0002529”,“timestamp”:2296473316,“frequency”:864900000,“channel”:6,“rfChain”:1,“crcStatus”:1,“codeRate”:“4/5”,“rssi”:-107,“loRaSNR”:-11.2,“size”:29,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“board”:0,“antenna”:0},“phyPayload”:“gMUkkACAAQACstvRiimLSg7tBRtLQwSxCtQIGW4=”}
14.01.2019 15:18:42 gateway/00800000a0002529/rx {“rxInfo”:{“mac”:“00800000a0002529”,“timestamp”:2296473324,“frequency”:868900000,“channel”:0,“rfChain”:0,“crcStatus”:1,“codeRate”:“4/5”,“rssi”:-30,“loRaSNR”:11,“size”:29,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“board”:0,“antenna”:0},“phyPayload”:“gMUkkACAAQACstvRiimLSg7tBRtLQwSxCtQIGW4=”}
14.01.2019 15:18:42 application/13/device/0101010101180009/join {“applicationID”:“13”,“applicationName”:“default”,“deviceName”:“InfraredCamera”,“devEUI”:“0101010101180009”,“devAddr”:“009024c5”}
14.01.2019 15:18:42 application/13/device/0101010101180009/rx {“applicationID”:“13”,“applicationName”:“default”,“deviceName”:“InfraredCamera”,“devEUI”:“0101010101180009”,“rxInfo”:[{“gatewayID”:“00800000a0002529”,“name”:“Multitech”,“rssi”:-107,“loRaSNR”:-11.2,“location”:{“latitude”:45.5920744,“longitude”:9.351876299999999,“altitude”:0}}],“txInfo”:{“frequency”:864900000,“dr”:0},“adr”:true,“fCnt”:1,“fPort”:2,“data”:“AAAAAAAAAP4+CQ0FA6sAAA==”,“object”:{“dataHex”:“00000000000000fe3e090d0503ab0000”,“message”:“frame unknown”}}
14.01.2019 15:18:42 gateway/00800000a0002529/tx {“token”:49050,“txInfo”:{“mac”:“00800000a0002529”,“immediately”:false,“timestamp”:2297473316,“frequency”:864900000,“power”:14,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“codeRate”:“4/5”,“iPol”:true,“board”:0,“antenna”:0},“phyPayload”:“YMUkkACgAAC5WqOU”}
14.01.2019 15:18:42 gateway/00800000a0002529/ack {“mac”:“00800000a0002529”,“token”:49050}

14.01.2019 15:18:44 gateway/00800000a0002529/rx {“rxInfo”:{“mac”:“00800000a0002529”,“timestamp”:2298628372,“frequency”:864100000,“channel”:2,“rfChain”:1,“crcStatus”:1,“codeRate”:“4/5”,“rssi”:-97,“loRaSNR”:-10,“size”:12,“dataRate”:{“modulation”:“LORA”,“spreadFactor”:12,“bandwidth”:125},“board”:0,“antenna”:0},“phyPayload”:“YMUkkACgAAC5WqOU”}

I would be able to recreate the same flow of messages and being able to “build” the phyPayload in javascript. My goal is to simulate a large number of nodes in javascript and send the MQTT messages to the network server.

Do you thing this is a difficult task? I need to derive AppSKey, NwkSKey and then to use those to encrypt data, right?

Is this just for a stress test?

You have this application:


http://lorhammer.itk.fr/

I think it was already tested on loraserver and the creator was around here