In this section, we will take a look at IP Address ranges and related concepts as they are essential to understand a little bit of Infrastructure Architecture.
IP address is used to identify machines in a network. IP address could be either 32 bit (IPv4) or 128 bit (IPv6).
Let us discuss IPv4 in more detail.
IP addresses are generally expressed in decimal format, for e.g., 184.108.40.206. The corresponding value in binary format is obtained by using binary representation of each of the individual numbers using 8 bit representation as shown in the below table.
|Decimal Representation||Binary (8 bit) Representation|
An IP address has two parts to it. The network address and the host machine address. To determine which part is IP address and which part is host machine address, we need another representation called 'Subnet Mask'.
The subnet mask is also represented in a similar way as IP addresses. For e.g., a sample subnet mask could be 255.255.255.0
When we perform a logical AND operation between the IP address and the subnet mask, we get the network address. For e.g., IP address: 220.127.116.11
Subnet Mask: 255.255.255.0
Logical AND result (Network Address): 192.128.160
In TCP/IP Protocol, a router will use the subnet mask to determine the network address and determine the network in which a machine exists.
Network Mask classes:
Extending on the above concept of subnet mask, there are 3 classes of Network masks as defined below. These three classes have been defined and they have been allocated IP addresses for each of these classes by an International Organization known as InterNIC.
|Class||Mask||Starting IP Address Range||# of Host machines|
|Class B||255.255.0.0||172.16.0.0||1,048, 576|
A Class A network can accommodate maximum number of hosts, followed by Class B and Class C.
Let’s say in Class C network, we take most significant 3 bits out of the last decimal notation for the subnet mask. So the last decimal representation would be 11100000.
So the subnet mask would become 255.255.255.224
The total number of bits used for subnet mask, thus becomes (8 X 3) +3 = 27
We can represent this subnet mask as /27. This representation is known as CIDR notation.
Public and Private IP Addresses:
A public IP address is the address that is assigned to a computing device to allow direct access over the Internet. Public IP addresses should be unique globally as it is used for routing traffic requests over the internet. Web Servers, Email Servers etc. generally would have a public IP address.
A private IP address is the address space allocated by InterNIC to allow organizations to create their own private network. These private IP addresses could belong to any one of the class A, B, C networks defined above.
Network Address Translation:
Consider a Local Area Network within a corporation, which has a huge number of workstation machines. These machines need access to internet; however, the corporation cannot assign a public IP address to each of these machines (For reasons of security and economy). All these machines would have a private IP address. But in order to connect to the Internet, and be able to send/receive traffic, these machines would need some kind of a public IP address.
Network Address Translation is a concept which will help us achieve this. In a LAN, the Network Address Translation is performed by a Firewall, which will have a public IP Address. When a workstation wants to send a request to a resource on the internet, the traffic goes via the Router, and the Router would recognize that this request is intended to be routed to internet and will forward it to the firewall. The resources outside the firewall see the request as coming from a public IP address.
Thus, the requests coming out from all the workstations will have the same Public IP Address.