Showing posts with label compu-geekery. Show all posts
Showing posts with label compu-geekery. Show all posts

Saturday, March 24, 2012

A Modest Proposal on How to Make Software Patents Suck Less

Timothy Lee, who's guest-blogging for Megan McArdle, has a nice condemnation of the US software patent system in general, and software patent lawyers in particular.  I am an inventor in 25 issued patents, all of them having at least a software component to them, so I have some experience in this area.  Here's my opinion:

Software patents suck.  They represent a huge drag on American innovation and are a significant barrier to entry into the technology business.  I wouldn't even think of starting a garage op these days; unless you're capitalized well enough to to a full freedom-to-operate search on your product up front and defend at least one reasonably competent troll, you'd be crazy to do something that you actually wanted to make money selling.  The abysmal swamp that comprises the body of software patent claims is effectively unnavigable.

The biggest problem here is that software method claims have to be written in English, and actual software methods aren't.  Even though every patent attorney I've ever worked with has demanded that I throw a few flowcharts of a preferred embodiment of the idea into the disclosure, the flowcharts can't be used in the claims, nor can pseudocode.  Just English.

There's actually a good reason for this.  Any specific embodiment of a software method that was claimed is trivial to be worked around to avoid infringement, because writing an equivalent algorithm is usually possible.  So you go to great lengths to make your claims as general as possible.

But the result is a nightmare.  First, the claim language,a without cross-referencing it back to the disclosure is just gobbledegook. Second, even after you've finally deciphered the claim language, the odds that it uses any standardized set of terms of art that might be cross-referenceable against other existing claims is vanishingly small.  So patent examiners can't rely on any reasonable keyword system to look for prior art.  Neither can lawyers doing FTO searches.

Bottom line:  If you've written more than about a thousand lines of code in your product, you've probably infringed on somebody.  The good news is that probably nobody will notice, because they can't do a reasonable search to look for art that your product may infringe upon any better than you can look for prior art to avoid infringement in the first place.  The bad news is that anything that you market successfully will cause the sharks to start circling.  Then you'll have zillions of claims that sorta-kinda look like you might be infringing upon them, and you'll have to litigate each one of them or otherwise make them go away.

Over the years, I've thought of several ways that the pain might be reduced.  Here are some of my favorites:
  1. Force all software method claims to be dependent upon an independent apparatus claim.  This would effectively allow somebody to use your idea in an unrelated product.  So, for example, Apple could beat up on Google when an Android phone used "slide to answer", but they couldn't take a medical equipment maker with a touch screen that used "slide to activate" or "slide to access diagnostics".  This also eliminates a favorite attack avenue for trolls, who love to extort companies with completely unrelated products that happen to use some method that peripherally resembles something that they own.
  2. Reduce the term of protection for software methods from 20 years to, say, oh, I don't know, maybe 2 years.  This business moves so fast that if you can't be successful with a two-year jump on your competitors, you're simply not going to be successful.
  3. Finally, let's look into the organization of the USPTO databases for software methods.  Truth be told, I don't really know what they do in this area, but I can fairly confidently tell you that it's not helping very much.  I assume it's mostly keyword-based.  If we had a structured library of objects, we might get a little further.
And it's this last one that got me thinking.

Patent claims have to be written in English.  But there's no reason why you couldn't  write method claims in some kind of high-level language, compile them to an intermediate, structured form, and then drive a code generator off of that intermediate form to produce claims, written in English.

If you can capture the essence of the method's intellectual property in that intermediate form (which is, admittedly, incredibly difficult if you want the information to be both sufficiently general and useful for searching at the same time), then there are a number of huge benefits.  If it's structured properly, you should be able to compare a test proposition against a database of reference intermediate forms to look for possible infringement.

If you're looking for freedom to operate, you can code up your product's methods in the new language, and an automated tool ought to be able to extract areas of potential infringement in one query.  You'll still need a human in the loop, but this would drive down your FTO search costs by at least an order of magnitude.

If you've ever been an inventor attempting to draft a claim, you'll know that you and your attorney play this tedious, horrible what-if game, where you pretend that you're a competitor trying to avoid infringement of the claim you've just written.  You do this to tighten up your wording to make the claim as general as possible.  With this new high-level language, probing your claim is much easier to do, because you can test various infringement-avoidance schemes by writing them up in the language and letting the software tell you if they conflict or not.

If you're an examiner, you'd love this thing.  Of course, the odds are pretty slim of getting legislation through to have the USPTO require that claims be written this way.  But imagine that inventors started attaching the high-level source code to the application, to supplement the formal claims that the source code generated.  The examiner will be much more efficient in understanding your claims and searching for conflicts if he can generate the intermediate form.

Of course, this doesn't help much for the zillions of claims that are already in there, but at least it puts a bound on how bad the problem can get in the future.  Also, I could envision the USPTO embarking upon an effort to reverse-compile existing claims to build up a comprehensive database against which to search.

As I said above, this is really, really hard.  Computer languages are pretty stupid, so encapsulating meaning in a rigorous form is going to be something that the inventor provides to the language, no the other way around.  I can think of some elements and requirements, though:
  • Terms of art.  Software geeks hardly ever use the same terms for the same things, so detecting that two areas of interest overlap is extremely difficult.  If your language formally defines terms of art, at least you can use keyword searches on the definitions to minimize the profusion of jargon.  In the best case, you slowly build up a list of statements like, "a fujiwatt is like a gizmo, except it uses a thingamabob instead of a framjamit."  Everybody understands object-oriented software engineering these days (or at least they won't admit that they don't), so classification of meta-information like this isn't a foreign concept.
  • Referencing enablement in the claim language.  Flipping back and forth between the disclosure and the claims when you're reading any kind of patent is inevitable, but it's worse with software patents.  Incorporating references to hunks of enablement in the construction of the claims would be meta-information that wouldn't make it into the actual claims but which would significantly improve understanding of claims.  It also has the nice property of making sure that you've covered everything you're claiming in some hunk of enablement, since failure to do so can invalidate your patent.
  • Writing algorithms in a scoped form, from the most general to arbitrary levels of specificity.  Your attorney whacks you repeatedly over the head until you learn that anybody can avoid infringement on a claimed algorithm.  The trick is to be able to describe the method in a form that's over-general, then specify its key features at ever-greater levels of detail.  If the language can support this structure, then it can tell you when you've made things just specific enough to have a novel, unobvious, useful claim.  Another goal of such a specification would be to allow dependent claims  to cover varying applications or options.
  • Modeling multiple agents in a system.  I'm a networking/telecommunications geek, and lots of my claims involved systems of software agents interacting with one another.  I expect that lots of software claims work the same way.  You often write sets of claims from the viewpoint of each agent in the system, so that a competitor can't avoid infringement by replacing one component of your system.  The language would need to support that.
