LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Network Discovery of Xbox 360 (https://www.linuxquestions.org/questions/linux-networking-3/network-discovery-of-xbox-360-a-912559/)

Vitus13 11-08-2011 08:12 PM

Network Discovery of Xbox 360
 
Currently I'm writing a cron job to collect statistics about the local network. It also monitors the number of open connections from my torrent/media server and puts everything into a csv that I can do analysis on.

The problem is, I don't have any way to monitor my roommate's XBox 360. He complains of poor ping time while I'm torrenting (which is understandable) but in order to judge how much to adjust my torrents I need to know what type of impact XBox Live actually has on the network.

I'd like to at least know when the XBox is on the network, which I was trying to do via pings before I found out that M$ broke the golden rule and set the XBox to not respond to pings. I know it must respond to some protocols, but I'm not sure which ones or how to implement them from the command line.

tl;dr;
Does anyone know how to (given the static IP lease of an XBox) determine if it is turned on and connected to XBox Live?

Network Layout (path traces):
Modem - SwitchA - NATRouterA - SwitchB - XBox(eth)
Modem - SwitchA - NATRouterA - SwitchB - ServerA(eth1)
Modem - SwitchA - ServerA(eth0)


//--- EDIT

After running some captures with wireshark, it seems that the XBox will occasionally multicast UPnP messages. Using mnc I can get the text from those messages (seems to be HTTP, which plays nice with stream tools).

So now my question shifts to: How can I log the date and time whenever I capture a packet with mnc? Right now I'm doing this:
Code:

mnc -i eth1 -l -p 1900 239.255.255.250 | grep 10.0.0.6
LOCATION: http://10.0.0.6:1026/
LOCATION: http://10.0.0.6:1026/
LOCATION: http://10.0.0.6:1026/
LOCATION: http://10.0.0.6:1026/
LOCATION: http://10.0.0.6:1026/


//--- EDIT #2
I took a look into the UPnP protocol and from what I understand if I multicast this text to 239.255.255.250:1900 then every device on the network should unicast back the UPnP services they offer, which will achieve my goal of determining if the XBox is on. The Caveat: Everyone response except for the XBox. I get responses from the router and other UPnP media servers, but M$ products don't want to play by the rules... again.

Code:

$ cat m-search
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 2
ST: ssdp:all
$cat m-search|emcast -t 10 239.255.255.250:1900 && mnc -l -i eth0 -l -p 1900 239.255.255.250

I know that the request is well formatted because wireshark understands it and I get responses within a second or two from the router and other media servers.

//--- FINAL EDIT:
M$ is very picky about line endings. As soon as I adjusted the above m-search file to use \r\n line endings it worked.

So my original question stands.... How can I use this to check if the XBox is on at one minute intervals and record the date&time to a text file when it is.


All times are GMT -5. The time now is 07:03 PM.