Skip to content

Entries

Steal This Education

I think copyright infringement may save millions of lives.

Allow me to explain.

So starts a pretty well-thought-out essay from Dan's Data. Read it: it won't take too much of your time, and may give you a different way of looking at the bandwidth you're using up.

How I doubled my bandwidth by playing with routing tables

A while back, I availed of Sun's postpaid HSDPA service, primarily as a stopgap until I could finagle a proper hardline connection. I kept it, so I could work, even in the middle of a farm, as I stated in a previous post.

Except I haven't been to that farm in a while. Hell, I haven't gone anywhere in a while. I'm either working, sleeping or studying. For the past 2 or 3 months, the Huawei dongle that Sun provided went unused (except the one time my mom borrowed it to use during a trip to Baguio). Aside from that, it used to see daylight only when I take it out of the drawer when I clean my office. Or, you know, when I took it out to take a picture for use with an entry.

I'm still paying monthly fees for the thing; I'm locked to it by a 2-year contract. So I figured I should find a way to actually make use of it.

Back when I was still using Windows, I remembered a little trick you could do with dial-up connections. You could trunk them, resulting in a single virtual connection with bandwidth that's effectively the sum of its individual connections. I figured if Windows could do it, GNU/Linux should also be able to, no sweat.

As most of you know, I'm a code monkey by temperament and vocation; what system and network administrations skills I have, I learned by virtue of being the most qualified one in the family to take it up. So it took me a while to figure out, but, by ghod, was it worth it when I finally managed to do it.

In the interest of saving other people much hair-pulling, incomprehensible mumbling and outright violent tantrums, I'm writing the instructions down.

The situation

The DSL connection I'm using can do bursts of up to and around 120 to 140 kB/second, or about 1 mbps. Nothing to write home about, but it works out okay. For the past couple of days or so, I've noticed problems with my main connection's bandwidth shrinking to pretty much nothing, before going back up to its normal state.

This happens without rhyme nor reason (that I can figure out), although it's probably my lousy v7 Linksys router signaling its impending (and none-too-soon) death. Although it could also be the telco's fault; the ineptitude of PLDT's "technical" staff is legion.

As you can probably imagine, I got a little bit of a push from being annoyed by this.

Sun's HSDPA connection, meanwhile, averages about the same. True, Sun says I ought to get up to twice as much bandwidth, but I'm literally 4 feet away from a dead spot in every direction--I'm taking whatever I can get.

The payback

When I finally got this setup working, I managed to hit a little under 200 kB/sec before (it seems) a bunch of seeders called it a night. Sadly, I was too stunned and giddy after I got it working that I didn't manage to grab a screenshot as it was going down, so you're going to have to trust me on this one.

The screenshot I did manage to grab is shows an ongoing torrent while the YouTube video clip in the background is still able to buffer quite a sizable percentage. Normally, even when only about 50 kBps of my downstream goes to torrents, I'm unable to build up that much of a buffer in YouTube.

The build-up

While guides abound, none of the ones I dug up explained clearly the difference between bridging, bonding/link aggregation, and a bunch of other networking terms that seem to require a CCNA to understand. Also, all of the guides I've come across assume that you're trying work with two or more ethernet adapters.

After multiple cursing rounds that would make any tanned and salted sailor blush, I finally hit the right sequence of incantations required to get it working. And, no, you don't need to actually need to be a CCNA (or have one by your side) to get this working; you don't even have to read the links in the previous paragraph.

The setup

If you're using a GPRS "modem", as I am, I'm assuming you've already managed to figure out how to connect to your provider. Personally, I use the stock ppp package, with a custom chat script, to which I've also added custom ip-up and ip-down scripts.

Having facilities for post-connection and post-disconnection scripts isn't required, of course, but helps in making things run smoother.

In any case, here're the commands you need to run, presented without comment (those come afterward):

ip route add $PPP_NET dev $PPP_DEV src $PPP_IP table gprs
ip route add default dev $PPP_DEV table gprs

ip route add $HOME_NET dev $HOME_DEV src $HOME_IP table home
ip route add default via $HOME_GATEWAY table home

ip rule add from $PPP_IP table gprs
ip rule add from $HOME_IP table home

ip route del default via $HOME_GATEWAY dev wlan0
ip route add default scope global \
    nexthop via $HOME_GATEWAY dev $HOME_DEV weight 5 \
    nexthop via $PPP_NET dev $PPP_DEV weight 1

