A byte order is a sequence of bytes stored in a computer's memory or transmitted by a network, divided into two, big-endian and small-ended
Here's an example of an IP address: an IP address of 32 bits, which requires 4 bytes to store, such as 1.1.1.2 and 2.2.2.1
1. Small end little endian: Store low-order bytes at the start address: In line with the thinking habit from small to large, address low storage value of low, address high storage value of high level for the small end machine above the IP address byte storage order: 2.1.1.1 1.2.2.2 Low-to-high 2. Big endian: The high-order byte is stored in the start address: In line with the large left small on the right reading habits, address low storage value of low, address high storage value of high-endian machine above the IP address byte storage order: 1.1.1.2 2.2.2.1 Low-to-high network byte-order is big-endian. When processing a network datagram, the byte order needs to be converted via Ntohl (32-bit)/ntohs (16-bit)
Network byte order