VMWare + ipfix + NAT = intermittent fail

So I put all of these things together a while ago for bandwidth reporting:

  • VMWare‘s netflow reporting – I configured a virtual distributed switch to send netflow reporting to a collector.  Every time some machine runs up its internet usage, the bytes and things get tallied up and sent off for collection.
  • NAT: in order to reach the collector, the netflow packets pass through a NAT gateway, which rewrite them because the source network address is on a private network.  Okay, so that makes no sense if you don’t speak jargon, but that’s just tough.  The packets went through this thing.  Come to think of it, I think I didn’t even consider how the packets were getting routed from the source to the collector – they arrived in good order, so I was happy, and I thought no further.
  • ipfix: VMware doesn’t send netflow packets, but sends something like netflow called ipfix.

And, for good measure:

  • My preferred flow capture thing didn’t speak ipfix, so I used nfcapd to translate the packets.

And it worked wonderfully – one of those quick hacks that becomes permanent. It was perfect(ish) … until the tenth of this month.  At that point, it started logging very odd bandwidth information:

srcIP    dstIP      prot  srcPort  dstPort  octets     packets
0.0.0.0  0.0.0.1    0     23047    38382    285327087  43
0.0.0.0  0.0.0.231  0     0        0        325        285327087

The famous IP address 0.0.0.0 sent 43 packets with a total of 285327087 bytes … that means that some of those packets were seriously huge – mega jumbo frames of 6.3Mb each. Then it sent 285327087 packets totalling 325 bytes. The famous NULL packet was detected!  This information appeared in the flow-capture log … and investigation showed that it was in the nfcapd logs.  Wireshark could not understand the captures, which left the prime suspect as VMware – surely they updated something and broke everything. Maybe a memory error on the collector, or maybe a memory error on the netflow originator … what could it be?

It turns out that at the bottom of this pile of steaming randomness, is that the ipfix/netflow streams from multiple VMware ESX servers together look like one stream from a single confused host, rather than discrete streams from a number of slightly less confused hosts. The collector sees them all having the same source IP address.  Usually the data sent by different VMware hosts would be sent at different times, but as the load increased, and as time passed and things went in and out of sync, so it became more likely that there would be a collision, confusion and corruption.

All I needed to do was remove the NAT, and the problem evaporated.

The moral of the story is: netflow and NAT do not mix.  Don’t cross the beams.

Posted in Stuff | Tagged , , , , , | Comments Off on VMWare + ipfix + NAT = intermittent fail

Ocean basket case

Years ago we went to Ocean Basket and came away with 50% food poisoning (two ate, one came away sick).  We have not been back.  However, we did not say anything to anyone at the time.  Why make a fuss?

This kind of truck and bull bar

This kind of truck and bull bar, because you never know when you need to bump an ex-client.

Today, their huge truck with its huge metal bull bar tried to bump my car off the road, because I had the temerity to be scared that they would make good on jumping the stop sign where that very car has been bumped by someone driving just like they did.  The truck did jump the stop sign.  This was not a mistake: it was aggressive driving, accompanied by laughing in the cabin – ha ha, big commercial ten ton plus truck with bull bar intimidates defenceless little passenger vehicle.  Ha ha, breaking the law is cool.  Ha ha, little people are like ants, we can crush them.

So now, I’m telling the world: these people don’t care about you.  They do not care.  Your well-being is their joke.  It’s all very funny.  Well, maybe they care about you, but they certainly don’t care about me.  They so don’t care that they employ the worst sort of person to drive their goods around.  They are not unaware that their drivers are irresponsible: the only reason to fit a bull bar to an expensive vehicle that does not drive in rural areas is because you know that the vehicle is damaging others: instead of getting better staff, you institutionalise the damage that your staff do.

Now I’m making a fuss.  If they are capable of this, they are capable of bigger failures.

Posted in Stuff | Tagged , , , , , | 1 Comment

Ubuntu 14.04 GPT EFI faiL

I installed Ubuntu 14.04 and ran into a problem.  Starting with the default 64 bit version using pretty straightfoward settings as a new installation, I ended up with this terse message after the installation completed:

Operating system not found

It turns out that the laptop (a 2 year old lenovo) can only boot from EFI and GPT under a narrow set of conditions, roughly equal to “are you booting the original installation of windows from the original disk”.  GPT is a new partitioning scheme for disks bigger than 4Gb, and EFI is a booting scheme for storing the operating system boot files on those partitions. This means that the system does not boot by running the code from the first sector of the hard disk (the master boot record, MBR). Instead it loads files and things like that in a FAT-32 GPT partition. The BIOS of the computer I used has some kind of bug that causes EFI booting to fail.  Ubuntu 14.04 has enabled EFI booting and GPT partitioning by default, which kinda breaks things.

