Sunday, 8 December 2013

IP Address

IP Address

No doubt you've heard the term "IP address." Unless you're a techie, though, you may not have more than a shadowy notion of what an IP address actually is or how it works. Let's explore the concept.
An IP address is a fascinating product of modern computer technology designed to allow one computer (or other digital device) to communicate with another via the Internet. IP addresses allow the location of literally billions of digital devices that are connected to the Internet to be pinpointed and differentiated from other devices. In the same sense that someone needs your mailing address to send you a letter, a remote computer needs your IP address to communicate with your computer.
"IP" stands for Internet Protocol, so an IP address is an Internet Protocol address. What does that mean? An Internet Protocol is a set of rules that govern Internet activity and facilitate completion of a variety of actions on the World Wide Web. Therefore an Internet Protocol address is part of the systematically laid out interconnected grid that governs online communication by identifying both initiating devices and various Internet destinations, thereby making two-way communication possible.
An IP address consists of four numbers, each of which contains one to three digits, with a single dot (.) separating each number or set of digits. Each of the four numbers can range from 0 to 255. Here's an example of what an IP address might look like: 78.125.0.209. This innocuous-looking group of four numbers is the key that empowers you and me to send and retrieve data over our Internet connections, ensuring that our messages, as well as our requests for data and the data we've requested, will reach their correct Internet destinations. Without this numeric protocol, sending and receiving data over the World Wide Web would be impossible.
IP addresses can be either static or dynamic. Static IP addresses never change. They serve as a permanent Internet address and provide a simple and reliable way for remote computers to contact you. Static IP addresses reveal such information as the continent, country, region, and city in which a computer is located; the ISP (Internet Service Provider) that services that particular computer; and such technical information as the precise latitude and longitude of the country, as well as the locale, of the computer. Many websites provide IP address look-up services to their visitors, free of charge. If you're curious about your own IP address, you can locate these websites by performing a Google search.
Dynamic IP addresses are temporary and are assigned each time a computer accesses the Internet. They are, in effect, borrowed from a pool of IP addresses that are shared among various computers. Since a limited number of static IP addresses are available, many ISPs reserve a portion of their assigned addresses for sharing among their subscribers in this way. This lowers costs and allows them to service far more subscribers than they otherwise could.
Static IP addresses are generally preferable for such uses as VOIP (Voice over Internet Protocol), online gaming, or any other purpose where users need to make it easy for other computers to locate and connect to them. Easy access can also be facilitated when using a dynamic IP address through the use of a dynamic DNS service, which enables other computers to find you even though you may be using a temporary, one-time IP address. This often entails an extra charge, however, so check with your ISP.
Static IP addresses are considered somewhat less secure than dynamic IP addresses, since they are easier to track for data mining purposes. However, following safe Internet practices can help mitigate this potential problem and keep your computer secure no matter what type of IP address you use.
IP Address is Logical Address. It is a Network Layer address (Layer 3)

Two Versions of IP:
IP version 4 is a 32 bit address

IP version 6 is a 128 bit address


IP version 4

Bit is represent by 0 or 1 (i.e. Binary)

IP address in binary form (32 bits):

01010101000 00 101 10 11 11 11 00 00 00 01


32 bits are divided into 4 Octets:

01010101. 00000101. 10111111. 00000001


IP address in decimal form:


 85.5.191.1















Binary values of an IP address


Binary value of first octect 



where,

2=  128

2=  64

2=  32

2=   16

2=   8

2=   4

2=   2

2=   1






01010101. 00000101. 10111111. 00000001 

the decimal value first octet of  this IP is 



01010101. 00000101. 10111111. 00000001 



Take only the values of one and leave zeros

ie:





128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 85



the value of first octet is 85


85.00000101. 10111111. 00000001 


same way all the other octet works on the same principle 

so after converting 

01010101. 00000101. 10111111. 00000001 

you will get the decimal format like 

85.5.191.1

like that if we are taking the first octet 




























Rolling of IP address will be like as follows


0.0.0.0------------------------------->first IP

