I'm relatively new to this topic so there might be some fundamental gap in my knowledge, but I am trying to use GStreamer to send an MPEG2-TS stream to an embedded device using IPv6 (on Windows 10). The embedded device is connected via a USB-Ethernet adapter to a media converter (RJ45 -to- BroadR-Reach).
If I use IPv4 to broadcast (e.g. 192.168.1.255), everything works fine. I can receive the stream on the device without any problems. A sample command that works:
gst-launch-1.0.exe -v filesrc location=d:/video.ts do-timestamp=false ! \
"video/mpegts, systemstream=(boolean)true, packetsize=(int)188" ! \
tsparse set-timestamps=true ! rtpmp2tpay mtu=1200 pt=127 ! \
udpsink host=192.168.1.255 port=5001
Now I need to do this with IPv6 via multicast and I can't figure out how!
Assuming the IPv6 address of the embedded device is fe80::1:2:3 and the IPv6 address of the Ethernet interface on the PC is fe80::1:2:4. Which address do I use as multicast? I already tried ff0x::1:2:4 and ff1x::1:2:4 (where x=1,2,3), but the data is transmitted over my computer's main network interface (e.g. WiFi interface, this was checked using Wireshark).
If I try to add the option of multicast-iface, GStreamer gives the following error:
Could not join multicast group: Error joining multicast group: The
requested address is not valid in its context.
Ok, so after posting similar questions to various mailing lists and forums, I've learned that you can't bind to an interface this way and additionally, multicast traffic is always routed through interface with the lowest metric. So the only possibility to achieve what I wanted is to:
Play around with the metrics of the interfaces in question
Add a route for the required address range
Somehow force all traffic from GStreamer through the required interface (e.g. ForceBindIP)
Since I couldn't make any permanent changes to the Windows machine vis-a-vis the network routes/metrics, I went with a modified version of the 3rd option, i.e. a VirtualBox virtual machine running GStreamer on Linux with the USB-Ethernet adapter setup as the only active network interface.
Related
I need to create a veth device for the slowpath for control packets.
What I tried till now:
I have created veth interfaces using below command
sudo ip link add veth1-2 type veth peer name veth2-1
when I use command sudo dpdk-devbind.py --bind=igb_uio veth1-2 to add veth into dpdk.
It gives me an error that "Unknown device: veth2-1
Is there any way we can add veth interfaces in dpdk ?
If you want a "dpdk-solution", then what you'll want to look at is KNI: https://doc.dpdk.org/guides/prog_guide/kernel_nic_interface.html
From their docs:
The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
The benefits of using the DPDK KNI are:
Faster than existing Linux TUN/TAP interfaces (by eliminating system
calls and copy_to_user()/copy_from_user() operations.
Allows management of DPDK ports using standard Linux net tools such as
ethtool, ifconfig and tcpdump.
Allows an interface with the kernel network stack.
If your fine using a non-dpdk solution, then a TUN/TAP device is a typical way to interface with the networking stack. Your application would receive packets on the dpdk-controlled nic, and if it is a control packet you would simply forward it on to the TUN/TAP device (or KNI if using DPDK's version of TUN/TAP). Similarly for the other direction, if the TUN/TAP/KNI device receives a packet from the networking stack, you would simply send it out the DPDK physical nic.
My question is how to send packet another Physical Server from my Computer using dpdk.
I already watched example code rxtx_callbacks and i want to use this code.
but there is no place to enter a specific ip and port to another server.
how i can send packets to places on a server using dpdk with specified ip and port?
and how i can receive packets using dpdk?
Is l3fwd correct or is this another concept?
help me
DPDK is an open-source library that allows one to bypass Kernel and ETH-IP-TCP stack to send packets from userspace directly on NIC or other custom hardware. There are multiple examples and projects like pktgen and TREX which uses to generate user-defined packets (desired MAC address, VLAN, IP and TCP-UDP) payload.
For the queries
how i can send packets to places on a server using dpdk with specified ip and port?
[Answer] make use of DPDK PKTGEN as an easy way to generate. Other examples are pcap based burst replay and trex.
But the easiest way to generate and send traffic is using scapy with DPDK sample application skeleton. Following are the steps required to achieve the same.
Install DPDK to desired platform (preferably Linux)
build the DPDK example skeleton found in path [dpdk root folder]/examples/skeleton
bind a physical NIC (if traffic needs to be send out of server) with userspace drivers like igb_uio, uio_pci_generic or vfio-pci
start the application with options '-l 1 --vdev=net_tap0,iface=scapyEth'. this will create TAP interface with name scapyEth.
using scapy now create your custom packet with desired MAC, VLAN, IP and Port numbers.
and how i can receive packets using dpdk?
[Answer] on receiver side run DPDK application like testpmd, l2fwd, or skeleton if packets needs to received by Userspace DPDK application or any Linux sockets can receive the UDP packets.
Note: easiest way to check whether packets are received is to run tcpudmp. example tcpdump -eni eth1 -Q in (where eth1 is physical interface on Reciever Server.
Note: Since the request how i can send packets to places on a server is not clear
Using DPDK one can send packets through a physical interface using dedicated NIC, FPGA and wireless devices
DPDK can send packets among applications using memif interface
DPDK can send packets between VM using virtio and vhost
DPDK can send and receive packets to kernel, where Kernel routing stack and ARP table determine which kernel interface will forward the packets.
I am trying to send and receive TCP streams from an iPad via a wireless connection to a laptop. I create sockets with boost::asio. This project is a port of a data streaming library that I maintain that works quite well on Windows, OSX, and Linux.
I can get the app to send and receive streams to/from other computers on a wired LAN when I run it on the simulator. But, when I target the device itself, I can't see any streams.
As I say, I am communicating via wireless between an iPad and a laptop. I create a wireless network on the laptop and then give the iPad a static IP. The connection appears to be fine, because I can ping the iPad with no packet loss. I have also tried connecting the devices by putting them on the same wireless LAN (although I'm not supposed to use wireless routers at work) and this also does not work.
According to apple, setting up streams like this with NSStream will just work. Maybe there is some permissions magic happening under the hood that I am not doing with my calls to boost::asio functions. In any case, I can't see the streams.
Actually, it turns out the only thing that was wrong was that I needed to set up my routing table so that it pointed multicast to the wireless card:
> sudo route -nv add -net 224.0.0.183 -interface en1
I got the IP from inspecting packets in wireshark -- it is the address that my device is multicasting to in my laptop. Sending works (from device to laptop), receiving is still silent though. This may be something else that needs to be set int the routing table (I really don't understand much at all about multicasting) or else I can fiddle with some config settings with my library.
I'm new to network programming in C++ and I'm writing a very simple app that is suppose to do a multicast.
From my research I see one of the first things I need to do is find out if my router supports multicast forwarding and multicast routing protocols.
My point of confusion is, I am connected to the internet via a mobile hotspot device, and I don't exactly know how to find out if it supports multicasting.
Does anyone know how I can go about finding out if I can indeed send multicasts with this type of wireless connection?
Thanks
I found that on a linux box (that supports ifconfig) you can use the ifconfig command to see if multicast is supported. eth0 for example will show Multicast along with some other information.
For windows in the command line:
netsh interface ip show joins
should tell you
This computer is taking SDI video as input and giving RTP stream as output. There is no problem joining this rtp multicast from another computer on the same network but if I run my software on the SDI to RTP machine, I can't get any packets. There is no problem joining multicast but it acts like there are no packets.
We have 2 identical networks, I tried both, no success. I also tried some other software like VLC to see if they can get any packets and it seems they don't have any problem at all. I checked resource monitor and saw that these software are listening ports without giving a local ip address. I am always setting computers local ip address before joining any multicast stream to select the network ( there are 2 )
For jrtplib you need to set acceptOwnPackets before creating a session
RTPSessionParams rtp_sp;
rtp_sp.SetAcceptOwnPackets( TRUE );