rewrite tcp rebuild