Method and apparatus for data transfer using the composition of packets