Slashdot Mirror


Remotely Counting Machines Behind A NAT Box

Overtone writes "Steve Bellovin of AT&T Labs Research has published a paper showing how to remotely count the number of machines hiding behind a NAT box (in IMW 2002, the Second Internet Measurement Workshop). Your friendly DSL or cable broadband provider could implement this technique to enforce their single-machine license clause. Bellovin explains how to change the NAT software to defeat the measurement scheme, but the fix is complicated and unlikely to appear in commercial home gateways anytime soon."

35 of 574 comments (clear)

  1. Not where I'm from by pi+radians · · Score: 5, Interesting

    Your friendly DSL or cable broadband provider could implement this technique to enforce their single-machine license clause.

    There are still providers that limit you to only one computer per connection? Wow. I guess the high competition in my area (GTA) has allowed the customers a little bit more freedom. In fact, my provider will give minor tech support for most routers and hubs.

    --

    sin(6cos(r)+5A)
    1. Re:Not where I'm from by Rude+Turnip · · Score: 3, Interesting

      If the cable company thinks they can successfully charge me $10 extra per month for extra IP addresses ($5 per extra address: gf's comp + Tivo), they're crazy. Here is what will happen:

      1. Cable gets cut - no more basic + digital package + cable modem: Cable Co will lose $115/mo

      2. Mini-dish goes up and DSL comes in.

    2. Re:Not where I'm from by Karrots · · Score: 3, Interesting

      Ever thought of Bandwidth metering? Thats what the ISP I used to have did something like 12Gig's a week. They mainly did it so they could provide a good level of service to every one. If you wanted more gigs you could purchase more.

      Recently they just lifted the Download metering for weekend and night time. Pretty cool I think.

  2. what if they are chained? by SHEENmaster · · Score: 5, Interesting

    so that you have two firewalls back2back and the other boxes behind it? It's a bit extreme, but worth it if your cable company is composed of jackasses.

    Most users just want web access, and this technique doesn't work on proxies.

    --
    You can't judge a book by the way it wears its hair.
    1. Re:what if they are chained? by pagen · · Score: 2, Interesting

      Ok - Panicing in Austin here. Can you do this with a second NAT device? I have a nice Router using NAT (SMC Barricade - SMC7008BR). If I buy the new SMC model and stick it between the Cable Modem and the current SMC, would this avoid any detection. A one time $100 seems like a simple solution for my home network. Even pays for itself in a month.

      Thanks in advance,

      PaGeN

      --
      When a Ball Dreams, It Dreams it's a Frisbee.
  3. Maybe not home gateways... by jericho4.0 · · Score: 2, Interesting
    but I bet a fix will apear for the Linux kernel pretty quick.

    This is similar to the paketto suite. That allowed pinging behind a NAT wall.

    --
    "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  4. Is this really a big deal? by Jhon · · Score: 2, Interesting

    Why is it a big deal for some company (broadband provider) whose ToS contract up-front says only X number of machines can use this connection or else additional fees apply to expect their customers to comply with the terms of their contract?

    If you want 10 machines to share an internet connection, sign up with a company which doesn't care or charge for how many computers share the connection OR pay for the additional machines for ISPs who do.

    It's interesting to note that this would only ID the number of machiens behind NAT boxes -- not those using proxy servers (a la squid). At least from what I read...

    -jhon

    1. Re:Is this really a big deal? by NetDrain · · Score: 3, Interesting

      Yes, it is in fact a big deal. Not every community has multiple options for high speed internet access -- if you're unlucky enough to be stuck in an area with only one ISP that offers cable/DSL and they have the draconian requirement that you have only one machine on the network, you have a problem.

      The telephone companies did this a while ago about the number of phones you could have connected to your phone line. They monitored the voltage drop on the line when your phone rang. They eventually gave up trying to enforce it.

  5. Like the RIAA... by hndrcks · · Score: 5, Interesting

    the cable / DSL operators will soon find out that trying to wage this battle through technical means will result in an arms race they cannot possibly win...

    ...which will, of course, result in their attempts to find more onerous legal solutions to the problem.

    I say - let the games begin!

    --
    Everyone will start to cheer when you put on your sailin' shoes.
  6. Score another one for Linux by guido1 · · Score: 5, Interesting

    The method described decodes packets from the NAT, using the IP header's ID field (which is normally a simple counter) to determine number of nodes behind the NAT. (Find X distinct ID field chains, that is the number of PCs...)

    However:
    Some hosts take evasive measures. Since the IPid field is used only for fragment reassembly (see below), some Linux kernels use a constant 0 when emitting Path MTU discovery [5] packets, since they cannot be fragmented. Recent versions of OpenBSD and some versions of FreeBSD use a pseudo-random number generator for the IPid field.


    Hurray for Linux... :)

    1. Re:Score another one for Linux by UU7 · · Score: 2, Interesting

      umm, guido ...

      Setting it to 0, as Linux does, is one possibility; as discussed below, in a NAT situation this can leak information, and hence is probably undesirable.

      "Hurray for Linux..." ?
      Forget to read the rest about Open and FreeBSD ?

  7. Telephones by Smallpond · · Score: 2, Interesting

    At one time the telephone monopoly measured ringer current to locate
    "unauthorized" telephones that customers would (gasp!) install without
    consulting Bell. People installed phones anyway.

    Once everyone has many devices with IP addresses on their home LAN,
    there is no way the ISP's can keep up. Just ignore this.

  8. Re:What about Linux? by Anonymous Coward · · Score: 4, Interesting

    Fron the paper:

    We do not currently attempt to deal with the randomized IPid generator used by OpenBSD and FreeBSD. Crypt-analyzing the generator may be infeasible in any event. It should be possible to detect a random background to other, linear sources; the current version of the code does not do that.

    So take that BSD bashers [ggg]. Of course, a gateway implementation to mask/randomize the IPids would be better - giving you a site-wide fix at once.

    First one to market with one wins ;)

  9. Multiple Systems != Multiple Boxen by Heghta' · · Score: 5, Interesting

    I can already imagine conversations like this:

    ISP: We'll have to cut your net access! We detected several dozen computers simultaneously accesing the net through our service, while the contract only allows you one!
    Customer: Uh, I only have one box, I just love to have 30 windows of VMWARE open at once. How better to show off system performance!
    ISP: arglllll

    I mean, if the customer says he uses VMware, what's the ISP gonna do? Cut off the line without real evidence? I'd assume there are enough people who'd not mind a lawsuit.

    --

    Ash nazg durbatulûk, ash nazg gimbatul
    ash nazg thrakatulûk, agh burzum-ishi krimpatul.

    1. Re:Multiple Systems != Multiple Boxen by Rick+the+Red · · Score: 2, Interesting

      Your ISP probably doesn't even know what VMware is. I'm with ATT^H^H^HComcast, and they don't know squat. I recently had a problem with email, and they asked, "Are you using Outlook Express?" When I said no, the reply was, "We only support Outlook Express." So, if they don't support VMware, you're probably not allowed to use it. I have a small (3-4 computer) network at my house, and I don't dare tell them I have a file server because, per the terms of my service agreement, I'm not allowed to run a server! I'm not hosting any web pages or anything, but technically if I want to share files among the computers in my house, I should do it peer-to-peer. OK, so I have 5 computers, and one of them is on all the time and it holds a lot of files but nobody ever sits at its keyboard and it runs OpenBSD but not X Windows and has no desktop apps, but it's not a server, I swear :-)

      --
      If all this should have a reason, we would be the last to know.
  10. How this works by szquirrel · · Score: 5, Interesting

    Counting boxes is done using the "id" field in the IP header. The id field is relatively unique to each datagram sent between two hosts and is used to reassemble datagram fragments. This scheme depends on the observation that most IP stacks keep this field unique by just incrementing a counter for each datagram. By examining the id field of each packet coming from a NAT box and finding trends in the values you can tell how many boxes are behind the NAT. Each trend you can identify is another box hiding behind the NAT.

    But as the article states:

    We do not currently attempt to deal with the randomized IPid generator used by OpenBSD and FreeBSD. Cryptanalyzing the generator may be infeasible in any event.

    So there you go. Write a patch for your IP stack to randomize the id field instead of incrementing it. I couldn't do it, but I imagine someone else can (and will).

    --
    Never approach a vast undertaking with a half-vast plan.
    1. Re:How this works by aberson · · Score: 2, Interesting

      Can somebody please explain to me how one computer with 2 FTP uploads running looks different than 2 computers with 1 FTP upload each?

      _It's_my_understanding_ (please educate me) that for each connection I make, I have a new "id" count started... so, either way there would be 2 out of sync "id" counts going.

    2. Re:How this works by maraist · · Score: 2, Interesting

      IP-ID is not for reconstruction but identification.. It's like a database RowID.. Sequentiality has no bearing except that auto-incrementation is easier to implement than true random number uniqueness. mssql and other databases, however actually do perform random number generation (checking against a database of previously used values).

      In any case, IP-ID is good for ICMP requests (such as ping)... If someone drops your ping's echo-request packet, they can be nice and send a response saying I've gone and dropped your IP package uniquely named IP-ID. Many servers don't do this anymore for fear of the "ping-of-death" DOS attack.

      As for your question of how to reassemble packets. This is only really relavent for non TCP protocols (ICMP, UDP, etc). TCP has it's own sequence counter and can easily facilitate mini-sized IP packets. UDP can theoretically send 64k messages however and relies apon the underlying IP to fragment.

      My memory is a bit fuzzy, but there are additional IP fields that specify which fragment out of n-total a given packet is. The idea is that routers/gateways can reconstruct/break-apart the packet arbitrarily at each leg of the internet's journey. I believe that each fragment still carries the originating IP-ID.. But it is the IP-ID + fragment-number + timestamp that uniquely identifies a packet (since a server will eventually reuse old IP-ID's).

      --
      -Michael
  11. Possible fix by entrager · · Score: 4, Interesting

    After reading the document (something that is rarely done among posters), it appears to me that this wouldn't be TERRIBLY hard to fix. The different machines are recognized by the sequences of IPids that are generated for the packets that are sent out. This field must be unique for each packet with the same protocal, destination, and source. This prevents the NAT from simply mangling the number in the field, making it impossible to track the number of machines.

    Someone correct me if I'm wrong, but it seems to me that iptables could be updated to change the IPid of outgoing packets to a single sequence and just keep a table of old ids -> new ids. When necessary, it performs the translation. So basically it acts as a two way filter, packets behind the NAT will all have the correct id, packets beyond it will all appear as a single sequence. Would this work?

    1. Re:Possible fix by jstepka · · Score: 2, Interesting

      Not really.. you could randomly assign a number to this ID field and then keep a mapping of which machine the return packets are assigned to. This would make it impossible for the next up to know the actual number of machines you have, making your node appear to have an unlimited number of machines

      I happen to really like this idea because it would prevent the next up from knowing which machine was doing what on the Internet, making you anonymous to your node number.

      --
      Justen Stepka
  12. Can we make it a DMCA violation? by DoofusOfDeath · · Score: 4, Interesting

    There must be some way to make it so that an ISP doing this kind of analysis becomes a DMCA violation of the customer. Any ideas?

  13. You should have read further: by burgburgburg · · Score: 2, Interesting
    Setting it to 0, as Linux does, is one possibility; as discussed below, in a NAT situation this can leak information, and hence is probably undesirable.

    On OpenBSD and FreeBSD, however:

    A keyed generator, as is used in OpenBSD and FreeBSD, provides some protection, but one needs to be careful to avoid duplication if the generator is rekeyed periodically.

  14. Re:Silver Lining? by digitalsushi · · Score: 3, Interesting

    A geek friendly ISP, that is, one that would want customers that utilize their connections, would be more than happy to sell them all full T1 service for about 400 to 1200 dollars a month, depending on where you happen to live :)

    I think in general (not aimed at you, Anonvmous) people tend to not realize that everybody has to share when it comes down to it. Sure, most ISPs cover that fact with a healthy dose of greed, but in the end, a 50 dollar price point is what you get after you trim the 1% of us, the power users. They dont like us and there's a good reason- we cost them money when we use more than the normal user! And I dont blame an ISP for enforcing; it's not a matter of being fair as they are just doing this to make money.. a geek friendly ISP would last all of 10 minutes with similarly priced services as what is regularly available. Oh well. I got my plan all worked out. Another 40 a month and I can have business dsl- full servers, whatever i want, nat, all perfectly cool with the ISP. ah, but i lose cause i gave up the 40 extra a month? not when they make a policy change to the residentials and I'm the only one left with a working web and mail server :D

    --
    slashdot: where everyone yells sarcastic metaphors to themselves to understand the issue
  15. What are you talking about? by amarodeeps · · Score: 2, Interesting

    There's every possibility the ISPs and cable companies already know about this. Why do you think they would tell us? This is the same tired argument used to justify security through obscurity...it's specious.

    I say, thank you Steve for making me aware of this. Now I have the option to take action, as do the companies that make these home networking devices.

  16. Re:hrmph. by Phroggy · · Score: 2, Interesting

    All those single-computer use clauses are evil anyway. A DSL line gives you X bandwidth, so X bandwidth is what you use, regardless of how many machines you multiplex it to. Arbitrary fees for extra machines behind the connection are just more ways to rape^H^H^H^Hmilk the customer.

    If you have two computers, they figure you're going to be using more bandwidth than if you only had one. for example, if you and your wife are both surfing the web at the same time, more bandwidth is being used than if you only had one computer (so only one of you could be surfing at a time). If this is generally true, then the ISP has a higher cost for users with two computers than for users with one (remember that the ISP has to pay for bandwidth from their backbone providers; they don't pay a flat monthly rate like you do).

    Of course, in many cases this is not true. I have several computers, and I use far less bandwidth than the guy with only a single PC who leaves Kazaa running 24/7.

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  17. Who's your daddy? by Chazmati · · Score: 2, Interesting

    I enjoyed telling the cable people to screw off. They charged me in advance of services rendered (!) and everytime a legislated rate decrease was passed, they would somehow have in increase in operating costs that exceeded it (so rates would go up anyway).

    But then I went to DirecTV, and it felt good to not be the hostage of the cable company... until I realized I was still a hostage.

    I do have DSL, but we finally booted DirecTV. It was just too much money every month. I tried calling customer service to see if I could step down to a more economical package (maybe with the 10-15 channels I actually watch) but they told me I was already at the lowest level (which has seemingly hundreds of channels). The infuriating part: when I called to cancel they said I could switch to a cheaper package with less channels.

    But anyway, this is about IP addresses and NAT; coudln't we have a kernel/netfilter module that will resequence all outgoing packets consecutively and reverse on the return?

  18. Re:trying to crack down on reselling by binaryDigit · · Score: 2, Interesting

    any attempts to change their pricing to this model will be met by massive consumer outcry.

    But if ALL the high speed isp's start charging "by the bit", then why would they care if their p2p customers start bitching. They are under no legal obligation to provide unlimited bandwidth. And if the p2p people don't like it, they can switch back to dialup is what they'll say. I think that "by the bit" is inevitable. They don't do it now because they are all trying to stay afloat and expand their customer bases. But once they have a nice critical mass built up, then they'll start metering. Makes too much sense. It's "fair" in that those who use the most, pay the most. They wouldn't care how many machines are hiding behind your NAT, because in the end, they'll still get their money (depending on pricing scales of course).

  19. Power Users aren't bandwidth hogs. by mellon · · Score: 2, Interesting

    It's people who want streaming audio and video, or massive file sharing. Power users just want to be able to download the data they need, when they need it, without a long wait. I don't say this to put down people who do streaming - I use it too, sometimes. But a power user probably consumes an order of magnitude less bandwidth than a user who has the connection primarily to do streaming media. Personally, I'm exquisitely happy with my broadband DSL connection, and with my ISP (speakeasy).

    My main worry right now is that Congress will kill my ISP by fiat, and I'll be forced to buy service from a baby bell again. :'}

  20. Why connecting multiple machines is ethical by fuzzykitty · · Score: 2, Interesting

    This argument is only valid for DSL, however I think the cable companies should be hauled into court for false advertising.

    In my experience, when I get DSL I am paying for a particular guaranteed bandwidth to my ISP. How many machines I choose to hook up to that is purely my business, provided I am not running a neighborhood LAN (fair enough) because the contract is per address.

    What an ISP does not like is the fact that their "model" of what you should be doing tends to get blown away by multiple machines. They may not like this, but thats too bad. If you are going to promise bandwidth, then that is what you should deliver. If you don't, it's false advertising. It is a bit like the RIAA because they do not want to adopt methods that give them public relations headaches (ie. they do not like admitting their true intentions) such as:

    "Garunteed 650kbs (so long as you only use it less than 2hr out of every day)"

    As a side note, I remember reading the contract for my ISP stating that excessive Up/Downloading were grounds for termination of service. However there was no definition for this term and nobody at the company seemed to have a good idea of what this was. Put simply, if I did use enough bandwidth downloading Linux Distro's 20 times a week and they terminated me I could sue them. Frankly I am surprised their lawyers allowed that one to get out the door.

  21. Other ways to detect multiple users by agenthh · · Score: 2, Interesting

    The ISPs could also try checking all the TTLs (time to live) of the packets.
    Many routers don't set this value to be one specific value, and multiple computers have multiple TTLs. Thus, it is an excellent indication of multiple computers.
    Also, if you happen to be using Linux kernel 2.4, netfilter nat modules happen to change the TTL to one certain value.

    --agenthh

  22. Don't rock the boat by Hershmire · · Score: 2, Interesting

    Sure, this could be used to count the number of machines behind broadband customers connections. The fact is, though, that it probably won't.

    As you know, broadband service providers make money by assuming not everyone is using 100% of their bandwidth all the time. The only way they'll care as to whether you have multiple machines is if you use too much bandwidth. And even then, they'll probably only disconnect you for using too much bandwidth, and not having a shared connection.

    I'm sure they won't give up a $50/month source of revenue because Joe has his mom's computer connected to a NAT box. Now, if Joe's mom was running a public FTP server...

    --
    if(!toilet_paper) roll.replace(new roll); //Stupid roommates.
  23. Other methods, and solutions by evilviper · · Score: 3, Interesting

    Well, this comment is going to be so far down that most people wont see it, but I'll try it anyways.

    The method described is only one method to count hosts behind a NAT box. Just think how much fun your ISP could have if they utilized a passive nmap-like system. Just by analizing the traffic, they can tell what OS created the packets, among other things.

    That said, there are ways around this already in the wild. OpenBSD's PacketFilter (PF) has a "modulate state" keyword that would solve you problem nicely. That tells PF to essentially rewrite the packets, primarily to give them the benefit of OpenBSD's random sequence numbers, but it will also stop any other analysis of the packets.

    Of course, that still leaves the posibility of them checking your surfing habbits. However, that would be, not only incredibly intrusive, but quite difficult for them to do on a large scale. Besides, if it every happens, and they say they saw your firewall making connections to 12 different websites at the same time, just tell them it was all from your one machine, and there's nothing they can do to refute it.

    Of course, I'm not concerned about this in the least. I'm using Earthlink broadband, who happen to care about customer privacy more than any other. I certainly didn't hear of any other ISPs giving the US government the finger when they wanted to install Carnivore.

    --
    Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  24. I love my web proxy by sir99 · · Score: 2, Interesting

    Hmm, 99% of my LAN's Internet traffic goes through my caching and filtering web proxy, so it would look like there was only one machine anyway. What little traffic doesn't go through the proxy is probably too scattered to detect a noticible trend. And as someone else mentioned, iptables might have to reassign the IPIDs to prevent collisions anyway. Maybe we'll get random IPIDs like FreeBSD, too :-) In my case, they might be better off looking at TTL, window size, and all the other stuff nmap uses to detect different OSes.

    --
    The ocean parts and the meteors come down
    Laid out in amber, baby.
  25. Re:It's already here by internic · · Score: 2, Interesting

    Seriously, anyone who bitches about these sorts of restrictive policies should put their money where their mouth is and switch to a provider like Speakeasy . Not only are they geek friendly when it comes to multiple machines, but they also have a lot of other good projects including the following:

    Not to mention the fact that they offer at least some Linux support (examples here and here). I don't know the extent of it, because honesty I don't ask my ISP for help with my OSs often. Also, when I got DSL they offered static IPs when most of the other providers I looked at in my area only seemed to offer dynamic for residential customers.

    You might be asking yourself, "Does this guy work for Speakeasy?" No. But I am a satisfied customer, and I am afraid that good ISPs like this one will be pushed out by bigger companies (*cough*Verizon*cough*) who offer their customers a much more restricted set of options and don't give back to the interenet community (if you beleive in such a thing). All this because these other companies can offer their servies a few bucks cheaper a month or with a little better initial perks, or just because the other companies have better name recognition and more marketing dollars. That and there are many savvy users at these less friendly ISPs who know they can slip by restrictions (at least in the short term), so they opt for convenience and saving a few bucks over promoting the behavior they'd like to see and options all users can take advantage of.

    So, if you're concerned by the increasing restrictiveness of ISPs, use your wallet to make a statment by switching to one of the good guys.

    --
    "You call it a new way of thinking; I call it regression to ignorance!" -- Operation Ivy
  26. Why use NAT? by Ed+Avis · · Score: 2, Interesting

    If all you want is web access, why bother with NAT at all? It is an ugly hack, really. You can just set up a proxy server (squid or wwwoffle) and configure browsers to use that. You'll probably get better performance, too, since the proxy server can do caching. Or you could use NAT for ssh connections and an explicit proxy server for http/https/ftp.

    OK, I know there are some NATting products which do caching internally, but it's not as clean as just configuring the web browsers to talk directly to a proxy, and it's more likely to break stuff. (At least, some 'transparent' web caches are horribly broken.)

    --
    -- Ed Avis ed@membled.com