This address is assigned by the NIC and it has two section or parts. The one on the left represents network identification and the one on the right represents the node identification. In consideration of the point mentioned above (four numbers between 0-255, or 32 bits or four bytes), each byte represents either the network or the node. The NIC assigns the net and the institution (or provider) assigns the node.
There are some restrictions: 0 (for example, 0.0.0.0) in the network space is reserved for the routing by default and 127 (for example, 127.0.0.1) is reserved for the (local loopback or local host), 0 in the node part refers to this network (for example,192.168.0.0) and 255 is reserved for sending packets to all (broadcast) machines (for example, 188.8.131.52). There may be different types of networks or addresses in the different assignations:
Class A (network.host.host.host): 184.108.40.206 to 220.127.116.11 (126 networks, 16 million nodes) define the large networks. The binary standard is: 0 + 7 network bits + 24 node bits.
Class B (network.network.host.host): 18.104.22.168 to 22.214.171.124 (16K networks, 65K nodes); (usually, the first node byte is used to identify subnets within an institution). The binary standard is 10 + 14 network bits + 16 node bits.
Class C (net.net.net.host): 126.96.36.199 to 188.8.131.52 (2 million of networks, 254 nodes). The binary standard is 110 + 21 network bits + 8 node bits.
Classes D and E (network.network.network.host): 184.108.40.206 to 255.255.255.254 reserved for multicast (from one node to a set of nodes that form part of the group) and experimental purposes.
Some address ranges have been reserved so that they do not correspond to public networks, and are considered private networks (interconnected computers without external connection; the messages will not be sent through Internet, but through an intranet). These address ranges are class A 10.0.0.0 to 10.255.255.255, class B 172.16.0.0 to 172.31.0.0 and class C 192.168.0.0 to 192.168.255.0.
The broadcast address is special, because each node in a network listens to all the messages (as well as its own address). This address makes it possible to send datagrams (generally routing information and warning messages) to a network and all nodes on the network will be able to read them. For example, when ARP tries to find the Ethernet address corresponding to an IP, it uses a broadcast message, which is sent to all the machines on the network at the same time. Each node in the network reads this message and compares the IP that is being searched and sends back a message to the sender node if they match.
Two concepts that are related to the point described above are the subnets and routing between these subnets. Subnets subdivide the node part into smaller networks within the same network, so as to, for example, improve the traffic. A subnet is in charge of sending traffic to certain IP address ranges, extending to the same concept of Class A, B and C networks, but only applying this rerouting in the IP node part. The number of bits interpreted as a subnet identifier is provided by a netmask, which is a 32-bit number (as is an IP). In order to obtain the subnet identifier, we will have to perform a logical AND operation between the mask and the IP, which will provide us with the subnet IP. For example, an institution with a B class network, with number 172.17.0.0, would therefore have a netmask with number 255.255.0.0. Internally, this network is formed by small networks (one per floor in the building, for example). In this way, the range of addresses is reassigned in 20 subnets (floors in our example, except 172.17.1.0, that has a special role), 172.17.1.0 to 172.17.20.0. The point that connects all these floors, called the backbone, has its own address, for example 172.17.1.0.
These subnets share the same network IP, whereas the third is used to identify each of the subnets within it (which is why it will use the netmask 255.255.255.0).
The second concept, routing, represents the mode in which the messages are sent through the subnets. For example, let us say there are three departments with Ethernet subnets:
|1)Purchases (subnet 172.17.2.0),|
|2)Clients (subnet 172.17.4.0),|
|3)Human Resources, (subnet 172.17.6.0)|
|4)Backbone with FFDI (subnet 172.17.1.0).|
In order to route the messages between the computers on the three networks, we need three gateways that will each have two network interfaces to switch between Ethernet and FFDI. These would be:
|1)PurchasesGW IPs:172.17.2.1 and 172.17.1.1,|
|2)ClientsGW IPs:172.17.4.1 and 172.17.1.2|
|3)HumanResourcesGW IPs:172.17.6.1 and 172.17.1.3, in other words, one IP on the subnet side and another on the backbone side.|
When messages are sent between machines in the purchases area, it is not necessary to leave the gateway, as the TCP/IP will find the machine directly. The problem arises when the Purchases0 machine wishes to send a message to HumanResources3. The message must pass through the two respective gateways. When Purchases0 "sees" that HumanResources3 is on another network, it sends the packet through the PurchasesGW gateway, which in turn sends it to HumanResourcesGW, which, in turn, sends it to HumanResources3. The advantage of having subnets is obvious, given that the traffic between all the purchases machines, for example, will not affect the Clients or Human Resources machines (although this is more complex and expensive in terms of designing and building the network).
IP uses a table to route the packets between the different networks, in which there is a default routing associated to net 0.0.0.0. All the addresses coincide with this one, as none of the 32 bits are necessary; they are sent through the default gateway to the indicated network. In the purchasesGW, for example, the table would be:
The '-' means that the machine is directly connected and does not need routing. The procedure for identifying whether routing is required or not consists of performing a very simple operation with the two logic ANDs (subnet AND mask and origin AND mask) and comparing the two results. If they match, there is no routing, but the machine defined as gateway must be sent in each machine, so that this machine routes the message.
For example, a message from 172.17.2.4 to 172.17.2.6 would mean:
|172.17.2.4 AND 255.255.255.0 = 172.17.2.0|
|172.17.2.6 AND 255.255.255.0 = 172.17.2.0|
As the results are the same, there would be no routing. On the other hand, if we do the same from 172.17.2.4 to 172.17.6.6 we see that there will be routing through 172.17.2.1 with an interface change (eth0 to ffdi0) to 172.17.1.1 and from here to 172.17.1.2 with another interface change (fddi0 to eth0) and then to 172.17.6.6. The default routing will be used when none of the rules match. If two rules match, the routing that matches the most precisely, in other words, the one with the least zeros, will be used. In order to build the routing tables, we can use the route command during machine startup; however, if it is necessary to use more complex rules (or automatic routing), we can use the routing information protocol (RIP) command or, between independent systems, the external gateway protocol (EGP) or also the border gateway protocol (BGP) commands. These protocols are implemented through the gated command.
In order to install a machine on an existing network, it is necessary to have the following information, obtained from the network provider or the administrator: node IP address, network IP address, broadcast address, netmask address, router address and DNS address.
If we are setting up a network that will never have an Internet connection, we can choose the addresses that we wish, but it is advisable to maintain an appropriate order corresponding to the size of the network that will be needed, so as to avoid administrative problems within the network in question. We will now see how to define the network and node for a private network (we have to be careful, as, if the machine is connected to the network, we can inconvenience another user to whom this address has been assigned): node address 192.168.110.23, netmask 255.255.255.0, net part 192.168.110., node part .23, net address 192.168.110.0, broadcast address 192.168.110.255.