Reverse Engineering Packet Structures from Network Traces by Segment-based Alignment