Problems I see with the ATA-over-Ethernet protocol
I've been experimenting with AoE lately, and as a resultI've been looking at the protocol more than I did in my earlierexposure . Unfortunately, the more I look at the AoEprotocol, the more uncomfortable I get.
The AoE protocol is quite simple; requests and replies are simpleEthernet frames, and a request's result must fit in a single replypacket. This means that the maximum read and write sizes per request arebounded by the size of the Ethernet frame, and thus on
Linux kernel asynchronous IO doesn't work on sockets
I've been considering writing a fully asynchronous ATA over Ethernettarget driver (I'm not entirely happy with the current one and itsperformance). If Linux asynchronous IO worked on sockets (specificallyraw network sockets), there is a nice simple design where you just setup a pool of buffers and then cycle each one through a little statemachine (network in to disk IO to network out).
(This works especially great for AOE because the protocol is both basedon raw packets and completely unordered,
You can't change a Python function's local variables from outside
In an aside in a recent entry , I wrote:
With sufficient cleverness, you can construct a version of
capture()that is passedstore's name and puts the result in it directly,without needing you to make it an array and usestore[0].
I'm wrong. In Python, no outside power can change a function's localvariables (more precisely, no outside power can change the namebindings , doing the equivalent of ' localvar =something '). While you can
An interesting mistake with ZFS and iSCSI
First I'll show you the symptoms, then I'll explain what I did to shootmyself in the foot:
# zpool create tank01 c0t38d0# zpool create tank02 c0t39d0# zpool replace tank01 c0t38d0 c0t42d0
(Time passes, the resilver finishes, and zpool status tank01 shows nouse of c0t38d0.)
# zpool attach
Why I wish Python had assignment in conditionals
There's a lot of times where a function wants to return more than aplain boolean; for example, validation routines often want to returnsome sort of explanation of the validation error (if there is one).At the same time, the most natural way to use the function is oftenin the flow of a conditional:
if blah(o): ....elif not validates(o): # whoops, lost the error reason
There's a variety of traditional answers to this,
Thinking about the Python equivalents of C's !! double negation
C's !! double negation idiom is a way of compressing all non-zerovalues of an expression down into a 1. There's a number of things thatyou can use to get the same effect in Python:
- if you know that your result is always zero or positive, you can use
cmp(). I'm ambivalent about whether this is obscure usage; you'reat least making it clear what you're doing, although probably not why.(If your result can be
How many bits of information are in a password?
The number of bits of information in a password are a function of thealphabet that the password is drawn from and how many characters longit is. The formula is:
nbits = ceil(log2(len(alphabet)) * nchars)
So what does that mean? Let's take the case of 8 character longUnix passwords, and do a table:
| alphabet | total bits | (bits per character) |
| lower case ASCII | 38 | 4.7 |
| lower case plus digits | 42 | 5.2 |
| upper and lower |
How not to set up your DNS (part 16)
Sort of presented in the traditional illustrated format:
; sdig ns ibc.com.au.ns1.ibc.com.au.ns2.ibc.com.au.; dig cname ibc.com.au. @ns1.ibc.com.au.[...];; flags: qr aa; QUERY: 1, ANSWER: 1, [...][...];; ANSWER SECTION:ibc.com.au. IN SOA ns1
A suggestion for HMAC signature construction
Here is a useful safety tip if you are constructing HMAC signatures for structured messages,things that you want to parse later: put a format version number intoeither the key or the message.
If you want messages in the old format to fail signature checks so thatthe rest of your code doesn't have to deal with them, put the versionnumber into the key. Put it into the message if you want your code togracefully deal with several generations of message formats; each willstill verify, but the
Weekly spam summary on July 7th, 2007
This week, we:
- got 9,123 messages from 254 different IP addresses.
- handled 17,076 sessions from 1,364 different IP addresses.
- received 264,864 connections from at least 70,143 different IPaddresses.
- hit a highwater of 12 connections being checked at once.
Volume has dropped compared to last week ,including total messages, which surprises me a bit. As we can see inthe per-day table