udpsrc does not work on 2 NIC & Port mirror linux setup

Peter Maersk-Moller pmaersk at gmail.com
Thu Jan 28 18:31:58 UTC 2021


Couple of questions to help you out. I assume you have two interfaces

1) What is the IP source address of the stream you are seeing with
Wireshark, but not receiving with udpsrc?
2) What is the interface you are seeing the stream coming in on?
3) What is your routing table saying for routing to the source address in 1)

*Now assume your host with multiple interfaces is Linux.* If it is not,
then much of the text below may or may not apply.

You (applications) will by default not get UDP packets from X seen/received
on interface B from your IP stack if your routing table says the address X
is reachable via interface A.

By default a linux host with multiple interfaces has a single shared
routing table. If you want to use a single shared routing table and are
seeing packets from X on interface B while your routing table says X is
reachable through interface A, then change your routing table or make sure
the packets are coming in on interface A instead og interface B

If that is not possible, use Google to discover how to setup multiple
routing tables on a single linux host. That way you can define individual
routing table for interface A and define another routing table for
interface B. That way you can tell that packets from X can arrive on
interface B while you prefer reaching X via interface A. If this is how you
want it, then you may add to your routing table for interface B that X can
be reached via X (set metric so interface A is still preferred for reaching
X, if that is what you want). You may want to configure it so traffic send
from X to IP address of B is responded to via interface B even though your
linux host may overall prefer to reach X via interface A.

Please note, just adding a secondary routing entry with a higher metric for
destination X via interface A while maintaining a preferred routing with
lower metrix via interface A for reaching destination X, *WILL NOT HELP YOU*
.

So either change routing (keeping one routing table) or setup individual
routing tables for each interface.

Best
Regards
Peter Maersk-Moller


On Thu, Jan 28, 2021 at 6:55 PM kepitto <kepitto at outlook.com> wrote:

> I've tried a lot of stuff, but I can't seem to get it to work. (Same
> problem
> exists with ffmpeg/vlc)
>
> Basically, I can't get the UDP Stream directly into a videotool. I can
> verify the data coming in through tcpdump/wireshark etc. and i can also
> create the videofiles through gstreamer/ffmpeg afterwards, but I can't use
> the udp source as input.
>
> The current setup is the following:
> The camera streams MJPEG through UDP to a fixed address & port. I port
> mirrored the data from the camera, so that I can verify the data coming in
> through wireshark on a 3rd device.
>
> The reason behind doing this is that multicast is not supported, so I need
> a
> way to get the data on 2 devices through unicast. Port mirroring seemed
> like
> a viable solution.
>
> Am I missing something here? What do I need to do to get this working?
> I thought maybe it's due to the two networkinterface setup as I use 1x usb
> to ethernet for the port mirror and 1x ethernet for the web, but
> disconnecting the other shows no difference.
> The routing seems correct too: "ip route get camera.ip" returns that the
> routing is through the usb to ethernet on my static ip.
>
> Example of an attempt:
>
> Gst-launch-1.0 udpsrc port=streamingport(confirmed through wireshark) !
> jpegdec ! videorate ! video/x-raw,framerate=30/1 ! autovideosink (does not
> work)
>
> Gst-launch-1.0 filesrc location=hexdumpfile.txt ! jpegdec ! videorate !
> video/x-raw,framerate=30/1 ! autovideosink (does work)
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210128/6cbf58ca/attachment.htm>


More information about the gstreamer-devel mailing list