Canonicalize CIDR: Difference between revisions

Clean up task description a bit.
(Clean up task description a bit.)
Line 12:
 
;Explanation:
An Internet Protocol version 4 address is a 32-bit value, conventionally represented as a number in base 256 using dotted-decimal notation, where each base-256 "digit" is represented by the digit valuegiven in decimal and the digits are separated by periods. Logically, this 32-bit value represents two components: the leftmost (most-significant) bits determine the "network" portion of the address, while the rightmost (least-significant) bits determine the "host" portion. Classless Internet Domain Routing block notation indicates where the boundary between these two components is for a given address by adding a slash followed by the number of bits in the network portion.
 
In general, CIDR blocks stand in for the entire set of IP addresses sharing the same "network" component;, so it's common to see access control lists that specify a singleindividual IP addressaddresses using CIDR with /32 to indicate that only the one address is included. Often,Software the tools usingaccepting this notation expectas theinput addressoften expects it to be entered in canonical form, in which the "host" bits are all zeroes. inBut thenetwork binaryadmins representation.sometimes Butskip carelessthis networkstep adminsand mayjust provideenter CIDRthe blocksaddress withoutof canonicalizinga themspecific first.host Thison taskthe handlessubnet with the canonicalizationnetwork size, resulting in a non-canonical entry.
 
The example address, 87.70.141.1/22, translates into 01010111010001101000110100000001 inrepresents binary notation zero-padded to 32 bits. The0101011101000110100011 /22 means0100000001, thatwith the first/ 22 of those bits determineindicating the match;network/host the final 10 bits should be 0division. ButTo theycanonicalize, insteadclear includeall two 1the bits: 0100000001.to Sothe toright canonicalizeof the address,/ changeand thoseconvert 1'sback to 0'sdotted todecimal: yield0101011101000110100011 01010111010001101000110000000000,/ which in dotted-decimal0000000000 is 87.70.140.0.
 
 
1,480

edits