Viewing timestamps using USRP2

I am trying to use wireshark to extract the timestamp from the received
ethernet packets to test my sync_every_pps() function is working. I have
located the word I need to extract from the received data but how can I
automatically extract this and display it as an integer in the display
window in wireshark?

Alternatively, is there a better way to view the timestamp information
to
check for a reset?

View this message in context:
http://old.nabble.com/Viewing-timestamps-using-USRP2-tp27435137p27435137.html
Sent from the GnuRadio mailing list archive at Nabble.com.

MarcW wrote:

I am trying to use wireshark to extract the timestamp from the received
ethernet packets to test my sync_every_pps() function is working. I have
located the word I need to extract from the received data but how can I
automatically extract this and display it as an integer in the display
window in wireshark?

Alternatively, is there a better way to view the timestamp information to
check for a reset?

You can either write a custom wireshark plugin to parse the packets (in
which case you’ll want to consult with a better source of information on
wireshark - perhaps their mailing list), simply monitor the word
yourself, or you could write a c++ application that talks to libusrp2
directly and prints out the timestamp. I did at one point modify the
rx_streaming_samples application that is packaged with gnuradio to do
just that. But I’ve also used wireshark and simply watched for the reset
manually.
Doug


Douglas G.
Code 5545
U.S. Naval Research Laboratory
Washington, DC 20375
(202) 767-9048
[email protected]

Thanks for your help Doug. I thought I knew which bits to monitor which
contained the timestamp but now im not sure! The packets received seem
very
large. I have included a screenprint of one below. Please could you tell
me
which bits are the timestamp in this packet?
The data appears to start from line 0020 but every other 32 bits are
either
ff or 00.
Do we add the sync_every_pps() to txrc.c immediately before the while
loop?

0000 00 15 17 d2 56 23 00 50 c2 85 33 f7 be ef 00 00 …V#.P
…3…
0010 00 00 6c 00 00 00 00 00 cd a6 fe 10 00 06 00 0c …l…

0020 ff f0 ff f2 ff f1 00 33 00 36 00 13 00 20 00 31 …3 .6…
.1
0030 00 15 00 17 00 00 ff ff 00 11 ff f1 00 12 00 0f …

0040 00 09 00 03 ff fa ff e7 00 00 ff fb ff f9 00 09 …

0050 ff e7 00 04 ff df ff e9 ff df 00 23 00 0d 00 09 …
…#…
0060 ff e7 ff c5 ff e2 00 2f 00 09 00 29 ff ec ff e1 …/
…)…
0070 ff da ff ff ff fc 00 05 00 09 ff e3 ff e0 ff e3 …

0080 ff e4 ff ed ff ec ff fe ff fe ff cc ff ee ff da …

0090 ff bc ff d1 ff db ff ee ff ec ff fb ff f5 ff e7 …

00a0 00 0b 00 0f ff e5 00 00 ff f9 00 15 ff fb 00 09 …

00b0 00 13 00 0c 00 10 00 3f 00 11 00 32 00 0b ff f6 …?
…2…
00c0 ff f6 00 03 00 37 00 14 00 3f ff e8 ff f8 ff fb …7…
.?..
00d0 00 0a ff e5 00 03 ff e9 00 07 ff e9 ff f5 00 08 …

00e0 00 27 00 00 00 0c ff f0 ff ef 00 1f 00 13 ff ee .‘…

00f0 ff eb ff f0 ff f3 00 04 00 11 ff de ff e6 00 05 …

0100 ff e6 ff ef 00 0c 00 0c ff e2 00 02 ff e2 00 19 …

0110 ff f5 00 37 ff fe 00 21 00 17 ff f7 00 18 00 09 …7…!

0120 00 03 ff e5 ff e4 ff fb 00 1e ff f7 00 04 ff de …

0130 ff db 00 00 ff f8 ff db ff ca ff bd ff f0 ff bb …

0140 ff fc ff e5 ff fd ff fe ff f7 ff e3 ff da ff ef …

0150 00 18 00 11 00 25 ff ff 00 2b ff ee ff fc 00 23 …%…
.+…#
0160 ff ef 00 08 ff dc ff bf 00 0d 00 00 00 17 00 20 …

0170 ff f1 00 09 00 06 ff fb 00 07 00 0e 00 09 ff fe …

0180 00 21 00 1a ff fa 00 39 ff e2 00 0a 00 31 ff f4 .!..9
…1…
0190 00 19 00 1c 00 06 00 0a ff bd ff b6 00 09 00 0b …

