I'm struggling to understand how to compute the CIDR number from an IP address for hours. Examples I've seen don't explain how the provided answer was found. For example, if I have the IP 220.127.116.11, I thought the CIDR number was 24 because 18.104.22.168 is a class C address with a subnet mask of 255.255.255.0 so the first 24 bits would be 1s. Is this answer correct? If not, please explain how to find the CIDR number in this case. Thanks.
The CIDR number is simply the number of one bits in the network mask. You cannot get a CIDR number from an address, it comes from the network mask.
You have no idea what the number is for your example of
22.214.171.124, but if you had the mask
255.255.255.192, you would know that it is
126.96.36.199 with a mask of
255.255.255.192 would be