Sunday, March 6, 2011

Private and Public IP Addresses

What are Public IP & Private Ip Addresses ?

Internet Protocol (IP) addresses are usually of two types: Public and Private. If you have ever wondered to know what is the difference between a public and a private IP address, then you are at the right place. In this post I will try to explain the difference between a public and a private IP addres in layman’s terms so that it becomes simple and easy to understand.

What are Public IP Addresses?

A public IP address is assigned to every computer that connects to the Internet where each IP is unique. Hence there cannot exist two computers with the same public IP address all over the Internet. This addressing scheme makes it possible for the computers to “find each other” online and exchange information. User has no control over the IP address (public) that is assigned to the computer. The public IP address is assigned to the computer by the Internet Service Provider as soon as the computer is connected to the Internet gateway.

A public IP address can be either static or dynamic. A static public IP address does not change and is used primarily for hosting webpages or services on the Internet. On the other hand a dynamic public IP address is chosen from a pool of available addresses and changes each time one connects to the Internet. Most Internet users will only have a dynamic IP assigned to their computer which goes off when the computer is disconnected from the Internet. Thus when it is re-connected it gets a new IP.
You can check your public IP address by visiting www.whatismyip.com

What are Private IP Addresses?

An IP address is considered private if the IP number falls within one of the IP address ranges reserved for private networks such as a Local Area Network (LAN). The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private networks (local networks):

10.0.0.0 – 10.255.255.255 (Total Addresses: 16,777,216)
172.16.0.0 – 172.31.255.255
(Total Addresses: 1,048,576)
192.168.0.0 – 192.168.255.255
(Total Addresses: 65,536)

Private IP addresses are user for numbering the computers in a private network including home, school and business LANs in airports and hotels which makes it possible for the computers in the network to communicate with each other. Say for example, if a network X consists of 10 computers each of them can be given an IP starting from 192.168.1.1 to192.168.1.10. Unlike the public IP, the administrator of the private network is free to assign an IP address of his own choice (provided the IP number falls in the private IP address range as mentioned above).

Devices with private IP addresses cannot connect directly to the Internet. Likewise, computers outside the local network cannot connect directly to a device with a private IP. It is possible to interconnect two private networks with the help of a router or a similar device that supports Network Address Translation.
If the private network is connected to the Internet (through an Internet connection via ISP) then each computer will have a private IP as well as a public IP. Private IP is used for communication within the network where as the public IP is used for communication over the Internet. Most Internet users with a DSL/ADSL connection will have both a private as well as a public IP.

You can know your private IP by typing ipconfig command in the command prompt. The number that you see against “IPV4 Address:” is your private IP which in most cases will be 192.168.1.1 or 192.168.1.2. Unlike the public IP, private IP addresses are always static in nature.
Unlike what most people assume, a private IP is neither the one which is impossible to trace (just like the private telephone number) nor the one reserved for stealth Internet usage. In reality there is no public IP address that is impossible to trace since the protocol itself is designed for transperancy.


.

IP Address and IP Classes

Every host on a TCP/IP network needs to have a unique address, similar to you needing a unique address for your house. With this unique address, it is possible to send data from host to host.
Every packet contains addressing information in the header, and the IP address in the header is used to route packets. If several people on your street had the same address, the post office would have a difficult time sorting mail. For a similar reason, IP addresses are unique on each network. IP addressing is simply configuring each TCP/IP host with a valid IP address.

For access to the Internet, a host must have an IP address that identifies not only the host address (like a house number) but also identifies the network address (like a street number). An administrator needs to be aware of proper addressing techniques so that the hosts on the network will function correctly. TCP/IP addresses are based on 32-bit addresses.

IP Address classes



IP addresses are divided into five IP classes:
IP address class A
IP address class B
IP address class C
IP address class D
IP address class E

All IP addresses are placed in a particular class based on the decimal values of their first octets. In the first octet, an IP address can start with a decimal value between 1 and 255.

IP class A addresses have first octets with a decimal number from 1 to 127. Example:
27.x.y.z
102.x.y.z

IP class B addresses have first octets with a decimal number from 128 to 191.Example:
128.x.y.z
151.x.y.z

IP class C addresses have first octets with a decimal number from 192 to 223.Example:
192.x.y.z
223.x.y.z



IP class D addresses have decimal values from 224 to 239 in the first octet, and the 4 leftmost bits are 1110.Example:
224.x.y.z
239.x.y.z

The last IP address class of addresses is IP class E. IP class E addresses range from 240 to 255 in the first octet, and the 4 leftmost bits are 1111. Example:
240.x.y.z
255.x.y.z

The system of IP class addresses has been set up to help ensure assignment of unique IP addresses. DHCP discover, DHCP offer, DHCP request, and DHCP acknowledgment are are four steps in getting an IP address from a DHCP server.

Computer IP Address Configuration



To find out local what is My IP address and possible TCP/IP networking problem follow next steps:
  • If you use win9x/ME go to start-run and type winipcfg, and then press ENTER
  • For win2k/xp or wista go to start-run (Windows Wista user go to Windows button), type cmd and then ENTER. At the DOS prompt type ipconfig and you'll see DNS suffix, IP address, subnet mask, and default gateway. For more info type ipconfig /all
  • For Macintosh select the TCP/IP control panel from the Apple menu's "Control Panels" sub-menu. The TCP/IP control panel window will open and display your ip address.