The invention provides a method of encoding a data packet for encapsulation in one or more frames for communication from a transmitter to a receiver in a network interface. The method includes dividing the data packet into one or more data chunks and determining the length of a data chunk as the lesser of the number of bytes available in a current frame, the number of bytes remaining in the data packet, or a predetermined number of bytes. The method includes determining if the data chunk is the end-of-the-packet (EOP) and when the data chunk is not the EOP, the method includes prepending the data chunk with a control character representing the length of the data chunk and non-EOP.