# UDP/TCP stream data block formats

**URL:** <https://www.ruby-forum.com/t/udp-tcp-stream-data-block-formats/221075>\
**Category:** GNU Radio\
**Created:** [June 29, 2012, 1:35pm UTC](https://www.ruby-forum.com/t/udp-tcp-stream-data-block-formats/221075 "2012-06-29T13:35:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 29, 2012, 1:35pm UTC](https://www.ruby-forum.com/t/udp-tcp-stream-data-block-formats/221075/1 "2012-06-29T13:35:03Z")

</div>

Hello,

I want to stream data from an external sampler to Gnuradio over UDP or  
TCP.

I am wondering about the data formats. As far as I was able to see with  
Wireshark, for example float is 4 bytes IEEE format, but how is I and Q  
arranged? Integer is 32bit wide, but again, how is it with I and Q.

Any hint to a document would be great!

Thanks a lot

Gnter (dl4mea)

---

<div class="post-metadata">

**Author:** ![guenter\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@guenter\_k](https://www.ruby-forum.com/u/guenter_k)\
**Post date:** [June 29, 2012, 2:31pm UTC](https://www.ruby-forum.com/t/udp-tcp-stream-data-block-formats/221075/2 "2012-06-29T14:31:09Z")

</div>

On Fri, Jun 29, 2012 at 12:33:47PM +0100, Guenter K. wrote:

> I am wondering about the data formats. As far as I was able to see with  
> Wireshark, for example float is 4 bytes IEEE format, but how is I and Q  
> arranged? Integer is 32bit wide, but again, how is it with I and Q.
> 
> Any hint to a document would be great!

gr\_udp\_{source/sink}.cc is probably a good place to start looking.

Note that the UDP blocks are agnostic of the data type (like most GNU  
Radio stream handling blocks) and read the data as strings.  
So if you transmit a gr\_complex, think of it as a string of 8 bytes  
length.  
If endianness is something you’re worried about, that might actually be  
a problem if your hosts have different endianness.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association
