Flux rss
Bookmark Bookmark & Share
Indirizzo  IP Endereço IP IP Adressen Adresse IP Dirección IP

What is an IP address?

Computers communicate over the Internet using the IP protocol (Internet Protocol), which uses numerical addresses, called IP addresses, made up of four whole numbers (4 bytes) between 0 and 255 and written in the format xxx.xxx.xxx.xxx. For example, 194.153.205.26 is an IP address given in technical format.

These addresses are used by networked computers to communicate, so each computer on a network has a unique IP address on that network.

It is ICANN (Internet Corporation for Assigned Names and Numbers, replaced since 1998 by IANA, Internet Assigned Numbers Agency) which is responsible for allocating public IP addresses, i.e. IP addresses for computers directly connected to the public internet network.

Decrypting an IP address

An IP address is a 32 bit address, generally written in the format of 4 whole numbers separated by dots. There are two distinct parts to an IP address:

  • the numbers to the left indicate the network and are called the netID,
  • the numbers to the right indicate the computers on this network and are called the host-ID.

Shown in the example below:

network example

Note the network to the left 194.28.12.0. It contains the following computers:

  • 194.28.12.1 to 194.28.12.4

Note that of the right 178.12.0.0. It includes the following computers:

  • 178.12.77.1 to 178.12.77.6

In the case above, the networks are written 194.28.12 and 178.12.77, then each computer making up the network is numbered incrementally.

Take a network written 58.0.0.0. The computers on this network could have IP addresses going from 58.0.0.1 to 58.255.255.254. So, it is a case of allocating the numbers in such a way that there is a structure in the hierarchy of the computers and servers.

So, the smaller the number of bits reserved on the network, the more computers it can contain.

In fact, a network written 102.0.0.0 can contain computers whose IP address can vary between 102.0.0.1 and 102.255.255.254 (256*256*256-2=16,777,214 possibilities), while a network written 194.24 can only contain computers where the IP address is between 194.26.0.1 and 194.26.255.254 (256*256-2=65,534 possibilities), this is the notion of IP address classes.

Special addresses.

When the host-id is cancelled, i.e. when the bits reserved for the machines on the network are replaced by zeros (for example 194.28.12.0), something called a network address is obtained. This address cannot be allocated to any of the computers on the network.

When the netid is cancelled, i.e. when the bits reserved for the network are replaced by zeros, a machine address is obtained. This address represents the machine specified by the host-ID which is found on the current network.

When all the bits of the host-id are at 1, the address obtained is called the broadcast address. This a specific address, enabling a message to be sent to all the machines on the network specified by the netID.

Conversely, when all the bits of the netid are at 1, the address obtained is called the multicast address.

Finally the address 127.0.0.1 is called the loopback address because it indicates the localhost.

Network classes

IP addresses are divided into classes, according to the number of bytes which represent the network.

Class A

In a class A IP address, the first byte represents the network.

The most significant bit (the first bit, that to the left) is at zero which means that there are 27 (00000000 to 01111111) network possibilities, which is 128 possibilities However, the 0 network (bits valuing 00000000) does not exist and number 127 is reserved to indicate your machine.

The networks available in class A are therefore networks going from 1.0.0.0 to 126.0.0.0 (the last bytes are zeros which indicate that this is indeed a network and not computers!)

The three bytes to the left represent the computers on the network, the network can therefore contain a number of computers equal to:
224-2 = 16,777,214 computers.

A class A IP address, in binary looks like:

0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NetworkComputers

Class B

In a class B IP address, the first two bytes represent the network.

The first two bits are 1 and 0, which means that there are 214 (10 000000 00000000 to 10 111111 11111111) network possibilities, which is 16,384 possible networks. The networks available in class B are therefore networks going from 128.0.0.0 to 191.255.0.0.

The two bytes to the left represent the computers on the network. The network can therefore contain a number of computers equal to:
216-21 = 65,534 computers.

A class B IP address, in binary looks like:

10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NetworkComputers

Class C

In a class C IP address, the first three bytes represent the network. The first three bits are 1,1 and 0 which means that there are 221 network possibilities, i.e. 2,097,152. The networks available in class C are therefore networks going from 192.0.0.0 to 223.255.255.0.

The byte to the left represents the computers on the network, the network can therefore contain:
28-21 = 254 computers.

In binary, a class C IP address looks like:

110xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NetworkComputers

Allocation of IP addresses

The aim of dividing IP addresses into three classes A, B and C is to make the search for a computer on the network easier. In fact, with this notation it is possible to firstly search for the network that you want to reach, then search for a computer on this network. So, allocation of IP address is done according to the size of the network.

