Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not read entire length of packets #32

Open
nabeelni opened this issue Sep 15, 2022 · 8 comments
Open

does not read entire length of packets #32

nabeelni opened this issue Sep 15, 2022 · 8 comments

Comments

@nabeelni
Copy link

doesnt read entire length of packets of file on broadcom asus router

@nabeelni
Copy link
Author

if i have 1000 frames lets say it doesnt return all the frames captured from asus router e.g at 40 MHz

@Gi-z
Copy link
Owner

Gi-z commented Oct 18, 2022

CSIKit performs grouping to generate CSI matrices with dimensions of (nRx, nTx, nSub) (Rx=Receiving antennas, Tx=Transmit antennas, Sub=Subcarriers).

For instance, if there are 1000 frames in a .pcap file collected from the ASUS RT-AC86U when operating in 4x4 MIMO mode, then each 16 sequential frames will be from a different Tx/Rx pairing. Those sequential frames contain the matrix from each antenna pairing but represent the CSI measurement for the same 802.11 frame. You can confirm this by inspecting the sequence number associated with each frame. Let me know if that matches up and explains your issue.

@Gi-z
Copy link
Owner

Gi-z commented Dec 3, 2022

Closing this due to inactivity. Feel free to reopen if you wish to continue. 👍

@Gi-z Gi-z closed this as completed Dec 3, 2022
@sarielkk
Copy link

sarielkk commented Dec 29, 2023

CSIKit performs grouping to generate CSI matrices with dimensions of (nRx, nTx, nSub) (Rx=Receiving antennas, Tx=Transmit antennas, Sub=Subcarriers).

For instance, if there are 1000 frames in a .pcap file collected from the ASUS RT-AC86U when operating in 4x4 MIMO mode, then each 16 sequential frames will be from a different Tx/Rx pairing. Those sequential frames contain the matrix from each antenna pairing but represent the CSI measurement for the same 802.11 frame. You can confirm this by inspecting the sequence number associated with each frame. Let me know if that matches up and explains your issue.

Hello! Thank you for your project. It helped me a lot.
I still don’t quite understand why frame count obtained by CSIKIT is different from the UDP number captured using nexmon, and it does not show regularity.

@Gi-z
Copy link
Owner

Gi-z commented Dec 30, 2023

Hello! Thank you for your project. It helped me a lot.

I still don’t quite understand why frame count obtained by CSIKIT is different from the UDP number captured using nexmon, and it does not show regularity.

Hi. So the PCAPs you get when using Nexmon contain UDP packets. So when you have a Raspberry Pi with CSI in a PCAP, 600 packets means 600 frames of CSI. This matches the frame count you would observe in the Nexmon MATLAB example.

However, when you use a device that has multiple antennas (like the ASUS router), CSIKit and the Nexmon MATLAB example behave differently. Each frame in the Nexmon PCAPs contains a marker to indicate which antenna received it. This means that multiple antennas can receive the same frame. As a result, one frame will show up as several frames in the Nexmon MATLAB example, with the total count being nRx * nTx * nFrames = frameCount. CSIKit automatically assembles this data into matrices, where a single frame will have a csi_matrix attribute containing an nRx * nTx-dimensional matrix. This means when you use the get_CSI function, you get a single matrix of dimensions (nRx * nTx * nFrames, nFrames = frameCount).

Hope this helps, let me know if that clears it up for you.

@sarielkk
Copy link

sarielkk commented Jan 11, 2024

Hello! Thank you for your project. It helped me a lot.
I still don’t quite understand why frame count obtained by CSIKIT is different from the UDP number captured using nexmon, and it does not show regularity.

Hi. So the PCAPs you get when using Nexmon contain UDP packets. So when you have a Raspberry Pi with CSI in a PCAP, 600 packets means 600 frames of CSI. This matches the frame count you would observe in the Nexmon MATLAB example.

However, when you use a device that has multiple antennas (like the ASUS router), CSIKit and the Nexmon MATLAB example behave differently. Each frame in the Nexmon PCAPs contains a marker to indicate which antenna received it. This means that multiple antennas can receive the same frame. As a result, one frame will show up as several frames in the Nexmon MATLAB example, with the total count being nRx * nTx * nFrames = frameCount. CSIKit automatically assembles this data into matrices, where a single frame will have a csi_matrix attribute containing an nRx * nTx-dimensional matrix. This means when you use the get_CSI function, you get a single matrix of dimensions (nRx * nTx * nFrames, nFrames = frameCount).

Hope this helps, let me know if that clears it up for you.

Thanks for your reply, I understand the problem.
I also found another problem when using CSIKIT. When I processed the data collected by the single-antenna transmitter (router) and the dual-antenna receiver (Nexus 6P), CSIKIT showed that my data was 1Rx, 2TX. When I processed the data collected by the dual-antenna transmitter (router) and the single-antenna receiver (Nexus 6P), CSIKIT shows that my data is 2Rx, 1Tx, but there is only one valid set of data when viewing the csv file. May I ask why this happens?
Finally, I attach the data file I collected using Nexus 6P.
c3n1.pcap is the configuration of Tx dual antenna, Rx single antenna;
c1n3.pcap is the configuration of Tx single antenna, Rx dual antenna.
c1n3.pcap.gz
c3n1.pcap.gz

@Gi-z Gi-z reopened this Feb 2, 2024
@Gi-z
Copy link
Owner

Gi-z commented Feb 2, 2024

Thanks for providing examples of both configurations, this is really helpful. I've got a Nexus 6P sitting here but the battery is absolutely fried.

Can you confirm the mapping of Tx/Rx is correct with these .pcap samples? c1n3 should contain data with 1 Tx/2 Rx, and c3n1 should contain data with 2 Tx/1 Rx. And so your issue is with the --csv option only outputting data from one antenna?

@sarielkk
Copy link

sarielkk commented Feb 6, 2024

Thanks for providing examples of both configurations, this is really helpful. I've got a Nexus 6P sitting here but the battery is absolutely fried.

Can you confirm the mapping of Tx/Rx is correct with these .pcap samples? c1n3 should contain data with 1 Tx/2 Rx, and c3n1 should contain data with 2 Tx/1 Rx. And so your issue is with the --csv option only outputting data from one antenna?

I can make sure the mapping of this data is correct, the data is collected by myself.
The fact is that c3n1.pcap is 2Tx/1Rx; c1n3.pcap is 1 Tx/2Rx.
My problem is that when I execute csikit c3n1.pcap, c3n1 displays 1 Tx/2Rx and c1n3 displays 2 Tx/1 Rx. The numbers of Tx and Rx are exactly the opposite of what they actually are.
I don't know if this has happened to others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants