Theory part to I P Subnet Calculator

Introduction

Internet Protocols (IP) are probably the most common protocol types at all. With IP it is possible to communicate in and between different  net types (LAN, WAN...). Internet Protocols consist of several communication protocols. The most  popular below these are the Transmission Control Protokol (TCP) and the Internet Protocol (IP). At least at the second one we will take a look in this text. The aim is to take care of the addressing (IP address and computation of the subnet mask), so that everyone reading this text should be able to calculate a valuable IP number and subnet mask. To reach this we'll start with a short introduction on Internet Protocol. In the second part we'll have to look at the rules in IP-addressing and subnet masking.

Historical

Like for other technical achievements, research in  Internet Protocols were fundamentally motivated by military interests. In the middle of the 70's of the last century it was the Defense Advanced Research Project Acency (DARPA) who started, with help of the Stanford University, Bolt, Beranek and Newman (BBN), developing a packet-switched network  in order to simplify communication between heterogeneous computer systems in research labs. Owing to the foundation of the DARPA and the achievement of the scientists, at the ends of the 70's the Internet Protocols occurred .

TCP/IP was first integrated in Berkley Software Distribution (BSD) UNIX , which then finally put the backbone of the World Wide Webs (WWW).

Internet Protocols (IP)

To start with the introduction in Internet Protocols  it seems to be useful, that we compare the layers of IP- Suite to the theoretical OSI layers. For this the following figure should be a helpful illustration:

Figure 1: OSI Reference Model / IP Suite

How mentioned  before, this text itself dedicates to the OSI network layer, in other words to the IP. Overall, we will have to understand the basic structure of an IP-packet. This structure is illustrated in the following Figure:

Figure 2: Structure of a IP package

Structure of IP addresses

As already  mentioned in the historical part, the central thought behind Internet Protocol is,  to send packets efficiently  through large networks (" routing"). If one regards the complexity of structure like the WWW, which consists of ten thousands of interlaced single nets , it's no question that, in order to realize an efficient data communication,  a clearly structured addressing is required. At this point the addressing of the IP packets (source- and destination-address), suggested in figure 2,  appears. They are called IP-addresses. They consist of individual components and they are subordinated to a strict format. Those addresses can be divided into a network- and host-address. IP-addresses are used to calculate subnet- addresses, too. But we will talk about subnets in chapter IP Subnet addressing.

Each host in a TCP/IP network possesses a unique logical 32-bit address, which can be split up into two main parts: The first part is a network number and the second part describes a host number. The network number, in case that our network is part of the Internet, was given by the Internet Network Information Center (InterNIC). For example: An Internet Service Provider (ISP) gets several network-numbers from the InterNIC. The ISP itself is able to assign host-numbers as required (following the rules of IP-addressing). The host- number marks a host in a network. Summarized: A ISP refers a network number from the InterNIC, this number becomes part of the IP-addresses which he can distribute. The ISP assigns host- numbers to the hosts . The net number and the host number result in then a unique address: IP-number.

Now to the structure of IP- addresses: The 32-bit IP-address is divided into four separate bytes. These are normally represented in the dotted-decimal-notation:

Figure 3: Ex. of a IP- address in dotted-decimal-notation

8 bits 8 bits 8 bits 8 bits
196 . 168 .

1

.

1

In these four bytes the individual bits are kind-moderately weighted (128, 64, 32,.16, 8, 4, 2, 1). For this a octet assumes values between 0 and 255.

Classes of IP addresses

The IP- addresses are divided into five classes: A, B, C, D and E. The classes are defined as follows:

IP Subnet addressing

IP of networks can be divided into smaller internal networks, the so-called subnetworks (or subnets).
It looks outward further like one network. Thus e.g. external routers don't know anything from a segmenting
and anything from the internal structure of the organization, probably however internal routers. The formation of subnets brings
the network administrator several advantages. These contain e.g. higher flexibility, more efficiency
in handling also
network addresses and Broadcast Traffic.

An existing network address can be divided into many subnets e.g. 192.168.1.0, 192,168,2,0, 192.168.3.0
and 192,168,4,0 are all subnets in the network 192.168.0.0

IP Subnet mask

In order to partition a network with given network address further, the host part of the IP address is divided:

Network - address Host - address part
Subnet-address Host-address

A subnet is provided, by "borrowing" bits of the host-address part and determines these as subnet-address .
The number of "borrowed" bits isn't constant and is specified by the subnet mask.



Subnet masks need the same format and the same representational as IP addresses. The subnet mask has
in all bit locations as network- and subnet-address a binary 1 and in all bit locations of host-address a
binary 0.


Let us take for example an address 129,47,0,0 of the class B. The 2 Bytes=16 bits host part we divide into e.g.
4 bits for a subnet-addressing and 12 bits for the host addressing. This permits  15 subnet and 4094 knots.

Another allocation in e.g. 8 and 8 bits would permit 254 networks with ever 254 knots.


The subnet mask bits come from the bits higher placed (from left) than the host -address.



There are different subnet masks for subnets of the class to B and C.

A subnet mask consists likewise of 4 bytes and it gets added to the IP-Address for address-computations with a logical AND. 
Develops the complete network-sender-hurry.


Two examples may clarify this:

IP address: 129.47.27.14 = 10000010.00111001.00011011.00001110
Subnetmask: 255.255.0.0 = 11111111.11111111.00000000.00000000
---------------------------------------------------------------------------------------------------
Added: 10000010.00111001.00000000.00000000 = 129.47.0.0

A subnet addressing with 4 bits:

IP address: 129.47.27.14 = 10000010.00111001.00011011.00001110
Subnetmask: 255.255.240.0 = 11111111.11111111.11110000.00000000
------------------------------------------------------------------------------------------------------
Added: 10000010.00111001.00010000.00000000 = 129.47.(16).0

The usual subnet mask for a class B address without subnets is 255.255.0.0. But the address 171,16,0,0 from the class B,
which specifies 8 bits for subnet, the subnet mask has 255.255.255.0. The reason is that 8 bits of the subnet-address make possible 256
subnets. Two are omitted however, one for the network Address and one for the Broadcast-address.

In following figure a reference table for class B of nets:

Number of bits Subnet mask Number of Subnets Number of host

2

255.255.192.0

2

16382

3

255.255.224.0

6

8190

4

255.255.240.0

14

4094

5

255.255.248.0

30

2046

6

255.255.252.0

62

1022

7

255.255.254.0

126

510

8

255.255.255.0

254

254

9

255.255.255.128

510

126

10

255.255.255.192

1022

62

11

255.255.255.224

2046

30

12

255.255.255.240

4094

14

13

255.255.255.248

8190

6

14

255.255.255.252

1 6382

2


Following by a reference figure about class C  nets:

Number of bits Subnet mask Number of Subnets Number of host

2

255.255.255.192

2

62

3

255.255.255.224

6

30

4

255.255.255.240

14

14

5

255.255.255.248

30

6

6

255.255.255.252

62

2