0.0.0.1
0.0.0.2
0.0.0.3
0.0.0.4
.
.
.
.
.
.
.
.
0.0.0.0255

0.0.1.0

0.0.1.1
0.0.1.2
0.0.1.3
0.0.1.4
0.0.1.5
0.0.1.6
.
.
.
.
.
.
.
.
.0.0.0.1.255

0.0.2.0

0.0.2.1
0.0.2.2
0.0.2.3
.
.
.
.
.
0.0.2.255.
.
.
.
.
.
.255.255.255.255-------------------------->last IP


so from         0.0.0.0 to 255.255.255 there will be about  

4294967296 (232)  ip address  



And these IP's are clasiffied into 5 calsses


they are 



to understand just notice the first octet of the IP address 
if it begins in between 


0 -127       =  CLASS A



128 - 190  = CLASS B



 191 - 223  = CLASS C



 224 - 239  = CLASS D



 240 - 255  = CLASS E





eg: 10.0.0.1 




Take the first octet of the IP address its 10 so check where it 

 is coming in the above range ? 

 Its coming in the first range  ,so this is an 

 A CLASS IP address 



lets check another one 

192.168.1.1 ?

 (its C Class )


  what about 129.0.0.3??


   its (B Class)



lets try some more



find the Binary format and class of the following IP ADDRESS


192.168.5.1


10.0.0.1


129.0.0.10


160.60.20.1









IP ADDRESS OCTET FORMAT

















HOW DO COMPUTERS COMMUNICATE WITH EACH OTHER





Using a network connection, including connecting to the Internet, computers connect to each other to transmit data between them and communicate with 

Think of TCP/IP as a book of rules, a step-by-step guide that each computer uses to know how to talk to another computer. This book of rules dictates what each computer must do to transmit data, when to transmit data, how to transmit that data. It also states how to receive data in the same manner. If the rules are not followed, the computer will not be able to connect to another computer, nor send and receive data between other computers.

Internet service providers (
ISP), the companies that provide Internet service and connectivity also follow these rules. The ISP provides a bridge between your computer and all the other computers in the world, which are all a part of the Internet. The ISP uses the TCP/IP protocols to make computer-to-computer connections possible and transmit data between them. When successfully connected to an ISP you will be assigned an IP address, which is a unique address given to your computer or network and allows it to be found while on the Internet.

If you have a home computer network, the computers are also using TCP/IP to connect to each other. This 
protocol allows each computer to "see" the other computers on the network and share files between them and is what makes it possible for a printer to be shared on a network. When computers connect to each other on the same network, it is called a local area network, or LAN. When multiple networks are connected to each other, it is called a wide area network, or WAN.

 With this type of network, your home will have a network router that connects to your ISP. The router is given the IP address for your connection to the Internet and then assigns local IP addresses to each device in your network. These local addresses are often 192.168.1.2-255. When accessing a local computer in your own network, your router sends your TCP/IP packets between the local IP addresses. However, when you want to connect to the Internet your router communicates to the Internet with the IP address assigned to it from the ISP. This is why when on the Internet your IP address is not a 192.168.x.x address.
When requesting information from a web page, such as Computer Hope you enter a URLthat is easy to understand and remember. In order for your computer to access the computer containing the pages that URL must be converted into an IP address, this is done with DNS. Once DNS has converted the URL into an IP address the routers on the Internet will know how to route your TCP/IP packet. Below is a graphic illustration of everything explained above to help better illustrate the process of your computer communicating with another computer on the Internet.

Today, computers using the Microsoft Windows OS, Apple OS and Linux OS all use the TCP/IP protocol to connect to other computers on a LAN or WAN. Connecting to a LAN or WAN requires either a wired connection or a wireless connection. A wired connection is usually done using a network cable (Cat5 or Cat6 network cable). A wireless connection (Wi-Fi) is done using a 802.11b, 802.11g or 802.11n wireless network card. With both connection types, a network router is usually required to connect to other computers. Connecting to the Internet at your home will also require either a cable modem or a DSL modem, depending on which ISP you use.


