UDP Sink: 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...")
 
(→‎Source Files: Update urls to use "main")
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
This block provides basic UDP data transmission capabilities with a few additional features for processing in custom receiving applications. A header can be added in various formats for tracking.  For instance all headers also provide a sequence number that can be used to identify gaps in packets.
[[Category:Stub Docs]]
 
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 that payload size impacts the overall size of a single UDP packet. 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.
 
NOTES:<br>
* This block does support connecting to IPv6 addresses. If an IPv6 address is detected as the destination IP address, the block will automatically adjust for proper connection. Just make sure your IPv6 stack is enabled.
* 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>


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
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 ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
<code>For the version with 4 params depreciated in 3.9, see [https://wiki.gnuradio.org/index.php?title=UDP_Sink&oldid=8002 this page]</code>
 
; Address
: IP address; default: 127.0.0.1 (localhost)
 
; Destination Port
: default: 2000
 
; Header
: options: [None, 64-bit Sequence Number, Sequence + 16-bit data size, CHDR
:        (64-bit)]


; Param 1 (''R'')
; UDP Packet Data Size
: 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).
: default: 1472


; Param 2
; Send Null Packet as EOF
: blah blah blah
: options: [No, Yes]
 
; Vec Length
: 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_sink.grc]
 
[[File:Test_udp_sink_fg.png]]


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


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


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-network/lib/udp_sink_impl.h]


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


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

Latest revision as of 14:51, 22 February 2023

This block provides basic UDP data transmission capabilities with a few additional features for processing in custom receiving applications. A header can be added in various formats for tracking. For instance all headers also provide a sequence number that can be used to identify gaps in packets.

Note that payload size impacts the overall size of a single UDP packet. 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.

NOTES:

  • This block does support connecting to IPv6 addresses. If an IPv6 address is detected as the destination IP address, the block will automatically adjust for proper connection. Just make sure your IPv6 stack is enabled.
  • 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

Address
IP address; default: 127.0.0.1 (localhost)
Destination Port
default: 2000
Header
options: [None, 64-bit Sequence Number, Sequence + 16-bit data size, CHDR
(64-bit)]
UDP Packet Data Size
default: 1472
Send Null Packet as EOF
options: [No, Yes]
Vec Length
vector length; default: 1

Example Flowgraph

This flowgraph can be found at [1]

Test udp sink fg.png

Source Files

C++ files
[2]
Header files
[3]
Public header files
[4]
Block definition
[5]