# Packet sequence numbers

**URL:** <https://www.ruby-forum.com/t/packet-sequence-numbers/232970>\
**Category:** GNU Radio\
**Created:** [November 7, 2014, 8:16pm UTC](https://www.ruby-forum.com/t/packet-sequence-numbers/232970 "2014-11-07T20:16:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 7, 2014, 8:16pm UTC](https://www.ruby-forum.com/t/packet-sequence-numbers/232970/1 "2014-11-07T20:16:07Z")

</div>

I’m using a vector-insert block to add a fixed-size header to a  
stream of interleaved short samples at a fixed interval, and  
then running it though

stream-to-tagged-stream =\> tagged-stream-to-PDU =\> Socket-PDU

to wrap it up in a UDP packet and send it out the network.  
The header consists of 28 shorts, and the data of 512 shorts  
(actually 256 complex short samples), to yield a UDP packet  
payload of 540 shorts (1080 bytes).

This works fine for the fixed fields in the header, but two  
of them are variable: Sequence-number and timestamp.

Is there any convenient way from within GRC to insert an  
incrementing number into one of the shorts in the header?  
I know it can be done by writing a custom block, but is there  
any way to use existing blocks from within GRC?

And what about the timestamp? Any easy way _within GRC_ to  
use and track the timetag from the USRP and the sample number  
to gen up a timestamp value for the header?

@(^.^)@ Ed
