Saturday, August 21, 2010

ISC merges LDAP configuration patch for DHCP

What? OK, first the acronyms:
  • ISC is the Internet Systems Consortium. They are responsible for core Internet software, the F-root name server, and many RFC documents.
  • LDAP is the Lightweight Directory Access Protocol. Read about it here.
  • DHCP is the Dynamic Host Configuration Protocol. It's the technology that runs in the background when you set up your computer to "obtain address automatically".
ISC maintains DHCP software that pretty much every operating system vendor on the planet (except Microsoft) uses. It is core networking software. Until 2007, I was maintaining this software in Fedora Linux and Red Hat Enterprise Linux (by maintain, that means I made sure we were using the latest stable version and applied any patches to the code to make the ISC work correctly on our operating system).

Enter the LDAP patch. DHCP software has two components: the server and the client. The client is what runs on your computer when you connect to the network. It speaks to a DHCP server, which is run by your ISP or a wifi router or your company's IT department. The server is configured using a configuration file usually called /etc/dhcpd.conf. It can get rather large and difficult to maintain, so large DHCP sites wanted the ability to store their configuration in some sort of database. This is what the LDAP patch allows. Your DHCP server configuration can be stored in an LDAP database and managed by any number of separate tools. In fact, the DHCP servers themselves do not necessarily need configuration data as they can just request that from the LDAP server.

Support for LDAP in the DHCP server was started by some enterprising people at Ntelos and Novell. The original authors moved on to other projects and since I was maintaining this patch in Fedora Linux, I was asked to take over ownership of the patch for upstream purposes. I said sure and moved it over to I received many bug reports, patches, and requests for this patch to make it in to various releases of Fedora Linux and RHEL. Not all could be fulfilled, but it was clear that a lot of people want LDAP configuration support in the DHCP server.

ISC was asked on numerous occassions to merge this patch in to the upstream DHCP code. I am pleased to say that as of version 4.2.0 of ISC dhcp, the LDAP configuration has been merged. This is great news because I no longer have to maintain the patch out of tree. If you are finding bugs with LDAP support in dhcp and you are using 4.2.0 or higher, send your bug reports and patches to ISC. See the README file in the source code for how to report bugs.