Its simple,consider that computers are communicating 

                             COM 1                                     COM 2



Here both IP address Starts with 10, and we know that  its an A class IP address in the table above its shown that there are one N portion and three H portion ,which mean that the are one network portion and three host potion ,


if the ip address is in A class all the computers in the network has to be assigned the same network portion ..


 like here both the IPs start with 10 so it will communicate with each other






Network & Broadcast Address


Terms you need to know:

CIDR: Classless Inter-Domain Routing. Think of it as a replacement for a Netmask. The CIDR Value is equivalent to the number of on bits in a 32 bit address going left to right. For example: the CIDR value of 24 means the first 24 bits are turned on and the last 8 bits are turned off: 11111111.11111111.11111111.00000000. (See RFC's: 1519, 1817, 4632).



Network address    :   IP address with all bits as ZERO in the host portion.


Broadcast address  : IP address with all bits as ONES in the host

                              portion.



Valid IP Addresses    lie between the Network Address and the
                              Broadcast Address.









Example - Class A

 Class A : N.H.H.H

Network Address   :  0xxxxxxx.00000 00 0 . 00 000 00 0 . 000 00 00 0

Broadcast Address :  0xxxxxxx.11111 11 1 . 11 111 11 1 . 111 11 11 1












Example - Class B


Class B : N.N.H.H

Network Address    :  10xxxxxx. x x x x x x x x .00 00 00 00 .00 00 00 00

Broadcast Address :  10xxxxxx. x x x x x x x x .11 11 11 11 .11 11 11 11








Example - Class C

Class C : N.N.N.H


Network Address   : 110xxxxx. x x x x x x x x . x x x x x x x x .0 00 00 000

Broadcast Address :110xxxxx. x x x x x x x x . x x x x x x x x .1 11 11 111









The Steps to identify the Network and Broadcast Address of a Sunbelt


Convert the IP Address and CIDR (or Netmask) to binary. In our lesson entitled Decimal and Binary Conversion of IP Addresses we gave you the tools to convert any IP to Binary. If you need additional help you can try our handy IP Conversion Calculators.


Use a Bitwise AND (IP & CIDR) Operator to return the corresponding values of the IP and CIDR addresses. This gives you the Network Address (Network ID) A simple way to use the Bitwise AND Operator in Binary is show in the following example:
IP Address: 192.168.1.15

CIDR: 24 (Netmask: 255.255.255.0)

Binary IP Address: 11000000.10101000.00000001.00001111
Binary CIDR:         11111111.11111111.11111111.00000000


Using the Bitwise AND (&) Operator, compare the Binary IP Address to the Binary CIDR Address. The result will be the Network Address of the IP Address we are using:


Binary IP:                       11000000.10101000.00000001.00001111
Binary CIDR:                   11111111.11111111.11111111.00000000
Binary Network:               11000000.10101000.00000001.00000000


The resultant Network Address is 11000000.10101000.00000001.00000000. Converting this back to the format of an IPv4 Address gives us 192.168.1.0. This is our Network Address. Therefore, 192.168.1.15 belongs to the 192.168.1.0/24 network.

To get the Broadcast Address we need to do a Binary inversion of the CIDR or Netmask Address.

The inversion of the CIDR Address of 11111111.11111111.11111111.00000000 becomes: 00000000.00000000.00000000.11111111.


Now we use the Bitwise OR Operator on the Binary Network Address and the inverted CIDR Address to get the Broadcast address. 


Binary Network Address:               11000000.10101000.00000001.00000000
Inverted Binary CIDR:                   00000000.00000000.00000000.11111111
Binary Broadcast Address:            11000000.10101000.00000001.11111111


We now convert 11000000.10101000.00000001.11111111 to IPv4 Decimal octet: 192.168.1.255.


The Broadcast Address for the 192.168.1.0/24 Subnet is 192.168.1.255.
Now that you have your feet wet,



 let's try a few more.


identify the Network and Broadcast Addresses for each of the following examples:

1.     10.10.1.97/23
2.     192.168.0.3/25

Example one: Convert 10.10.1.97/23 to Binary.


IP Address:           00001010.00001010.00000001.01100001
CIDR Address:      11111111.11111111.11111110.00000000

Use Bitwise AND Operator (IP & CIDR):

IP Address:                      00001010.00001010.00000001.01100001
CIDR Address:                 11111111.11111111.11111110.00000000Network Address:             00001010.00001010.00000000.00000000

Binary CIDR:                   11111111.11111111.11111110.00000000

Inverted Binary CIDR:       00000000.00000000.00000001.11111111

IP:                                   11000000.10101000.00000000.00000011

CIDR:                 11111111.11111111.11111111.10000000

Network:            11000000.10101000.00000000.00000000

Binary CIDR:                   11111111.11111111.11111111.10000000


Inverted Binary CIDR:       00000000.00000000.00000000.01111111

Network Address: 10.10.0.0

Binary Inversion of CIDR:

Use Bitwise OR Operator to get the Broadcast Address:

Binary Network: 00001010.00001010.00000000.00000000

Inverted Binary CIDR: 00000000.00000000.00000001.11111111

Binary Broadcast: 00001010.00001010.00000001.11111111

Broadcast Address: 10.10.1.255

IP Address 10.10.1.97/23 belongs to the 10.10.0.0/23 Network. The network 

Address is 10.10.0.0 and the Broadcast Address is 10.10.1.255.







Example two: Convert 192.168.0.3/25 to Binary.



IP Address: 11000000.10101000.00000000.00000011

CIDR Address: 11111111.11111111.11111111.10000000

Use Bitwise AND Operator (IP & CIDR):


Network Address: 192.168.0.0

Binary Inversion of CIDR:

Use Bitwise OR Operator to get the Broadcast Address:

Binary Network: 11000000.10101000.00000000.00000000

Inverted Binary CIDR: 00000000.00000000.00000000.01111111

Binary Broadcast: 11000000.10101000.00000000.01111111

Broadcast Address: 192.168.0.127

IP Address 192.168.0.3/25 belongs to the 192.168.0.0/25 Network. The network 

Address is 192.168.0.0 and the Broadcast Address is 192.168.0.127.







Private IP Address



When you send a letter from your house to a friend, you have to know the address to send it to so that the postman knows which street and which house to take it to. Computer networks such as the Internet are no different except instead of sending your web traffic to "1145 Main Street"; your computer's location is known as an IP Address.
An IP address is your computer's equivalent of your postal address and just like the mail service, each computer has to have its own address so that it will only receive the information that is meant for it and not anything that is meant for someone else.
While we are used to writing out streets and house numbers on envelopes, inside your computer IP Addresses are usually represented in what is known as dotted-decimal format such as 124.62.112.7 as this is the system that is understood by computers. As you can see, the address is split into 4 sections known as "octets" and each of the four octets can be numbered from 0-255, providing a total of 4,294,967,296 potentially unique IP Addresses.
Now, while 4.2 Billion might seem like a lot, for many years large amounts of these have been allocated and used by large network such as backbone providers, ISPs and large Universities that made up the early Internet While other groups still have been reserved for special purposes and are not usable, so in practice the real amount is far less than 4.2 billion. The problem that we face today is that with many homes owning more than one computer and with cell phones, PDAs and even fridges being enabled for Internet access these days, IP Addresses are running out.
When I mentioned above that some blocks of addresses had been reserved for special purposes, one of these purposes was for private networking and it is these private addresses that help to relieve the pressure on the remaining address space and make possible many of the cable and DSL routers that people have at home today to share their Internet connection amongst many PCs.
Private IP address ranges
The ranges and the amount of usable IP's are as follows:
10.0.0.0 - 10.255.255.255
Addresses: 16,777,216
172.16.0.0 - 172.31.255.255
Addresses: 1,048,576
192.168.0.0 - 192.168.255.255
Addresses: 65,536
So, what are these addresses and how do they work?
For example, if I had 6 computers that I wanted to network, I might number them from 172.16.0.1 up to 172.16.0.6 and this would still leave over a million more addresses that I could use if I were to buy some more computers or if I was networking a large office and needed lots and lots of addresses.
These blocks of addresses can be used by anyone, anywhere - even if your neighbor is using the exact same addresses this won't cause a problem. This is possible because these addresses are known as "non-Routable addresses" and the devices on the internet that move data from one place to another are specially programmed to recognize these addresses. These devices (known as routers) will recognize that these are private addresses belonging to your network and will never forward your traffic onto the Internet so for your connection to work; you will always require at least one real address from the general pool so that your home router can perform what is known as "Network Address Translation".
NAT is a process where your router changes your private IP Address into a public one so that it can send your traffic over the Internet, keeping track of the changes in the process. When the information comes back to your router, it reverses the change back from a real IP Address into a private one and forwards the traffic back to your computer.
Private addresses and NAT is what makes your home router work and by using them, anyone is able to connect as many computer's as they wish to the Internet without having to worry about running out of addresses and this gives everyone many more years until all the available addresses are used up




There are certain addresses in each class of IP address that are



reserved for Private Networks. These addresses are called private



addresses.


These addresses are not Routable (or) valid on Internet.




Subnet mask




A subnet allows the flow of network traffic between hosts to be segregated based on a 
network configuration. By organizing hosts into logical groups, subnetting can improve 
network security and performance.

Subnet Mask

Perhaps the most recognizable aspect of subnetting is the subnet mask. Like IP addresses, a subnet mask contains four bytes (32 bits) and is often written using the same "dotted-decimal" notation. For example, a very common subnet mask in its binary representation
11111111 11111111 11111111 00000000
is typically shown in the equivalent, more readable form
255.255.255.0

Applying a Subnet Mask

A subnet mask neither works like an IP address, nor does it exist independently from them. Instead, subnet masks accompany an IP address and the two values work together. Applying the subnet mask to an IP address splits the address into two parts, an "extended network address" and a host address.
For a subnet mask to be valid, its leftmost bits must be set to '1'. For example,
00000000 00000000 00000000 00000000
is an invalid subnet mask because the leftmost bit is set to '0'.
Conversely, the rightmost bits in a valid subnet mask must be set to '0', not '1'. Therefore,
11111111 11111111 11111111 11111111
is invalid.
All valid subnet masks contain two parts: the left side with all mask bits set to '1' (the extended network portion) and the right side with all bits set to '0' (the host portion), such as the first example above.

Subnetting in Practice
Subnetting works by applying the concept of extended network addresses to individual computer (and other network device) addresses.

An extended network address includes both a network address and additional bits that represent the subnet number... (see below)
... . Together, these two data elements support a two-level addressing scheme recognized by standard implementations of IP. The network address and subnet number, when combined with thehost address, therefore support a three-level scheme.
Consider the following real-world example. A small business plans to use the 192.168.1.0 network for its internal (intranet) hosts. The human resources department wants their computers to be on a restricted part of this network because they store payroll information and other sensitive employee data. But because this is a Class C network, the default subnet mask of255.255.255.0 allows all computers on the network to be peers (to send messages directly to each other) by default.
The first four bits of 192.168.1.0 -
1100
place this network in the Class C range and also fix the length of the network address at 24 bits. To subnet this network, more than 24 bits must be set to '1' on the left side of the subnet mask. For instance, the 25-bit mask 255.255.255.128 creates a two-subnet network as follows.


Network address
(24 bits)
Subnet number
(1 bit)
Extended network
Host address range
11000000 10101000 00000001
0
192.168.1.0
192.168.1.1 - 192.168.1.127
11000000 10101000 00000001
1
192.168.1.128
192.168.1.129 - 192.168.1.255
For every additional bit set to '1' in the mask, another bit becomes available in the subnet number to index additional subnets. A two-bit subnet number can support up to four subnets, a three-bit number supports up to eight subnets, and so on.
Private Networks and Subnets
As mentioned earlier in this tutorial, the governing bodies that administer Internet Protocol have reserved certain networks for internal uses. In general, intranets utilizing these networks gain more control over managing their IP configuration and Internet access. The default subnet masks associated with these private networks are listed below.


Network address range
Default mask
10.0.0.0 - 10.255.255.255
255.0.0.0
172.16.0.0 - 172.31.255.255
255.240.0.0
192.168.0.0 - 192.168.255.255
255.255.0.0


Consult RFC 1918 for more details about these special networks.



Subnetting Review

Subnetting allows network administrators some flexibility in defining relationships among network hosts. Hosts on different subnets can only "talk" to each other through specialized network gateway devices like routers. The ability to filter traffic between subnets can make more bandwidth available to applications and can limit access in desirable ways.

Class
Address
# of Hosts
Netmask (Binary)
Netmask (Decimal)
CIDR
/4
240,435,456
11110000 00000000 00000000 00000000
240.0.0.0
CIDR
/5
134,217,728
11111000 00000000 00000000 00000000
248.0.0.0
CIDR
/6
67,108,864
11111100 00000000 00000000 00000000
252.0.0.0
CIDR
/7
33,554,432
11111110 00000000 00000000 00000000
254.0.0.0
A
/8
16,777,216
11111111 00000000 00000000 00000000
255.0.0.0
CIDR
/9
8,388,608
11111111 10000000 00000000 00000000
255.128.0.0
CIDR
/10
4,194,304
11111111 11000000 00000000 00000000
255.192.0.0
CIDR
/11
2,097,152
11111111 11100000 00000000 00000000
255.224.0.0
CIDR
/12
1,048,576
11111111 11110000 00000000 00000000
255.240.0.0
CIDR
/13
524,288
11111111 11111000 00000000 00000000
255.248.0.0
CIDR
/14
262,144
11111111 11111100 00000000 00000000
255.252.0.0
CIDR
/15
131,072
11111111 11111110 00000000 00000000
255.254.0.0
B
/16
65,534
11111111 11111111 00000000 00000000
255.255.0.0
CIDR
/17
32,768
11111111 11111111 10000000 00000000
255.255.128.0
CIDR
/18
16,384
11111111 11111111 11000000 00000000
255.255.192.0
CIDR
/19
8,192
11111111 11111111 11100000 00000000
255.255.224.0
CIDR
/20
4,096
11111111 11111111 11110000 00000000
255.255.240.0
CIDR
/21
2,048
11111111 11111111 11111000 00000000
255.255.248.0
CIDR
/22
1,024
11111111 11111111 11111100 00000000
255.255.252.0
CIDR
/23
512
11111111 11111111 11111110 00000000
255.255.254.0

C
/24
256
11111111 11111111 11111111 00000000
255.255.255.0
CIDR
/25
128
11111111 11111111 11111111 10000000
255.255.255.128
CIDR
/26
64
11111111 11111111 11111111 11000000
255.255.255.192
CIDR
/27
32
11111111 11111111 11111111 11100000
255.255.255.224
CIDR
/28
16
11111111 11111111 11111111 11110000
255.255.255.240
CIDR
/29
8
11111111 11111111 11111111 11111000
255.255.255.248
CIDR
/30
4
11111111 11111111 11111111 11111100
255.255.255.252



SubnetMask - Examples


Class A : N.H.H.H


11111111.00000000.00000000.00000000

Default Subnet Mask for Class A is 255.0.0.0



 Class B : N.N.H.H

11111111.11111111.00000000.00000000

Default SubnetMask for Class B is 255.255.0.0


Class C : N.N.N.H

11111111.11111111.11111111.00000000

Default SubnetMask for Class C is 255.255.255.0


How Subnet MaskWorks ?


IP Address : 192.168.1.1


SubnetMask : 255.255.255.0

ANDING PROCESS :

192.168.1.1       = 11000000.10101000.00000001.00000001
255.255.255.0   = 11111111.11111111.11111111.00000000
==================================================
192.168.1.0       = 11000000.10101000.00000001.00000000
==================================================



The output of an AND table is 1 if both its inputs are 1.

For all other possible inputs the output is 0.