A method for transmitting variable length packets based on FEC coding.
Data packets are successively and contiguously stored in a
two-dimensional storage device. FEC coding is performed to generate
parity packets. The parity packets are stored in the two-dimensional
storage device. The data packets, offsets representing positions of the
data packets in the two-dimensional storage device, types of packets, and
the parity packets are then transmitted.