Closed phanijsp closed 5 months ago
Hello, you get the error because you are trying to remove the frame header without removing the mac header beforehand. As you see in your first screenshot, the mac header is only peeked - not removed - so when you call RemoveHeader
ns-3 looks for the byte structure of a frame header but finds the bytes of the mac header instead. Try with something like:
Ptr<Packet> secondPacketCopy = packet->Copy();
LorawanMacHeader tmpMacHdr;
secondPacketCopy->RemoveHeader(tmpMacHdr);
LoraFrameHeader frameHdr;
frameHdr.SetAsUplink();
secondPacketCopy->RemoveHeader(frameHdr);
Here I'm making another copy of the Packet to avoid modifying it if you want to preserve the original one which goes into the packet tracker.
Thank you, that worked.
Trying to get address of ED in gateway-lorawan-mac.cc when GW receives an uplink message. Below screenshot shows the changes I have made to the GW mac.
I have captured the below log before the deserialize method of LoraFrameHeader throws errors and gets stuck in a loop. Please note that there is only 1 ED and 1 GW in this simulation. So the packet being serialized and deserialized in the log are the same.
Screenshot of the error:
Specifications