Working with IP Multicast

Working with IP Multicast

SOLVING ISSUES WITH MULTICAST

If you are unable to receive multicast on your server via Dektec card please follow the steps below.  It is most likely related to reverse path filtering - this is a feature of the kernel that blocks multicast from addresses from which there is no route.

Reverse path filtering is a mechanism adopted by the Linux kernel, as well as most of the networking devices out there to check whether a receiving packet source address is routable.
So in other words, when a machine with reverse path filtering enabled receives a packet, the machine will first check whether the source of the received packet is reachable through the interface it came in.

STEPS TO VERIFY MULTICAST

  1. Check and install Dektec driver and DtuNw versions
  2. Find dectek cards nics:
    ip maddr show
  3. Assign static IP addresses for Dectek’s ports.
  4. Activate multicast on the NIC: 
    ifconfig [Dectek’s port1 and port2 name] multicast
  5. Test if you are receiving multicast: 
    1. tcpdump -c 10 dst host [source_multicast_address] and port [source_multicast_port] and multicast -i [Dektec’s port1 NIC name]
    2. e.g. tcpdump -c 10 dst host 224.171.25.26 and port 2526 and multicast -i eth3
  6. if not:
    1. check reverse filters: sysctl -a | grep
      .rp_filter
    2. check RP filter for dectek card nic (should be 0): 
      cat /proc/sys/net/ipv4/conf/[nic_name]/rp_filter
    3. and set temporarily:
      echo 0 > /proc/sys/net/ipv4/conf/[nice_name]/rp_filter
    4. To permanently set rp filters modify /etc/sysctl.conf### # Controls source route verification (previously 1)### net.ipv4.conf.default.rp_filter = 0
    5. restart you NICs: ifconfig eth3 down / up
  7. if still not, 
    1. turn off your firewall and repeat above point 5
  8. if still not; make sure that you are sending the multicast to Icareus Playout server
  9. test that ffprobe can receive you multicast (https://ffmpeg.org/ffprobe-all.html)
    1. ./ffprobe udp://[source_multicast_address]:[source_multicast_port]?localaddr=[Dectek_port_ip_address] -loglevel 56 -show_error -protocol_whitelist udp
    2. e.g.: ./ffprobe udp://224.171.25.26:2526?localaddr=192.168.214.77 -loglevel 56 -show_error -protocol_whitelist udp

RECORDING IP MULTICAST

USING PYTHON SCRIPT

#> python multicast_to_file.py

out: <output_file_name_here>
ip: <multicast_ip_here>
port: <multicast_port_here>

press Ctrl + C to stop the recording

Download: multicast_to_file.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import socket
import struct
 
filename = raw_input ("out: ")
ip = raw_input ("ip: ")
port = int (input ("port: "))
 
 
sock = socket.socket (socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind (('', port))
 
multicast_request = struct.pack ("4sl", socket.inet_aton (ip), socket.INADDR_ANY)
sock.setsockopt (socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, multicast_request)
 
out = open (filename, "wb")
while (True):
    try:
        data = sock.recv (4096)
        print (ip + ":" + str (port) + " -> " + "data (" + str (len (data)) + "bytes)")
        out.write (data)
 
    except KeyboardInterrupt:
        out.close ()
        sock.close ()
        print ("Done")
        exit (0)

CHECKING MULTICAST MPEG-TS WITH FFPROBE

#> ffprobe udp://<multicast_ip>:<multicast_port>



    • Related Articles

    • Managing Networks

      Introduction The multinetwork feature in Icareus Playout opens the possibility to output several Networks (or Transport Streams over IP) from a single Playout server. Each Network may have it's own set of configuration parameters as well as ...
    • EIT TS-over-IP Input

      Introduction It is possible to fetch EIT events directly from a transport stream sent over IP network using UDP or RTP. A Dektec card with a network port is required for that: DTA-160, DTA-2160 or DTA-2162. This network card should be configured ...
    • FAQ - Frequently Asked Questions

      Q: HOW TO CHECK MULTICAST MPEG-TS WITH FFPROBE A: #> ffprobe udp://<multicast_ip>:<multicast_port> Q: How to manually synchronize the server time (once)? A: Use the ntpdate command and the appropriate NTP server: #service ntpd stop #ntpdate ...
    • EIT Checker

      Alarms Alarms tab displays a list of all current alarms. Alarms are raised for overdue EIT p/f present items that exceed the threshold value. Media flow Name of a media flow that is monitored Service id Id of a service that has a present EIT event ...
    • Managing Networks

      INTRODUCTION  Networks are a key feature of Icareus Playout platform. Each Network contains one or several  Actual  subnetworks and those in the system represents a individual transport stream with DVB Services, data services, configurations, tables, ...