How to monitor data traffic on a network and send it to max/msp

Endorak's icon

Endorak

5月 19 2017 | 5:04 午後

Hi guys,
Is there a way to monitor users' data traffic through a network (ex. a wifi network connected to the internet) and communicate them to max using for example the serial communication protocol?

It would be nice for me to use those infos to map some audio parameters for a project.

Thanks in advice for your help. Really appreciated.

Dirk's icon

Dirk

5月 20 2017 | 2:12 午後

check out the tshark CLI that comes with wireshark -- awesome fun! wrap it with a bit of some scripting to send osc to max to make your params dance

Endorak's icon

Endorak

5月 20 2017 | 4:08 午後

Thank you Dirk, it seems interesting!
Is there a guide on how to pull out infos and data from tshark/wireshark in OSC protocol?

I'm not really skillful on that...

Dirk's icon

Dirk

5月 20 2017 | 4:53 午後

here's a minimalist reference using a short python3 script pushing tshark traffic to a max patch I threw together up in github -- enjoy

Endorak's icon

Endorak

5月 20 2017 | 6:11 午後

Thank you very much, really.

I'll try not only to use it but also to learn from it.

Endorak's icon

Endorak

5月 24 2017 | 4:30 午後

I'm trying to setup all the things (I didn't have python installed).
I took the version 2.7 of py, installed the python-osc library.
Installed wireshark and run it.
When I run the python script it works, but it tells me that it's capturing from firewire.
I assume that I have to change the script to capture the data flow from the wifi connection, but I'm not really sure how to do that.
I'm using Wireshark instead of the textual version of it, Tshark. Is it a problem?

Thank you in advance and sorry for my beginner questions.

Dirk's icon

Dirk

5月 24 2017 | 4:36 午後

you'll need to use tshark for the provided script to work as written. are you on a mac or pc? you can test tshark separately to experiment with traffic filters then update the python script to fit your needs via a shell/dos prompt

Endorak's icon

Endorak

5月 24 2017 | 4:44 午後

I'm on a mac.

I've also tried to run tshark from the terminal (tshark -v), but the result is the same, no messages in the max console.

Endorak's icon

Endorak

5月 24 2017 | 4:52 午後

Ok, I've located the right interface: 4. en1 (that it's my wifi network).
Selecting it from tshark, it shows me the traffic through it.

Now, how can I change the listening port in the py script?

Dirk's icon

Dirk

5月 24 2017 | 4:56 午後

the current patch and python code both reference port 8000 -- you can change them both to any valid port of your choosing, just make sure the port numbers always match

Dirk's icon

Dirk

5月 24 2017 | 5:32 午後

for more fun, check out some of julian olive's epic works using an expensive wifi adapter supporting monitor mode -- w00t!

encoder audio's icon

encoder audio

3月 31 2018 | 7:19 午前

Is there an easier way for this?
I had a network usage to MIDI app on my Nintendo in the past and loved it.
Would be really nice to get random data from the world to use it in Max...