The basics of networking require the following information to establish a network connection.

--- Unique IP Address

A connection must have a address that is unique to its network. Where as most networks are connected to the internet, then the connection must have a unique address for the entire internet. However since the invention of NAT Routing (Network Address Translation Routing) which acts similar to a Proxy Service, you can have networks that are not directly connected to the internet but still have internet access. Networks that have NAT Routing should be assigned IP Addresses that are reserved for Private Address Space.

Private IP Address Space
10.0.0.0 through 10.255.255.255
172.16.0.0 through 172.31.255.255
192.168.0.0 through 192.168.255.255

--- IP Netmask

The netmask breaks the IP address into sections to identify the network the IP address resides on. The most basic and common are Class subnets.

Class A Netmask 255.0.0.0
Class B Netmask 255.255.0.0
Class C Netmask 255.255.255.0

The term Netmask is from the programming term Bitmask which is used in Anding Operations. This divides the address so the leftmost bits determine the network and the right most bits determine the node.

Dec - 255.0.0.0 - Binary 11111111.00000000.00000000.00000000
Dec - 255.255.0.0 - Binary 11111111.11111111.00000000.00000000
Dec - 255.255.255.0 - Binary 11111111.11111111.11111111.00000000

IP Address Dec 12.34.56.78
Netmask Dec 255.0.0.0
- Binary 00001100.00100010.00111000.01001110
- Binary 11111111.00000000.00000000.00000000

So from this we can see that the first 8 bits (also called an octet) is identified as the network portion of the IP address where as the last 24 bits (or 3 octets) identifies that node address.

--- Network - Node Address

More complex subnets can be assigned by shifting where the netmask ends at the binary level. The following algorithm is useful for calculating this information. Make one column from 1 to 256 in the power of two. The second column should be the reverse. The third column will start with 255. Take the number of the third column and subtract the number from the first column to find the result for the next row of the third column. This method is very useful for exams as the chart can easily be built for reference in testing centers, as well is considered a legitimate method of keeping notes.

1 256 255 /32 : 255 - 1 = 254
2 128 254 /31: 254 - 2 = 252
4 64 252 /30 : 252 - 4 = 248
8 32 248 /29 : 248 - 8 = 240
16 16 240 /28 : 240 - 16 = 224
32 8 224 /27 : 224 - 32 = 192
64 4 192 /26 : 192 - 64 = 128
128 2 128 /25 : 128 - 128 = 0 /25
256 1 0 /24

Taking this chart we can say for example if we see the netmask of 255.255.255.248 that it will separate the range into 32 networks each containing 8 IP addresses. Often you will see this in CIRD Notation (Classless Inter-Domain Routing) such as 12.34.56.72/29 which would represent the 255.255.255.248 netmask and contain the addresses of 12.34.56.72 through 12.34.56.79.

--- Gateway

If a network is going to connect to other networks such as the Internet, then the network will have one of the IP addresses on that network reserved as the gateway. When a gateway is defined on a network, the netmask will define a subnet in which you will also have a Network IP and Broadcast IP reserved. This is for the gateway to be able to discover the additional IP addresses that it communicates with. So keeping to our example of 12.34.56.72/8 the first available IP address of 12.34.56.72 would be reserved as the Network IP and the last IP address of 12.34.56.79 would be reserved for the Broadcast IP. While there is not any requirements for where the gateway is to be defined, it is common practice to use the first available IP address which would be 12.34.56.73. While the subnet assigns 8 IP addresses on this type of subnet, 3 of them are reserved, leaving 5 available addresses for use.

--- Routing Verses Switched VLAN (Virtual Local Area Network)

With true routing protocols, much of the IP address space becomes unusable and wasted. In our example we have 12.34.56.72/8 on a network, then we add an additional subnet 12.34.57.72/8 on the same network. With routing protocols you have to add a second gateway. This will require a Network IP and a Broadcast IP for the additional subnet, leaving only 5 usable IP addresses. With VLAN technology, only the original gateway needs to be defined on the first subnet. Additional subnets can be added to the network which use a virtual Class C netmask of 255.255.255.0 This allows all 8 IP addresses to be available rather than only 5.

--- Resolving DNS Servers

While the IP address, gateway and netmask allow for connectivity, in order to locate network addresses by friendly names such as www.google.com, the network connection will need to have Resolving DNS Servers. These may or may not reside on the same network, and it should also be noted that not all DNS servers allow access to be resolving DNS servers. Should an error occur with the Domain Name Resolution it is important to know if the DNS server is local to the subnet or not as there could be a connectivity issue rather than a DNS issue. For this is it common to run a traceroute to the DNS server to establish if the problem is network related or if the problem is in the DNS resolver.

--- Diagnostics

For Windows you can view all settings from the command "ipconfig /all"

C:\>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : MYSERVER
Primary Dns Suffix . . . . . . . : MYSERVER.LOCAL
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : MYSERVER.LOCAL

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : IntelĀ® 82567LM-3 Gigabit Network C
onnection
Physical Address. . . . . . . . . : 00-00-00-00-00-00
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 12.34.56.146
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 12.34.56.1
DHCP Server . . . . . . . . . . . : 12.34.56.2
DNS Servers . . . . . . . . . . . : 12.34.56.2
10.34.3.2
10.33.3.2
Primary WINS Server . . . . . . . : 12.34.56.2
Secondary WINS Server . . . . . . : 12.34.56.2
10.33.3.2
Lease Obtained. . . . . . . . . . : Wednesday, June 17, 2009 3:00:03 PM
Lease Expires . . . . . . . . . . : Friday, June 19, 2009 3:00:03 PM

From this we can see that the connection is on a private network and has DHCP enabled for addressing the IP assignment. This can be notated in CIRD format as follows:

Subet 10.36.0.0/19
IP 10.36.3.146
WINS 10.34.3.2
Resolver1 10.36.1.2
Resolver2 10.34.3.2
Resolver3 10.33.3.2

For linux the information is stored in two locations, so you will need the command "ifconfig" and look at the file "/etc/resolve.conf".

root@cpanel [~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:12.34.56.18 Bcast:12.34.56.23 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:59699990 errors:0 dropped:0 overruns:0 frame:0
TX packets:58437560 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1020446900 (973.1 MiB) TX bytes:1110541147 (1.0 GiB)
Base address:0xecc0 Memory:fe100000-fe120000

eth0:1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:12.34.56.19 Bcast:12.34.56.23 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xecc0 Memory:fe100000-fe120000

eth0:2 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:12.34.56.20 Bcast:12.34.56.23 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xecc0 Memory:fe100000-fe120000

eth0:3 Link encap:Ethernet HWaddr 00:00:00:00:00:0000:00:00:00:00:00
inet addr:12.34.56.21 Bcast:12.34.56.23 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xecc0 Memory:fe100000-fe120000

eth0:4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:12.34.56.22 Bcast:12.34.56.23 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xecc0 Memory:fe100000-fe120000

root@cpanel [~]# cat /etc/resolv.conf
nameserver 69.56.222.10
nameserver 216.185.111.10

Again this can be noted as follows

Subet 12.34.56.16/29
IP 12.34.56.16 through .23
Resolver1 69.56.222.10
Resolver1 216.185.111.10

So using the CIRD format can record information in a compact format.


Note: The IP addresses have been changed to protect the innocent. If I miscalculated something on the transition for this page I am sorry!