What is an IP Address? IPv4 and IPv6 Address Examples

by Ramesh Natarajan on January 18, 2012

Question: I’ve been playing around with Linux desktop distro for a while. But, I’m very new to networking. Can you explain me in simple terms about what is an ip address and give me an example?

Answer: When someone mails you a postal letter, you get it. How? Because it has an address that uniquely identifies your home. Pretty basic. Right? Just like your home, every system in the Internet need to have an unique address for someone to find it. That is called an ip address.

Even when the servers are not on the internet, within your own private network, every system need to have a unique ip-address, if you like the machines in your network to talk to each other.

Every system can be accessed using both ip-address and their domain name. For example, when you ping yahoo.com, you’ll see the public ip-address it is using. So, both http://yahoo.com and http://98.139.180.149 will take you to the same website.

# ping yahoo.com
PING yahoo.com (98.139.180.149) 56(84) bytes of data.

IPv4 Address Example

An example ip-address:

69.89.31.226

The above ip-address is in the dotted decimal number format. An ip address is in the format of 4 sets of decimal numbers separated by dots. The decimal number in each and every set is in the range 0 to 255. Each and every set is called octet. So, there are 4 octets in an ip address.

However systems understands ip-address only in the binary format. So, when you configure your system with an ip-address in a dotted decimal number format, it is converted to a binary number format internally by the system as shown below.

01000101010110010001111111100010
(or)
01000101.01011001.00011111.11100010

IPv4 IP address are 32 bit numbers. In the above binary format, there are total of 32 binary numbers. Each and every binary number that are separated by the dot is converted to its corresponding binary number. There are total of 4 bytes here.

Each and every octet can have a value from 0 to 255. Since there are 4 octets in an ip-address, the total possible combination of unique ipv4 ip addresses are 4,294,967,296.

IPv6 Address Example

IPv4 stands for Internet Protocol Version 4. Most of the networks and systems in the internet is currently configured for IPv4. Since IPv4 ip address has only 32 bits (a total of 4,294,967,296 unique ip-addresses), the ip addresses in the internet are running out quickly. Please note that there is a big block of these ip addresses are reserved for special purposes (for example, private network and multicast addresses).

IPv6 stands for Internet Protocol Version 6. Since there is a possibility that we might run out of ip address in the internet, IPv6 was developed. IPv6 ip address has 128 bits. This is a huge improvement from the 32 bit ipv4 ip address. While lot of networks are getting configured for both IPv4 and IPv6, there is still a huge number of networks and systems in the internet that works only for IPv4. But eventually all these systems might go towards the IPv6 route.

IPv6 ip address is typically written in hexadecimal separated by colon. A colon separates 16 bit. The following is an example of IPv6 address:

2002:4559:1FE2::4559:1FE2

Leading zeros can be truncated. For example “0000″ can be be just written as empty. In the above example :: indicates that it has multiple 0′s in that location. Typically the IPv6 format can be written down in three ways 1) compressed, 2) uncompressed and 3) fully uncompressed as shown below. All of the following are the same:

  • IPv6 Compressed (0000 is not displayed) – 2002:4559:1FE2::4559:1FE2
  • IPv6 Uncompressed (0000 is displayed as 0) – 2002:4559:1FE2:0:0:0:4559:1FE2
  • IPv6 Fully Uncompressed (0000 is fully displayed) – 2002:4559:1FE2:0000:0000:0000:4559:1FE2

Execute “ifconfig -a” which will display both ipv4 and ipv6 ip-addresss (if it is configured appropriately):

# ifconfig -a | egrep 'inet|inet6'
   inet addr:69.89.31.226
   inet6 addr: 2002:4559:1fe2::4559:1fe2

Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 12 comments… read them below or add one }

1 jalal hajigholamali January 18, 2012 at 8:57 pm

thanks

2 jim January 19, 2012 at 6:53 am

nicely written & very understandable. thanks!

3 Karthik.P.R January 20, 2012 at 2:09 am

Thanks for providing a detailed information about IPv6.

Regards,
Karthik.P.R
(MySQL DBA)

4 Lu Fleszar January 20, 2012 at 6:18 am

By putting in the :: notation ,it seemed to show how a group of 0′s is noted.In the expanded version you show three sets of 0000:0000:0000 which totally baffled me.Nowhere do you show a normal Ipv6 address without the 0′s

5 manojkumar January 21, 2012 at 8:26 am

nice one … it can be still better if u explains about private ip and public ip :) thanks for the valuable information always

6 Dave January 31, 2012 at 8:25 am

I’m confused too about how :: turned into :0:0:0: — shouldn’t it be ::::?

7 R. Zwicker February 1, 2012 at 1:10 pm

Also interesting to note the ipv4 to ipv6 translation.
For inet addr:69.89.31.226 and inet6 addr: 2002:4559:1fe2::4559:1fe2
hex 45 = dec 69
hex 59 = dec 89
hex 1f = dec 31
hex e2 = dec 226
Thanks.

8 sumit dinodiya July 22, 2012 at 10:46 pm

Hello sir , your blogs are full of practical information and your language is also simple and easy to understand………….and i have doubt regarding ip adressess , now they are cleared……..thanks..

9 priya January 30, 2013 at 12:21 am

Hello sir, I have a doubt…. can u differentiate between MPLS and MPLs-VPN?

10 SATHISH August 28, 2013 at 7:37 pm

Easy to understand

thanking you
Regards

Sathish

11 Raju October 23, 2013 at 4:43 am

Really good..

Felt like understood something about Networking..

12 Anch January 2, 2014 at 1:09 pm

Beautifully explained :)

Leave a Comment

Previous post:

Next post: