Thursday, November 8, 2012

Give Federalism a chance?

There's a lot of talk about yesterday's presidential election, but I don't want to talk about that.  What I find interesting are the ballot measures.  Here are the ones that are even mildly interesting:


  • Three states, Colorado, Washington, and Oregon, decriminalized some for of marijuana usage as a state matter.  It's still against Federal law
  • Three states, Maine, Maryland, and likely Washington, endorsed gay marriage.  31 states had previously officially rejected endorsing it.
  • Two states, Maryland and Rhode Island, extended legalization of gambling while one, Oregon, rejected it.
  • One state, Missouri, explicitly disallowed their Governor from legislating on health exchanges
  • One state, Montana, required parental notification of abortions
  • One state, California, voted to keep the death penalty

I find these interesting not because of the content, but because it shows that we still want Federalism.  The most interesting to me are the marijuana bills.  Those states are reliable votes on federalizing just about anything, yet the actually bothered to put on the ballot and pass a measure to decriminalize something that's already against federal law.  Why bother?  I would bet a large percentage of the people who voted to decriminalize at the state level drug use that's still a federal crime think Missouri's rejection of Obamacare at the state level is insane.

But why?

Why must everything be a federal issue?  Why can't some states have the death penalty (even for minors) and others not?  Why can't some states have legal marijuana and not others?  

I'm so tired of hearing about how horrible it is we're a divided country.  I can tell you how we can stop being a divided country:

Let the people in Washington have their legal marijuana and gay marriage, but don't make the people in Georgia endorse gay marriages established in Washington.  Let Massachusetts have their government run healthcare, but Texas stay with private healthcare.  I understand that some things, even some very important things, must be handled at the Federal level.  There may be serious issues with parts of Sarbanes-Oxley, but I'll admit it had to be done at the Federal level.  (And, conveniently, it has to with the regulation of interstate commerce, which was already a Federal power)  But huge chunks of what makes us a divided nation (Carbon emissions, health care, abortion, gay marriage, drug control, speed limits, drinking ages, the death penalty...) don't have to be national issues.

So if Montana and Washington State both agree that there shouldn't be one national standard, why can't we go back to not having one national standard?

Thursday, October 25, 2012

Bayonets and Submarines

The debate earlier this week contained this exchange:
ROMNEY: Our Navy is old -- excuse me, our Navy is smaller now than at any time since 1917. The Navy said they needed 313 ships to carry out their mission. We're now at under 285. We're headed down to the low 200s if we go through a sequestration. That's unacceptable to me...
OBAMA: But I think Governor Romney maybe hasn't spent enough time looking at how our military works. You mentioned the Navy, for example, and that we have fewer ships than we did in 1916. Well, Governor, we also have fewer horses and bayonets, because the nature of our military's changed. We have these things called aircraft carriers, where planes land on them. We have these ships that go underwater, nuclear submarines.

It has since come out in numerous news sources that we actually have more bayonets than in 1916, that they were used in Iraq and Afghanistan, that we used horses actively in Afghanistan, and that we had submarines in 1916 (As did the Germans in sinking some of our ships leading up to our entry into WWI).

The most common response I've seen to this is that it's pedantic and misses the forest for the trees.  I disagree.  It would be pedantic to point out that Romney said 1917 (because by 1917 we had built more ships for WWI) and Obama would have been technically accurate about bayonets if he had also said 1917 (we drastically increased the size of the Army, and thus the number of bayonets, after entry into the war).

The problem with Obama's statement isn't the minor facts, it's that he's using the minor facts to show that his knowledge of modern combat is far superior to either Romney or the Defense Review Board that asked for more ships, thus the dismissive introduction about spending time looking at how the military works.  If Obama had spent the time he claims Romney needs to spend on "looking at how our military works" he would know that every one of our Marines still carries a bayonet, is trained to use them, and have used them in recent conflicts.  Worse his ignorance is practiced.  This isn't a line he came up with on the fly, he had prepared this response knowing that the question would be asked.  He could have justified his decision to hold the number of ships down by some example of how he believes we can adequately project power with the 285 ships we have, but he didn't.  He made a premeditated decision to instead portray Romney as a backwards ignoramus who is stuck in the days when we used bayonets and horses, not understanding that we still use bayonets and horses.



Wednesday, October 17, 2012

Obama's one point plan

In the debate last night President Obama accused Governor Romney that
Gov. Romney doesn’t have a five-point plan, he has a one-point plan. And that plan is to make sure that folks at the top play by a different set of rules.