Class Number of possible networks Maximum number of computers on each one
A 126 16777214
B 16384 65534
C 2097152 254

Class A addresses are used for very large networks, while class C addresses are for example allocated to small company networks.

Reserved IP addresses

It frequently happens that in a company or organisation only one computer is linked to the Internet and it is through this that other computers on the network access the Internet (generally we talk of a proxy or gateway).

In such a case, only the computer linked to the network needs to reserve an IP address with ICANN. However, the other computers still need an IP address to be able to communicate with each other internally.

So, ICANN has reserved a handful of addresses in each class to enable an IP address to be allocated to computers on a local network linked to the Internet without the risk of creating IP address conflicts on the network of networks. These are the following addresses:

  • Private class A IP addresses: 10.0.0.1 to 10.255.255.254, enabling the creation of large private networks comprising of thousands of computers.
  • Private class B IP addresses: 172.16.0.1 to 172.31.255.254, making it possible to create medium sized private networks.
  • Private class C IP addresses: 192.168.0.1 to 192.168.0.254, for putting in place small private networks.

Subnet masks

Subnet masks

In short, a mask is produced containing 1s with the location of bits that you want to keep and 0s for those you want to cancel. Once this mask is created, you simply put a logical AND between the value you want to mask and the mask in order to keep the part you wish to cancel separate from the rest.

So a netmask is presented in the form of 4 bytes separated by dots (like an IP address), it comprises (in its binary notation) zeros at the level of the bits from the IP address that you wish to cancel (and ones at the level of those you want to keep).

Importance of subnet masks

The primary importance of a subnet mask is to enable the simple identification of the network associated to an IP address.

Indeed, the network is determined by a certain number of bytes in the IP address (1 byte for class A addresses, 2 for class B and 3 bytes for class C). However, a network is written by taking the number of bytes which characterise it, then completing it with zeros. For example, the network linked to the address 34.56.123.12 is 34.0.0.0, because it is a class A type IP address.

To find out the network address linked to the IP address 34.56.123.12, you simply need to apply a mask where the first byte is only made up of 1s (which is 255 in decimal), then 0s in the following bytes.
The mask is: 11111111.00000000.00000000.00000000
The mask associated with the IP address 34.208.123.12 is therefore 255.0.0.0.
The binary value of 34.208.123.12 is: 00100010.11010000.01111011.00001100
So an AND logic between the IP address and the mask gives the following result:

00100010.11010000.01111011.00001100
		AND
11111111.00000000.00000000.00000000
		=
00100010.00000000.00000000.00000000
Which is 34.0.0.0. It is the network linked to the address 34.208.123.12

By generalising, it is possible to obtain masks relating to each class of address:

  • For a Class A address, only the first byte must be retained. The mask has the following format 11111111.00000000.00000000.00000000, i.e. 255.0.0.0 in decimal;
  • For a Class B address, the first two bytes must be retained, which gives the following mask 11111111.11111111.00000000.00000000, relating to 255.255.0.0 in decimal;
  • For a Class C address, by the same reasoning, the mask will have the following format 11111111.11111111.11111111.00000000, i.e. 255.255.255.0 in decimal;

Creation of subnets

Let us re-examine the example of the network 34.0.0.0, and assume that we want the first two bits of the second byte to make it possible to indicate the network.
The mask to be applied will then be:

11111111.11000000.00000000.00000000

That is 255.192.0.0

If we apply this mask to the address 34.208.123.12 we get:

34.192.0.0

In reality there are 4 possible scenarios for the result of the masking of an IP address of a computer on the network 34.0.0.0

  • When the first two bits of the second byte are 00, in which case the result of the masking is 34.0.0.0
  • When the first two bits of the second byte are 01, in which case the result of the masking is 34.64.0.0
  • When the first two bits of the second byte are 10, in which case the result of the masking is 34.128.0.0
  • When the first two bits of the second byte are 11, in which case the result of the masking is 34.192.0.0

Therefore, this masking divides a class A network (able to allow 16,777,214 computers) into 4 subnets - from where the name of subnet mask - can allow 222 computers or 4,194,304 computers.

It may be interesting to note that in these two cases, the total number of computers is the same, which is 16,777,214 computers (4 x 4,194,304 - 2 = 16,777,214).

The number of subnets depends on the number of additional bits allocated to the network (here 2). The number of subnets is therefore:

Number of bits Number of subnets
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 (impossible for class C) 256


