Data Communication and Networks: Department of Computer Science Najran University
Data Communication and Networks: Department of Computer Science Najran University
Data Communication and Networks: Department of Computer Science Najran University
2
IPv6 Addresses
• Motivation for a new version of IP: scaling problems caused by
the Internet’s massive growth.
• IETF began looking into an expansion of the IP address space
in 1991.
• Larger address space.
• Support for real-time services.
• Security support.
• Autoconfiguration (i.e., ability of hosts to automatically
configure themselves with information such as IP address and
domain name).
• IPv6 uses 128-bit addresses.
• Even based on pessimistic estimates of address assignment
efficiency, IPv6 addresses provide over 1500 addresses per
square foot of the earth’s surface.
3
IPv4 Addresses
4
Note
Note
5
Note
6
Figure 5.1 Dotted-decimal notation
7
Example 5.1
Solution
We replace each group of 8 bits with its equivalent decimal number and
add dots for separation:
a. 129.11.11.239
b. 193.131.27.255
c. 231.219.139.111
d. 249.155.251.15
8
Example 5.2
Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
9
Example 5.3
Solution
a. There should be no leading zeroes (045).
b. We may not have more than 4 bytes in an IPv4 address.
c. Each byte should be less than or equal to 255.
d.A mixture of binary notation and dotted-decimal notation.
10
Example 5.5
Solution
We can subtract the first address from the last address in base 256 .
The result is 0.0.3.255 in this base. To find the number of addresses in
the range (in decimal), we convert this number to base 10 and add 1 to
the result..
11
Example 5.6
Solution
We convert the number of addresses minus 1 to base 256, which is
0.0.0.31. We then add it to the first address to get the last address.
Addition is in base 256.
12
Figure 5.6 Finding the class of address
13
Example 5.10
Solution
See the procedure in Figure 5.7.
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first bit is 1; the second bit is 0. This is a class B
address.
d. The first 4 bits are 1s. This is a class E address.
14
Example 5.11
Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 193 (between 192 and 223); the class is C.
c. The first byte is 14 (between 0 and 127); the class is A.
d. The first byte is 252 (between 240 and 255); the class is E.
15
Figure 5.8 Netid and hostid
16
Figure 5.9 Blocks in Class A
17
Note
18
Figure 5.10 Blocks in Class B
19
Note
20
Figure 5.11 Blocks in Class C
21
Note
22
Figure 5.12 The single block in Class D
23
Note
24
Figure 5.13 The single block in Class E
25
Note
26
Note
27
Figure 5.14 Two-level addressing in classful addressing
28
Example 5.12
29
Figure 5.15 Information extraction in classful addressing
30
Example 5.13
Solution
Figure 5.16 shows a possible configuration of the network that uses this block.
1. The number of addresses in this block is N = 232−n = 16,777,216.
2. To find the first address, we keep the leftmost 8 bits and set the rightmost 24 bits
all to 0s. The first address is 73.0.0.0/8, in which 8 is the value of n.
3. To find the last address, we keep the leftmost 8 bits and set the rightmost 24 bits
all to 1s. The last address is 73.255.255.255.
31
Figure 5.16 Solution to Example 5.13
32
Example 5.14
Solution
Figure 5.17 shows a possible configuration of the network that uses this block.
1. The number of addresses in this block is N = 232−n = 65,536.
2. To find the first address, we keep the leftmost 16 bits and set the rightmost 16
bits all to 0s. The first address is 18.8.0.0/16, in which 16 is the value of n.
3. To find the last address, we keep the leftmost 16 bits and set the rightmost 16
bits all to 1s. The last address is
18.8.255.255.
33
Figure 5.17 Solution to Example 5.14
34
Example 5.15
Solution
Figure 5.17 shows a possible configuration of the network that uses this block.
1. The number of addresses in this block is N = 232−n = 256.
2. To find the first address, we keep the leftmost 24 bits and set the rightmost 8
bits all to 0s. The first address is
200.11.8.0/24, in which 24 is the value of n.
3. To find the last address, we keep the leftmost 24 bits and set the rightmost 8
bits all to 1s. The last address is
200.11.8.255/24.
36
Note
37
Figure 5.20 Network addresses
38
Figure 5.21 Network mask
39
Figure 5.22 Finding a network address using the default mask
40
Example 5.16
Solution
Since the class of the address is C, we assume that the router applies
the default mask for class C, 255.255.255.0 to find the network
address.
41
Example 5.17
in which 626 is the area code, 358 is the exchange, and 1301 is the
subscriber connection.
42
Example 5.18
44
Example 5.19
45
Figure 5.24 Example 5.19
46
Figure 5.25 Network mask and subnetwork mask
47
Similar to Figure 5.24 subnetting (Three –level addressing)
Subnet address
Addresses in a network with and without subnetting
2 21
2 21
Subnet ID
Figure 4.24 Default Mask vs Subnet Mask
Logical
AND
Logical
AND
Figure 5.25 Network mask and subnetwork mask
55
Figure 5.2 Format of classless addressing address
The n after the slash defines the number of bits that are the
same in every address in the block. So if n is 20, it means
the twenty leftmost bits are identical in each address.
56
Prefix and Prefix Length
57
Table 5.1 Prefix lengths
The addresses in color are the default masks for classes A, B, and C.
Thus, classful addressing is a special case of classless addressing.
58
Example 4 - Find first address
Solution
The prefix length is 27, which means that we must keep
the first 27 bits as is and change the remaining bits (5)
to 0s. The following shows the process:
Address in binary: 10100111 11000111 10101010 01010010
Keep the left 27 bits: 10100111 11000111 10101010 01000000
Result in CIDR notation: 167.199.170.64/27
60
Example 5 – Find first address Using
binary
Solution
Figure 5.3 shows the solution. The first, second, and
fourth bytes are easy; for the third byte we keep the bits
corresponding to the number of 0s in that group. The
first address is 140.120.80.0/20.
65
Example 5 – Find first address Using
binary
Solution
Figure 5.3 shows the solution. The first, second, and
fourth bytes are easy; for the third byte we keep the bits
corresponding to the number of 1s in that group. The
first address is 140.120.80.0/20.
70