I disagree with this characterization of Governor Romney's plan, but I'm more interested in Obama's plan:

  • Special rules for the GM bankruptcy to reward politically connected creditors over senior creditors
  • Over 1200 special exemptions to healthcare rules
  • Special loan and grant deals to politically connected green energy firms, several of questionable legality (such as the subordination of the US loans to Solyndra under private loans)

Who wants to have different sets of rules again?

Romney would have let GM go bankrupt. Obama did.

In last night's debate Obama came back to one of his favorite campaign talking points: Romney would have just let GM go bankrupt.  While it's true that Romney would have done so, and said he would in speeches, I'm not clear why it's interesting.  GM went bankrupt and Obama supported it.

The first sentence of the Wikipedia article on the GM restructuring (which is accurate):
The General Motors Chapter 11 sale of the assets of automobile manufacturer General Motors and some of its subsidiaries was implemented through section 363 of Chapter 11, Title 11, United States Code in the United States Bankruptcy Court for the Southern District of New York

There are serious questions surrounding how the bankruptcy was handled.  For instance whether TARP repayments could legally be used to bailout automakers, or whether the Federal government actually has the power to subordinate higher priority creditors in order to make sure that union pensions continue to get funded, but Romney and Obama agree that the whole thing should be handled through Chapter 11.  We know that because Romney said so and Obama handled it through Chapter 11.

Tuesday, September 18, 2012

My Dream Cabinet

I've been thinking lately about what cabinet members I'd like to see in a Romney administration.  I'll first note that I'm not that worried about the Senate.  Obama has already demonstrated that you can make recess appointments while the Senate is actually in session, so Romney should be able to just make them all as recess appointments his first weekend.

Secretary of State : John Bolton.
Secretary of the Treasury : Thomas Sowell
Attorney General : Andrew McCarthy
Department of Defense : ???


The rest of them I'd prefer to just get rid of, but I'd love to see comments on good candidates anyway.
Also, it's not a cabinet position, but I'd love to see Ann Coulter as Press Secretary.

Oh, forgot one:

Secretary of Homeland Security : Bruce Schneier

Wednesday, August 15, 2012

More debate debates

story came out late yesterday that a group of Democrats had written the "Commission on Presidential Debates" requesting that they not bring up the Simpson-Bowles recommendations in debates.  This evidently comes after a group of Republicans had written requesting they ask specifically which parts of Simpson-Bowles they agree with.

I have thoughts on whether or not the National Commission on Fiscal Responsibility and Reform (the formal name of the Commission Obama put Simpson and Bowles in charge of) is actually relevant in the Presidential debates, but that's not my real issue here.  My real issue is that a private corporation initially established by the heads of the parties is accepting suggestions from individual congressmen on what the American people should or should not hear about during the Presidential debates.

Can we not get back to a format where candidates lay out their own cases and try to rebut the other side without the circus of 3 debates plus 1 vp debate, one of which is a "town hall" where questions are selected by a biased, but supposedly impartial, selector from the general public, all moderated by biased, but supposedly impartial, journalists?

Mr. Lincoln, do you prefer boxers or briefs?
Mr. Douglass, you have setup land grants to favor railroad expansion in Chicago.  As President, will you continue to support the railroads?


Tuesday, August 14, 2012

Traffic Shaping, part 2

A few days ago I bragged about my beautiful flow control on my home network.  Things were much better than before, but they weren't as good as I thought.

Backups hummed along at 95% of max line speed and interactive traffic usually responded in a half second or so.  But not everything was well in the Federalist household.  You see sometimes in the evenings if the kids are good we have "screen time."  When this happens my wife usually watches something on Hulu on her laptop, some of the kids watch Netflix on the Wii, and others might watch YouTube on a desktop.  When that happens everything pauses and has to wait to buffer and interactive latency shoots up to an unacceptable 2-3 seconds.  This vexed me so I went into my router looked around.  Problems, but no obvious solutions.  The backup traffic is way over its allocated bandwidth and the normal traffic is nowhere close to its allocated traffic.  Traffic shaping is supposed to fix this, and in my testing it did.  So I did what any geek would do, I started noodling with stuff.  Raise txqueuelen on the vlan.  Lower txqueuelen on the vlan.  Raise it on the physical device.  Lower it on the physical device.  Change burst lengths on the classes.  Nothing helped.

Then I started Googling and found the answer.  I consulted probably a dozen sites on using Linux traffic shaping before I wrote the first script, but they all missed something critical.  They said to measure your bandwidth with different sites and figure out what your actual upstream bandwidth is and use that as your cap.

