Implemented tool to find my IP Address and location
You can try the tool at – Find my IP Address with location tool
How is my IP Address assigned ?
Regional internet registries ( RIRs ) are responsible for IP address allocation to Internet Service Providers. Internet service providers ( ISPs ) in turn allocate IP addresses to enterprises, other service providers, and any organization requiring IP address space. In order to find my IP Address or information on any other IP address I use the tool below. This tool can find my IP address from the PHP variable $_SERVER[‘REMOTE_ADDR’].
To find my IP address location the code calls the ipinfodb.com API to gather the location coordinates. These coordinates are then used to find my IP address location on Google Maps. I have included the PHP code below that could be used to find any IP location and plot it on Google map.
Code for find my IP Address and location tool
How to find my IP Address version 4 ( IPv4 )
The IP address found by find my IP address tool above is an IPv4 IP address. IPv4 is Internet Protocol version 4. IPv4 IP addresses are represented in dotted decimal format where the 32-bit address is divided into four 8-bit segments, each of which are converted to decimal, and then separated with dots.
How to find my IP Address version 6 ( IPv6 )
With tool above I cannot find my IP address version 6. In future I need to be able to find my IPv6 IP address. IPv6 IP address is considered an evolution of IPv4 IP address and still needs to be deployed widely. IPv6 IP addresses are 128 bit and consist of up to eight hexadecimal values (16 bit each), each between 0 and FFFF, separated by colons. Each address digit represents four bits as per the mapping of each hex digit (0–F).
For example: 2001 : DB8 : 5F62 : AB41 : 0 : 0 : 0 : 801 represents an IPv6 IP address. Looking at each digit, 2 = 0010, 0=0000, 0=0000, 1=0001, 0=0000, D=1101 and so on.
Main IPv6 IP address features
128 bits hierarchically assigned with address scoping (e.g., local link versus global) to improve scalability.
Supports flexible extension headers and provide extensibility for new header types. It also has more efficient routing mechanism.
Quality of service (QoS) support.
It supports hierarchical routing and route aggregation.
Includes datagram service.
Has support for encryption and authentication
Stateless and stateful address self-configuration by IP devices.
Support for Mobile IPv6.
What is DHCP
The Dynamic Host Configuration Protocol ( DHCP ) is a client–server protocol for devices connecting to an IP network to automatically obtain an IP address. The IP address found for a device on this page could have been assigned via an DHCP server. This protocol allows a device to broadcast its request for an IP address and one or more than one DHCP servers service that request transparently. For most devices such as laptops, desktops or phones with data services the DHCP process happens during boot-up without any intervention. DHCP allows IP addresses to be reused by different devices as it dynamically allocates the addresses based on demand. DHCP is supported as part of both IPv4 and IPv6.
Types of IP address allocation in DHCP
Manual or Static Allocation
In this case the DHCP server assigns a fixed IP address based on MAC address.
Here the DHCP server assigns an IP address to a device for a limited time period. The same IP address could be later reassigned to another device if its lease is over and not renewed on initial device. DHCP server allocates IP addresses from a configured range assigned to it.
Here the DHCP server assigns a permanent IP address to the client. The idea is similar to dynamic mode however in this case DHCP server assigns same IP Addresses from list of ones used previously for that particular device. The DHCP server maintains a list of IP addresses and MAC addresses pairs which it uses for assignment.
For those devices that obtain IPv6 addresses dynamically, a client based or a network server based approach could be used. In client-based or stateless address assignment (address auto configuration) a client can determine its location based on router advertisements using ICMPv6 and automatically calculate its interface identifier to derive an address. However it might need manual intervention in case of duplicate addresses being detected. In case of DHCP for IPv6 (which is called DHCPv6), which is a network server based or stateful approach, the DHCPv6 server would assign the 128-bit IPv6 address to the device in a manner similar to DHCP for IPv4 operation.