I'm sure there are lots of other features.  Feel free to add your favorites.  The odds of my writing such a language are pretty small (compilers are not my thing), but who knows?

Sunday, December 5, 2010

In Which Julian Assange Demonstrates That He's Not Against Secrecy, Only Secrets Not Controlled by Him

Apparently Wikileaks's Julian Assange has an "insurance file" containing lots of secrets that he hasn't released, but which he threatens to release if he's shut down.

I have to say that I'm supportive of the idea that government should be as transparent as possible, in which case the recent state department and Afghanistan dumps are fair game--as long as Assange didn't pay for or coerce Bradley Manning for the information, he's not guilty of espionage, and he ought to have the same rights as any other (highly irresponsible) journalist. (Manning, of course, is guilty of treason and/or espionage, if news reports are correct.)

As for Assange's philosophy of damaging government apparatus by making it more and more paranoid about leaks, well, that's not exactly the right idea, is it? But in general, transparency is a public good, and exposing things that the government wants secret is often not a bad thing.

So, what is Assange's first considered action when he comes under pressure? He's going to threaten his foes with "secret information". Mind you it's not stuff that a government has managed to keep secret, it's stuff that he's keeping secret.

So much for transparency. He's clueless at best and more likely just a garden-variety hypocrite.

Thursday, August 5, 2010

In Which, From Our Position Just in Front of the Fan, We Observe a Cluster of Moist Brown Objects on a Ballistic Trajectory Toward Us

I've always been OK with regulation for location neutrality on the internet while opposing application neutrality because it can stifle protocol innovation. Now it appears as if some of the Big Boys may be about to force the issue:
Google and Verizon, two leading players in Internet service and content, are nearing an agreement that could allow Verizon to speed some online content to Internet users more quickly if the content’s creators are willing to pay for the privilege.

The charges could be paid by companies, like YouTube, owned by Google, for example, to Verizon, one of the nation’s leading Internet service providers, to ensure that its content received priority as it made its way to consumers. The agreement could eventually lead to higher charges for Internet users.
Now, it's possible that the NYT is simply casting this in the most negative light possible but, if true, I can't think of a better way of chumming the water for the net neutrality sharks to begin a full-on feeding frenzy. It's abysmally stupid.

Note that there is a serious engineering issue here. When we use DSCP to mark packets, there's a bit of a gentlemen's agreement that we use the proper code point for a particular application. If you suddenly start using different markings for the same application, you're now essentially practicing location discrimination. You can do some amount of verification that applications are being nice via policy, but it gets tricky.

I'm not entirely opposed to the idea of paying for quality of service. Indeed, paying for QoS to enable certain types of applications (for video over IP or gaming or teleoperation, for example) is almost essential. But you want that tariffing to be directed at the content consumer, not the provider. Otherwise, you get to the point where large, rich content providers can choke out the smaller guys. (Note that conversational communications is a special case, in that both ends of the stream are both consumers and providers.)

Could this all be solved by simply enforcing neutrality on all TCP traffic? This would obviously provide an (undesirable) incentive for content providers to move to UDP-based protocols, as BitTorrent has already done. It would be easier in theory to enforce clean classifications of applications with UDP and to prevent abuses of policy, but you still have the problem of what to do with encrypted traffic. Maybe you only deal with encrypted traffic best-effort, and rely on protocols like sRTP for conversational traffic that needs to be kept private.

Damn, we're on the slippery slope. I'm not sure I want to think too much about the composition of the mud.

UPDATE 14:54 EDT:

Well, this is a little better:
"People get confused about Net neutrality," Schmidt said. "I want to make sure that everybody understands what we mean about it. What we mean is that if you have one data type, like video, you don't discriminate against one person's video in favor of another. It's OK to discriminate across different types...There is general agreement with Verizon and Google on this issue. The issues of wireless versus wireline get very messy...and that's really an FCC issue not a Google issue."
This jibes reasonably well with my position, but I'm hard-pressed to figure out how you distinguish one kind of TCP traffic from another. It's still a bit of an unforced error.

Tuesday, April 6, 2010

Good News/Bad News

The good news is that the DC Circuit Appeals Court has tossed out the FCC's cease and desist order to Comcast in re. Net Neutrality and L'affaire BitTorrent, on the grounds that the FCC doesn't have any statutory authority to regulate in this area.

The bad news, of course, is that this means that Congress will likely attempt to provide the FCC with the statutory authority to do so. However much I distrust the FCC to make consistently rational decisions dealing with delicate engineering aspects of the internet, I distrust those idiots in Congress even more.

Wednesday, November 25, 2009

And Today's Word Is...

kludge or kluge (klo̵̅o̅j)
noun
  1. a piece of computer hardware or software, or a computer system, that is clumsily designed or improvised from mismatched parts
  2. any poorly designed device or system
I've been watching the Climategate saga with a certain amount of amusement. I have to confess to a certain amount of schadenfreude on this whole thing. It's not that I don't think that anthropogenic global warming isn't real, and it's not even that I don't think that it's a cause for a certain amount of concern. But it always warms the cockles of my heart to see any group whose fundamental identity is based on being a bunch of self-righteous, holier-than-thou--worse, smarter-than-thou--scolds get their comeuppance.

But there is a real lesson in this for both scientists and non-scientists alike, and today I'd like to concentrate on the psychology of computer simulation.

