Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
RST-2002
IP Addressing
Basic Addressing
RST-2002
Basic Addressing
IP addresses are written in dotted decimal format. Four sections are separated by dots. Each section contains a number between 0 and 255.
10.1.1.1
RST-2002
Basic Addressing
Why is each section a number between 0 and 255?
Computers operate in binary, humans operate in decimal. Computers treat IP addresses as a single large 32 digit binary number, but this is hard for people to do. So, we split them up into four smaller sections so we can remember and work with them better!
10.1.1.1
RST-2002
Basic Addressing
10.1.1.1
32/4 == 8.
28 = 256. But, computers number starting at 0, so to make a space of 256 numbers, we number from 0 to 255.
8 32
RST-2002
Basic Addressing
Each device on a network is assigned an IP address.
10.1.1.1
00001010 00000001 00000001 00000001
Network
Host
Basic Addressing
The network mask shows us where to split the network and host sections. Each place there is a 1 in the network mask, that binary digit belongs to the network portion of the address. Each place there is a 0 in the network mask, that binary digit belongs to the host portion of the address.
10.1.1.1
00001010 00000001 00000001 00000001
255.255.255.0
Network
Host
RST-2002
Basic Addressing
10.1.1.1
00001010 00000001 00000001 00000001
Prefix
Host
= 24
10.1.1.1/24
RST-2002
Basic Addressing
The network address is the IP address with all 0s in the host bits. The broadcast address is the IP address with all 1s in the host bits. Packets sent to either address will be delivered to all the hosts connected to the wire.
10 00001010
prefix
1 1 000000011 00000001
0/24 00000000
host
these bits are 0, so this is the network address 10 00001010 prefix 1 1 000000011 00000001 255/24 11111111 host
RST-2002
10
192.168.100.80/26 ????
RST-2002
11
48
24 12 6 3 1 0
0 0 0 0 0
remainder
divide by 2 remainder divide by 2 remainder divide by 2 remainder divide by 2 remainder divide by 2 remainder
RST-2002
Left
12
The bottom is the binary MSD, the top the binary LSD.
Right
11000000 10101000 01100100 01010000 192 168 100 80 11111111 11111111 11111111 11000000 8 +8 +8 +2 == 26
13
If you have a prefix length, just wrote down the number of 1s. If you have a network mask, computer the binary as with the IP address.
NOR these two.
16
RST-2002
14
64
32
16 8 4 2 1
1
0 1 0 0 0
32
0 8 0 0 0 168
RST-2002
15
For each octet in the network mask that is 255, add 8 to the prefix length.
For the one octet that isnt 255, convert to binary and add the right number of bits--or use a chart!
RST-2002
16
192.168.100.80/26
These three octets are part of the network
26/8 == 3 (remainder 2)
The remainder tells us what the network address in the fourth octet is
RST-2002
17
1 2 4 8 16 32 64 128
Add the three octets we set aside earlier, and the network (prefix!) is 192.168.100.64/26. 80 - 64 == 16, so the host address is 16.
RST-2002
18
1 2 4 8 16 32 64 128
64 addresses 64 - 2 == 62 hosts
64 + (64 - 1) == 127 192.168.100.127 is the broadcast address
RST-2002
19
192.168.100.80/22
These three octets are part of the network
22/8 == 2 (remainder 6)
The remainder tells us what the network address in the third octet is
RST-2002
20
Remainder == 6
8 7 6 5 4 3 2 1
1 2 4 8 16 32 64 128
4 x 25 == 100 4 x 26 == 104 Third octet is 100! Set the fourth octet to 0. 192.168.100.0/22
21
1 2 4 8 16 32 64 128
Subtract two.
RST-2002
22
The key is to work in octets, rather than trying to work with the entire IP address at once!
RST-2002
23
10.1.1.0/26
RST-2002
These host addresses are described by this network These networks are described by this network
25
Changing the mask bit from 1 to 0, which shortens the prefix length, means the bit in the two networks that distinguish them from one another are now considered host bits!
RST-2002
2003, Cisco Systems, Inc. All rights reserved.
26
A network which is a part of another network is called a subnet. There is another term, the supernet, but its definition depends on whether you are using VLSM subnetting, or calssful subnetting, so it will be defined in the next two sections.
RST-2002
VLSM
VLSM: Variable Length Subnet Masking It simply means that the entire IP address space is treated as one flat address space. Any prefix length is allowed in the network at any point.
RST-2002
28
VLSM
At this point, you pretty much already know VLSM! You already know how to find the network address, broadcast address, and number of hosts in a network. Two other common problems in working with VLSM networks remain:
Building summary addresses from groups of networks. We wont cover this here (maybe later in routing). Building network addressing schemes from a given number of hosts and networks.
RST-2002
29
Find the smallest number in the chart that will fit the number of the largest number of hosts + 2.
Continue through each space needed until you either run out of space, or you finish.
RST-2002
30
8 7 6 5 4
1 2 4 8 16 32 64 128
32 < (58 + 2) < 64 24 + 2 == 26 10.1.1.0/26 takes care of the first 58 hosts Start the next block at 10.1.1.64
The next network is 10.1.1.0 + 64, so we start the next round at 10.1.1.64.
RST-2002
31
32 < (49 + 2) < 64 24 + 2 == 26 10.1.1.64/26 takes care of the next 49 hosts Start the next block at 10.1.1.128
RST-2002
32
16 < (29 + 2) < 32 24 + 3 == 27 10.1.1.128/27 takes care of the next 29 hosts Start the next block at 10.1.1.160
The next network is 10.1.1.128 + 32, so we start the next round at 10.1.1.160.
RST-2002
33
1 2 4 8 16 32 64 128
(14 + 2) == 16 24 + 4 == 28 10.1.1.160/28 takes care of the next 14 hosts Start the next block at 10.1.1.176
RST-2002
34
8 7 6 5 4
1 2 4 8 16 32 64 128
RST-2002
35
supernet
10.1.0.0/23
10.1.1.0/24 10.1.2.0/24 10.1.2.0/25 10.1.2.128/25 10.1.2.128/26
RST-2002
supernet
supernet
subnets
Classful Addressing
RST-2002
37
Classful Addressing
Network Class Beginning Digits in Binary Natural Range of Prefix Addresses Length Example Major Networks
Class A
10XX
Class B
110X
16
Class C
1110
24
RST-2002
38
Classful Addressing
Its illegal to have multiple network masks within a single major network. There cannot be a mix of /24s and /25s in the 10.0.0.0/8 major network. There cannot be a mix of /25s and /26s in the 11.0.0.0/8 network.
RST-2002
39
You can find the network address, broadcast address, and number of hosts as we described earlier. You can find the number of networks by subtracting the network mask from the natural mask, and then using the chart.
RST-2002
40
10.1.1.0/25
10.0.0.0/8 is class A
25 8 == 17 17/8 == 2, 1 remaining
RST-2002
41
25 8 == 17 17/8 == 2, 1 remaining
8 7 6 5 4
1 2 4 8 16 32 64 128
RST-2002
42
Subnet 0
The network with all the between the host and the natural major net set to 0. This only exists in classful addressing schemes.
Yes No Yes
172.31.1.0/24
192.168.100.0/25
No
Yes
RST-2002
43
Broadcast Subnet
The network with all the bits between the host and the natural major network set to 1.
configured these bits are 1, so this is the network broadcast network 10.255.0.0/16 10.255.0.0/24 172.31.255.0/24 Yes No Yes
172.31.255.0/25
192.168.100.128/25
No
Yes
RST-2002
44
Find the smallest number in the chart that will fit the number of the largest number of hosts + 2.
Use that prefix length for all the subnets (remember you cannot have different subnet masks within the same major network).
RST-2002
2003, Cisco Systems, Inc. All rights reserved.
45
A subnet is any prefix with a prefix length longer than the natural prefix length of the major network.
A supernet is any prefix with a prefix length shorter than the natural prefix length of the major network.
RST-2002
46
172.16.0.0/19
192.168.0.0/16 Network Class Class D (Multicast) Class E (Experimental)
RST-2002
47
C 208.0.12.0/24 is directly connected, Serial0/2 .... S 208.1.10.0/24 [1/0] via 208.0.12.11 .... 144.2.0.0/16 is variably subnetted, 2 subnets, 2 masks S 144.2.2.0/24 [1/0] via 208.0.12.11 S 144.2.3.0/29 [1/0] via 208.0.12.11 C 208.0.7.0/24 is directly connected, Serial0/0 C 208.0.6.0/24 is directly connected, FastEthernet0/0 C 208.0.0.0/24 is directly connected, FastEthernet0/1 S 208.1.0.0/16 [1/0] via 208.0.12.11 a supernet and natural mask in the same network address space
RST-2002
48