5 Network-Layer Part 1 Logical Addressing (1)
5 Network-Layer Part 1 Logical Addressing (1)
3
Part 1:
Logical Addressing
Reference Chapter 19 from ref1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 19.4
19-1 IPv4 ADDRESSES
19.5
Notes:
19.6
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
19.7
Example 19.1
Solution
We replace each group of 8 bits with its equivalent decimal number (see
Appendix B) and add dots for separation:
19.8
Example 19.2
Solution
We replace each decimal number with its binary equivalent
(see Appendix B).
19.9
Example 19.3
19.10
Example 19.3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.11
In classful addressing, the address
space is divided into five classes:
A, B, C, D, and E.
19.12
Figure 19.2 Classes in binary and dotted-decimal notation
• The concept of address classes is now considered legacy and not commonly used for
modern IP addressing.
• The introduction of Classless Inter-Domain Routing (CIDR) allows for more flexible
allocation of IP address blocks, irrespective of the traditional class boundaries.
13
Finding the classes in binary and dotted-decimal notation
19.14
Example 19.4
19.15
Example 19.4
Solution
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 byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.16
Table 19.1 Number of blocks and block size in classful IPv4 addressing
19.17
In classful addressing, a large part of
the available addresses were wasted.
19.18
Table 19.2 Default masks for classful addressing
19.19
Classful addressing, which is almost
obsolete, is replaced with classless
addressing.
19.20
Example 19.5
Figure 19.3 shows a block of addresses, in both binary
and dotted-decimal notation, granted to a small business
that needs 16 addresses.
19.21
Example 19.5
• In figure 19.3
o The addresses are contiguous.
o The number of addresses is a power of 2 (16 = 24)
19.22
In IPv4 addressing, a block of
addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the
addresses and the /n defines the mask.
19.23
The first address in the block can be
found by setting the rightmost
32 − n bits to 0s.
19.24
Example 19.6
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 00100000
or
205.16.37.32
This is actually the block shown in Figure 19.3.
19.25
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.
19.26
Example 19.7
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
19.27
The number of addresses in the block
can be found by using the formula
232−n
19.28
Example 19.8
2 32−28 or 16
19.29
Another method to extract information
from a prefix
19.30
Example 19.9
• Find
a. The first address
b. The last address
c. The number of addresses.
19.31
Example 19.9 (continued)
Solution
a. The first address can be found by ANDing the given addresses
with the mask. ANDing here is done bit by bit. The result of
ANDing 2 bits is 1 if both bits are 1s and is 0 otherwise.
19.32
Example 19.9 (continued)
19.33
Example 19.9 (continued)
19.34
Figure 19.4 A network configuration for the block 205.16.37.32/28
19.35
The first address in a block is
normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.
19.36
Figure 19.5 Two levels of hierarchy in an IPv4 address
19.37
Figure 19.6 A frame in a character-oriented protocol
19.38
Each address in the block can be
considered as a two-level
hierarchical structure:
the leftmost n bits (prefix) define
the network
the rightmost 32 − n bits define
the host.
19.39
Figure 19.7 Configuration and addresses in a subnetted network
19.40
Figure 19.8 Three-level hierarchy in an IPv4 address
19.41
Example 19.10
19.42
Example 19.10 (continued)
Group 1: 64 customers
For this group, each customer needs 256
addresses. This means that 8 (log2 256) bits
are needed to define each host. The prefix
length is then 32 − 8 = 24. The addresses
are
19.44
Example 19.10 (continued)
Group 3: 128 customers
For this group, each customer needs 64
addresses. This means that 6 (log264) bits are
needed to each host. The prefix length is then 32
− 6 = 26. The addresses are
19.45
Figure 19.9 An example of address allocation and distribution by an ISP
19.46
Exercise
• An organization is granted a block of addresses
with the beginning address 14.24.74.0/24. The
organization needs to have 3 subblocks of
addresses to use in its three subnets: one subblock
of 10 addresses, one subblock of 60 addresses, and
one subblock of 120 addresses. Design the
subblocks.
19.48
Private IP addresses
• Range of private addresses:
– IPv4: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and
169.254.0.0/16.
– IPv6: FC00::/7 range.
19.49
Figure 19.10 A NAT implementation
19.50
Figure 19.11 Addresses in a NAT
19.51
Figure 19.12 NAT address translation
19.52
Table 19.4 Five-column translation table
19.53
19-2 IPv6 ADDRESSES
19.54
An IPv6 address is 128 bits long.
19.55
Figure 19.14 IPv6 address in binary and hexadecimal colon notation
19.56
Figure 19.15 Abbreviated IPv6 addresses
19.57
Example 19.11
19.58
Ambiguity of multiple “::” in an address
ipv6-address/prefix-length
The prefix-length is a decimal value indicating the
number of leftmost contiguous bits of the address.
60
Types of IP Address Version 6
425,352,958,651,173,079,329,218,259,289,
710,264 (or 4.25×1037)unique IP addresses
63
Unicast Address
• Following are different types of unicast addresses in IPv6:
Global unicast: A routable address in the IPv6 Internet, similar to
a public IPv4 address.
Link-local: Used only to communicate with devices on the same
local link.
Loopback: An address not assigned to any physical interface
that can be used for a host to send an IPv6 packet to itself.
Unspecified address: Used only as a source address and
indicates the absence of an IPv6 address.
Unique local: Similar to a private address in IPv4 (RFC 1918)
and not intended to be routable in the IPv6 Internet.
IPv4 embedded: An IPv6 address that carries an IPv4 address
in the low-order 32 bits of the address.
64
Global Unicast
• Global unicast addresses (GUAs), are globally routable and reachable in the IPv6
Internet. They are equivalent to public IPv4 addresses. The generic structure of a
GUA, which has three fields:
Global Routing Prefix: The Global Routing Prefix is the prefix or network portion of
the address assigned by the provider, such as an ISP, to the customer site.
Subnet ID: The Subnet ID is a separate field for allocating subnets within the
customer site. Unlike with IPv4, it is not necessary to borrow bits from the Interface
ID (host portion) to create subnets. The number of bits in the Subnet ID falls between
where the Global Routing Prefix ends and where the Interface ID begins.
Interface ID: The Interface ID identifies the interface on the subnet, equivalent to the
host portion of an IPv4 address. The Interface ID in most cases is 64 bits.
65
Unique Local Address
❑ Organizations can manually set addresses using the prefix FD::/64.
66
Link Local Address
❑ The link-local addresses start with the prefix fe80::/10.
67
IPv6 loopback
The loopback address represents the same interface as a computer. The
TCP/IP protocol stack loops the packets back on the same interface both in
IPv4 and IPv6.
In IPv4, 127.0.0.0/8 network is reserved for loopback addresses.
In IPv6, the loopback address is
0000:0000:0000:0000:0000:0000:0000:0001/128. It can be simplified to::1/128.
68
Figure 19.18 Reserved addresses in IPv6
19.69
Figure 19.18 Reserved addresses in IPv6
19.70