make encoding packets through records