510 likes | 658 Views
Chabot College. ELEC 99.05 Subnet Masking. Logical Address Composition. Though the exact length and format of a logical (layer 3) address differs depending on the protocol, all logical addresses share this basic formula:. NETWORK NUMBER. HOST NUMBER. Logical Address Composition.
E N D
Chabot College ELEC 99.05 Subnet Masking
Logical Address Composition Though the exact length and format of a logical (layer 3) address differs depending on the protocol, all logical addresses share this basic formula: NETWORK NUMBER HOST NUMBER
Logical Address Composition IP address may have an additional field, the subnet field, that is used to identify smaller networks within a larger network. NETWORK NUMBER SUBNET NUMBER HOST NUMBER
Address Classes 1st octet 2nd octet 3rd octet 4th octet Class A (0 - 127) Network Host Host Host Class B (128-191) Network Network Host Host Class C (192-223) Network Network Network Host
Address Classes Class A 85 45 31 158 Class B 168 65 114 201 Class C 210 144 235 56 Network Host
The Subnet Mask • The solution to the IP address shortage was thought to be the subnet mask. • Formalized in 1985, the subnet mask breaks a single class A, B or C network in to smaller pieces.
8 bits 8 bits Subnetting What’s happened to the host fields? Network Network Subnet Host 8 bits are now used to represent subnets. Only 8 bits remain for possible hosts.
8 bits 8 bits Subnetting What’s happened to the host fields? Network Network Subnet Host 8-bit subnet field = 28 subnets = 256 subnets. 8-bit host field = 28 hosts = 256 hosts. Remember, we started with 65,536 hosts!
The Subnet Mask • The Subnet Mask is a 32-bit number. • Its job is to tell routers (and humans) which bits are network number and which bits are used to represent hosts.
The Subnet Mask • The Subnet Mask corresponds to the IP address. • A “1” bit in the subnet mask means that the corresponding bit in the IP address should be read as a network number • A “0” bit in the subnet mask means that the corresponding bit in the IP address should be read as a host bit.
The Subnet Mask 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 00000000 00000000 Here, the first 16 bits of the mask are set to “1.” Thus, the first 16 bits (2 octets) of the IP address are network number.
The Subnet Mask Network Network Host Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 00000000 00000000 The mask shows that the first two octets refer to the network number.
The Subnet Mask Network Network Host Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 00000000 00000000 255 0 0 255 The mask shows that the first two octets refer to the network number.
The Subnet Mask Network Network Network Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 11111111 00000000 Here, the first 24 bits are set to “1” in the subnet mask. Thus, the first 24 bits (3 octets) of the IP address are network number.
The Subnet Mask Network Network Network Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 11111111 00000000 255 255 0 255 Here, the first 24 bits are set to “1” in the subnet mask. Thus, the first 24 bits (3 octets) of the IP address are network number.
The Subnet Mask Network Network Network Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 11111111 11100000 Here, the first 27 bits of the subnet mask are set to “1.” Thus, the first 27 bits of the IP address refer to network number.
The Subnet Mask Network Network Network Host 10101001 11000111 01000101 10001001 Address Mask 11111111 11111111 11111111 11100000 255 255 224 255 Here, the first 27 bits of the subnet mask are set to “1.” Thus, the first 27 bits of the IP address refer to network number.
The Default Subnet Masks Class A or /8 255 0 0 0 Class B or /16 255 255 0 0 Class C or /24 255 255 255 0 If any additional bits in the subnet mask are set to “1,” then subnets have been created.
The Subnet Mask Network Network Network Host 207 21 54 0 Address Mask 255 255 255 0
The Subnet Mask Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 00000000 Mask 255 255 255 0
Class C : 1-bit Mask (/25) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 10000000 Mask 255 255 255 128 Masks can be written different ways. When the phrase “1-bit” mask is used, that means 1 more bit than the default. This example can also be called a 25-bit mask, or /25 (there are 25 network bits).
Class C: 2-bit Mask (/26) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11000000 Mask 255 255 255 192
Class C: 3-bit Mask (/27) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11100000 Mask 255 255 255 224
Class C: 4-bit Mask (/28) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11110000 Mask 255 255 255 240
Class C: 5-bit Mask (/29) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11111000 Mask 255 255 255 248
Class C: 6-bit Mask (/30) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11111100 Mask 255 255 255 252
Class C: 7-bit Mask (/31) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11111110 Mask 255 255 255 254
Class C: 8-bit Mask (/32) Network Network Network 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11111111 Mask 255 255 255 255
Class C : 1-bit Mask (/25) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 10000000 Mask 255 255 255 128 Because this is a class C, all nodes on this network will share the first three octets. Those numbers are not an issue.
Last Octet 1-bit Mask (/25) Host 0 Address 00000000 10000000 Mask 128 How many subnet possibilities with 1 bit? 21 = 2 different possibilities
Subnet #0 Subnet #1 Last Octet 1-bit Mask (/25) Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 The last octet can be any value from 0 - 255.
Subnet #0 Subnet #1 7 bits Last Octet 1-bit Mask (/25) Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 How many hosts can be on each subnet? 27 = 128 different possibilities MINUS TWO.
Subnet #0 Subnet #1 Why “Minus Two”? • Two special host addresses are “reserved”: • the address of the subnet itself(all zeros) • the broadcast address for the subnet(all ones) Decimal Binary 0 = 00000000 Subnet addr. 127 = 01111111 Broadcast addr. 128 = 10000000 Subnet addr. 255 = 11111111 Broadcast addr.
Network #, Broadcast Address Decimal Binary 0 = 00000000 1 = 00000001 36 = 00100100 127 = 01111111 128 = 10000000 255 = 11111111 All zeros in the HOST portion of the address is reserved for network (or subnet) number. All ones is reserved for the network (or subnet) BROADCAST address.
Subnet #1 Subnet #0 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 So, which subnet is this host on? 207.21.54.35 Subnet #0 255.255.255.128
Subnet #0 Subnet #1 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 Are these two hosts on the same subnet? 207.21.54.115 207.21.54.129 No. 255.255.255.128 255.255.255.128
Subnet #0 Subnet #1 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 Unfortunately, older TCP/IP software cannot handle subnets with all zeros in the subnet field.
Subnet #0 Subnet #1 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 More bad news, older TCP/IP software cannot handle subnets with all ones in the subnet field.
Subnet #0 Subnet #1 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 For now, using subnets that have all zeros or all ones in the subnet field should be considered illegal. (It’s not really, but….)
Subnet #0 Subnet #1 Last Octet Decimal Binary 0 = 00000000 127 = 01111111 128 = 10000000 255 = 11111111 Bottom line, a 1-bit mask results in no usable addresses.
Class C : 2-bit Mask (/26) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11000000 Mask 255 255 255 192 Because this is a class C, all nodes on this network will share the first three octets. Those numbers are not an issue.
Class C : 2-bit Mask (/26) Host 0 Address 00000000 11000000 Mask 192 How many subnet possibilities with 2 bits? 22 = 4 different possibilities: 00 01 10 11
Subnet #3 Subnet #2 Subnet #1 Subnet #0 Last Octet Decimal Binary 0 = 00000000 63 = 00111111 64 = 01000000 127 = 01111111 128 = 10000000 191 = 10111111 192 = 11000000 255 = 11111111
Subnet #0 Subnet #1 6 bits Last Octet Decimal Binary 0 = 00000000 63 = 00111111 64 = 01000000 128 = 01111111 How many hosts can be on each subnet? 26 = 64 different possibilities MINUS TWO.
Subnet #3 Subnet #2 Subnet #1 Subnet #0 Which subnets can be used? Decimal Binary 0 = 00000000 63 = 00111111 64 = 01000000 127 = 01111111 128 = 10000000 191 = 10111111 192 = 11000000 255 = 11111111
Putting it together Assuming the mask: 255.255.255.192, which addresses are legal for hosts? 1) 207.21.54.35 2) 207.21.54.63 3) 207.21.54.65 4) 207.21.54.190 5) 207.21.54.195
Class C : 3-bit Mask (/27) Network Network Network Host 207 21 54 0 Address 11001111 00010101 00110110 00000000 11111111 11111111 11111111 11100000 Mask 255 255 255 224 Because this is a class C, all nodes on this network will share the first three octets. Those numbers are not an issue.
Class C : 3-bit Mask (/27) Host 0 Address 00000000 11100000 Mask 224 How many subnet possibilities with 3 bits? 23 = 8 different possibilities: 000 001 010 011 100 101 110 111
Last Octet Decimal Binary Decimal Binary 128 = 10000000 0 = 00000000 159 = 10011111 31 = 00011111 160 = 10100000 32 = 00100000 191 = 10111111 63 = 00111111 192 = 11000000 64 = 01000000 223 = 11011111 95 = 01011111 224 = 11100000 96 = 01100000 255 = 11111111 127 = 01111111
Subnet #0 Subnet #1 5 bits Last Octet Decimal Binary 0 = 00000000 31 = 00011111 32 = 00100000 64 = 00111111 How many hosts can be on each subnet? 25 = 32 different possibilities MINUS TWO.