After pulling the plug on your HSDPA connection, you need these commands to ensure that traffic flows normally through your remaining connection properly:

ip route add default via $HOME_GATEWAY dev $HOME_DEV

Here're what the variables above should be:

  • $PPP_NET is the network segment your HSDPA connection tells you you're a member of. For my Sun connection, it's 10.64.64.64.
  • $PPP_DEV is the PPP device your connection is attached to. Most likely ppp0, unless you have another PPP connection.
  • $PPP_IP is the IP address your provider has assigned to your connection.
  • $HOME_NET is the network segment your wireless connection is associated with. Mine's 192.168.1.0/24.
  • $HOME_DEV is the device associated with your wireless connection. Probably wlan0.
  • $HOME_IP is your wireless connection's IP address.
  • $HOME_GATEWAY is your gateway's address. If you only have one router, this'll be your router's IP address.

The identifier after table in the above commands is an arbitrary string. You probably have to edit the iputils configuration first; on my Arch Linux install, the file I needed to edit was /etc/iproute2/rt_tables.

Of course, this isn't limited to pairings of an HSDPA and wireless connections; this would work just as well with wired connections. Just replace $HOME_DEV with the appropriate ethernet device name (e.g., eth0). The weight values can be tweaked, as well; think of it as an affinity indicator for packets. The higher the weight, the more likely it is that a given packet will go through that particular route.

(This is probably incorrect, or, at best, inaccurate.) Near as I can tell, what we're doing is we're setting up the routes for each connection. Setting each individual connection up, as it is, to be able to perform by itself. Then we tell GNU/Linux about the two separate routes we've set up, and let the system figure out how it's going to use it. We also tell the system that no matter what happens, particular IP addresses have to be reached by a particular route. This lets me still reach (and be reached by) the other computers in my network without a hitch.

The letdown

It's not all sweetness and light, mind you. There are some caveats to this setup.

As an example, take this publicly-private tracker I've recently become a member of. It tracks ratios using a member's IP address; since I'm reachable by, and (worse yet) can reach them using, two addresses, my ratios have become a little off.

