cs331-102-ch19

Download Report

Transcript cs331-102-ch19

Chapter 19
Network Layer:
Logical Addressing
19.1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
19-1 IPv4 ADDRESSES
An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for
example, a computer or a router) to the Internet.
Topics discussed in this section:
Address Space
Notations
Classful Addressing ( complete from book till mask)
Classless Addressing ( from book till two-level hierarchy: no subnetting,
example 19.9 not included)
Subnetting/Supernetting ( from lecture notes)
Network Address Translation (NAT) ( from Book till one address IP)
IPv6 ( from lecture notes)
19.2
Note
An IPv4 address is 32 bits long.
19.3
Note
The IPv4 addresses are unique
and universal.
19.4
Note
The address space of IPv4 is
232 or 4,294,967,296.
19.5
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
19.6
Note
In classful addressing, the address
space is divided into five classes:
A, B, C, D, and E.
19.7
Figure 19.2 Finding the classes in binary and dotted-decimal notation
19.8
Table 19.1 Number of blocks and block size in classful IPv4 addressing
19.9
Note
In classful addressing, a large part of the
available addresses were wasted.
19.10
Table 19.2 Default masks for classful addressing showing netid and hostid
19.11
Note
Classful addressing, which is almost
obsolete, is replaced with classless
addressing.
19.12
Note
Classless addressing: Variable size
blocks.
Address block restrictions:
1. Contiguous.
2. Power of 2.
3. First address devisable by the number
of addresses.
19.13
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.
We can see that the restrictions are applied to this block.
The addresses are contiguous. The number of addresses
is a power of 2 (16 = 24), and the first address is divisible
by 16. The first address, when converted to a decimal
number, is 3,440,387,360, which when divided by 16
results in 215,024,210.
19.14
Figure 19.3 A block of 16 addresses granted to a small organization
19.15
Note
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.16
Note
The first address in the block can be
found by setting the rightmost
32 − n bits to 0s.
19.17
Note
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.
19.18
Note
The number of addresses in the block
can be found by using the formula
232−n.
19.19
Figure 19.4 Network address
19.20
Note
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.21
Figure 19.6 2 level hierarchy in an IPv4 address
19.22
• SUBNETTING
• SUPERNETTING
Figure 5-2
A network with three levels of
hierarchy (subnetted)
Figure 5-3
Addresses in a network with
and without subnetting
Figure 5-4
Hierarchy concept in a telephone number
Figure 5-5
Default mask and subnet mask
Finding the Subnet Address
Given an IP address, we can find the
subnet address by applying the mask to the
address. We can do this in two ways:
straight or short-cut.
Straight Method
In the straight method, we use binary
notation for both the address and the
mask and then apply the AND operation
to find the subnet address.
Example 1
What is the subnetwork address if the
destination address is 200.45.34.56 and the
subnet mask is 255.255.240.0?
Solution
11001000 00101101 00100010 00111000
11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000
The subnetwork address is 200.45.32.0.
Short-Cut Method
** If the byte in the mask is 255, copy
the byte in the address.
** If the byte in the mask is 0, replace
the byte in the address with 0.
** If the byte in the mask is neither 255
nor 0, we write the mask and the address
in binary and apply the AND operation.
Example 2
What is the subnetwork address if the
destination address is 19.30.80.5 and the
mask is 255.255.192.0?
Solution
See Figure 5.6
Figure 5-6
Example 2
Figure 5-7
Comparison of a default mask and
a subnet mask
The number of subnets must be
a power of 2.
Example 3
A company is granted the site address
201.70.64.0 (class C). The company needs
six subnets. Design the subnets.
Solution
The number of 1s
mask is 24 (class C).
in
the
default
Solution (Continued)
The company needs six subnets. This number
6 is not a power of 2. The next number that is
a power of 2 is 8 (23). We need 3 more 1s in
the subnet mask. The total number of 1s in
the subnet mask is 27 (24 + 3).
The total number of 0s is 5 (32 - 27). The
mask is
Solution (Continued)
11111111 11111111 11111111 11100000
or
255.255.255.224
The number of subnets is 8.
The number of addresses in each subnet
is 25 (5 is the number of 0s) or 32.
See Figure next slide
Example 3
A supernetwork
Supernetting
In supernetting , an organization can
combine several class C blocks to
create a larger range of addresses.
Several networks are combined to create
a super network. Classless addressing
has eliminate the need for this.
19.42
NAT
NAT: A large set of addresses internally
and one address or small set of
addresses externally.
19.43
Table 19.3 Addresses for private networks
19.44
Figure 19.10 A NAT implementation
19.45
Figure 19.11 Addresses in a NAT
19.46
Figure 19.12 NAT address translation
19.47
NAT Example
NAT enabled router
Case 1: Host A in the figure sends a packet to IP address 216.109.118.73, port 80, with its
local port set to 6798. The resulting entry in the NAT box (assume that the current row
index is 9000) is
Row # 9000
Case 2: Supposed just after part (A) above, host B sends a packet to
the same destination address and port, with it's local port also set to
6798. The resulting entry in the NAT box
Row # 9001
19-2 IPv6 ADDRESSES from lecture notes
Despite all short-term solutions, address depletion is
still a long-term problem for the Internet. This and
other problems in the IP protocol itself have been the
motivation for IPv6.
19.49
Note
An IPv6 address is 128 bits long. It uses
Hexadecimal representation
19.50