There are two (2) main IPv4 address space, these are the Public address space and the Private address space.
The primary difference between both address spaces is the Public IPv4 addresses are routable on the Internet.
This means any device which requires communication other devices on the Internet will need to be assigned a Public IPv4 address on its interface which is connected to the Internet.
The public address space is divided into five (5) classes:
Class A - 1.0.0.0 – 126.255.255.255
Class B - 128.0.0.0 – 191.255.255.255
Class C - 192.0.0.0 – 223.255.255.255
Class D (Multicast) - 224.0.0.0 – 239.255.255.255
Class E (Experimental) - 240.0.0.0 – 255.255.255.255
Large routing table on each device on the Internet.
Wastage of any unused IP address within a network block.
There are three (3) classes of Private IPv4 address which are allocated for private use only, this means within a private network such as a local area network (LAN).
The benefit of using the private address space (RFC 1918), the classes are not unique to any particular organization or group.
They can be used within an organization or a private network. However, on the Internet, the Public IPv4 address is unique to a device. This means if a device is directly connected to the Internet with a Private IPv4 address, there will be zero network connectivity to devices on the Internet.
Requires Network Address Translation (NAT) to translate the source Private IPv4 address to the Public IPv4 address.
Most Internet Service Providers (ISPs) usually has a filter to prevent any RFC 1918 address from entering their network.
The private address space is divided into three (3) classes:
Class A – 10.0.0.0/8 network block | 10.0.0.0 – 10.255.255.255
Class B – 172.16.0.0/12 network block | 172.16.0.0 – 172.31.255.255
Class C – 192.168.0.0/16 network block | 192.168.0.0 – 192.168.255.255
Length - 32 bits in the form of Binary notation
Decimal - 192.168.1.2
Binary - 11000000.10110000.00000001.00000011
Octet – a group of 8 bits
Converting binary to decimal and vice versa.
For every IP address, there’s an accompanying subnet(work) mask. This address is used to define the following:
The subnet mask is used to indicate the network and host portion of an IP address.
The subnet mask is used to determine the number of available IP addresses on a network.
Identify the Network ID using the ANDing process.
If two (2) or more devices such as computers are communicating over multiple networks, the subnet mask of each device determines if a computer should send the packet to the default gateway/router or not.
There are three (3) default classes of subnet mask:
Class A = 255.0.0.0
Class B = 255.255.0.0
Class C = 255.255.255.0
Each IPv4 address class has their own default subnet mask.
An IP address such as 10.10.10.1 which is a Private Class A address, will use the subnet mask of 255.0.0.0.
Another example we can use is the address, 191.5.4.6 which is a Public Class B address, therefore this address will use a default subnet mask of 255.255.0.0.
You would have noticed after some IPv4 addresses there’s a forward slash (/) with a number next such as /8, /16 & /24.
This is the shorthand way of representing a subnet mask. This is known as a network prefix.
How is a /8, /16 or even a /24 represent an entire subnet mask?
Firstly, let’s convert a Class A subnet mask:
Decimal: 255.0.0.0
Binary: 11111111.00000000.00000000.00000000
As we can see, there are eight 1s in the subnet mask, from this denotation, we get /8.
Network Address Translation (NAT) is used to map internal private IP address(es) to a public IP address(es) on a router's outside interface.
When configuring Inside Source NAT, the router's interface which is connected to the WAN/Internet is known as the Outside interface.
The interface which is connected to the internal LAN is known as the Inside interface. These terms are used when identifying NAT interfaces.
Inside Local—This is the local IP address of a private host on your network (e.g., a workstation's IP address).
Inside Global—This is the public IP address that the outside network sees as the IP address of your local host.
Outside Local—This is the local IP address from the private network, which your local host sees as the IP address of the remote host.
Outside Global—This is the public IP address of the remote host (e.g., the IP address of the remote Web server that a workstation is connecting to).
There are three (3) types of NAT, these are:
Static NAT
Dynamic NAT
Port Address Translation (PAT)
Static NAT allows a one-to-one mapping of a private IP address to a public IP address on a router.
This type of translation/mapping is used provide access to web, email, file servers and so on.
Dynamic NAT (pool) is used to map multiple private IP addresses to multiple Public IP addresses.
In Port Address Translation (PAT), multiple private IP addresses are mapped to a single public IP address.
PAT is also known as NAT Overload.
PAT is used to help preserve the public IPv4 address pools, allowing many private IPv4 networks to be mapped onto a single public IPv4 address.