# Given IP/CIDR and subnet mask - calculate # of subnets and # of hosts per subnet [duplicate]

My question is not a duplicate "The slash after an IP Address - CIDR Notation" because the answers to this question say that CIDR is our SUBNET MASK. And My question is "If CIDR is our subnet mask - why am I provided with second subnet mask?"

So I am given bunch of IP/CIDR and subnet masks and I am asked to calculate # of subnets and hosts per subnet. For example

IP address ---- Subnet mask ----- Number of subnets ----- Number of hosts per subnet

128/8 ---------255.255.255.128 ------------------ ? -------------------------------- ? ---------------

What I am confused about is what does it mean to give subnet mask if we are given CIDR. I though CIDR is exactly subnet mask but represented with different notation.

From wiki: 192.168.100.14/24 represents the IPv4 address 192.168.100.14 and its associated routing prefix 192.168.100.0, or equivalently, its subnet mask 255.255.255.0, which has 24 leading 1-bits.

So I though if I have 128/8 then I have 255.0.0.0 as a subnet mask. But then I am given another subnet mask. How should I treat this?

Thanks

• @RonMaupin I know what slash mean... – YohanRoth Oct 28 '15 at 23:10
• @RonMaupin from you links to answers "The slash and the number following it is just a shorthand way to write a subnet mask. It's called CIDR (Classless Inter-Domain Routing) notation." And this is exactly what confuses me! Why am I giving another subnet mask then CIDR is just a notation for subnet mask – YohanRoth Oct 28 '15 at 23:10
• Right but there are many questions about subnetting, and the accepted answer at the link tells you how to subnet, too. It's just binary math; change addresses and masks to binary, perform the actions, return to decimal. This has be answered many time in many ways on this site. You should search. – Ron Maupin Oct 28 '15 at 23:14