Packet Communications

From GNU Radio
Revision as of 10:51, 9 October 2021 by Duggabe (talk | contribs) (Simulating Baseband Packet Processing)
Jump to: navigation, search

DRAFT (A Work in Progress)

This tutorial presents methods to transmit and receive packet data using burst transmissions. The data can originate from a message source or a stream source. A hardware implementation is shown using BPSK modulation.


Simulating Baseband Packet Processing

In order to grasp the basics of packet processing, this section presents a transmitter and receiver without any modulation or channel impairments.

Building the flowgraph

Build the following flowgraph using the details given below:

Pkt 7 base fg.png

This flowgraph can be downloaded from Media:Pkt_7_base.grc.

Message Strobe

For the Message Strobe to generate a PDU, the Message PMT must be of the form


This specific vector has a length of 9 and the character values of "GNU Radio".

Variable, Id: hdr_format

The Protocol Formatter uses a Format Object to define its parameters. The one used in this example is

 hdr_format digital.header_format_crc(len_key, num_key)

Protocol Formatter

The entry for the Format Obj. is 'hdr_format'

Protocol Parser

The entry for the Format Obj. is 'hdr_format'


This block is an Embedded Python Block which converts a PDU string into a PMT string. The code is contained in Pkt_7_base.grc


To test the flowgraph, click the "Execute the flowgraph" icon, or press F6. An example of the output is:

pdu length = 4 bytes
pdu vector contents = 
0000: 0d 10 00 3a 
pdu length = 13 bytes
pdu vector contents = 
0000: 47 4e 55 20 52 61 64 69 6f 8f aa 09 f1 

Tag Debug: 
Input Stream: 00
  Offset: 13  Source: n/a     Key: packet_len   Value: 13
  Offset: 13  Source: n/a     Key: packet_num   Value: 1
******* MESSAGE DEBUG PRINT ********
GNU Radio

The first PDU DEBUG PRINT is the header data containing the payload length, packet number, and a CRC16 of the header.

The second PDU DEBUG PRINT is the payload including a CRC32 of the data.

The Tag Debug shows the length tag and the packet number tag.

The MESSAGE DEBUG PRINT shows the payload data as a string.

Using BPSK and Hardware

Transmitting a Signal

Receiving a Signal