The fix is:

  1. Boot a rescue system and chroot into the installed system
  2. Use gdisk to convert the GPT partition table to the standard old MBR
  3. Run grub-install /dev/sda  (well, maybe /dev/sdb, because you might be booting a rescue system from a USB stickie).
  4. Reboot

However, I first tried at least some of these:

  • Retry (did I select some odd option during installation)
  • Custom partitioning without GPT (Ubuntu 14.04 has hidden full system encryption so that it doesn’t work in custom partitioning)
  • GRUB installed on the MBR (but GRUB 0.97 which is non-EFI does not know how to read its data from a GPT partition).
  • BIOS flash updates: these are provided as an ISO image that you can burn to CDROM … but the system has no CDROM drive.  I wasted lots of time fiddling with various projects that profess to be able to boot an ISO image from a flash drive, but didn’t to do so for me.  The program that showed the most promise was unetbootin, and that got stuck on its boot loader, and didn’t boot the “bootable” ISO.
  • LILO: this uses a block list, so it can boot anything anywhere … but this system needs to survive a kernel upgrade, and I’ve never tested Debian’s support for LILO in kernel updates. (Didn’t even try it.)

I finally found gdisk referenced on stackexchange – and that did the trick:

$ gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.7

Command (? for help): ?
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu

Command (? for help): r

Recovery/transformation command (? for help): ?
b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
d use main GPT header (rebuilding backup)
e load main partition table from disk (rebuilding backup)
f load MBR and build fresh GPT from it
g convert GPT into MBR and exit
h make hybrid MBR
i show detailed information on a partition
l load partition data from a backup file
m return to main menu
o print protective MBR data
p print the partition table
q quit without saving changes
t transform BSD disklabel partition
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu

Recovery/transformation command (? for help): g

This is the second failure of Ubuntu 14.04 in as many days (two days, not 14 days) — the other failure is that it simply will not install on machines without PAE support. (And I always thought that PAE was strictly optional.)

Posted in Stuff | Tagged , , , , , , , | Comments Off on Ubuntu 14.04 GPT EFI faiL

Thanks for nothing, Mozilla

So Mozilla just threw its CEO Brendan Eich under the bus because the brainless baying hounds of homosexual rights came barking at their door.

Thanks Mozilla. What an example you have set.  You have just given in to terrorists – you have paid their ransom, you have given them the sacrifice they demand. They will move on from this triumph to the next, gloating over the bloody remains on your organisation on their iphones, windows phones and .NET enhanced internet explorer only web sites.  You believe you did this for the good of your organisation.  You did this to the detriment of every organisation that intends to be impartial.  Now that they have tasted CEO blood, they will never stop.

What’s next for this brave organisation? What about:

  • Fire people accused of “islamophobia”
  • Fire people for supporting an unpopular political party
  • Fire people for supporting an unpopular religion
  • Fire people for failing to use .NET
  • Fire people for failing to support Microsoft Open Office XML
  • Fire people using Javascript (Brendon Eich started it: it must be bad)
  • Fire fox (what does the fox say?)

So where to find a new browser?  Certainly not google chrome: Google gave money to fight for the cause of the terrorists against the people of California.

I don’t want my browser to be approved by the homosexual lobby.

An update: Mozilla says:

Brendan was not fired and was not asked by the Board to resign. Brendan voluntarily submitted his resignation. The Board acted in response by inviting him to remain at Mozilla in another C-level position. Brendan declined that offer. The Board respects his decision.

Reading between the lines:

  1. Brendan was not fired and was not asked by the Board to resign.  In private discussions he was told that this was a distinct possibility and that he would receive no support from the board.  No statements would be made in his favour, and all of his unrelated actions would be questioned.
  2. Brendan voluntarily submitted his resignation.  This was nice, because otherwise we would have had to ask him to submit it.
  3. The Board acted in response by inviting him to remain at Mozilla in another C-level position.  We did not decline his resignation, and assure him of our full support.  Instead, we offered him a demotion (from Javascript to C?)
  4. Brendan declined that offer.  He’s not an idiot.  We knew this, and expected it.  It was not a genuine offer in any case.  We threw him under the bus in order that the bus could ride over him.  Retaining his bloody corpse would be a burden to us.
  5. The Board respects his decision.  We are so glad that we were able to dismiss the man by withdrawing support and undermining our stated values.  When we say we respect the decision, we mean good riddance.

