# 11 Perspectives on IPv4 Subnetting
###### tags: `CCNA`
### Class A B C
12章的圖講解Class A B C

#### Class B example

### Operational View Versus Design View of Subnetting

### Analyze Subnetting and Addressing Needs
1. Which hosts should be grouped together into a subnet?
2. How many subnets does this internetwork require?
3. How many host IP addresses does each subnet require?
4. Will we use a single subnet size for simplicity, or not?
### Rules About Which Hosts Are in Which Subnet
**不同subnet 才會需要跨router**

### Determining the Number of Subnets
1. VLAN
2. Point-to-point serial link
3. Ethernet WAN (Ethernet Line Service)


### Determining the Number of Hosts per Subnet

### One Size Subnet Fits All—Or Not
The final choice in the initial planning step is to **decide whether you will use a simpler design by using a one-size-subnet-fits-all philosophy**.
是否將使**用一種尺寸subnet**適合所有的理念來使用更簡單的設計
#### Defining the Size of a Subnet

#### One Size Subnet Fits All

#### Multiple Subnet Sizes (Variable-Length Subnet Masks)

#### One Mask for All Subnets, or More Than One

### Make Design Choices

#### Choose a Classful Network
**Public IP Networks**

#### Growth Exhausts the Public IP Address Space
三個方法來解決IP不足的問題


### Private IP Networks

- **Avoiding Using Another Organization’s Public Address Range for Private Networks**: Some organizations have a part of their networks that need zero Internet access. The hosts in that part of their network need IP addresses. RFC 1918 suggests that truly private networks—that is, networks with no need for Internet connectivity—use addresses from the RFC 1918 list of private networks.
- **Avoiding/Delaying IPv4 Address Exhaustion**: To delay the day in which all public IPv4 addresses were assigned to organizations as public addresses, RFC 1918 calls for the use of NAT along with private networks for the addresses internal to an organization.
- **Reducing Internet Routers’ Routing Table Size**: Using private networks also helps reduce the size of the IP routing tables in Internet routers. For instance, routers in the Internet do not need routes for the private IP networks used inside organizations (in fact, ISPs filter those routes).
#### Choosing an IP Network During the Design Phase
After the choice to use a private IP network has been made, just pick one that has enough IP addresses. **You can have a small internetwork and still choose to use private Class A network 10.0.0.0.**
It might seem wasteful to choose a Class A network that has over 16 million IP addresses, especially if you need only a few hundred. However, there’s no penalty or problem with using a private network that is too large for your current or future needs.
For the purposes of this book, most examples use private IP network numbers. **For the design step to choose a network number, just choose a private Class A, B, or C network from the list of RFC 1918 private networks.**
#### Choose the Mask

### Classful IP Networks Before Subnetting


i.g. Class A: **N=8 H=24** 192.XXX.XXX.XXX
■ Class A: 224 – 2 = 16,777,214
■ Class B: 216 – 2 = 65,534
■ Class C: 28 – 2 = 254
### Borrowing Host Bits to Create Subnet Bits

### Choosing Enough Subnet and Host Bits
N, representing the number of network bits, remains locked at 8, 16, or 24, depending on the class. Conceptually, the designer moves a (dashed) dividing line into the host field, with subnet bits (S) between the network and host parts, and the remaining host bits (H) on the right. The three parts must add up to 32 because IPv4 addresses consist of 32 bits.
■ Number of subnets required
■ Number of hosts/subnet

### Build a List of All Subnets
- ■ Subnet number: Also called the subnet ID or subnet address, this number identifies the subnet. It is the numerically smallest number in the subnet. It cannot be used as an IP address by a host.
- ■ Subnet broadcast: Also called the subnet broadcast address or directed broadcast address, this is the last (numerically highest) number in the subnet. It also cannot be used as an IP address by a host.
- ■ IP addresses: All the numbers between the subnet ID and the subnet broadcast address can be used as a host IP address.


#### Plan the Implementation

#### Assigning Subnets to Different Locations


#### Choose Static and Dynamic Ranges per Subnet
Devices receive their **IP address and mask assignment in one of two ways**: dynamically by using Dynamic Host Configuration Protocol **(DHCP) or statically through configuration.**
For DHCP to work, the network engineer must **tell the DHCP server the subnets for which it must assign IP addresses.**
