Subject: OSPF alignment

From: Paul Jakma <[email-masked]>
Date: Fri, 12 Nov 2004 19:35:43 +0000

Hi,

I'm wondering what the criteria are for alignment in OSPF structures?
RFC2328 appears careful to maintain 4byte alignment, however doesnt
exactly specify this is required, no alignment restrictions appear to
placed on length fields. However, the packet and auth (though not
LSA) checksum definitions do mention that a pad byte should be
appended if the packet is not 2byte aligned.

So the question is:

- may LSA packets be of arbitrary byte lengths?

(appears so, though existing RFCs seem careful to ensure packets
would always be aligned to 2 bytes, possibly even 4, and padding
procedure is defined for 2 of the checksums)

if so:

- Is it permitted to zero pad packets to align them if required? (and
should the packet length include the pad bytes? I presume so)

- may LSAs be of arbitrary byte lengths?

(appears so, eg Opaque LSA RFC is careful to specify that opaque
LSAs must be padded to alignment.)

If so: same question as for packet length: can LSA be padded (and
should LSA length include padding)?

We're trying to figure out whether it is possible to simply check for
unaligned LSAs in packets, and drop the packet (ie that unaligned
LSAs within LSA Update or whatever packets would never occur), or
whether we must accept a performance hit and assume that LSAs (or
other data) within packets can be located at arbitrary byte
boundaries, and fix up as needs be.

Thanks in advance..

PS: It would possibly be useful to have an I-D on the issue of
alignment within OSPF.

regards,
--
Paul Jakma      [email-masked]   [email-masked]  Key ID: 64A2FF6A
Fortune:
Be a better psychiatrist and the world will beat a psychopath to your door.

---

From: Paul Jakma <[email-masked]>
Date: Mon, 15 Nov 2004 02:04:06 +0000

> I'm wondering what the criteria are for alignment in OSPF structures?

Apologies, looks like a co-maintainer of Quagga had beaten me to
asking the list.

regards,
--
Paul Jakma      [email-masked]   [email-masked]  Key ID: 64A2FF6A
Fortune:
"The way of the world is to praise dead saints and prosecute live ones."
  -- Nathaniel Howe