Shortened Expression

Shortened Expression
The good news is there are a few tricks to help rescue us when writing these monster addresses.
For one thing, you can actually omit parts of the address to abbreviate it, but to get away with
doing that you have to follow a couple of rules. First, you can drop any leading zeros in each
of the individual blocks. After you do that, the sample address from earlier would then look
like this:
2001:db8:3c4d:12:0:0:1234:56ab
OK, that’s a definite improvement—at least we don’t have to write all of those extra zeros!
But what about whole blocks that don’t have anything in them except zeros? Well, we can
kind of lose those too—at least some of them. Again referring to our sample address, we can
remove the two blocks of zeros by replacing them with double colons, like this:
2001:db8:3c4d:12::1234:56ab
Cool—we replaced the blocks of all zeros with double colons. The rule you have to follow
to get away with this is that you can replace only one contiguous block of zeros in an address.
So if my address has four blocks of zeros and each of them were separated, I just don’t get to
replace them all. Check out this example:
2001:0000:0000:0012:0000:0000:1234:56ab
And just know that you
can’t
do this:
2001::12::1234:56ab
Instead, this is the best you can do:
2001::12:0:0:1234:56ab
The reason why the previous example is your best shot is that if you remove two sets of
zeros, the device looking at the address will have no way of knowing where the zeros go back
in. Basically, the router would look at the incorrect address and say, “Well, do I place two
blocks into the first set of double colons and two into the second set, or do I place three blocks
into the first set and one block into the second set?” And on and on it would go because the
information the router needs just isn’t there.