(I've since added a rule that connections to that tracker have to go through my home network; though as to why I never thought about doing it earlier, I can only plead being tired. And lazy. And, also, being a n00b.)

So, if you frequent a site that tracks you by IP (as opposed to cookies), you should add a rule that restricts traffic to that site's IP address to a specified route. Switching between two or more routes might lead to hair-pulling, and people only have so much hair.

(There are likely incomplete thoughts, errors and whatnot in this post; if so, excuse please, and let me know. I'll get to them eventually--right now, I just want to catch up on my sleep debt.)

[Update: Here's another screengrab, this time of bwm-ng, done while I was pulling Evolution from the repos:

Yep. 340+ kilobytes per second. A little under 3 megabits/sec. It's like my connections, together, are the little pipes that could. :D]

Why Wi-Tribe is doomed to failure

Being on the Intartubes is pretty big deal in my line of work. I remember a time when I had to strictly limit my time online: connect to grab email from a POP3 server, disconnect, read and possibly reply to emails, then reconnect if there were any outgoing emails to be sent. I longed for a time when I can be constantly connected, when transferring gigabyte-sized files wasn't just a pipe dream.

Nowadays, I only think about my Internet connection when it's being flaky, or when it's (gasp!) down altogether.

Up until a few years ago, though, Internet connections with decent-enough speeds were limited to when you were in a place that can be reached through hardlines. Want to browse the Web while in the middle of a farm in (well, nowadays, not-so-) sleepy Malolos, Bulacan? If you existed in the Philippines in pre-2006 (near enough), tough luck.

Post-2006, and you've got more of a chance.

HSDPA devices proliferate in the country, being offered under mostly similar terms by three largest telcos (Smart, Globe and Sun). And they're mostly not half-bad; just don't expect to be able to transfer multi-gigabyte files without going bat-shit insane.

Earlier this year, a new contender in the wireless "broadband" competition emerged: Wi-Tribe.

Hold up—that doesn't seem right. Calling them a contender implies that I think they have a chance. Which they don't.

First off, they seem to confused as to what they are. They're offering a fixed-base wireless Internet connection, similar to what I know Globe offers. Except their service doesn't come with a phone line (nor do they offer one). Anyway, since it's a fixed-base connection (meaning, it requires AC power), that means no dice if you want to surf in the middle of that farm I mentioned earlier (plus, their base is bulky, to boot). Which is why I thought it was weird (and stupid, and even kind of funny) that the couple of salespeople I talked to tried to push their product on me as a replacement for my HSDPA connection.

The lack of a phone service isn't probably a big deal-breaker for most people, since you either already have a landline, or rely on mobile phones. But, then again, if you already have a landline, why go with Wi-Tribe? Hardline connections are more reliable, and are often faster in reality. The ones who usually go with wireless, fixed-base connections are those who live in areas that aren't serviceable by PLDT (the Philippine telco; like Ma Bell, except the Philippine government never got it through their heads that they should break it up).

Nor are their plans unlimited: they cap it at about 12 gigs per month, with some sort of promo that allows you to go up to 48 gigs, if you mostly use it during off-peak hours). If you go over, you pay them a bit more. Overages; they still make me cringe to this day. I guess I'm pretty far from the baseline, since I regularly eat up more than 50 gigs per month. But, still, offering capped plans in this day and age? Hey, Wi-Tribe: 1998 called, and they want their pricing scheme back.

Again, for those people, there are alternatives. And all of them don't have their transfers capped.

From where I'm sitting, it looks like the only ones who'd go for Wi-Tribe are those who are desperate to be on the Intarwebs, have been passed over by PLDT and Globe and/or Smart, aren't aware of the HSDPA plans available from Globe, Smart and Sun, and only ever go to Facebook to play games.

But here's the kicker. Here's where I really get pissed.

It's as if Wi-Tribe deliberately want geeks to fuck off.

Never mind the transfer cap, never mind the ignorant salespeople, never mind the convoluted pricing scheme.

They're either fucking liars, or are extremely stupid.

See, Wi-Tribe brands their service to be 4G. It's plastered all over their tents, their site, and every promotional copy of theirs I've come across. 4G. When, strictly speaking, they're not even fit to be called 3G. They're not lying "just a little bit", not fudging their numbers to attract customers. No, they're outright trying to fool the public by claiming to be 4-fucking-G, one fucking generation ahead of the competition, bitches.

Never mind how my HSDPA connection promises me a best-effort of 2mbit/s, while they only do fucking half.

Quick, you've got a product or a service; who do you rely on to spread the word? Early adopters. And when your product is tech-heavy? Who should you target first?

Geeks.

Geeks who read. Who know how to fucking use a fucking search engine to verify your claims. 4G?! Pshaw. I spit in the general direction of your transfer caps and barely 3G service.

No self-respecting geek would want to be seen with this thing. If I go into another geek's house and see that bulky Wi-Tribe base glowing ominously in a corner, I'll know that this is a faux geek, easily seduced by marketing speak.

No, thank you. I'll stick with the stupid "techs" over at PLDT (and their "engineers" who don't even know what the fuck pinging a server or doing a traceroute means); at least, when my connection works (which is about 99.9% of the time), it's great. I'll even stick with my Sun HSDPA connection, which I hardly use, and becomes flaky if the wind even so much as blows a little too strong or some shit. At least I knew what I got into, and I'm perfectly happy paying for it for the rare instances that I use it.

I will not participate in a scam of a product that, seems to me, deliberately flips the bird towards the people they should be courting.

Blog topics on the backburner

Haven't done a substantial post (well, what passes for one around these parts) in quite a bit. Not that I've ran out of ideas; in fact, I've got a few. Just haven't figured out which one to tackle first. Which, I suppose, is just another way of saying I haven't mustered enough passion to write a 1.5k+ word post on any of these ideas.

Anyway, my regular visitors here (Yes, I mean you. You know who you are.) know how cantakerous and snarky I can be, if I can be bothered enough to care about something. And I'm building up quiet a steam; might be good for a rant or two. Here's a list of topics I'm thinking about writing; if you favor one (or two), let me know either through the comments, or IM.

  • Why Wi-Tribe is doomed to failure: Wi-Tribe is a relatively new (here, anyway) wireless Internet service; I don't think they have a snowball's chance in hell.
  • Telecommuting in the Philippines: Why it sucks, why it can't help doing so, and why it'll continue to suck for quite a while yet.
  • Abortion: Oh, come on. You knew I'd write about this eventually.
  • Comparison of the credit card system here and in the US: Why the situation here is worse.
  • WTH happened to XEmacs?
  • Drunk driving, breathalyzers, and privacy

You might notice that, out of six topics, only two are in any way related to tech. And, of those two, the angle I'm going for one of them (tellecommuting in the Philippines) is going to result in a post that's barely related to tech.

Maybe I should switch careers? :P

I blame @NathanFillion for this

I drive a 25 year old Mitsubishi Lancer SL that's a little worse for wear. Suprisingly (for other people, not me; I love my car), it can still do up to 8 kilometers per liter. And that's with me driving like a maniac--I tried taking it easy for about a whole month, once, and I managed to get it up to about 10 kilometers per liter. This is in the city, by the way.

My car, which I've called Alice long before it was mine (I'm her third driver), has definitely seen better days, and while I have no plans of ditching her, I have been thinking about getting a new (or newer) car to supplement her. (Well, mostly, the plan is to get a family vehicle, and keep Alice for myself, to terrorize pedestrians and other motorists with.) Originally, I was thinking about a used Evo IV, or maybe an Impreza STi; lately, the target has been a brand-new Mitsubishi ASX GLS SE.

