15.5 What s in an IP Address?

     

15.5 What's in an IP Address?

The most common version of IP addressing in use today is still IP version 4 (IPv4). This is the 32-bit address that identifies not only a host but also the network to which the host is connected. When we are communicating with another machine, it is said that the IP software has a basic decision to make: Is the destination host on a local network or a remote network ? Figure 15-1 shows the fundamental question posed to the IP software regarding the location of another host.

Figure 15-1. The fundamental question IP has to answer.

graphics/15fig01.gif


At the heart of this concept are the notion of routing and the fact that an individual LAN interface can reside only in one logical network. If a server has several LAN interfaces (either physical or logical), each interface will have an individual IP address. It is possible to configure multiple physical interfaces with the same network address, but it is more common to configure each interface with an IP address that identifies that interface to be a member of a different network. The kernel will maintain a routing table of all the routes we have to all configured networks; by default, this routing table will simply document which interfaces are configured with IP addresses and which network addresses they relate to. In this way, a server with multiple LAN interfaces is acting as a router .

An IPv4 address is a 32-bit address that is most commonly represented in the dotted octet notation: dotted because we use dots to separate different parts of the address, and octet because the major components of the address are four 8-bit parts with each part having a maximum decimal value of 255. How we configure the first 5 bits of the address will determine which class of IP address we are using and by default how the IP address is divided into its two distinct identifiers: the network address (or net ID) and the host address (or host ID ) . The reason for setting up classes of IP address was to distinguish the size , complexity, and use of individual networks. Table 15-4 shows the five classes designed into the IPv4 address:

Table 15-4. IPv4 Address Classes

Class

Bits

 

1

2

3

4

7

8

16

24

32

A

network address

host address

B

1

network address

host address

C

1

1

network address

host ID

D

1

1

1

multicast address

E

1

1

1

1

reserved for future use


Class D (the first octet being 224 239 inclusive) addresses are only used by multicast applications, e.g., dynamic routing, and Class E addresses (the first octet being 240 255 inclusive) are not used. This leaves us with Class A to C addresses to use for individual LAN interfaces. I never found this description using bit-fields easy to understand or visualize. Table 15-5 shows how I interpret the IPv4 address classes:

Table 15-5. Example IPv4 Addresses and Default Network Addresses

Class

Initial octet

Example

Default Subnet mask

Network Address

Hosts per network

A

127

15.145.100.10

255.0.0.0

15.0.0.0

2 24 =16777216

B

128 191

171.100.35.44

255.255.0.0

171.100.0.0

2 16 =65536

C

192 224

192.168.0.1

255.255.255.0

192.168.0.0

2 8 =256


The organization that assigns network addresses is known as the Internet Assigned Number Authority (IANA: http://www.iana.org); however, when an organization joins the Internet, it can obtain a network number from an organization known as the Network Information Center or InterNIC (http://www.internic.net). We can apply to InterNIC for a network address; although regional addressing authorities look after four major geographical locations (see http://www.iana.org/ipaddress/ ip-addresses .htm for details). Once we have a network address, we can use the range of addresses within it to assign to individual hosts, or we can utilize a specific subnet mask to divide the host address into multiple network addresses. When determining our network address, the IP software will perform a logical AND operation with our IP address and our subnet mask to produce our network address. When communicating with another node, it will perform the same logical AND operation, and if the resulting network address is different, we must be communicating with a node on a different logical network behind a least one router, i.e., we consult our routing table to find the route to that network. Otherwise, both network addresses are the same, which means the node is connected to the same logical network and, hence, we consult our ARP cache to obtain the MAC address of that node.

As we should know, certain addresses are reserved; we mentioned Class D and Class E addresses previously. Certain other addresses are meant to signify specific entities: 1's represent "all"; in the context of a host ID, 1's would represent "all hosts", commonly known as a broadcast address. All 0's on the other hand signify "this"; a host ID of all 0's is meant to signify "this host"; however, there is a long-standing error in Berkley UNIX (and in HP-UX) the implementation of which allows a host to use all 0's as a broadcast address. In my case, the last octet is my host ID, but if I use all 0's, I get a response from all HP machines on my network:

 

 root@hpeos003[]  ping 192.168.0.0  PING 192.168.0.0: 64 byte packets 64 bytes from 192.168.0.203: icmp_seq=0. time=0. ms 64 bytes from 192.168.0.204: icmp_seq=0. time=0. ms 64 bytes from 192.168.0.201: icmp_seq=0. time=0. ms 64 bytes from 192.168.0.202: icmp_seq=0. time=0. ms 64 bytes from 192.168.0.100: icmp_seq=0. time=2. ms 64 bytes from 192.168.0.203: icmp_seq=1. time=0. ms 64 bytes from 192.168.0.204: icmp_seq=1. time=0. ms 64 bytes from 192.168.0.201: icmp_seq=1. time=0. ms 64 bytes from 192.168.0.202: icmp_seq=1. time=1. ms 64 bytes from 192.168.0.100: icmp_seq=1. time=1. ms ----192.168.0.0 PING Statistics---- 2 packets transmitted, 10 packets received, -400% packet loss round-trip (ms)  min/avg/max = 0/0/2 root@hpeos003[] 

In layman's terms, all 0's in a host ID will signify "this network". When we obtain our network ID, it is common for us to use part of the host ID to form a network address; this is the idea of subnetting.



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net