Azure VNet and address space

Viewed 4092

Just started learning Azure Virtual Network. Following excerpt is about Address Space as defined here: VNet Address Space. Question: When you say a VNet has an address space 10.0.0.0/16, what does it mean? I have read an address space is a range of IP addresses for a Virtual Network and its subnets. What is 16 in 10.0.0.0/16 and when you assign IP address to a resource from this address space what role does 10.0.0.0/16 play? I assume you cannot just pick any four numbers and create an IP address xx.x.x.x (x's are numbers here) for a resource in the VNet with the above address space. I just read some online docs on the subject but, for a newbie in this subject, I found those to be bit overwhelming to understand. Can there be a simple explanation to start with?

Address space: When creating a VNet, you must specify a custom private IP address space using public and private (RFC 1918) addresses. Azure assigns resources in a virtual network a private IP address from the address space that you assign. For example, if you deploy a VM in a VNet with address space, 10.0.0.0/16, the VM will be assigned a private IP like 10.0.0.4.
1 Answers

Think about the internet with 255.255.255.255 addresses.

Now think about your internal/private at home Router/Switch network and how it typically starts with 192.168.0.0.

In organisations you typically assign the private network with 10.0.0.0 addresses. NIC cards in PCs can communicate using the internal network as well as the public internet.

Question: When you say a VNet has an address space 10.0.0.0/16, what does it mean?

In order to define the size of the network (how many IP addresses) we use a CIDR range.

So a Network with 10.0.0.0/28, the calculation is 32 minus the CIDR, eg:

32 - 28 = 4

Then 2 to the power of the result:

2^4 = 2 * 2 * 2 * 2 

16 addresses!

In real life you'd create VNet with more than 16 addresses. Because inside VNets you define Subnets which are smaller address ranges that fit inside the VNets address range.

Your example of 10.0.0.0/16 is more realistic VNet size for an organisation and equals 65536 addresses.

Ref: https://devblogs.microsoft.com/premier-developer/understanding-cidr-notation-when-designing-azure-virtual-networks-and-subnets/#:~:text=The%20second%2C%20and%20most%20important,which%20provides%20eight%20IP%20addresses.

Best to learn this particular topic VNets & Subnets with CIDR from online video's because it involves electronics with masking and binary it can confuse people when they look deeper beyond what I've just explained.

Related