The reason is as simple as: because RFC-1700 says so.
Following a three-decade dispute over which endianness is the single "correct one", Danny Cohen published On Holy Wars and a Plea of Peace in an attempt to shed light into the problem (which is deeper than just "byte order") and with the futile hope that the industry would agree on one consistent order.
The bottom line was that as long as you transmit a message as "one message", there is no such problem as order, but as soon you transmit sub-parts in the message (words, bytes, or bits) you need to decide for one order. It does not matter much which one you choose as long as you stick to your decision. The debate about which order is more correct than the other was as unproductive and silly as the debate on how to break an egg in "Gulliver's Travels", which Cohen referred to and took the name "endianness" from.
In 1994, the authors of RFC-1700 decided to end the debate, at least as far as the IP suite was concerned, by stating:
The convention in the documentation of Internet Protocols is to express numbers in decimal and to picture data in "big-endian" order. That is, fields are described left to right, with the most significant octet on the left and the least significant octet on the right.
Every RFC thereafter has followed (explicitly or silently) that convention, which of course includes IPv6.
Practically speaking, it doesn't matter what byte order IP addresses are. They could be words or bytes in little-endian or big-endian, or nibbles, or they could be counting Quatloos if the implementors deemed that practical.
For 99% of all people, 99% of the time, it makes zero difference because neither are you supposed to look at or understand the address, nor do you need to remember "magic values", nor do you (normally) need to modify an address.
You usually get an opaque block of memory that is an IP address and port from "somewhere" (say, getaddrinfo
or recvfrom
) and you use that blob as-is, e.g. with socket
or sendto
.
You do not normally need to perform "math" on the address, or anything similar. At best, you might want to compare two addresses for equality.
Yes, applications that need to perform more complicated things with addresses exist, but they are by far the minority of applications.