I wrote a multithread program in Python, that analyses traffic from two multicast addresses with the same port, however it looks like my threads don't distinguish from where are datagram's coming.
Information:
1st multicast address: 239.0.1.104:12345
with throughput of 10.69 Mbps
2nd multicast address: 239.0.1.105:12345
with throughput of 6.08 Mbps
The goal of my program is to call analyser two times by two different threads, the desired outcome is that program would print:
Received 10.69 Mbps!
Received 6.08 Mbps!
However currently my program sums up both multicasts and prints:
Received 16.78 Mbps
Received 16.78 Mbps
So I wanted to forward address let's say from 239.0.1.105 to port 12346
instead of 12345
and pass this port into my program hoping that this will help program to distinguish which datagrams are coming to which socket.
How can I do this using iptables?
Also, If this would help, there is the issue of my program asked on programming stack: Programming stack question
I modified a little bit code to be called by functions, however general idea is the same:
ifconfig, my interface and my address
Route Table
Netstat Output