Public IP Addresses
Each LAN connected to the internet has a single public IP Address. This is the address seen by other computers and networks on the Internet and is the address attached to packets sent across the Internet.
There are 2 main types of Public IP Addresses: Static and Dynamic
Private IP Addresses
Computers within a LAN have their own private IP Address, that is different to their Public IP Address. This private IP Adddress is either:
- Issued by the Server / Router using Dynamic Host Configuration Protocol (DHCP)
- Set manually by the computer user themselves.
Private IP addresses are usually in the 192.168.x.x range though can also be in the 10.x.x.x and 172.x.x.x
Network Address Translation(NAT)
When a user sends a packet from a computer to a server over the internet, the NAT server swaps the private IP address for a public IP Address and attaches a PORT ID to the packet. The NAT server keeps track of which computers are assigned to which private IP address, so that when a packet returned to the port, it can swap that public IP address on the packet back to the private ip address and send it through the LAN to the correct computer.
Static vs Dynamic IP
Static IP Addresses
These are mainly used by:
- Businesses with LANs that need to be accessed externally from the internet
- Website Hosts
- Gamers who want the fastest, most reliable internet service
Static IP addresses stay the same, which mean that data is always sent in the most efficient manner. However a static IP address opens your network up to attackers.
Dynamic IP addresses
Most home internet users are issued with a dynamic IP address when their router connects to the internet and the IP address is renewed every month or so. Each time it is renewed a new IP Address is drawn from the pool.
This sharing of IP addresses allows the internet to continue to function even when there are more devices in the world than their are available IP addresses (4 billion different ip addresses are available in total for IPV4 addresses). It is also potentially harder to hack as a network’s IP address is constantly changing.
The limited number of addresses available on the internet using IPV4 led to the development of IPV6, though this technology is still in the process of being rolled out…
Dynamic Host Configuration Protocol
IPv4 is a 32 bit address split into 4 sections
Range 0 – 255 (256 Possibilities in each)
Total addresses = 256 x 256 x 256 x 256 = 4.3 Billion.
4.2 Billion Addresses is not enough for the modern world as the world has 7 Billion plus inhabitants and many people have more than one internet connected device.
IPv6 is 128 Bit Address,
Probably enough for the foreseeable future.
- Future proof – plenty of unique addresses for each device.
- Security built in to the profile
- Allows for QOS packet prioritising.
- A bit more overhead in packet size
- Many legacy devices and systems still don’t fully support IPv6 so we still need IPv4 backup.
Compressing IPv6 Addresses
IP Version 6 addresses are incredibly long, which makes them difficult humans to read/write, even when represented using hexadecimal. Fortunately IP Version 6 Addresses can be Shortened (Compressed). Take a look at the video to see how this can be done.
Mapping IPv4 addresses to IPv6 Addresses
In order to transition from IPv4 to IPv6 old addresses will need to be mapped into IPv6 addresses so that the two can coexist in the new system.
In order to achieve this the first 80 bits are set to 0, followed by 16 bits set to 1. In hexadecimal this would look like:
0:0:0:0:0:ffff (or 0::ffff if it has been compressed)
The remaining 32 bits of an IPv4 address can then be incorporated into the remaining bits.
In hexadecimal each component of the remaining address then fits into 2 Hexdecimal digits each