01a0 00 18 00 05 ff cc 00 13 ff fd ff dc ff f6 ff ed …

01b0 00 18 00 23 00 00 ff ea ff fe 00 0c 00 0d ff e7 …#…

01c0 00 27 ff de 00 0c 00 03 00 17 00 2f 00 1b 00 31 .’…
…/…1
01d0 00 27 00 1e ff e5 00 26 ff d1 ff ee 00 02 00 01 .‘…&

01e0 ff ee ff f7 ff e7 ff d3 ff c4 ff ce ff ef ff d3 …

01f0 ff f5 ff e5 ff bc ff d4 ff ec ff cf ff d6 00 28 …
…(
0200 ff f9 00 12 ff fd 00 03 ff db 00 14 ff f2 ff d5 …

0210 ff cf ff bf ff da ff d4 ff e3 00 1a ff e1 00 0d …

0220 00 10 00 00 00 0e 00 10 ff f7 00 11 00 08 00 31 …
…1
0230 ff fe 00 08 00 06 ff ed ff ff ff d7 ff f3 ff fc …

0240 ff d2 00 0e ff d7 ff fe 00 0f 00 1c 00 30 00 26 …
…0.&
0250 ff fe 00 1b 00 1e 00 14 00 01 00 0d 00 03 00 29 …
…)
0260 00 0b ff f5 00 07 ff f4 00 0a ff ed 00 00 00 0a …

0270 00 16 00 2e ff eb ff f0 00 03 00 12 00 23 ff ff …
…#…
0280 00 16 00 14 00 05 00 06 ff f6 ff eb ff f2 ff c8 …

0290 00 10 00 00 00 19 ff f0 00 2a 00 18 ff e0 ff ff …
.
02a0 ff f8 ff d6 ff f8 ff ef ff e2 00 0e 00 10 00 0c …

02b0 00 34 00 27 00 28 00 25 ff f4 ff f0 00 05 ff df .4.'.(.%

02c0 00 18 ff ed ff ef 00 19 00 0d ff e2 00 1c 00 00 …

02d0 00 00 ff f9 00 17 ff f4 00 10 00 11 00 0a 00 3d …
…=
02e0 00 2e 00 13 00 1b 00 0e 00 20 00 03 ff d8 ff db … .

02f0 ff f8 ff d5 ff c1 ff e8 ff dd ff e5 ff eb 00 2a …

0300 ff c4 ff d7 00 0a ff d9 ff fd 00 0c ff f2 00 05 …

0310 ff dc ff ee 00 00 00 1f 00 1b 00 25 ff fe ff f2 …
…%…
0320 00 03 ff e2 00 0b 00 27 00 1a 00 0c ff fa ff f7 …’

0330 ff fb 00 13 00 1e 00 0d ff e1 00 00 00 0c ff f5 …

0340 00 53 00 18 00 3b ff c2 ff f9 ff de 00 0a 00 29 .S…;…
…)
0350 00 03 00 0c 00 09 00 23 ff e8 00 21 00 04 00 18 …#
…!..
0360 ff fc ff ed ff f0 ff bf ff dd ff ef ff fc ff b4 …

0370 ff f3 ff bc ff c9 ff f7 ff c8 ff ea ff fc ff ef …