The Mozilla privacy policy says that they won’t pass your information around, except under a narrow set of circumstances.  However, they feel themselves at liberty to act on information obtained in violation of all they hold sacred.

It seems that liberal dogmatism trumps privacy.

Posted in Stuff | Tagged , , , , , , | Comments Off on Thanks for nothing, Mozilla

Cloudflare doesn’t help your DDOS

Ever since CloudFlare helped out Spamhaus with their big deal big DNS reflection DDOS attack, conventional wisdom has said that if you are faced with a DDOS attack, you should give CloudFlare a shot. By all means, give it a try: they have a compelling free offer that seems to be just the thing you need.

Here is what will happen:

  • You switch your DNS to cloudflare
  • You get your site up again
  • You receive a DDOS attack
  • You survive said DDOS attack
  • You think cloudflare is cool
  • You tell all your friends
  • You get a new and rewewed DDOS attack
  • You get a mail like below from cloudflare saying, basically, sorry dude, you’re toast.
  • You can now choose to pay $200 USD per month, or accept that your site is just sometimes going to be down.

The moral of the story is: you’re not spamhaus.  To be fair, cloudflare do say, somewhere in their blog or site that they’re not a DDOS solution.

From: CloudFlare <no-reply@cloudflare.com>
Subject: victim.co.za has been temporarily removed from CloudFlare
Date: Mon, 24 Mar 2014 02:11:21 +0000

CloudFlare has temporarily deactivated your website victim.co.za.

Your visitors will be directed to your origin server, where your website is hosted, instead of first passing through CloudFlare’s performance and security service. We’ll resume routing traffic through CloudFlare once the issue has been resolved. We review deactivated websites every 5 to 7 business days. To check your status, please log into: www.cloudflare.com/my-websites

COMMON QUESTIONS

WHY WAS MY SITE TEMPORARILY DEACTIVATED?
CloudFlare runs a globally distributed network serving millions of websites. Sometimes a large DDOS attack to one of our Free or Pro customers may degrade network performance. In these cases, we may temporarily remove the website under attack to avoid network degradation.

I AM ON THE FREE OR PRO PLAN. WILL UPGRADING TO BUSINESS HELP?
Yes. CloudFlare's advanced DDOS protection is included in the Business and Enterprise plans. If you upgrade to the Business plan, your website will be activated again.

HOW LONG WILL IT TAKE TO REACTIVATE MY SITE IF I DON’T UPGRADE?
We review deactivated websites every 5 to 7 business days.

IF I DELETE MY SITE AND RE-ADD IT, WILL THE TEMPORARY HOLD DISAPPEAR?
No. Any temporary holds are attached to the domain so deleting and re-adding the website will not change its status.

Replies to this email are not monitored or answered. For FAQs or to reach our help desk, please visit: www.cloudflare.com/support

Thank you for using CloudFlare.

The CloudFlare Team

***This is an automatic notification for victim.co.za
Posted in Stuff | Tagged , , , , | Comments Off on Cloudflare doesn’t help your DDOS

Teacher unions versus children

So teacher unions are against systems where the state diverts education funding from government schools to independent schools, since this puts the decision making about schooling in the hands of parents.  In the process of giving decision making powers to parents, the state would be taking power away from established schools, where the unionised teachers are employed.  How can parents possibly know what is in the best interests of teachers their children?

Unions count up the number of children being educated in private schools (largely at their parents’ expense) and dream that if those children were in the government schooling system, the heavens would open, and their job prospects would improve for union members – more children, more work, more responsibility, money, success, glory.

If it’s all about numbers, there’s something more that the teachers should be concerned about: abortion.

If the 82000 children aborted this year were not killed allowed to live instead of being killed aborted, their numbers would, in seven years, more than make up the numbers that are “missing” from the government school rooms.

How short sighted do you have to be to support a government that is killing off your career prospects?

Posted in Stuff | Tagged , , , , , | Comments Off on Teacher unions versus children

Android Emergency

On the way to work one fine morning, I stopped at a road accident scene, with some rather traumatic injuries – I thought someone had died, but instead of being dead, that someone spoke to me and asked me to phone a family member, telling me the number. So I thought I would do that.  At that point, I whipped out my trusty touch screen phone, and … well it was obscenely difficult:

  • Unlock the phone
  • Enter the unlock swipe code (a couple of times)
  • Choose the dialer (no, not the address book, the dialler … aargh)
  • Wait for the dial-a-number application to open (it just sits there and thinks about opening)
  • Change the mode of the dial-a-number application to actually dial a number
  • Wait for the dial-a-number application to show the keypad
  • Type in the number
  • Make a typo and press the wrong thing, and suddenly have to start again from way up in the list
  • Press the call button (is this thing working??)
  • Communicate to the disbelieving family member that I’m a confused person at an accident scene that they want to come to — compared to the trauma of dialing the number, this part was actually easy.