From CBS's Declan McCullagh, who seems to have a much stronger tolerance for wading through the HARRY_READ_ME.txt file than I do, we learn:
In addition to e-mail messages, the roughly 3,600 leaked documents posted on sites including Wikileaks.org and EastAngliaEmails.com include computer code and a description of how an unfortunate programmer named "Harry" -- possibly the CRU's Ian "Harry" Harris -- was tasked with resuscitating and updating a key temperature database that proved to be problematic. Some excerpts from what appear to be his notes, emphasis added:
I am seriously worried that our flagship gridded data product is produced by Delaunay triangulation - apparently linear as well. As far as I can see, this renders the station counts totally meaningless. It also means that we cannot say exactly how the gridded data is arrived at from a statistical perspective - since we're using an off-the-shelf product that isn't documented sufficiently to say that. Why this wasn't coded up in Fortran I don't know - time pressures perhaps? Was too much effort expended on homogenisation, that there wasn't enough time to write a gridding procedure? Of course, it's too late for me to fix it too. Meh.

I am very sorry to report that the rest of the databases seem to be in nearly as poor a state as Australia was. There are hundreds if not thousands of pairs of dummy stations, one with no WMO and one with, usually overlapping and with the same station name and very similar coordinates. I know it could be old and new stations, but why such large overlaps if that's the case? Aarrggghhh! There truly is no end in sight... So, we can have a proper result, but only by including a load of garbage!

One thing that's unsettling is that many of the assigned WMo codes for Canadian stations do not return any hits with a web search. Usually the country's met office, or at least the Weather Underground, show up – but for these stations, nothing at all. Makes me wonder if these are long-discontinued, or were even invented somewhere other than Canada!

Knowing how long it takes to debug this suite - the experiment endeth here. The option (like all the anomdtb options) is totally undocumented so we'll never know what we lost. 22. Right, time to stop pussyfooting around the niceties of Tim's labyrinthine software suites - let's have a go at producing CRU TS 3.0! since failing to do that will be the definitive failure of the entire project.

Ulp! I am seriously close to giving up, again. The history of this is so complex that I can't get far enough into it before by head hurts and I have to stop. Each parameter has a tortuous history of manual and semi-automated interventions that I simply cannot just go back to early versions and run the update prog. I could be throwing away all kinds of corrections - to lat/lons, to WMOs (yes!), and more. So what the hell can I do about all these duplicate stations?...

As the leaked messages, and especially the HARRY_READ_ME.txt file, found their way around technical circles, two things happened: first, programmers unaffiliated with East Anglia started taking a close look at the quality of the CRU's code, and second, they began to feel sympathetic for anyone who had to spend three years (including working weekends) trying to make sense of code that appeared to be undocumented and buggy, while representing the core of CRU's climate model.

One programmer highlighted the error of relying on computer code that, if it generates an error message, continues as if nothing untoward ever occurred. Another debugged the code by pointing out why the output of a calculation that should always generate a positive number was incorrectly generating a negative one. A third concluded: "I feel for this guy. He's obviously spent years trying to get data from undocumented and completely messy sources."

Programmer-written comments inserted into CRU's Fortran code have drawn fire as well. The file briffa_sep98_d.pro says: "Apply a VERY ARTIFICAL correction for decline!!" and "APPLY ARTIFICIAL CORRECTION." Another, quantify_tsdcal.pro, says: "Low pass filtering at century and longer time scales never gets rid of the trend - so eventually I start to scale down the 120-yr low pass time series to mimic the effect of removing/adding longer time scales!"
Disclaimer: I am not a scientific modeler, nor do I play one on TV. However, I have cobbled together the odd simulation to explain various software behaviors, and I've done the occasional spreadsheet to help me understand various physical processes. In my experience, the basic methodology for producing such a model goes something like this:
  1. Write the model.
  2. Run it.
  3. Stare uncomprehendingly at the results, trying to figure out why they bear no relationship to what you perceive reality to be.
  4. Debug it and modify it.
  5. Until it looks sorta-kinda right, go to step 2.
  6. Once you believe it's getting close, start tweaking the various constants you defined for your model in an effort to get it in closer and closer agreement with whatever your observed data set is.
  7. Run it.
  8. If it doesn't agree with your data set, go to step 6.
  9. Hopefully gain some insight into what you were modeling.
  10. Breathe a sigh of relief that it's finally over.
  11. (and this is the most important step of all) Forget all about how you constructed the model as quickly as possible.
My experience is that as soon as you have the model debugged, you tend to treat its results as gospel. You rely much too heavily on the model for any future inferences that you make about the system.

This is, in my experience, an essential part of the psychology of computer geeks. Computer programming is an exercise in abstraction: you break a problem down into more basic parts that you think you understand. Once you get the behavior you understand from the underlying parts, you can forget about them and concentrate on the behavior generated when you hook those parts together, and so on, until you've created the whole system. It takes a certain amount of discipline to remember that you programmed the basic parts on a day when you had just had a fight with your family, or were interrupted halfway through a key chunk of code, or were sick. They aren't necessarily correct.

I'm sure that the good folks at CRU were conscientious in verifying their models to the best of their ability. I am also sure that they were not software engineers, and our friend Harry's notes make it crystal-clear that he was dealing with a bag of poorly matched components produced by people that probably knew a lot about thermodynamics but not so much about object-oriented design (or even structured programming), to say nothing of rigorous source-code control. It's no wonder that they promptly forgot everything about their models as soon as they got them working.

Why is this important? Several reasons:
  • When a model isn't understandable, it isn't capable of being critiqued. Criticism is the foundation of all scientific inquiry.

  • In my experience, lack of elegance comes from lack of understanding of the underlying problem. You write bad code when you're blundering about. Blundering is all well and good--it's another of the unspoken foundations of scientific inquiry--but it's not so good when your results are being handed over to the UN as a basis for policy recommendations.

  • Bad code implies that you have no way of quantifying how sensitive your model is to its data. We know that a non-linear system like the atmosphere is incredibly sensitive to initial conditions (cf. the "butterfly effect"). My guess is that CRU not only doesn't know how noisy its measurements are, it doesn't know how much variations in those measurements affect the output.

  • There is absolutely no way that you can make cogent engineering recommendations on how to modify atmospheric behavior when you don't understand your model.