0380 00 2d 00 28 ff fa 00 2d 00 09 00 00 ff f5 00 04 .-.(…-

0390 ff ec 00 02 00 05 ff f3 ff fa ff fb ff d6 ff d9 …

03a0 00 18 00 1d 00 18 00 3d 00 00 00 22 ff fd 00 0e …=
…“…
03b0 ff ff ff f9 00 23 00 20 ff f6 ff f5 ff f6 ff f9 …#.

03c0 ff fd ff e5 ff f5 ff e4 00 07 ff dd ff fc 00 0f …

03d0 ff e8 ff ec ff be ff e7 00 0a 00 0f 00 01 00 18 …

03e0 ff e6 ff ff 00 05 ff e7 00 0a ff d3 00 0c 00 20 …

03f0 ff fa 00 17 ff f0 00 0d ff fa 00 0a ff f7 00 0d …

0400 ff f8 00 2c 00 09 00 08 00 03 ff dd 00 25 00 15 …,…
…%…
0410 00 17 00 13 ff e4 00 0c 00 08 ff f3 00 09 ff eb …

0420 00 03 00 08 00 11 00 07 ff e0 ff e2 ff ce 00 23 …
…#
0430 ff f4 ff ea ff d2 00 04 ff fd 00 0b 00 20 00 20 … …
.
0440 00 07 00 15 00 24 00 2a ff f4 00 18 00 19 00 0e …$.*

0450 00 15 ff de ff ef ff f6 00 06 00 04 00 09 ff d0 …

0460 00 0f ff e1 ff cf ff f6 00 2c 00 13 ff f3 00 03 …
.,…
0470 ff d3 00 0f ff ff 00 20 ff e0 ff d9 00 03 00 08 …

0480 ff c7 ff d1 ff da ff b6 ff e5 00 04 00 0e ff f6 …

0490 00 09 00 03 00 15 00 1c ff db 00 0f ff ee 00 1d …

04a0 ff ec ff ff ff c5 ff c0 00 08 00 00 00 14 ff c5 …

04b0 ff ce ff ed 00 09 00 0d 00 06 00 16 ff f8 ff ef …

04c0 ff c8 ff e2 ff da ff c3 ff e3 ff e0 ff f2 ff f1 …

04d0 ff fb 00 0a 00 1e 00 52 ff f7 ff de 00 26 00 07 …R
…&…
04e0 ff fd ff db 00 12 ff e7 ff e7 00 03 00 1e ff e4 …

04f0 ff e9 ff d5 ff fd 00 07 00 06 00 1c 00 1b 00 0c …

0500 00 0d ff f5 00 09 00 0f ff f4 ff f2 ff ec ff de …

0510 00 08 ff ff 00 27 00 0a 00 22 00 2f 00 1d 00 31 …'…
.”./…1
0520 00 41 00 2a 00 01 00 34 ff f3 00 31 00 16 00 0d .A.*…4
…1…
0530 ff eb ff ef 00 11 ff d2 00 03 ff f2 00 10 ff df …

0540 ff ff 00 26 ff df ff e6 ff d9 ff fc 00 05 00 1b …&…

0550 00 04 ff e4 ff e4 ff d2 00 0e 00 09 00 29 ff ff …
…)…
0560 00 08 ff fc ff e2 ff e6 00 22 00 01 ff f9 00 14 …
."…
0570 00 11 00 0a ff fe 00 02 ff fa ff f9 00 10 00 19 …

0580 ff f4 ff da 00 17 ff fb ff f3 ff b5 ff d4 ff b9 …

0590 ff d6 ff e4 ff e5 ff e9 ff eb ff dd ff e7 ff de …

05a0 ff e7 ff c9 ff be 00 02 ff ef 00 03 00 27 00 19 …
…'…
05b0 00 20 ff f1 ff f4 ff e0 ff fe 00 11 00 13 00 02 . …

05c0 ff f8 00 1c ff bf 00 01 ff ed 00 02 00 25 00 0f …
…%…
05d0 00 2e 00 1b 00 33 ff e3 00 11 …3… …

Doug G. wrote:


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Viewing-timestamps-using-USRP2-tp27435137p27436785.html
Sent from the GnuRadio mailing list archive at Nabble.com.

MarcW wrote:

Thanks for your help Doug. I thought I knew which bits to monitor which
contained the timestamp but now im not sure! The packets received seem very
large. I have included a screenprint of one below. Please could you tell me
which bits are the timestamp in this packet?
The data appears to start from line 0020 but every other 32 bits are either
ff or 00.
Do we add the sync_every_pps() to txrc.c immediately before the while loop?

Which version of gnuradio are you running? If you’re using the
usrp2-vrt git branch, the frame format has changed dramatically. If
you’re using the released code (or the master branch from git) the frame
structure is (IIRC) defined in
usrp2/firmware/include/usrp2_eth_packet.h. There’s the standard ethernet
header (dst, src, ethertype), a short ‘transport’ header (some flags,
sequence number, etc.), and the ‘fixed’ header which has some more
flags, and the 32-bit timestamp. The VRT format has a much longer
header, and includes a seconds count and a fractional seconds count.
You don’t need to call sync_every_pps() in the firmware (do you really
want to reset the clock every PPS?). The host can send the command to
sync_*_pps() when setting up the connection to the USRP2. For example,
in rx_streaming_samples, call u2->sync_to_pps() (or sync_every_pps() if
you really want that) before calling u2->start_rx_streaming. Then you
can have the copy handler print out the timestamp from each frame
received by the USRP2. In the VRT branch I believe there is already an
example application that prints out the timestamp from received frames.
Doug


Douglas G.
Code 5545
U.S. Naval Research Laboratory
Washington, DC 20375
(202) 767-9048
[email protected]