Udp source error "packet receive errors"

classic Classic list List threaded Threaded
5 messages Options
Vnd
Reply | Threaded
Open this post in threaded view
|

Udp source error "packet receive errors"

Vnd
Hi,

I am running pipeline with UDP multicast as input.
Some times I see random jump in input PCR. PCR is increasing and decreasing many times within few minutes. Due to this mpegtsdemux is resetting PCR calculation.

When I tried to look into network statistics using linux command "netstat  -su", UDP "packet receive error" is seen and error count is continuously increasing. As soon as this error count stops increasing ,PCR continuity also disappear.


[root@localhost ~] netstat -us
...
Udp:
    365585839 packets received
    64003 packets to unknown port received.
    1626505 packet receive errors
    393047 packets sent
    0 receive buffer errors
    0 send buffer errors
...

From netstat it is confirm that received input is not proper. What I understood from the forum and Linux manual is  "packet receive errors" can happen due to 2 reasons.
1. Application (pipeline) not able to consume data.
2. Corrupted data received. Checksum is not matching.

Many forums suggested to increase buffer size. I tuned buffer size using buffer-size property of udpsrc. Still this issue exist.

Am I missing any configuration in Linux kernel setting or in gst pipeline ??
Are packets dropped due to corruption. How to differentiate between corrupted input and buffer overflow ??

~ Vinod
Reply | Threaded
Open this post in threaded view
|

Re: Udp source error "packet receive errors"

Arjen Veenhuizen
What is the bitrate of your stream? For high bitrates, it could be a network stack buffer overflow. You can increase the UDP buffers using:
sysctl -w net.core.rmem_max=<value>
sysctl -w net.core.rmem_default=<value>
sysctl -w net.core.wmem_max=<value>
sysctl -w net.core.wmem_default=<value>

value would be in bytes. Normally a couple of megabytes should be sufficient.
Vnd
Reply | Threaded
Open this post in threaded view
|

Re: Udp source error "packet receive errors"

Vnd
Hello Arjen Veenhuizen,
Thanks for the reply.

I assumed that buffer-size of udpsrc plugin sets network stack size.

udpsrc  plugin calls g_socket_set_option() to set socket buffer size. Which sets rmem_max value.
This is what I understood from these link

http://man7.org/linux/man-pages/man7/socket.7.html
https://developer.gnome.org/gio/stable/GSocket.html#g-socket-set-option
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-udpsrc.html

Is my understanding is correct ??  Please correct me if I am wrong.

Yeah In many forums I found same solution what you sugested. Anyway I have set this let me observe the output.

~ Vinod
Vnd
Reply | Threaded
Open this post in threaded view
|

Re: Udp source error "packet receive errors"

Vnd
Hi,

If buffer-size > net.core.rmem_max then buffer-size is capped to rmem_max. I verified this in udpsrc code. This means we cant set buffer-size > rmem_max  

Thanks all.

~ Vinod

Reply | Threaded
Open this post in threaded view
|

Re: Udp source error "packet receive errors"

Jameswalter
In reply to this post by Vnd

When encountering the "packet receive errors" related to UDP (User Datagram Protocol) in a network application or system, it typically indicates issues with receiving UDP packets. Here are some common causes and troubleshooting steps to address this error:

Network connectivity issues: Check the network connectivity between the source and destination systems. Ensure that the network connection is stable and there are no issues such as high latency, packet loss, or network congestion. Troubleshoot any network-related problems and address them accordingly.

Firewall or security settings: Verify if there are any firewall rules or security settings that may be blocking UDP packets. Check the firewall configuration on the source and destination systems, as well as any intermediate network devices such as routers or switches. Ensure that UDP traffic is allowed and not blocked by any security measures.

Port availability: Ensure that the UDP port being used by the application or service is available and not being used by any other process. UDP uses port numbers to identify different services or applications. If the specified UDP port is already in use by another process, it can cause packet receive errors. Choose a different, unused port if necessary.

Software or application issues: Check the software or application that is handling the UDP packets. Look for any potential bugs, known issues, or misconfigurations that could be causing packet receive errors. Consult the documentation or support resources for the specific software or application to troubleshoot and resolve any issues.

Check network hardware: Examine the network hardware, such as network interface cards (NICs) or switches, for any hardware-related problems. Faulty or malfunctioning network hardware can lead to packet receive errors. Ensure that the hardware is functioning properly and consider updating drivers or firmware if available.

Monitor network traffic: Use network monitoring tools to capture and analyze network traffic related to the UDP packets. This can help identify any patterns, anomalies, or specific packets that are causing errors. Analyze the captured data to determine if there are any issues with the UDP packets, such as incorrect formatting or unusual behavior.

Update software and drivers: Ensure that the software, drivers, and operating system on both the source and destination systems are up to date. Outdated software or drivers can have compatibility issues and may not handle UDP packets correctly. Update them to the latest versions available.

Consult vendor or support resources: If the above steps do not resolve the issue, it is recommended to consult the vendor or support resources for the specific software, application, or network equipment involved. They can provide further guidance, troubleshooting steps, or potential patches or updates to address the packet receive errors.