Endianness


<aside> 📖 Little Endian: least significant byte is at lowest address

Makes most sense from an addressing/computational standpoint

</aside>

<aside> 📖 Big Endian: most significant byte is at lowest address

Makes most sense to a human reader

</aside>

Network Byte Order


Protable Code


You have to convert network byte order values to your host order

Helper functions: htons(), ntohs(), htonl(), ntohl()

Packet Formats


Untitled

The block of text on the left is taken verbatim from Request for Comments (RFC) 791, which specifies the IP protocol, version 4, or IPv4.