A network device includes an alignment module to align payloads of
received frames on memory boundaries in a buffer memory. The frames may
be Ethernet frames which encapsulate IP (Internet Protocol) packets as
payloads. The alignment module prefixes non-data bits to the frame header
to shift the IP payload into a position in the memory regions such that
the IP payload is aligned with the memory boundaries. The number x of
non-data bits is determined according to x=m*c+p, where m is the bit
depth of memory regions, n is the length of a header, p is the non-zero
remainder of the ratio n/m, and c is an integer.