add marshaling of packets
addRat function