prepare & clean buffer per packet