Well, no longer. Thanks to this tweet by @NathanFillion (What, seriously? You don't know Mal-freaking-Reynolds?), I have now reconsidered my choices.

Now, I want the Arcimoto Pulse (image links to more pics).

Despite the maker's goals, it'll cost me even more to own and operate this vehicle than it would for me to just keep Alice serviceable for the next, oh, I don't know, 5 years maybe? They're estimating most US-based customers will save at least a thousand USD every year in fuel alone. I ran the numbers on the calculator they provide on their site, and my savings come out a little over half their projections.

And that's discounting custom duties, importation tariffs and whatever the hell else I'm going to need to pay on top of the sticker price, unless Arcimoto sells them here directly (which, while possible, is highly unlikely--still asked them when that's going to happen, though).

Still... Damn it, I want it, and I want it now. I don't care that it's currently even more impractical for me, or that it'll be practical only for a few years (by my reckoning).

Captain Mal Reynolds has decreed it to be desirable, and I agree.

What? You'd dare oppose Captain Reynolds?

Sometimes I wish I could be like Krang...

You know him. The dude from Teenage Mutant Ninja Turtles. You know, the living brain without a body? That way, I could just continue focusing on building up my brain, and not have to bother with such tiresome shit as... well, maintaing one's body.

I pulled a back muscle the other night while shopping for groceries. It was stupid, because it was entirely avoidable. I managed to forget something most self-trained body-building jocks never figure out: You lift with your legs, not your back.

So, now, I can't walk properly, have to go through convoluted positions just to get out of bed in the morning, or lift anything heavier than a cup of coffee (and even that with difficulty). At least I didn't pull my muscle by ghoddamned sneezing (which was what happened about a year ago).

Yeah, yeah, I know. I need to get into shape and shit (what, round isn't a shape?). But, for gosh's sake, I'm a code monkey. My work ties me to a chair for more than 12 hours each fucking day. And, really, it's such a bother, trying to maintain one's body. Or, as I just told Danes, my calorie-processing, weather-proof support infrastructure for algorithm generation.

Somebody figure out a way to upload a human brain to the Intarwebz, plz. And I mean RIGHT NAO. kthxbai.

No more corruption!

Finally, I'm done with all the stupid, nonsensical, infuriating, productivity-draining video corruption issues I've been having on my laptop.

The bug is still there, I'm sure (I've seen it trying to peek its head a few times over the week): it's just that I haven't had enough uptime in over a month to get the bug to trigger itself hellaciously like before.

See, I haven't been able to get my laptop to hibernate properly for over a month. When telling it to hibernate, it goes through all the motions (pausing all processes, flushing caches, &c.) just fine. But when it gets to the snapshotting part, it just sits there and sulks.

No amount of keyboard bashing will get it to even acknowledge that it knows what the hell a keyboard is, no evident disk activity (as signaled by the laptop's disk activity blinkenlight), the CPU fan spins down after a while but that's it. Nothing else. It doesn't proceed to take a snapshot, or try and do anything that I can figure out.

At that point, all I can do is turn the power off.

Still, everytime I call it a day, I try to see if, maybe, this time, it'll hibernate. See, sometimes it does. But there's no rhyme or reason to it; nothing to give a clue as to what I should probably avoid if I intend on having a repeat performance.

I'm getting sufficiently pissed to really, really, really consider switching to a BSD full-time. Probably FreeBSD. Honest, I'm considering it. I have everything I'd care about losing backed up, anyway. Except the backup's encrypted with LUKS, which FreeBSD doesn't support, so I'd likely have to redo everything, but I don't care.

At least, with FreeBSD, I know I can't suspend to disk, so I don't even try. It's not a Russian roulette deal that often leaves me with orphaned inodes and an increased risk of losing something important (even with backups, it's still an annoyance).

Probably after I'm done with the Lisp project.

Lisp job was not a prank; trying to learn Common Lisp now

Apparently, I wasn't hallucinating when I found a want ad in the local Craig's List for a Lisp programmer. The poster replied, we got to talking, I sent my resumé, et voilà: I have a new prospective client!

We're sticking with my proposal in my introductory email: two weeks of part-time work, in return for a dead-tree version of a Lisp book (told you I was serious). If, at the end of two weeks, I'm deemed worthy enough to call myself a Lisp professional, we'll talk about... er, more traditional compensation.

In line with this new gig, I'm reviewing everything I ever learned about Lisp. I've dabbled with a few Lisps, though I've never managed to get into Common Lisp (and wouldn't you know it: the job requires the one Lisp I never tried seriously before). Just goes to show you: It pays to learn as much as you can while you're still able to.

Anyway, I installed Tracker tonight, in order to try and make it easy for me to wade through more than half a gigabyte worth of books in the form of PDFs and HTML. I'm trying to find all the Lisp books I've ever downloaded, to try and gleam whatever information I can from them.

I'm a hoarder when it comes to soft-copies of books, and have been building quite a library over the past few years (though I lost quite a bit due to hard disk failures). I figure, all they cost are hard disk space, and I've got plenty, so I download every half-interesting, freely available book I can find.

I'd try to organize them (by author, by title, by topic), so it'd be easier to find them. Then, I'd promptly forget to read any of it. After a few months, I even stopped organizing them.

So I need a desktop search toolkit in place.

I'd still need it, anyway; even without the books. I tend to be sloppy with anything I'm not currently working on, unless whatever program I'm using has a bum-proof way of organizing files (like Pidgin's logs or Firefox's bookmarks). So I need something that will index my crap for me, and help me find whatever it is I need at the moment.

Being on GNU/Linux, I've quite a few options. Chief among them is, of course, Beagle: for some reason, the first thing that comes to my mind when talking about desktop search (even before Google Desktop). Except it uses Mono, which I'd die before I ever use.

So far, Tracker's working out fine. Except I wish it has a "server mode", so I could have it installed on my desktop-slash-file server and query my (larger) collection from my office. But, then again, if the file I'm looking for is on the desktop, I'd have to get at it, anyway. So I guess indexing my autofs-managed mounts aren't such a big deal, after all.

Lisp! Whooo!

I just sent off an introductory email to someone who posted a want ad on Craig's List for a Common Lisp programmer.

Yep, that's right. There's someone looking for Filipino CL programmers. (For the non-geeks and/or non-CL-aware people: it's funny because most Filipino code monkeys don't even know what Lisp is, let alone know how to code in it.)

Just in case whoever posted the said ad went to check my blog, I wanted it to have a reference to my interest in the job. Because s/he might think I'm crazy. Or stupid. Or not be who I say I am.

Well, we all know I have a few screws loose, but what I did might be considered both crazy and stupid...

I promised to put about four hours a day of work, five days a week, for two weeks, if they'd buy me a copy of a book I can afford to buy for myself. Oh, and it's available for free online.

This for the opportunity to work on an actual Lisp project. It doesn't matter if it's proprietary, or if it never ships, or if it's going to power an uber-advanced pr0n site (free pr0n!). It's Lisp.

Oh, I probably won't get the post: my email reads too much like one written by an entirely crazy person. I'd rewrite it, except it's almost 3 in the morning, and I doubt I could be less enthusiastic about the job enough that I can write coherently (heh, that'd be a first).

Anyway, Anonymous Craig's List Lisp Ad Poster Person: I really did send you an email saying I'd work part-time for the price of a book (plus shipping and handling!), and, yes, I'm quite serious.