Last update on Thursday October 16, 2008 02:43:22 PM.This document entitled « IP Address » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
IP address spoofing IP address spoofing "IP address spoofing" is a technique that involves replacing the IP address of an IP packet's sender with another machine's IP address. This technique lets a pirate send packets anonymously. It is not a question of changing the... en.kioskea.net/contents/attaques/usurpation-ip-spoofing.php3
Command to detect your IP address! Command to detect your IP address! IP address (Internet Protocol) is a numerical identification to detect your computer on a network. It is used to communicate between nodes on a computer network. Find below the commands to execute and provide... en.kioskea.net/faq/sujet-553-command-to-detect-your-ip-address
Having a static IP address under Ubuntu 8.10 Having a static IP address under Ubuntu 8.10 To have a fixed IP persistent: Configure manually the interfaces For a fix IP (10.0.0.1 on your eth1 interface) use: To make use of dynamic IP (e.g eth0): DNS NetworkManager is a... en.kioskea.net/faq/sujet-979-having-a-static-ip-address-under-ubuntu-8-10
What is your IP address?What is your IP address? What is an IP address? How to know your IP address? For Windows 2000/ Windows XP/ Windows Vista users For Windows 95/ Windows 98 users By using online tools What is an IP address? When a PC is connected to... en.kioskea.net/faq/sujet-225-what-is-your-ip-address
MacOS X – Associating a name to an IP AddressMacOS X – Associating a name to an IP Address What you should know Use this step Example What you should know Please note: this is only valid until MacOSX 10.4, NOT for MacOSX 10.5 (Leopard) MacOSX is a BSD system, the first... en.kioskea.net/faq/sujet-2602-macos-x-associating-a-name-to-an-ip-address
How to display a visitor IP address?How to display a visitor’s IP address? Simple method Displaying IP in a graphic mode Show IP Display visitor's IP Address in a graphic with this simple php code. Consider that: Your... en.kioskea.net/faq/sujet-1965-how-to-display-a-visitor-ip-address
Another computer with the same IP address (Solved)Hello, I Was setting up my D-Link N Wireless router and when the install wizard was working i got a windows message that said that another computer on the same network had the same IP address as mine. My computer runs on windows vista and my internet... en.kioskea.net/forum/affich-62006-another-computer-with-the-same-ip-address
Who owns this IP Address? (Solved)Hello, I got a threatening comment on my website, bandew444.wordpress.com, and I have the IP address. I think I may know this person, because they knew my address, brother & girlfriend. The IP is 68.101.232.64 . I just want to find out the name on the... en.kioskea.net/forum/affich-86032-who-owns-this-ip-address
How to change IP address from command promptHello, Is there any way to change IP address of computer from Command prompt? I use WinXP as OS and I would like to know if I can change IP from Command prompt Please help me out. en.kioskea.net/forum/affich-13513-how-to-change-ip-address-from-command-prompt
Download Free IP SwitcherIf you are led to move regularly and to link you to different networks, you must re-configure IP address continuously, footbridge, mask of sub-network, proxy waiter, printer by default, etc.... For it, it is necessary to remember every network... en.kioskea.net/telecharger/telecharger-362-free-ip-switcher
Download IP Traffic MonitorIP Traffic Monitor monitors all network connections on the computer where it is installed. The program shows you detailed information, such as the remote IP address, host name if available, details of inbound and outbound traffic. Advantage It... en.kioskea.net/telecharger/telecharger-2872-ip-traffic-monitor
Download Visual IP TraceVisual IP Trace generally reveals IP addresses and “traces” them to find geographical location of its respective computers on a planisphere. Thanks to Visual IP Traces, you will be able to locate geographically one or more IP addresses, domain... en.kioskea.net/telecharger/telecharger-3277-visual-ip-trace
NAT- Network address translation, port forwarding and port triggThe principle of NAT Network address translation or NAT was developed in order to respond to the shortage of IP addresses with IPv4 protocol (in time the IPv6 protocol will respond to this problem). In fact, in IPv4 addressing the number of... en.kioskea.net/contents/internet/nat.php3
Port/Ports TCP/IPThe use of ports Many TCP/IP programs can be executed simultaneously over the Internet (you can for example open several browsers simultaneously or browse HTML pages while downloading a file via FTP). Each of these programs works with a protocol,... en.kioskea.net/contents/internet/port.php3
TCP/IPWhat does TCP/IP mean? TCP/IP is a suite of protocols. The acronym TCP/IP means "Transmission Control Protocol/Internet Protocol" and is pronounced "T-C-P-I-P". It comes from the names of the two major protocols in the suite of protocols, i.e.... en.kioskea.net/contents/internet/tcpip.php3