IP Subnetting. ZyXEL Communications 623ME-T, Prestige 623ME-T
Advertisement
Advertisement
Prestige 623ME-T User’s Guide
Appendix B
IP Subnetting
IP Addressing
Routers “route” based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.
IP Classes
An IP address is made up of four octets (eight bits), written in dotted decimal notation, for example,
192.168.1.1. IP addresses are categorized into different classes. The class of an address depends on the value of its first octet.
Class “A” addresses have a 0 in the left most bit. In a class “A” address the first octet is the network number and the remaining three octets make up the host ID.
Class “B” addresses have a 1 in the left most bit and a 0 in the next left most bit. In a class “B” address the first two octets make up the network number and the two remaining octets make up the host ID.
Class “C” addresses begin (starting from the left) with 1 1 0. In a class “C” address the first three octets make up the network number and the last octet is the host ID.
Class “D” addresses begin with 1 1 1 0. Class “D” addresses are used for multicasting. (There is also a class “E” address. It is reserved for future use.)
IP ADDRESS:
Class A
Class B
Class C
0
10
110
Chart B-1 Classes of IP Addresses
OCTET 1
Network number
Network number
Network number
OCTET 2
Host ID
Network number
Network number
OCTET 3
Host ID
Host ID
Network number
OCTET 4
Host ID
Host ID
Host ID
Host IDs of all zeros or all ones are not allowed.
Therefore:
A class “C” network (8 host bits) can have 2 8 –2 or 254 hosts.
A class “B” address (16 host bits) can have 2 16 –2 or 65534 hosts.
IP Subnetting B-1
Prestige 623ME-T User’s Guide
A class “A” address (24 host bits) can have 2 24 –2 hosts (approximately 16 million hosts).
Since the first octet of a class “A” IP address must contain a “0”, the first octet of a class “A” address can have a value of 0 to 127.
Similarly the first octet of a class “B” must begin with “10”, therefore the first octet of a class “B” address has a valid range of 128 to 191. The first octet of a class “C” address begins with “110”, and therefore has a range of 192 to 223.
Chart B-2 Allowed IP Address Range By Class
CLASS
Class A
Class B
Class C
ALLOWED RANGE OF FIRST OCTET
(BINARY)
00000000 to 01111111
10000000 to 10111111
11000000 to 11011111
ALLOWED RANGE OF FIRST OCTET
(DECIMAL)
0 to 127
128 to 191
192 to 223
Class D
Subnet Masks
11100000 to 11101111 224 to 239
A subnet mask is used to determine which bits are part of the network number, and which bits are part of the host ID (using a logical AND operation). A subnet mask has 32 bits; each bit of the mask corresponds to a bit of the IP address. If a bit in the subnet mask is a “1” then the corresponding bit in the IP address is part of the network number. If a bit in the subnet mask is “0” then the corresponding bit in the IP address is part of the host ID.
Subnet masks are expressed in dotted decimal notation just as IP addresses are. The “natural” masks for class
A, B and C IP addresses are as follows.
Chart B-3 “Natural” Masks
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
Subnetting
With subnetting, the class arrangement of an IP address is ignored. For example, a class C address no longer has to have 24 bits of network number and 8 bits of host ID. With subnetting, some of the host ID bits are converted into network number bits. By convention, subnet masks always consist of a continuous sequence
Prestige 623ME-T User’s Guide of ones beginning from the left most bit of the mask, followed by a continuous sequence of zeros, for a total number of 32 bits.
Since the mask is always a continuous number of ones beginning from the left, followed by a continuous number of zeros for the remainder of the 32 bit mask, you can simply specify the number of ones instead of writing the value of each octet. This is usually specified by writing a “/” followed by the number of bits in the mask after the address.
For example, 192.1.1.0 /25 is equivalent to saying 192.1.1.0 with mask 255.255.255.128.
The following table shows all possible subnet masks for a class “C” address using both notations.
Chart B-4 Alternative Subnet Mask Notation
SUBNET MASK IP ADDRESS SUBNET MASK “1” BITS
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
LAST OCTET BIT VALUE
255.255.255.252 /30
The first mask shown is the class “C” natural mask. Normally if no mask is specified it is understood that the natural mask is being used.
Example: Two Subnets
As an example, you have a class “C” address 192.168.1.0 with subnet mask of 255.255.255.0.
NETWORK NUMBER HOST ID
IP Address
IP Address (Binary)
Subnet Mask
192.168.1. 0
11000000.10101000.00000001. 00000000
255.255.255. 0
Subnet Mask (Binary) 11111111.11111111.11111111. 00000000
The first three octets of the address make up the network number (class “C”). You want to have two separate networks.
IP Subnetting B-3
Prestige 623ME-T User’s Guide
Divide the network 192.168.1.0 into two separate subnets by converting one of the host ID bits of the IP address to a network number bit. The “borrowed” host ID bit can be either “0” or “1” thus giving two subnets; 192.168.1.0 with mask 255.255.255.128 and 192.168.1.128 with mask 255.255.255.128.
In the following charts, shaded/bolded last octet bit values indicate host ID bits
“borrowed” to form network ID bits. The number of “borrowed” host ID bits determines the number of subnets you can have. The remaining number of host ID bits (after “borrowing”) determines the number of hosts you can have on each subnet.
Chart B-5 Subnet 1
IP Address
IP Address (Binary)
Subnet Mask
Subnet Mask (Binary)
NETWORK NUMBER
192.168.1.
11000000.10101000.00000001.
255.255.255.
11111111.11111111.11111111.
Subnet Address: 192.168.1.0
Broadcast Address: 192.168.1.127
LAST OCTET BIT VALUE
0
00000000
128
10000000
Lowest Host ID: 192.168.1.1
Highest Host ID: 192.168.1.126
IP Address
IP Address (Binary)
Subnet Mask
Subnet Mask (Binary)
Chart B-6 Subnet 2
NETWORK NUMBER
192.168.1.
11000000.10101000.00000001.
255.255.255.
11111111.11111111.11111111.
LAST OCTET BIT VALUE
128
10000000
128
10000000
Broadcast Address: 192.168.1.255 Highest Host ID: 192.168.1.254
The remaining 7 bits determine the number of hosts each subnet can have. Host IDs of all zeros represent the subnet itself and host IDs of all ones are the broadcast address for that subnet, so the actual number of hosts available on each subnet in the example above is 2 7 – 2 or 126 hosts for each subnet.
192.168.1.0 with mask 255.255.255.128 is the subnet itself, and 192.168.1.127 with mask 255.255.255.128 is the directed broadcast address for the first subnet. Therefore, the lowest IP address that can be assigned to an
Prestige 623ME-T User’s Guide actual host for the first subnet is 192.168.1.1 and the highest is 192.168.1.126. Similarly the host ID range for the second subnet is 192.168.1.129 to 192.168.1.254.
Example: Four Subnets
The above example illustrated using a 25-bit subnet mask to divide a class “C” address space into two subnets. Similarly to divide a class “C” address into four subnets, you need to “borrow” two host ID bits to give four possible combinations of 00, 01, 10 and 11. The subnet mask is 26 bits
(11111111.11111111.11111111.11000000) or 255.255.255.192. Each subnet contains 6 host ID bits, giving
2 6 -2 or 62 hosts for each subnet (all 0’s is the subnet itself, all 1’s is the broadcast address on the subnet).
Chart B-7 Subnet 1
IP Address
IP Address (Binary)
Subnet Mask (Binary)
Subnet Address: 192.168.1.0
Broadcast Address: 192.168.1.63
NETWORK NUMBER
192.168.1.
11000000.10101000.00000001.
11111111.11111111.11111111.
LAST OCTET BIT VALUE
0
00000000
11000000
Lowest Host ID: 192.168.1.1
Highest Host ID: 192.168.1.62
Chart B-8 Subnet 2
IP Address
IP Address (Binary)
Subnet Mask (Binary)
Subnet Address: 192.168.1.64
Broadcast Address: 192.168.1.127
NETWORK NUMBER LAST OCTET BIT VALUE
192.168.1.
11000000.10101000.00000001.
64
01000000
11111111.11111111.11111111. 11000000
Lowest Host ID: 192.168.1.65
Highest Host ID: 192.168.1.126
IP Address
IP Address (Binary)
Subnet Mask (Binary)
Chart B-9 Subnet 3
NETWORK NUMBER
192.168.1.
11000000.10101000.00000001.
11111111.11111111.11111111.
LAST OCTET BIT VALUE
128
10000000
11000000
Broadcast Address: 192.168.1.191 Highest Host ID: 192.168.1.190
IP Subnetting B-5
Prestige 623ME-T User’s Guide
IP Address
IP Address (Binary)
Subnet Mask (Binary)
Chart B-10 Subnet 4
NETWORK NUMBER
192.168.1.
11000000.10101000.00000001.
11111111.11111111.11111111.
LAST OCTET BIT VALUE
192
11000000
11000000
Broadcast Address: 192.168.1.255 Highest Host ID: 192.168.1.254
Example Eight Subnets
Similarly use a 27-bit mask to create 8 subnets (001, 010, 011, 100, 101, 110).
The following table shows class C IP address last octet values for each subnet.
Chart B-11 Eight Subnets
SUBNET SUBNET ADDRESS FIRST ADDRESS LAST ADDRESS BROADCAST ADDRESS
1 0 1 30
2 32 33 62
3 64 65 94
31
63
95
4 96 97 126
5 128 129 158
6 160 161 190
7 192 193 222
127
159
191
223
255 8 224 223 254
The following table is a summary for class “C” subnet planning.
Prestige 623ME-T User’s Guide
Chart B-12 Class C Subnet Planning
NO. “BORROWED” HOST BITS SUBNET MASK NO. SUBNETS NO. HOSTS PER SUBNET
1 255.255.255.128 126
2 255.255.255.192 62
3 255.255.255.224 30
4 255.255.255.240 14
5 255.255.255.248 6
6 255.255.255.252 2
7 255.255.255.254 1
Subnetting With Class A and Class B Networks.
For class “A” and class “B” addresses the subnet mask also determines which bits are part of the network number and which are part of the host ID.
A class “B” address has two host ID octets available for subnetting and a class “A” address has three host ID octets (see Chart B-1) available for subnetting.
The following table is a summary for class “B” subnet planning.
Chart B-13 Class B Subnet Planning
NO. “BORROWED” HOST BITS SUBNET MASK NO. SUBNETS NO. HOSTS PER SUBNET
3 255.255.224.0 8190
IP Subnetting
9 255.255.255.128
(/25)
512 126
B-7
Prestige 623ME-T User’s Guide
Chart B-13 Class B Subnet Planning
NO. “BORROWED” HOST BITS SUBNET MASK NO. SUBNETS NO. HOSTS PER SUBNET
(/26)
(/27)
(/28)
13 255.255.255.248
(/29)
8192 6
14 255.255.255.252
(/30)
16384 2
(/31)

Public link updated
The public link to your chat has been updated.
Advertisement