UDP Source: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...")
 
No edit summary
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
This block listens for traffic on the specified UDP port and outputs the specified data type.  Note that the header setting and payload size should match on both the sender and receiver.  For a normal network, a payload size of 1472 (1500-28 for UDP headers) represents the max size for a standard UDP packet.  For jumbo frames, 8972 can be used (9000-28).  Be careful adjusting this parameter as you could inadvertently cause unnecessary packet fragmentation and reconstruction.<br><br>
[[Category:Stub Docs]]
If you need the block to generate 0s (zeroes) when there is no UDP data, you can turn on the 'Src 0s If No Data' flag, however this is best paired with the [[UDP_Sink]] blockIf using a separate application, problems can arise if the sending application is not calling its send function with blocks matching payload size (the logic here can get a 'partial' packet after starting and not continue to produce zeros).<br><br>
This is the template for the [[:Category:Block_Docs|"Page-per-block Docs"]].  This first section should describe what the block does and how to use it, using however many paragraphs necessary. Note that the title of the wiki page should match the block's name in GRC, i.e. the one defined in the block's .grc file. Look at the [[FFT]] Block for a good example.
NOTE:<br>
For best performance and to ensure UDP packets are not dropped, add the following lines to your <code>/etc/sysctl.conf</code> and reboot (the reboot is required).<br>
<pre>
net.core.rmem_default=26214400
net.core.rmem_max=104857600
net.core.wmem_default=65536
net.core.wmem_max=104857600
</pre>
IT IS HIGHLY RECOMMENDED that the example test_udp_source/sink flowgraphs be tested with the sequence number header enabled (the default in those flowgraphs) as a validation that no network or IP stack bottlenecks may cause dropped packets at the rates planned in your environment before using in production, especially if headers will not be used in your environment to track dropped packets.
 
== Parameters ==
<code>For the version with 4 params depreciated in 3.9, see [https://wiki.gnuradio.org/index.php?title=UDP_Source&oldid=8001 this page]</code>
 
; Port
: Port number; default: 1234
 
; Header
: options: [None, 64-bit Sequence Number, Sequence + 16-bit data size, ATA Header]
 
; UDP Packet Data Size
: default: 1472


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
; Notify Missed Frames
: options: [No, Yes]


== Parameters ==
; Src 0s If No Data
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
: options: [No, Yes]


; Param 1 (''R'')
; Enable IPv6 Support
: Description of parameter, provide any tips or recommended values.  Note that the name of the parameter above should match the param's label that shows up in grc (e.g. Sample Rate).
: options: [No, Yes]


; Param 2
; Vec Length
: blah blah blah
: vector length; default: 1


== Example Flowgraph ==
== Example Flowgraph ==


Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.
This flowgraph can be found at [https://github.com/gnuradio/gnuradio/blob/master/gr-network/examples/test_udp_source.grc]
 
[[File:Test_udp_source_fg.png]]


== Source Files ==
== Source Files ==


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-network/lib/udp_source_impl.cc 1]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-network/lib/udp_source_impl.h 2]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-network/include/gnuradio/network/udp_source.h 3]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-network/grc/network_udp_source.block.yml 4]
 
[[Category:Block Docs]]

Latest revision as of 17:51, 11 February 2021

This block listens for traffic on the specified UDP port and outputs the specified data type. Note that the header setting and payload size should match on both the sender and receiver. For a normal network, a payload size of 1472 (1500-28 for UDP headers) represents the max size for a standard UDP packet. For jumbo frames, 8972 can be used (9000-28). Be careful adjusting this parameter as you could inadvertently cause unnecessary packet fragmentation and reconstruction.

If you need the block to generate 0s (zeroes) when there is no UDP data, you can turn on the 'Src 0s If No Data' flag, however this is best paired with the UDP_Sink block. If using a separate application, problems can arise if the sending application is not calling its send function with blocks matching payload size (the logic here can get a 'partial' packet after starting and not continue to produce zeros).

NOTE:
For best performance and to ensure UDP packets are not dropped, add the following lines to your /etc/sysctl.conf and reboot (the reboot is required).

net.core.rmem_default=26214400
net.core.rmem_max=104857600
net.core.wmem_default=65536
net.core.wmem_max=104857600

IT IS HIGHLY RECOMMENDED that the example test_udp_source/sink flowgraphs be tested with the sequence number header enabled (the default in those flowgraphs) as a validation that no network or IP stack bottlenecks may cause dropped packets at the rates planned in your environment before using in production, especially if headers will not be used in your environment to track dropped packets.

Parameters

For the version with 4 params depreciated in 3.9, see this page

Port
Port number; default: 1234
Header
options: [None, 64-bit Sequence Number, Sequence + 16-bit data size, ATA Header]
UDP Packet Data Size
default: 1472
Notify Missed Frames
options: [No, Yes]
Src 0s If No Data
options: [No, Yes]
Enable IPv6 Support
options: [No, Yes]
Vec Length
vector length; default: 1

Example Flowgraph

This flowgraph can be found at [1]

Test udp source fg.png

Source Files

C++ files
1
Header files
2
Public header files
3
Block definition
4