Extending simulator to support .pcap tracing - #103
Conversation
|
This looks like a great start to implement pcap tracing, thank you for this contribution! I have a couple of questions:
|
|
Hello @DvdMgr.
As you can see I also added two small fixes. We already discussed the dimension of FCnt via email some time ago, but what do you think about the second one? The regional parameters document (RP002) says that the byte limitation as is defined in the code refers to the entirety of MACPayload field, so I moved the check after |
|
As for the change to the If you have some spare time to keep working on the .pcap implementation, I think the best way to proceed is to keep adding to this pull request (so that I and other can also follow progress and contribute) and merge it once we are satisfied with the overall result. As for the check on maximum packet size, nice find! I agree that it should take into account the FrameHeader too, since it's defined for the PHY payload. |
|
Hello, I implemented a new header with the necessary fields for .pcap traces to be displayed correctly and moved the small fixes to another pull. I filled the header using the info from Design remark: I would have liked to be able to detect from inside |
| // Send the packet to the MAC layer, if it exists | ||
| NS_ASSERT (m_mac != 0); | ||
| m_mac->Send (packet); | ||
| m_promiscSnifferTrace (packet); |
There was a problem hiding this comment.
We may think where we capture the packet. Maybe the MAC layer does not have duty cicle available (or whatever) and will not send this packet. We have to be the closest possible to the PHY layer (Lower-MAC probably) to capture the packet that effectively will go to the medium. See Discussion : #103
|
HI @non-det-alle !!
I think we have not so trivial design decisions to make. In order to impact the less possible amount of core-code. And feed the trace cleanly. In any case, thank you @non-det-alle. |
|
Hello @renzoe, I agree with you that the |
|
HI @non-det-alle ! Thanks for the reply. "Short" answer:
Yes, I managed, it was you that showed me the way. See how they do it a ns-3 WifiHelper: wifi-helper.cc In my dirty way, because I put it at MAC, I am asking for the MAC layer of the Net Device, and finally you have something like this ( Actually, having our own |
|
Hello, |
|
Dear All, Thanks |
|
Hey @non-det-alle, @renzoe - can you provide a quick summary of the current state of this pull request? The branch linked to this PR does not seem to compile, is there a more updated version somewhere that I can test? |
|
Hello @DvdMgr, It's been a bit since I have taken a look so I don't remember, I'll go over it in the weekend and get back to you so we can decide what to do with it. In the meantime, have you tried it with the latest ns-3-dev? The support for LoRa Pcap files was merged some months ago but may still not be in an official release. |
@asmanuha sorry, I completely lost your message. I'll check the implementation and get back to you. |
28cecb2 to
2b352bc
Compare
|
Hello @DvdMgr, Sorry for the long pause. I addressed your comment on SNR. |
|
I checked the malformed payload error for downlink frames sniffed by devices. After a bit of testing with LinkAdrReq frames, it seems that the Wireshark dissector expects 4 bytes of MIC at the end. You can test by adding |
|
Sorry to butt in, but I recently opened an issue (123) about the same MIC problem #123, which is giving rise to slightly incorrect Time-on-Air for packets so I am interested in seeing how this develops! |
|
|
Hello, As mentioned previously by @DvdMgr, I added bidirectional Pcap sniffing (before was only on reception). For packets captured on transmission I put 0 for SNR and RSSI in the respective mandatory Pcap fields, as the sender does not have this information (the LORA_TAP format was designed for sniffing on reception). Also I improved PcapExample to provide traces of a more interesting scenario. Here, a single device is sending uplinks to a single gateway, and ADR is enabled. With default parameters, for the first 4 frames the device is duty-cycle limited at SF12. Then, after receiving an ADR reconfiguration from the server to SF9, it resumes its 60 seconds periodicity. I added a second commit with a simple fix to malformed frames: a fake MIC is added at the end of packets before they are sent (both uplink and downlink). |
|
I am closing this branch due to lack of replies from maintainers. |
|
I agree with @maribu that we should move the work to #195, especially because the code is compatible with the current simulator version. However, I think we should carry over the insights from the discussion above to provide a complete implementation of .pcap tracing. For example, we learned that we are still missing an implementation for MIC trailer (the source of malformed warnings in Wireshark). Thus, before tackling .pcap tracing, we might want to try and merge #126. |
Ah, I see :) Another insight is to also capture outgoing frames. I'll add this now and afterwards I'll go through the discussion in detail. There are somethings added here that #195 is still missing (e.g. filling the SNR with actual values). I have a prototype locally that uses the interference helper to compute that, as there it is easy to take other transmissions as sources for noise into account. I believe this is a good place for that, but the implementation is not really there yet. |
.pcap tracing (Issue #87):
Other fixes:
EDIT: The two minor fixes moved to other pull request because unrelated