Port pre-allocation and incremental allocation decrease logs generated by the CGN device, reduce stress of the log servers from receiving and managing logs, and improve the log server's data tracing efficiency.