Let me harp on this last point a bit more. Climate science has come a long way, and it's been able to generate some results to which we all ought to pay attention. However, there is nothing like a reliable theory of the atmosphere. We can barely reproduce historical climate behavior, to say nothing of predicting future behavior with any accuracy. The big lesson from Climategate is that, while it's a great achievement to be able to tweak a model until it fits your known data sets (and I'll leave the simply despicable behavior with regard to the acquisition, maintenance, manipulation, and obfuscation of those data sets to those with a greater store of moral outrage than I), it's quite another thing to have a model that's so well understood that a set of geo-engineering principles drops out of it.

And make no mistake: What we're embarking upon is a feat of geo-engineering. When we endeavor to reduce emissions, we're basically modifying the forcing functions on the atmosphere. (It's entirely possible that there's something that we don't understand that will cause non-linear behavior to emerge when the second derivative of the historical CO2 level goes strongly negative.)

Engineering has consequences, and it's really nice to understand them with with extremely well-understood science. This is how we avoid producing the atmospheric equivalent of Galloping Gertie.

Thursday, September 24, 2009

Net Neutrality Explained--Again! Differently!

In the wake of FCC Chairman Genachowski’s speech, there’s been a lively network neutrality discussion going on over at Obsidian Wings, here, here, and (though I didn’t comment on these) here and here and here.

I’m still very concerned that the technical issues associated with network neutrality are still falling through the cracks. Since there appears to be a limit on how big a comment you can post over at OW, I thought I’d spend some time and describe some of the issues.

The net neutrality debate of course dates back quite a while. A good summary can be had by looking at the Wu and Lessig brief to the FCC from 2003. To boil this all down, and to describe what the FCC is worried about, there seem to be three major bones of contention:

  1. That network management policies be open, so that the public can understand how traffic is being managed by any particular ISP. This is a pretty simple transparency issue.

  2. That access to an ISP’s network be available to all content providers, so that the ISP can’t favor, for example, its own content over the content of one of its competitors, or so that small providers have equal access to big providers. Let’s call this location neutrality.

  3. Finally, that ISPs practice application neutrality as well as location neutrality. The idea here is to guarantee that the internet is available as a public utility, with access guaranteed for any application--and protocol--that comes along.

Item #1 is just motherhood and apple pie, mod obfuscating enough information that an attacker can't exploit it. Transparency is good.

Item #2 was stimulated by perfectly reasonable public policy concerns. We don’t want the big providers to get bigger at the expense of the little guys, and we don’t want giant media conglomerates using their vertical content and media integration as a weapon against more horizontal competitors. All great.

At first blush, item #3 seems to make lots of sense. We want the internet to be available to the next clever fellow who invents the next killer app, right? He should be able to count on well-defined access the underlying network infrastructure, right? Wu and Lessig use the analogy of the power grid to make this point. An electronics manufacturer can count on the power grid to deliver 110V, 60 Hz current anywhere in the US. Why shouldn’t the internet provide the same platform for producers of network applications?

Well, there’s a problem. In fact, I can think of two problems, one pretty simple and the other definitely not-so-simple.

The first problem is that, while we think of our ISPs providing us internet service, what they mostly provide is web service. In 2007, HTTP traffic comprised 46% of all web traffic. Back in the late 90’s that number was probably closer to 85%.

But in between, a little thing called peer-to-peer (P2P) file sharing came along, with BitTorrent being the killer app.

The vast majority of ISP subscribers use the web for pretty much everything, so ISPs optimized their traffic engineering for web applications. Web access is very simple, but it’s highly asymmetric: You make a small request and you get back a large amount of data. ISPs therefore heavily biased their network traffic toward downloading data from the core network, rather than uploading data to it. I’m currently on Time Warner Roadrunner, and my download speed is 15 Mbps, but my upload speed is only 1 Mbps.

But a relatively small number of users use the internet for P2P file sharing. That application is so bandwidth-intensive that in 2007 it accounted for 37% of all traffic.

Access ISPs hate BitTorrent. BitTorrent uploads and downloads nearly symmetrically, and it uploads and downloads a lot. If you’re on a DOCSIS cable system for internet and you have a P2P aficionado in your neighborhood, there’s a pretty good chance that he’s consuming a sizable chunk of the upload bandwidth available.

ISPs attempted to solve this problem by throttling BitTorrent. All they have to do is drop the occasional packet, or even de-prioritize the traffic at the router, and BitTorrent uploads and downloads slow to a crawl. Torrent-heads responded by encrypting their BitTorrent flows, so it was harder to do packet inspection to discover which flows were true P2P traffic.

And then Comcast decided to send TCP reset messages to BitTorrent flows, causing them to abort. And, as if this weren’t guaranteed to cause unbridled rage, they then denied they were doing it. Until they got caught, of course.

BitTorrent is, of course, a fine poster child for application neutrality. If the FCC were to adopt an app neutrality policy, ISPs would no longer be able to throttle BitTorrent. They would probably have to respond by changing the download/upload bandwidth mix, which would require deploying a lot more network equipment and forcing the price of broadband up. Maybe that wouldn’t be so bad. I wouldn’t be happy about this, but it wouldn’t destroy the internet or stifle innovation or any of those things that anti-net neutrality folks get the vapors about.

But the second problem will do those things. The poster child application for this problem is voice and video over the internet (VVoIP), but the problem really applies to any communication application that needs to have real time communication flows. We’re about to go down the rabbit hole here, folks. Any of you who faint at the sight of internet acronyms should leave the room now.

So far, we’ve talked about the web and P2P apps, both of which use the internet’s Transmission Control Protocol (TCP). TCP was invented back in the late 1970’s and has been the dominant internet transport ever since. It provides an end-to-end reliable byte stream between two applications. To do so, it takes messages handed to it by an application and chops them up into Internet protocol (IP) packets, encapsulating each one with some information so that the packets can be re-assembled by the receiver application. If packets get dropped, or duplicated, or arrive out of order, the TCP information is sufficient to put everything back together or, if necessary, request that the sender re-send some of the packets.

TCP accomplishes its reliable transfer with two additional, highly important properties. One is flow control: this simply means that, if the receiver runs out of memory into which to receive the byte stream, it has a way to tell the sender to stop sending until memory becomes available. The other property is called congestion control. These two properties, or more precisely the lack of them in other transport protocols, are going to be a problem for application neutrality.

Everybody knows that the internet is built out of routers, which are pretty easy to understand at a basic level. A router receives IP packets (not messages) from one or more network interfaces, stores them into memory, then forwards them as fast is it can out some other set of network interfaces. There can be more input interfaces than output interfaces, or the inputs can be faster than the outputs. When this happens, packets build up in memory until the router runs out of space. Unlike TCP, the IP packets that the router deals with don’t have flow control, so the router can only drop them on their little pointed packet heads, and the receiver has to do decide what to do about the missing data.

When TCP packets get dropped, one of the most common behaviors is for the receiver merely to refuse to send an acknowledgment (ACK) packet back to the sender. After a while, the sender decides to re-transmit its currently unacknowledged packets. But now imagine that a router gets congested, so that a whole bunch of TCP connections lose some packets simultaneously. Odds are, all of the TCP senders will re-send data at the same time, making the router even more congested. If they keep doing this, the router undergoes what we somewhat euphemistically call “congestive collapse.” You’d probably say that the internet gets broken real bad.

To avoid this problem, TCP has a congestion avoidance algorithm called “slow start.” I’m not going to go into this in great detail (you can look it up), but it works something like this: When TCP starts sending data, it will only send one or two packets at a time without waiting for an ACK packet. If it gets and ACK and it has more stuff to send, it then doubles the number of packets it’s willing to send without an ACK, and so on, up to some fairly large number of packets that it’s willing to send. But if it loses even a single ACK, it infers that it’s encountered congestion and drops all the way back to sending one or two packets at a time, and gradually works its way back up, but only to some average value where it knows that it’s likely to start losing ACKS. As a result, TCP senders send a lot less data to congested routers until the congestion condition clears for some reason.

It’s pretty simple, and it works surprisingly well. It works so well that ISPs often implement a separate algorithm on their routers called “random early drop” (RED). RED is designed to smooth the congestion condition so that not all TCP streams drop into slow start at the same time, which is very inefficient, and is vulnerable to something called tail-drop synchronization, which, suffice it to say, is yet another way that a bunch of TCP senders can unintentionally gang up on a poor defenseless router and send it off to gibber in the corner.

This is why, when your neighbor is uploading porn via BitTorrent, you’re only muttering under your breath about how slow the network is, as opposed to calling your ISP and telling them that it’s broken. BitTorrent uses TCP and therefore obeys slow start, which keeps the router network only very close to being overloaded, instead of being actually overloaded.

Note that this also works perfectly well when you're watching video on YouTube or Hulu. In this case, the video is being sent from a server that reads it off of the disk and sends it over HTTP (which uses TCP). The receiver receives the stream of bytes that make of the video, decodes them, then renders them on your screen and speakers.

But there’s a wrinkle. Imagine that, on the first packet received by your browser, it started playing the video. As long as the video stream continued to be received at exactly the right rate, each new video frame and audio sample would arrive just in time to be rendered, and you’d see perfect video and hear perfect audio. Maybe the sender can send the video faster than the receiver can play it. That’s no problem; eventually the receiver will run out of memory to store the byte stream, and TCP flow control will kick in.

But now imagine that the sender is sending at exactly the right rate, with many packets between each ACK, and your video stream suddenly gets subjected to TCP slow start because an ACK gets lost. Suddenly, instead of sending one packet right after another, the sender has to wait until it receives an ACK for only one or two packets, which will at least cause “jitter”, or an irregularity in the spacing of the received TCP packets. If there’s enough jitter, the receiver will run dry: the next video or audio frame won’t be available when it needs to be rendered. Your video will freeze, or your audio will sound like it’s coming from the bottom of the sea, or through a fan.

Fortunately, this streaming video is stored on disk--it's not occurring in real time. So all the receiver has to do to avoid this problem most of the time is to wait a couple of seconds before playing the video out. Then, if there’s jitter, the data that’s already in the buffer will tide the player over until more data is received.

But what if there is no disk? What if the source of the video and audio is another human being? Two additional constraints now apply:
  1. The sender can’t ever send the stream faster than real time to make up for past or future jitter, and

  2. The receiver can’t wait to render the video or audio. If it does, the two humans can’t have a conversation. Research shows that human conversation starts to suffer (people tend to try to talk at the same time a lot) when the delay from the time that sound leaves a person’s lips to when it reaches the other person’s ears is more than about 150 milliseconds.

Now jitter becomes the dominant constraint on the quality of the real time application. If you transport the voice and video over TCP, it can induce fairly large amounts of jitter, sometimes more than a second’s worth, which translates into more than a second that the receiver has to delay.

Since TCP is largely unsuitable, the IETF, those fine folks that recommend protocols for the internet, invented something called the Real Time Protocol (RTP). RTP is quite different from TCP. It’s designed to get media from the sender to the receiver as fast as possible, with enough information added so that the receiver can decide if any data is missing, and so it can reconstruct the timing of the stream, playing it out at exactly the same rate at which it was captured by the sender. But this real-time behavior comes at a cost: RTP can't re-send dropped data, and it has neither flow control nor congestion control.

At the router level, RTP packets are just like TCP packets: They arrive, they get stored, and they get sent. And, just like TCP packets, they’ll get dropped if the router is congested.

Dropping a whole bunch of RTP packets in a row is bad. The receiver is capable of losing a packet here and there and hiding the fact from the user. But if you lose a lot of packets, at some point the user sees the video break up or the audio start to drop out, or echo, or sound like something out of a satanic ritual.

Even if the router doesn’t drop RTP packets, they still have to wait their turn to get sent. When your aforementioned neighbor has decided to download or upload porn, there may be hundreds of his TCP porn packets to each one of your voice and video packets. When the RTP packets get delayed behind other traffic, that can cause jitter. This makes the receiver have to buffer more data before it can start to play out, which translates to delay, which translates to reduced quality.

The other extreme is bad, too. Since RTP doesn't have any congestion control, if too many people fire off real time applications at the same time, the router is going to get swamped, and there's no way for it to tell RTP senders to shut up. Instead, the network has to perform some kind of admission control before the RTP application starts up. This is a kind of "mother may I?" step, where some service owned by the ISP does some accounting (very, very complicated accounting, it turns out) and decides whether your video will be the straw that breaks the camel's back.

(At this point, some of you are no doubt yelling at your screen, "There ain't no stinkin' admission control when I use Skype, man! You're crazy! Well, both of those statements may be true, but the reason that there's no admission control in the public net is that nobody is currently running very much high-def live video in the public net. These admission control schemes are used all over enterprise networks and are a key component of any modern VoIP enterprise PBX. When the public net grows enough video--or other type of real time application, the ISPs will have to do this.)

Once we have admission control, we still have to have some way to to let RTP packets be less likely to get dropped and to “jump the line” when the queue for the packets to be sent is too long. There are many ways to accomplish this, but the most popular is to mark the RTP packets with something that the router can recognize in the incoming IP packet. This marking is placed in a IP field called the “differentiated services code point” (DSCP). The best way to the think of DSCP is that it’s a priority that goes with the packet.

Routers don’t have to obey the DSCP markings on packets, but they can if they wish to provide differentiated quality of service (QoS). But there’s yet another problem here.

Imagine that I’m an ISP and I announce to all my customers and to the various content providers, “I’m going to support DSCP on my routers.” What is the likely response? It’s usually something like, “Yippee! DSCP! If I mark my packets with high-priority DSCP, my application will get better service!” You get a form of DSCP inflation, where the markings mean less and less, because there’s no marginal cost attached to using them. Pretty soon, the applications that really need differentiated QoS are crowded out by the ones that don’t really need it but decide to use it to give themselves an edge.

ISPs can solve this problem by charging for QoS, or they can find a way to enforce admission control. They may charge their customers for a premium plan, just like they charge for faster modem speeds today. Or they may charge by the amount of DSCP-marked data that gets sent or delivered.

However the ISP does it, you’ll now understand that the terms, “differentiated QoS” and “application neutrality” are not the best of friends. And yet the fact remains: real time applications will simply stop working without DSCP if the network becomes congested.

If application neutrality becomes an FCC-mandated regulation, there is simply no way to provide the real time services that are one of the major sources of innovation on the internet today. Note that VoIP works today because its bit rate is quite low, but even today you can wind up with significant delay. Live video is in its infancy and I fear that it won’t live to childhood if app neutrality is required. Beyond that, there are lots of real time applications that could grow to be significant. There’s obviously real time gaming, which is already taking off, albeit without tight real time constraints yet. How about tele-operation of industrial robots? Or surgical robots in underdeveloped regions where it’s hard to get a top-notch surgeon to visit? How about a service where somebody else drives your car for you, or merely prevents you from crashing? All of these applications, plus many more that nobody’s thought of, will be jeopardy.

So what are the consequences of forgoing mandated app neutrality? Well, the big one is that application developers have to think about how the internet works before they engineer something new. Is this really so bad? Don’t engineers do that already?

Of course they do. If they don’t, two things happen. First, their application may not work. But even if it does work, it may be a sufficiently bad citizen that ISPs hate it. (Cf. BitTorrent above.) Even worse, users that don't use it but are affected by it may hate it. Unless it’s really, really useful, it’s unlikely to gain any traction.

On the other hand, sometimes a useful application comes along that requires new features in the internet, like the real time apps I've been t talking about. Those new features aren’t free, but ISPs will implement them if there’s a business case for them. That can’t happen if application neutrality forbids the ISP from innovating features that have to be constrained to a particular class of traffic. Each new class of traffic comes with its own engineering requirements. The ISP has to be free to implement those requirements and choose a business model that makes it worthwhile.

Update 9/24/09 11:07 PM: Fixed some typos and broken links.

Update 10/7/09 5:23 PM: Yet another net neutrality thread here.

Wednesday, September 23, 2009

Yipeee! I've Been Discredited!

I kinda geeked out on a net neutrality policy debate over on Obsidian Wings and I actually got somebody to quote this humble blog in order to discredit me. They used this post, which of course has nothing to do with network neutrality but which did contain some mildly out-of-context red meat through which I could be scorned.

I'm sure that my traffic stats (if I were measuring them) have gone up by a factor of a hundred. I'm so proud!

Wednesday, February 4, 2009

Delaying DTV Is Not All Sweetness and Light

Want to know what's really going on with the decision to delay the mandated switchover to DTV? Take a look at this, from three weeks ago:

But the transition will also free up huge swaths of spectrum in the 700MHz band currently in use by analog broadcasters, which the Federal Communications Commission auctioned off last year. As FCC commissioner Robert McDowell noted on a panel at the Consumer Electronics Show in Las Vegas this weekend, "there are companies paying hundreds of billion of dollars to use this spectrum, and they expect the goods to be delivered."

One of those companies is Verizon, which ponied up nearly $9.4 billion for spectrum it plans to use for its 4G Long-Term Evolution wireless broadband network. In a letter to top members of the House and Senate commerce committees Monday, Verizon CEO Ivan Seidenberg urged members of Congress to resist any delay of the transition, warning that it could impede the company's plans. "Verizon Wireless intends to begin field testing and deployment of LTE this year," wrote Seidenberg. "Deployment of LTE, however, can only be done if we have access to the 700MHz frequencies. Delaying the DTV transition will delay our ability to upgrade those frequencies to 4G broadband for American consumers and have a negative impact on our nation's international competitiveness."

That viewpoint has put Verizon at odds with AT&T, which has signaled its support for a delay in order to ensure a smooth transition—and, coincidentally, is not planning to use its own winnings from the 700Mhz block for LTE.

It's not clear whether Verizon would really be able to make good on its plans to begin deploying its LTE network by the end of 2009. Most analysts believe that a relatively short postponement, on the order of three months, would have little effect on 4G deployment—provided it did not set the stage for further delays, as Verizon clearly fears it might. Such a delay might also avoid a spate of homeowners sliding off icy rooftops as they struggle to install new antennas.

But a longer, more disruptive delay might provide some breathing room for Verizon competitor Clearwire. That company is seeking to build market share for its own WiMAX network, a joint venture with Sprint, before LTE is ready for prime time. Clearwire has boasted that it remains years ahead of the competition, but while WiMAX networks in Portland and Baltimore are already up and running, scheduled expansions to other cities have been delayed until late 2009, even as Verizon has bumped up its own schedule. The company's stock has now been in free-fall for months, and several major backers recently announced they would take major write-downs on their investments in Clearwire. (The roster of large investors in Clearwire includes Obama-ally Google.) A toxic negative feedback loop in investor confidence could leave it unable to finance its promised buildouts for 2009. With any transition delay certain to push the spectrum handover into the next quarter of the fiscal year, if not further, the attendant uncertainty could also factor into investment decisions as Wall Street—and equipment makers—decide which standard to back.

I just love that new politics, don't you?

Tuesday, June 3, 2008

The Kamen Arm

Here's lots of video on Dean Kamen's prosthetic arm research. Simply incredible. DEKA marries software engineering and mechanical engineering together better than any group I know of.

Monday, June 2, 2008

Bad Idea In Progress

Time Warner is testing metered internet usage in Beaumont, TX. Net neutrality harpies should be going nuts over this, because it's one of the truly bad things you can do to neutrality.
Time Warner's tiers will range from $29.95 a month for relatively slow service at 768 kilobits per second and a 5-gigabyte monthly cap to $54.90 per month for fast downloads at 15 megabits per second and a 40-gigabyte cap. Those prices cover the cable portion of subscription bundles that include video or phone services. Both downloads and uploads will count toward the monthly cap.
If you go over your threshold, they're gonna charge a buck a gigabyte.

The problem with this is that it's setting a precedent whereby small commercial endpoints are going to be encouraged to be data-stingy, which provides the big guys (who are all leasing their own lines anyway) with a competitive advantage. This is exactly what the neutrality advocates want (rightly) to avoid.

I will repeat (again and again): The way to do this is to charge for quality of service. This puts everybody on a level playing field while still allowing the ISP to plan their networks appropriately.

Tuesday, May 20, 2008

Netflix Going Into Set-Top Box Biz

Netflix is preparing to take its "watch instantly" service directly to the set-top with a $100 wireless-capable box. It's an AppleTV competitor.

Monday, April 7, 2008

Still Clueless on Net Neutrality

From NYT, yet another op-ed that completely misses the point on net neutrality.
We hate when things are taken from us (so we rage at censorship), but we also love to get new things. And the providers are chomping at the bit to offer them to us: new high-bandwidth treats like superfast high-definition video and quick movie downloads. They can make it sound great: newer, bigger, faster, better! But the new fast lanes they propose will be theirs to control and exploit and sell access to, without the level playing field that common carriage built into today’s network.

They won’t be blocking anything per se — we’ll never know what we’re not getting — they’ll just be leapfrogging today’s technology with a new, higher-bandwidth network where they get to be the gatekeepers and toll collectors. The superlative new video on offer will be available from (surprise, surprise) them, or companies who’ve paid them for the privilege of access to their customers. If this model sounds familiar, that’s because it is. It’s how cable TV operates.
But the internet isn't cable TV, which is essentially a pre-allocated bandwidth system. The IP network is packet-switched, which means that uncoordinated traffic can arrive at any router and cause it to become congested. When that happens, real-time applications like video and voice simply stop working.

There are only two solutions to the real-time application problem. First, you can massively over-engineer the network so that the odds of having congestion are vanishingly small. Of course, this is prohibitively expensive. So if you'd like to have net neutrality enforced this way, be prepared to have your ISP bills go up by a factor of ten.

The only other solution is to pre-reserve the quality of service you need for the application you're consuming (or providing). The technology exists to do this. You can explicitly reserve bandwidth using a protocol called RSVP or you can implicitly reserve bandwidth by marking your IP packets according to the diffserv standards.

But there's a catch: If everybody were simply to start marking their packets with code points that would guarantee expedited service, then the whole system falls apart. If all traffic is expedited, then no traffic is truly expedited and we're back where we started.

So you need a mechanism to make sure that everybody only requests what they really need. That mechanism is to charge a premium for the expedited services. And that would conflict with what most clueless people (including politicians) consider to be the doctrine of network neutrality.

Please understand: I am an ardent defender of common carriage--the requirement that ISPs transport data indiscriminately, regardless of its origin, destination, or content--but you simply have to be able to charge for quality of service. You're running up against simple laws of physics here. They may be unobvious laws but they are nonetheless laws. To force ISPs to carry expedited traffic at the same price point as unexpedited traffic simply will not work. The net neutrality advocates have to understand the difference between common carriage and legislating pi equal to 3.000.

Minor disclaimer: Since I work in the biz, I should point out that my opinions are solely my own, although they largely agree with those of my employer. That's because my employer is not clueless.

Monday, March 24, 2008

Netflix Is Down

...and has been down all morning. I wonder how much this will cost them?

Friday, March 14, 2008

Better YouTube Resolution

A list of handy hacks for getting 480x360 resolution out of YouTube.

Monday, March 10, 2008

The End of Mobile As We Know It

Half the universe will be building applications for the iPhone, now that the software development kit has been released.
Businesses will be more likely to dole out iPhones to employees because, in addition to e-mail compatibility and synching ability, Apple is now offering a way for employees to access business servers that are behind firewalls. Moreover, the phones can be cleared of all data remotely, if they are lost or stolen. And Salesforce.com, a business services company, has already built applications using the iPhone development kit. "I think what you're going to see is, just the release of the enterprise integration alone is going to drive substantial business sales [of the iPhone]," says Raven Zachary, a software developer who started iPhoneDevCamp, a series of workshops to spur development of Web-based iPhone applications. "You'll see people leaving their BlackBerrys at the office."
Add in the $100 million Kleiner Perkins investment in iPhone software and you have the beginnings of critical mass.

Then there are the Google-backed Open Handset Alliance and the OpenMoko folks, who are promoting open reference designs for mobile phones that can host open applications.

What does this mean for the mobile carriers? It means they're in big trouble. Faced with this onslaught of open platforms, the first piece of revenue to dry up will be their highest-margin service revenue. They simply won't be able to restrict their handsets to accessing only their services. Following that, the application bandwidth demand will force them to provide cheaper (aka lower margin) data services. Finally, after they've invested in tons more data bandwidth for their networks, VoIP services will spring up that eat into their voice carriage. They'll be simple commodity data carriers.

Good news for us. Bad news for them. We should start thinking about how to keep a mobile data commodity market healthy. It's not going to be the sexiest business in the world and the coming crash in the mobile carriers' equity will leave a very narrow field, I suspect.

Friday, March 7, 2008

No, ICANN

This is disturbing and stupid:
Steven Marshall, the owner of T&M and affiliated websites such as www.cuba-hemingway.com, www.cuba-oldhavana.com, and www.cubanculture.com, is a British travel agent with an interest in Cuban culture who sells tours to Cuba to European tourists. Unfortunately for Mr. Marshall, the American government has little sympathy for those who don't share its hardline views of the Caribbean nation. Imagine his surprise when he woke up one day and rubbed his eyes clear - unbeknown to him, his company had been blacklisted by the American government, and his hosting company Enom had shut down all his websites.

The American government's obsession with all things Castro has led to some of the most restrictive trade sanctions in the world. Since 1963, the Office of Foreign Asset Control (OFAC) - an arm of the Treasury Department that enforces asset forfeiture decrees against international drug king pins, terrorists and assorted political undesirables - has robustly asserted its authority to seize assets of Americans or American companies that in any way, shape or form provide hard currency to the Castro regime.

But as the New York Times reported yesterday, the Treasury Department is taking an even more expansive view of its jurisdiction over the Cuban embargo, if the T&M case is indicative of things to come.

The case also threatens to renew lingering concerns in the internet community over continued American dominance of the internet. Marshall is a British citizen living in Spain. He sells tours to tourists in Europe, which imposes no restrictions on travel to Cuba. His servers were located in the Caribbean.

His only proven ties to the United States were domain registrations through ICANN-approved registrar Enom and his use of the .com top level domain, whose registry is, for all intents and purposes, owned by Verisign, an American company with close ties to the American government. The move by OFAC has troubled American experts on internet law. Should registration through an American registrar or registry really justify American jurisdiction and the forfeiture of websites which are not even hosted on American shores?
It would behoove the nitwits at OFAC to remember two important points:
  1. The rest of the world is uneasy, to say the least, with having the assignment of domain names and IP addresses administered by the ICANN, the Internet Corporation for Assigned Names and Numbers, which is a US corporation.


  2. There's widespread agreement that UN administration of the internet will be a catastrophe.
Given the fracas in Tunisia a couple of years back, this sort of press is exactly what can drive internet administration away from a pragmatic, non-profit company and into the hands of a bunch of politically hamstrung international bureaucrats.

Monday, March 3, 2008

Computing Commoditization

Intel is taking down their gross margin estimates. Lots of people are taking notice that the Asus Eee may be forcing a precipitous decline in computing cost. Charles Stross thinks (or thought, back in December) that this might be an early harbinger of a genuine commoditization of computing resources. Not great news for the box vendors but good news for us consumers.

Tuesday, February 19, 2008

Requiescat in Pace

Toshiba announces that they'll stop manufacturing HD-DVD players. Sometimes the right things really do happen.

Friday, February 8, 2008

What the Democrats Need to Know About Finite State Machines

I'm gonna geek out for a moment. When you design automatic equipment of any sort, you often use a technique based on a finite state machine. FSMs assume that any piece of machinery can be driven from any given state (i.e. set of current conditions) to another, based on a well-defined set of events. If you can define all the states and all the events, you can completely describe the operation of the gadget.

But there's one other hidden assumption built into FSMs: an FSM doesn't care about the past. It only cares about its current state and any events that occur in that state.

This morning, I happened to be watching the MSNBC Morning Joe program (yes, I know how sad that sounds), which had David Shuster subbing for Joe Scarborough. In response to a replay of Mitt Romney's statement that he can't let his campaign "be a part of aiding a surrender to terror," Shuster nearly exploded, immediately stating that the Republicans must then have already surrendered to terror for starting the Iraq war in the first place. (I will leave for another day the irony of Shuster pretending to be a reporter and making public statements like this for another day.)

Now what, you ask, does that have to do with FSMs? I'll tell you: We got into Iraq. You can agree or disagree whether getting into Iraq was "wise" or "worth it" or "the worst foreign policy disaster of the last century." You can't dispute the fact that we're there. That's the current state. The past simply doesn't matter.

Now, here's somebody who thinks that the GOP might win the Presidency, based on Clinton and Obama's inflexible vows to evacuate Iraq as soon as possible.

Now, from the current state of "we're in Iraq," there are two possible next states: We're either leaving, or we continue to be in Iraq.

I can only think of three sets of events that will result in leaving Iraq, and none of them have anything to do with whether being in Iraq was a good or a bad idea:

  1. You believe that evacuating Iraq without stabilizing it won't be disastrous for American foreign policy AND that the cost of stabilizing Iraq is too high.


  2. You believe that evacuating Iraq without stabilizing it will be disastrous for American foreign policy BUT that it's impossible to stabilize it.


  3. You believe that Iraq has been stabilized.

Now, there are probably a few people that hold with condition #1. But, since the Democrats have been harping about what a foreign policy disaster Iraq has been, presumably most people think that leaving without stabilizing will be very bad.

There are a large number of people who used to believe that condition #2 was true. They thought the war was unwinnable, so we might as well take our lumps and cut our losses. However, it seems more and more likely that stabilizing Iraq will indeed be possible, albeit at some sizeable expense in blood and treasure. So, if you believe that leaving an unstable Iraq would be a disaster, you must ultimately decide to stay until the situation is stable.

Virtually nobody thinks that condition #3 is true today. But if you can't abide condition #2, then you must decide to remain until the job is done. Full disclosure: I supported going to war in 2003. If I knew then what I know now, I wouldn't support it any more. Going to war was probably a mistake.

But I think that the only way out is condition #3. The Democrats have bet everything on condition #2. If they can't convince a majority of the electorate that condition #2 is true, they're going to lose.

Wednesday, February 6, 2008

Five Cables, Now

Cables near Penang, Malaysia and Bandar Abbas, Iran have also been cut, in addition to the two near Alexandria and the one off of Dubai.

A quick bleg: Is it normal to have this many cables out of service? I can't imagine that it is. Isn't anybody wondering whether this is sabotage?


UPDATE: Wired tries to debunk a variety of conspiracy theories here.