encode packet and send out
support set ack window size.