PDA

View Full Version : Networking: Discovering other running copies of a program


Roadfood
01-18-2005, 01:36 PM
Various software products, such as Microsoft Word, have a "feature" whereby when you launch the program, it checks the local network to see if there are any copies of the same program with the same serial number already running on a nearby machine.

My question is: How do they do that? Obviously, the program can't be checking with some sort of a central server at a known IP address, it's done completely ad hoc. My searching of Google led me to IP multicast, but that kinda seems like overkill for this particular behavior. A friend suggested that they might just be cycling through all 255 values of the last octet of their own IP address. In other words, when Word starts up, it finds out that it's host address is, say, 1.160.10.240. It then loops, trying 1.160.10.0, 1.160.10.1, 1.160.10.2 . . . 1.160.10.255, using a pre-defined port number to see of there is a copy of Word at any of those addresses. This seems workable, but it also restricts the discovery to the one subnet.

So does anybody know how it's done? By the way, the reason I'm asking is not for any nefarious purpose, I'm not trying to circumvent what Word does. I'm writing a program that needs to be able to discover copies of itself running on other computers of the local network so that they can communicate with each other (written in Java, if that makes any difference in the answer).

Bongmaster
01-18-2005, 03:04 PM
I've never heard that Word does that, are you certain? I know they have product activation and the serial number copy protection but never heard of this. In fact there were times in the past when I had unlicensed copies of Word running on a small network without any problems (this has since been corrected).

TimeWinder
01-18-2005, 04:28 PM
I suspect that it's just IP broadcast. The "highest" address in a subnet is the broadcast address; packets sent there will be delivered to all machines (most of whom just ignore it).

Lots of discovery protocols work this way, just blast a serial-number based id in UDP packet out to a specific port on the broadcast address when you start up. If anyone responses with the same ID, shut down (or whine to the user, or whatever). If not, just listen for others doing the same. Very low bandwidth - one packet per application startup. Applications I've written work this way (albiet for automatic network connections rather than copy protection).

It *is* limited to the subnet (routers generally won't pass broadcast packets), but that's usually a limitation companies are willing to live with, since putting machines on different subnets just to get around copy protection is going to be beyond most customers' ability and introduces issues of it's own.

Roadfood
01-18-2005, 04:32 PM
I've never heard that Word does that, are you certain? I know they have product activation and the serial number copy protection but never heard of this. In fact there were times in the past when I had unlicensed copies of Word running on a small network without any problems (this has since been corrected).I'm sure, I've seen Word do it on my home network. I had it installed for a time with the same serial number on two machines that are almost never used at the same time. But one time when Word was running on one machine and I launched it on the other, it told me that it detected another copy of Word with the same serial number already in use, and refused to start. Once I quit Word on the first machine, the second one ran with no complaint, so it's clearly somehow detecting and communicating with the other running copy.

These are both Macs, so maybe that "feature" is only in the Mac version? Hard to believe. You say you had "unlicensed copies", which unless you're just being fuzzy in your terminology, is not the same as two copies with the same serial number.

Roadfood
01-18-2005, 04:57 PM
I suspect that it's just IP broadcast. The "highest" address in a subnet is the broadcast address; packets sent there will be delivered to all machines (most of whom just ignore it).Ok, that helps, thanks. Doing some Google searching on "IP broadcast" seems to indicate that sending to 255.255.255.255 is an accepted standard for a broadcast (e.g. http://www.freesoft.org/CIE/RFC/1812/60.htm and http://compnetworking.about.com/od/workingwithipaddresses/l/aa042400b.htm). I can do more searching, but I'm just wondering if you have any links to anything more or less official about IP broadcasting? I'm just wanting to be very careful; I'd hate to put something like that into my program and then discover later that I'd done something that wasn't really accepted practice, and end up pissing off a bunch of IT managers.

Bongmaster
01-18-2005, 05:00 PM
I'm sure, I've seen Word do it on my home network. I had it installed for a time with the same serial number on two machines that are almost never used at the same time. But one time when Word was running on one machine and I launched it on the other, it told me that it detected another copy of Word with the same serial number already in use, and refused to start. Once I quit Word on the first machine, the second one ran with no complaint, so it's clearly somehow detecting and communicating with the other running copy.

These are both Macs, so maybe that "feature" is only in the Mac version? Hard to believe. You say you had "unlicensed copies", which unless you're just being fuzzy in your terminology, is not the same as two copies with the same serial number.

Sorry, I should have specified that they had the same serial number. I'll try a little experiment later and let you know if I get the same error.

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2018 STM Reader, LLC.