Entry type: FAQ, Entry ID: 2073614, Entry date: 07/24/2013
(2)
Rate

What is the connection between subnet masks and IP addresses with regard to subnetting and supernetting (Classless Inter Domain Routing CIDR)?

  • Entry
  • Associated product(s)

Configuration Notes
With CIDR, there is no fixed assignment of an IP address to a network class and possible subnetting in other networks or supernetting of several networks in a class. There is only one network mask that splits the IP address into a network part and a host part.

The CIDR function (Classless Inter Domain Routing) thus includes subnetting and supernetting.

The following Industrial Ethernet CPs support the subnetting and supernetting functions:

  • 6GK7343-1EX21-0XE0 as from FW V1.2
  • 6GK7343-1EX30-0XE0
  • 6GK7343-1GX21-0XE0 as from FW V1.1
  • 6GK7343-1GX30-0XE0
  • 6GK7343-1GX31-0XE0
  • 6GK7343-1CX10-0XE0
  • 6GK7343-1FX00-0XE0
  • 6FL4343-1CX10-0XE0
  • 6GK7443-1EX20-0XE0
  • 6GK7443-1EX30-0XE0
  • 6GK7443-1EX40-0XE0 as from FW V2.4
  • 6GK7443-1EX41-0XE0
  • 6GK7443-1GX20-0XE0
  • 6GK7443-1GX30-0XE0

The following CPUs with integrated PROFINET interface support the subnetting and supernetting functions:

  • IM151-8(F) PN/DP CPU
  • IM154-8(F) CPU
  • CPU314C-2 PN/DP
  • CPU315(F)-2 PN/DP as from FW V2.3
  • CPU317(F)-2 PN/DP as from FW V2.3
  • CPU319(F)-3 PN/DP
  • CPU412-2 PN
  • CPU414(F)-3 PN/DP
  • CPU416(F)-3 PN/DP
  • CPU412-5H PN/DP
  • CPU414-5H PN/DP
  • CPU416-5H PN/DP
  • CPU417-5H PN/DP
  • S7-1200 CPUs as from FW V1.0

The following Industrial Ethernet PC modules support the subnetting and supernetting functions:

  • CP1616 as from V2.0
  • CP1604 as from V2.0
  • CP1613 (A2) as from SW V7.1
  • CP1623
  • CP1628
  • CP1612 and IE General

For the remaining Industrial Ethernet PC modules like CP1613 (A2) < SW V7.1, CP1604 V1, CP1616 V1 and CP1512 it is only possible to configure the "Subnetting" function. It is not possible to configure the "Supernetting" function for these modules in STEP 7 / NCM PC. This is prevented in STEP 7 / NCM PC by an error message (see Fig. 05).

In these modules that support the TCP/IP protocol it is possible to set both the IP address and the associated subnet mask in the hardware configuration of STEP 7. The IP address and associated subnet mask are entered in the Properties window of the CP's or CPU's Ethernet interface. After inserting the Industrial Ethernet CP or CPU with integrated PN interface in the hardware configuration, you are offered the following default settings (see Fig. 01) in the Properties window of the CP's or CPU's Ethernet interface.

  • IP Address: 192.168.0.1
  • Subnet mask: 255.255.255.0


Fig. 01

If you wish to change these default settings for the IP address and subnet mask, you need information about the connection between classes of IP addresses and subnet masks. The following demonstrates the connection between classes of IP addresses and subnet masks.

Connection between class of the IP address and subnet mask
In principle there are 5 classes of IP addresses. These are the classes A to E. Each class has its own subnet mask. The connections are given in the table below.
 

Class Class bits IP address range Subnet mask Network share Node share
A 0xxxxxxx 0.x.x.x - 127.x.x.x 255.0.0.0 1 byte 3 bytes
B 10xxxxxx 128.0.x.x - 191.255.x.x 255.255.0.0 2 bytes 2 bytes
C 110xxxxx 192.0.0.x - 223.255.255.x 255.255.255.0 3 bytes 1 byte
D

1110xxxx

224.0.0.0 - 239.255.255.255

---

Multicast addresses

E 1111xxxx 240.0.0.0 - 255.255.255.255 ---

Reserved addresses
(for future purposes)

Class A network
IP addresses from Class A begin with the bit sequence 0-...; for example, the IP address range lies between 0.x.x.x and 127.x.x.x.
The subnet mask identifies the range that includes the address information for identifying the subnet. In Class A networks the first byte, that is to say the first 8 bits, corresponds to the IP address of the subnet address. Thus Class A networks are defined by the following subnet mask: 255.0.0.0 = 1111 1111 0000 0000 0000 0000 0000 0000. The last three bytes (24 bits) of the IP address identify a node in this subnet.

The total number of Class A networks can be calculated as follows:

  • 28-1-2 = 27-2 = 126 networks (since the IP address always begins with the bit sequence 0-..., 0.0.0.0 and 127.0.0.0 are not permitted)

The number of computers in a Class A network can be calculated as follows:

  • 224-2 = 16 777 214 computers (x.0.0.0 -> network address and x.255.255.255 -> broadcast address are not permitted)


Fig. 02