Your DSL company provisions exactly the bandwidth they said.  I know, you've never gotten within 90% of the advertised bandwidth.  I haven't either.  That's their fault, but it's not because they're lying, it's because they're inefficient.  And only when you understand exactly how can you traffic shape DSL properly.

The maximum length of a TCP/IP packet on an ethernet frame is 1500 bytes (excluding jumbo frames, because they don't apply here.)  Ethernet sticks a 14 byte header plus some padding on that, but Linux's traffic shaping modules are clever enough to figure that out, so you don't have to worry about it (which is why if you watch your stats, even if you set your max well below the capacity of your line you can never sustain it).  But DSL is actually PPP, so it sticks another 8 byte header inside the ethernet frame, lowering the max per packet to 1492 (but not the size of the transfer).  It's actually potentially worse than that because there could be other information stuck either inside or outside the ethernet packet but this isn't really the cause of the problem, and it's virtually impossible to get your DSL provider to tell you what the DSL packet really looks like, so I'll pretend it's just 8 bytes.

So you have 1492 bytes being transmitted from your router and 1500 bytes leaving the modem.  But DSL isn't ethernet.  It's being carried over the same line that carries the voice traffic, and that uses ATM.  So that the small packet voice traffic doesn't have to compete with huge data packets, ATM uses fixed 53-byte cells with 48-bytes of payload.

So we take our 1514 bytes (1500 plus the ethernet header) and divide it into 31 cells of 48 bytes (with 5 byte headers) and one with 26 bytes (padded to 48 bytes, with a 5 byte header).  Now our router sent 1492 bytes in data (which it counted as 1492+14), which takes up 32*53=1696 bytes.  Meaning we get to use about 88% of the bandwidth outbound from the modem.  This is where those numbers from our speed test came from.

But that's the maximum length of an ethernet frame (which also happens to be the easiest thing to speed test with).  What about the minimum?  The minimum TCP/IP packet is 20 bytes for the IP header plus 20 bytes for the TCP header and no payload for 40 bytes.  This happens to be what an ACK looks like, which happens to be pretty much the only thing you send back to a streaming video provider while you're watching a video.  When we packetize that for DSL/ATM we take 40 bytes, add an 8 byte PPP header and a 14 byte ethernet header for 62 bytes.  Then we divide that up into one frame of 48 bytes and one frame of 14 bytes, each with a 5 byte header.  So our router counted our 40 byte packet as 54 bytes, but it really took 106.  That means every single ACK that netflix, hulu, youtube, etc. are throwing takes twice as much DSL bandwidth as the router accounted for.  You don't notice this normally because ACKs are small and they're only sent roughly once per round-trip-time to the other side (on DSL, over 100ms) so on a single connection we're talking maybe 10kbits per second.  With multiple continuous downloads (which is what streaming video looks like when observed as raw bandwidth) we're adding 40k, but counting it as 20k.  Again, this wouldn't normally be a problem, but we were letting the low priority traffic use all the available bandwidth so now suddenly we're asking the DSL modem to send 400k per second on a 384k link and it's throwing stuff away randomly, causing retransmits and latency and all that stuff we were trying to avoid.

So we could fix this by lowering the bandwidth cap on the router to half our provisioned bandwidth.  It would be obtuse beyond belief, though, because then on large packets that make up most of our bandwidth by volume we're wasting half the already small pipe.  It ends up linux comes to our rescue again.  The htb qdisc (which I was already using) or the stab function on traffic control (which isn't available on the version of OpenWRT I'm using) provides both for a way to add additional overhead to the packet and to even to account for waste on different frame sizes later.

So now I have a new script that provides a full 384kbit outbound but sets "overhead 8" and "linklay atm" to tell linux how the DSL modem is going to mangle the traffic.  I've also gotten rid of the Wii rules and replaced them with a rule that just prioritizes all ACKs, which I suspect will give me high priority streaming video without having to actually identify streaming video (and as a bonus keep downloads downstream bound instead of upstream).  I'm sure I'll find faults with this, but in my testing it performs beautifully.  Even with uploads running at 97% of capacity I'm seeing latency numbers that look like an idle pipe.

EDIT: This ended up not working out as well as I want, so I ended up upgrading the router to kernel 2.6 and using the stab function to recompute packet size on enqueue and it's worked out fantastically.  In my test last night I was running netflix, hulu, and youtube simultaneously on three different computers while running an unrestricted upload with the bulk traffic flag set.  None of the videos paused at all and latency on ssh traffic was about 5% above an idle link.  I've updated the script above to the new 2.6 one.