IP Addresses and Network Address Translation

Public IP

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

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

 

NAT

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…

IPv4

IPv4

IPv4 is a 32 bit address split into 4 sections

e.g. 255.255.255.255

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

IPv6

IPv6 is 128 Bit Address,

340,282,366,920,938,463,463,374,607,431,768,211,456 Addresses.

Probably enough for the foreseeable future.

Advantages

  • Future proof – plenty of unique addresses for each device.
  • Security built in to the profile
  • Allows for QOS packet prioritising.

Disadvantages

  • 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.

YouTube Blocked? Click here for the Google Drive Version

Resources