HP-UX HB v13.00 Ch-09 - Networking Basics

HP-UX Handbook Rev 13.00 Page 7 (of 27)
Chapter 09 Network Basics
October 29, 2013
IP Addresses and Netmasks
An IP address specifies the network the system resides in and the “number” of the host within
this network. The IP address consists of a network part and a host part. The network part is
important for routing, to find a way through the network(s) to the target. The host part identifies
a specific host within its own network.
The netmask defines how many bits of the 4-byte IP address are used for the network part.
Usually 3 classes of networks are distinguished using predetermined netmasks and some
reserved areas of address range.
1
st
byte
type
network part
hosts part
netmask
< 128
class A
byte 1
byte 2,3,4
255.0.0.0
128 - 191
class B
byte 1,2
byte 3,4
255.255.0.0
192 - 223
class C
byte 1,2,3
byte 4
255.255.255.0
224 - 239
multicast
n/a
multicast group
> 239
reserved
n/a
n/a
n/a
Official network addresses have since become a rare commodity and the philosophy of small,
medium, and large networks no longer fits the bill of the current field of networking. Subnets and
so-called classless IP addresses are required nowadays. The theory behind all this is defined in
RFCs 1122 and 1878. As a result IP addresses are specified with the number of bits for the
network part, e.g. 15.140.10.113/21 (the first 21 bits of this address are the network part).
The following example will show how netmasks are used:
Network administration (IT) provides an official IP address and netmask. Now we would like to
determine which subnet this IP-address is located within, and which broadcast address belongs to
this subnet.
Example: IP-address: 15.140.10.113 netmask: 255.255.248.0
15.140.10.113/21 (in another notation see above)
binary
IP Address 15.140.10.113 0000 1111 . 1000 1100 . 0000 1010 . 0111 0001
Netmask 255.255.248.0 1111 1111 . 1111 1111 . 1111 1000 . 0000 0000
Using the logical AND results in the:
Net portion of the IP address 0000 1111 . 1000 1100 . 0000 1000 . 0000 0000
in decimal: 15.140.8.0
setting all hostbits to 1 results in the:
broadcast address 0000 1111 . 1000 1100 . 0000 1111 . 1111 1111