Class B network
IP addresses from Class B begin with the bit sequence 1-0-... and the address range lies between 128.0.x.x and 191.255.x.x. In Class B networks the first two bytes, that is to say the first 16 bits correspond to the IP address of the subnet address. Thus Class B networks are defined by the following subnet mask: 255.255.0.0 = 1111 1111 1111 1111 0000 0000 0000 0000. The last two bytes (16 bits) identify a node in this subnet.

The total number of Class B networks can be calculated as follows:

  • 216-2 = 214 = 16384 networks (since the IP address always begins with the bit sequence 1-0...)

The number of computers in a Class B network can be calculated as follows:

  • 216-2 = 65534 computers (x.x.0.0 -> network address and x.x.255.255 -> broadcast address are not permitted)


Fig. 03

Class C network
IP addresses from Class C begin with the bit sequence 1-1-0... and the address range lies between 192.0.0.x and 223.255.255.x. In Class C networks the first three bytes, that is to say the first 24 bits correspond to the IP address of the subnet address. Thus Class C networks are defined by the following subnet mask: 255.255.255.0 = 1111 1111 1111 1111 1111 1111 0000 0000. The last byte (8 bits) identifies a node in this subnet.

The total number of Class C networks can be calculated as follows:

  • 224-3 = 221 = 2 097 152 networks (since the IP address always begins with the bit sequence 1-1-0...)

The number of computers in a Class C network can be calculated as follows:

  • 28-2 = 254 computers (x.x.x.0 -> network address and x.x.x.255 -> broadcast address are not permitted)


Fig. 04

Class D subnetwork
The class D subnetwork consists of special addresses that are used for multicast addressing.

Summary
The splitting up of IP addresses in network share and node share leads to the following conclusions:

  • A Class A network is larger than a Class C network, because there is a greater address area available for addressing the computers.

  • There are much less Class A networks than Class C networks because the address area of the subnets is smaller.

Reserved addresses

  • The Class A network address 127.x.x.x is reserved for the Loopback function of all computers, which means that
    all IP addresses that have the value 127 in the first byte may only be used for internal tests of computers.

  • The value 255 in the last byte (Byte 4) is reserved asBroadcast Address. Thus, for example, the address 140.80.255.255 is a broadcast address to all nodes in the Class B network 140.80.0.0.

  • The following ranges are reserved for private networks. All IP addresses from these ranges are not routed in the Internet.
    10.0.0.0 - 10.255.255.255
    172.16.0.0 - 172.31.255.255
    192.168.0.0 - 192.168.255.255

Until now, the connection between the class of the IP address and subnet mask has been explained. Furthermore, it is possible to extend the subnet mask with the so-called "subnetting" procedure.

Subnetting
Subnetting can be implemented in a Class A network, for example. It is possible to divide the computers of this Class A network into further logical units (subnets). We will observe the Class A network 86.x.x.x as an example. The subnet mask of this Class A network is 255.0.0.0 (1111 1111 0000 0000 0000 0000 0000 0000). The address area can be divided further into logical subnets by extending the subnet mask by 1 bit. The subnet mask is then 255.128.0.0 (1111 1111 1000 0000 0000 0000 0000 0000).

This means the following for addressing:

  • Only the addresses 86.0.0.1 to 86.127.255.254 can communicate directly with each other, that is without router, because these computers have the same value (in this case "0") in the first bit after the subnet mask.

  • Only the addresses 86.128.0.1 to 86.255.255.254 can communicate directly with each other, that is without router, because these computers have the same value (in this case "1") in the first bit after the subnet mask.

  • The address area of the computers in this Class A network has been divided into two subnets.

Conclusion
By extending the subnet mask you can divide the address area of the computers into more logical units (subnets). The address area has been divided into two subnets in the example. By adding more bits you can quickly multiply the number of subnets.

Supernetting
Supernetting is the grouping together of multiple networks with partially the same network share in one subnet. The underlying technology is the opposite to subnetting and in principle means a procedure for addressing a large number of nodes within one subnet. With supernetting the node share of a network class is increased. Thus the network share of this network class is decreased.
We will observe the Class C network 192.168.178.0 as an example. The subnet mask of this Class C network is 255.255.255.0 (1111 1111 1111 1111 1111 1111 0000 0000). Now 2 bits are added to the node share. The subnet mask is then 255.255.252.0 (1111 1111 1111 1111 1111 1100 0000 0000).

  • The lowest IP address of the network to be assigned is
    192.168.176.1 (1111 1111.1111 1111. 1011 0000. 0000 0001)

  • The highest IP address of the network to be assigned is
    192.168.179.254 (1111 1111.1111 1111. 1011 0011. 1111 1110)

  • The addresses 192.168.176.1 to 192.168.179.254 can communicate directly with each other, this means without router.

Requirement
The use of "Supernetting" requires that the modules in the network support the "Classless Inter Domain Routing" (CIDR) function.

Note
If the module configured in STEP 7 does not support the subnetting function or the supernetting function, then use of these functions is prevented by the following error message in STEP 7


Fig. 05


Fig. 06

The STEP 7 Online Help indicates that the subnet mask in the incorrect format as follows.


Fig. 07

Error details
Detailed error description
Help us to improve Online Support.
The page requested cannot be displayed. Please contact the webmaster.
Contact to webmaster