These things are not difficult, but under pressure, it is easy to make mistakes, and mistakes cost time on smart phones.  It was surreal – the visibly injured person had a better handle on the situation than the man trying to make a simple phone call.

It wasn’t much better when I dialed 112 (the emergency number) for the ambulance – the phone was just sluggish.  Apart from hanging up by mistake in the middle of the call, I was on hold, and needed the phone to take pictures (someone was culpable and needed to be nailed), but I couldn’t because things don’t work like that.

I realised something: in an emergency, I want a phone, not a smartphone.  The device is a great GPS navigator, a wonderful game console, and awesome music player, a capable camera and video recorder, a good standby web browser, but for the one thing it occasionally needs to do fast, it is useless.

There’s a Dilbert comic about the superiority of Unix “Here’s a nickel kid get yourself a better computer”.  I need buttons, and a straightforward one-function interface.

In unrelated news, I’ve lost it.  It’s gone.  I think the kids hid it, hoping to play games on it later.

Posted in Stuff | Tagged , , , , , | Comments Off on Android Emergency

Arrays

A programmer working on a large project noticed that every single variable was stored in a separately named instance:

int c1, c2, c3, c4, c5, c6;

This meant that there was a lot of code of this sort:

c1++;
c2++;
c3++;
c4++;
c5++;
c6++;

Of course, this can be done more efficiently with a loop, so the programmer suggested it. None of his co-workers understood the concept, so he approached the boss, and showed him some example code, that would do the same thing in a loop:

int c[6], i;
for (i=0; i<sizeof(c);i++) {
  c[i]++;
}

He explained to his boss that this small change was a necessary improvement to the system architecture and skills of the programming team. His boss having once been a programmer understood completely, and asked, “So you want arrays?”

“Yes,” he replied.

On payday there was a substantial increase in his renumeration.

Posted in Stuff | Tagged , , , , | Comments Off on Arrays

My new password

I’m changing all my passwords to asterisks:

********

Now, when I enter my password, I can see what I’m typing.

Posted in Stuff | Tagged , , | Comments Off on My new password

Netgear STP bug (or something)

I found a fun bug today. We have a stack of netgear switches in our office – and we keep getting disconnected at odd times. I already found a switch which did not have STP enabled, and turned that on, and rearranged the physical links so that we would be doing slightly more star topology and slightly less daisy chain, but there was one link that stubbornly refused to be moved — when it moved, the network went down. That was not cool. On my second time around, I had a look at the actual STP packets the switches were sending out:

I got this downstairs:

06:27:15.376168 STP 802.1w, Rapid STP, Flags [Learn, Forward, Agreement], bridge-id 8000.20:e5:2a:52:46:c8.801c, length 43
        message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
        root-id 8000.20:e5:2a:52:46:c8, root-pathcost 0, port-role Designated

I got this upstairs:

06:23:58.609601 STP 802.1w, Rapid STP, Flags [Topology change, Learn, Forward, Agreement], bridge-id 8000.e0:91:f5:ba:fb:ad.8005, length 43
        message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
        root-id 8000.e0:91:f5:ba:fb:ad, root-pathcost 0, port-role Designated

And this was odd, because the two networks are connected, so they should have the same root brigde (root-id). Instead, each side believes they are the best and greatest STP root. When I tried to move a link to our “core” switch, that link was disconnected. It was rather frustrating.

I (eventually) changed the STP priority for the core switch from the default 32768 to 16384, and voilla! it worked. Suddenly both sides of the network agree on what the STP root-id is:

06:33:57.396606 STP 802.1w, Rapid STP, Flags [Learn, Forward, Agreement], bridge-id 4000.20:e5:2a:52:46:c8.801c, length 43
        message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
        root-id 4000.20:e5:2a:52:46:c8, root-pathcost 0, port-role Designated

And now I moved the link to get a more sane topology, and that worked too.

I speculate that this happened because the netgear RSTP implementation does some improper comparison of the MAC addresses, and multiple devices end up getting what they believe is the best score.

The moral of the story is: don’t rely on the defaults to work — always set the STP Bridge Priority: Switching -> Advanced -> CST Configuration -> Bridge Priority -> your number here.

Posted in Stuff | Tagged , , , , , | Comments Off on Netgear STP bug (or something)