From the RELNOTES file in the DHCP source code:
"The LDAP Patch" that has been circulating for some time, written by Brian Masney and S.Kalyanasundraram and maintained for application to the DHCP-4 sources by David Cantrell has been included. Please be advised that these sources were contributed, and do not yet meet the high standards we place on production sources we include by default. As a result, the LDAP features are only included by using a compile-time option which defaults off, and if you enable it you do so under your own recognizance. We will be improving this software over time. [ISC-Bugs #17741]
While the "do not yet meet the high standards we place on production sources" statement is a bit subjective, the bottom line is ISC has recognized that people want this support. Many thanks to everyone who contributed patches to improve LDAP support in DHCP. And many thanks to ISC for merging this code upstream!

NOTE: I am keeping the ldap-for-dhcp project alive on github for people still wanting to use older versions of DHCP. We have patches going back to dhcp-3.1.x which may be of use to someone.

Friday, August 6, 2010

Tape? Really?

I've moved my backup system to tape. My Amazon S3 experiment has not been reliable (or fast). Network backup is great, but going from a residential connection out is just not useful if have more than a couple gigabytes of data that changes daily. So I decided to go with tried and true technology: tape.

I have an HP StorageWorks DAT 72 external USB tape drive now. And 5 tapes. I'll probably need more tapes, but they cost around $5 each, so I'm not too worried about that.

Plugging in the drive caused the kernel to excrete these messages:

usb 1-1.4.2: new high speed USB device using ehci_hcd and address
usb 1-1.4.2: New USB device found, idVendor=03f0, idProduct=0125
usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.4.2: Product: DAT72 USB Tape
usb 1-1.4.2: Manufacturer: Hewlett Packard
usb 1-1.4.2: SerialNumber: 4855311024394344
scsi5 : usb-storage 1-1.4.2:1.0
scsi 5:0:0:0: Sequential-Access HP C7438A ZU8B PQ: 0 ANSI: 3
scsi 5:0:0:0: Attached scsi generic sg3 type 1
st: Version 20081215, fixed bufsize 32768, s/g segs 256
st 5:0:0:0: Attached scsi tape st0
st 5:0:0:0: st0: try direct i/o: yes (alignment 512 B)
osst :I: Tape driver with OnStream support version 0.99.4
osst :I: $Id: osst.c,v 1.73 2005/01/01 21:13:34 wriede Exp $

I have a test backup running now, but will play with it more tomorrow. So far it's A LOT faster than any of my network backup attempts.

Tuesday, August 3, 2010

Wedding Invitations and the USPS

We recently finished up our wedding invitations. We did the invitations ourselves, which involved finding stationary, figuring out the content, printing everything, and getting it all assembled in to envelopes. We both worked on the content and layout for each component of the invitation. Our parents helped us collect mailing addresses, but I also have to thank Facebook for helping out with that too. I purchased the massive quantities of postage we needed. Karen handled addressing all of the envelopes by hand. I handled printing everything as well as figuring out the return address labels. We used OpenOffice on Fedora Linux, which caused a bit of frustration, but really if we had been using any other office software, it would have been just as frustrating. As I told Karen, I am incapable of using office software (which she finds amusing because I work with computers, but I tell her it's just not the same as what I do).

But most importantly: invitations are done!

During the addressing phase, I learned more about preferred USPS addressing formats. Yeah, this is real edge-of-your-seat reading, I know. For starters, I was already familiar with the request by the USPS that addresses appear in all caps, no punctuation (except the hyphen in ZIP+4 codes or in street addresses), and using approved USPS short forms for types, directionals, and common words. The address should be left justified in the center of a #10 envelope, except centered is pretty loose since the scanners can pick it up from most anywhere on the front of an envelope. The return address is to be written in the same manner, but aligned to the upper left corner of the envelope. Postage is aligned to the upper right corner.

I learned some more specifics about preferred addressing and corrected some things I had wrong. For example:

  • Directionals are to be abbreviated as N=North, S=South, W=West, and E=East. If you have an intermediate directional, use the same letters to abbreviate, but put a space between them. This is a really common mistake. Instead of writing NW, you need to write N W.

  • Do not use the hash mark for the secondary unit number. If you know the secondary unit type, you need to use the abbreviation and then the number, e.g. APT 603. For each deliverable address, the USPS keeps normalized addresses in a database. They prefer you use those addresses on mailings. If you live in an apartment, but the USPS has your address listed as SUITE 603, you need to use SUITE 603 on your address. You can figure out your normalized address by looking it up on the USPS web site.

  • If you DO need to use a hash mark for the secondary unit number because you don't know what abbreviation you should use, put a space between the hash and the number, e.g. # 603.

  • Do not write a comma between the place name and the state abbreviation on the last line. Instead of writing HONOLULU, HI you need to write HONOLULU HI.

  • The hyphen is allowed in ZIP+4 codes and unit numbers (but only when it is part of the official unit number).

  • Only put a single space between the state abbreviation and the ZIP code. I did know this, but I feel it's worth mentioning as the USPS preferred method conflicts with business and personal letter writing styles that we are all taught in school.

  • Another I do know, but feel is worth mentioning are state and territory abbreviations. You need to use the two character USPS abbreviations and not GPO abbreviations that were taught thousands of years ago in school. That means writing AL instead of "Ala." and MA instead of "Mass."

  • Addresses are scanned from right to left and from bottom to top, which means the most significant information is at the bottom right corner of the address, which is the ZIP+4 code. If you have other lines of information you want on the mailing, place it on the top lines. The general rule I've picked out of the USPS information is that there are 4 important lines on an address and everything else is extra (this is only true for personal mailing, not business mailing). That's the list line, secondary address line, delivery address lines, and the recipient line.

  • Another I know, but want to point out. The city/state/zip line is really last line name/state/zip. The last line name does not necessarily correspond to city names. Last line names are assigned by the USPS and reflect city, town, CDP, or region names. You need to use the correct place name for your ZIP code, which may or may not correspond to the actual city or town you live in (though it may be an honoured exception).

I started looking this information up because while we were addressing invitations, Karen wanted the return address label on the back flap of the envelope and I wanted it in the upper left corner. I was trying to see if the back flap was acceptable. No conclusive answer found, but since it is not specifically stated, I can only assume it's not preferred.

What are the advantages to using preferred USPS addressing? More accurrate and faster deliveries. The USPS is extremely flexible when it comes to addresses, so these are not rules, they just ask that people follow them because it speeds up processing. It helps them help you.

Would you like to know more? Check out USPS Publication 28. It's a page turner, that's for sure.