Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Logging synchronization between two laptops with Intel 5300 cards #101

Closed
cathycy opened this issue Sep 15, 2015 · 7 comments
Closed

Logging synchronization between two laptops with Intel 5300 cards #101

cathycy opened this issue Sep 15, 2015 · 7 comments

Comments

@cathycy
Copy link

cathycy commented Sep 15, 2015

Hi,
I have two laptops configured with the Intel 5300 cards and csitool, and one of them is in AP mode(configured using hostapd). The client laptop connects to the host laptop. I have both of them logging the CSI values. The client laptop then pings the host laptop, and the pings are answered. The csi is then recorded.

What I think happens is that, the client laptop sends a ping, the host laptop receives it, and answers that ping, which is then received by the client laptop. The CSI is logged for these receptions at both laptops. This means I should have an equal number of CSI readings at both laptops, and the data should be synchronized except for a small delay in the packet being sent back.

However, from my observations during experiments, the number of samples logged by the client is very different from the number of samples logged by the host laptop. Also, the samples don't seem to be synchronized. Any suggestions on what I can do to get synchronization between the laptops? Any other suggestions are welcome too!

Thank you!

@dpward
Copy link
Collaborator

dpward commented Sep 26, 2015

In addition to the ICMP (ping) packets that you are sending, you need to consider the control traffic that is sent on the network as well (ARP/Neighbor Discovery, Zeroconf/mDNS, etc.) which can also result in CSI. Also depending on the link conditions, 802.11 retransmissions may occur and you may wind up with samples for each transmission attempt (if an ACK is not received, for example). It's best to examine a packet capture on both sides to make sure you understand the traffic profile (ideally creating another interface in monitor mode and capturing on it with Wireshark, so you can see traffic at the link layer).

@cathycy
Copy link
Author

cathycy commented Oct 5, 2015

Thank you for the reply. Since I cannot control the link conditions, is there a better way to do this experiment instead of having AP and client mode on the two laptops? Or do you think I can achieve the required experiment setting only by creating another interface in monitor mode and logging the traffic? I am asking this because I don't have another interface for monitor mode right now and want to know if there is a possibility by using just the current setup.

@dhalperi
Copy link
Owner

dhalperi commented Oct 5, 2015

The way I did this is by putting a sequence number in the payload of the packets, and using that sequence number to synchronize logs.

@dhalperi dhalperi closed this as completed Oct 5, 2015
@cathycy
Copy link
Author

cathycy commented Oct 7, 2015

Hi,

Sorry to trouble you again, but I have a few questions since I am new to this:

  1. There is a sequence number for the packets, ICMP seq, which is displayed in the terminal when I ping. Can this sequence number be used for the synchronization purpose, or would I have to put in another sequence number in the payload?
  2. I read FAQ 12, which says that by enabling IWL_CONN_RX_MPDU_MSK , the IEEE 802.11 sequence number would be logged. I tried reading through the codes to understand where this information would show up, but I am not great at this, and couldn't understand how to extract this information. Could you please explain/ refer me to codes on how to get the sequence number for the packets?

Thank you!

@dhalperi
Copy link
Owner

dhalperi commented Oct 8, 2015

If you set that bit, then the file produced by log_to_file will include records with payloads in addition to the other records you are recording. You will then need to modify the processing code to handle them.

If you inspect this part of read_bf_file.m, you can see that we skip all records other that do not have code 0xbb, for beamforming measurements.

If you add a handler for the 0xc1 log entries, you will see the packet payloads.

Packet payload records are logged immediately following the CSI, which is how you can link CSI entries with individual payloads.

@dhalperi
Copy link
Owner

dhalperi commented Oct 8, 2015

See also David's comment here: #65 (comment)

@dpward: I thought that CSI preceded MPDU, but you indicate the reverse. I may be wrong – it's been more than 3 years since I ran the CSI tool ;).

@swashah
Copy link

swashah commented Nov 19, 2016

@cathycy : Were you able to synchronize two laptops, as I also want to do synchronization of CSI collected on 02 machines in monitor mode. I will appreciate your help

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

No branches or pull requests

4 participants