620 likes | 761 Views
Chapter 6 IPv4 Addresses – Part 2. CIS 81 Networking Fundamentals Rick Graziani Cabrillo College graziani@cabrillo.edu Spring 2010. This Presentation.
E N D
Chapter 6IPv4 Addresses – Part 2 CIS 81 Networking Fundamentals Rick Graziani Cabrillo College graziani@cabrillo.edu Spring 2010
This Presentation • For a copy of this presentation and access to my web site for other CCNA, CCNP, and Wireless resources please email me for a username and password. • Email: graziani@cabrillo.edu • Web Site: www.cabrillo.edu/~rgraziani
Note • This presentation is not in the order of the book or online curriculum. • This presentation also contains information beyond the curriculum.
Host IP Addresses 172.0.0.0 (net) 10101100.00000000.00000000.00000000 255.0.0.0 (SM) 11111111.00000000.00000000.00000000 172.0.0.1 10101100.00000000.00000000.00000001 172.255.255.254 10101100.11111111.11111111.11111110 172.255.255.255 10101100.11111111.11111111.11111111 (broadcast) 172.16.0.0 (net) 10101100.00010000.00000000.00000000 255.255.0.0 (SM) 11111111.11111111.00000000.00000000 172.16.0.1 10101100.00010000.00000000.00000001 172.16.255.254 10101100.00010000.11111111.11111110 172.16.255.255 10101100.00010000.11111111.11111111 (broadcast)
Host IP Addresses 172.1.16.0 10101100.00000001.00010000.00000000 255.255.240.0 11111111.11111111.11110000.00000000 172.1.16.1 10101100.00000001.00010000.00000001 … 172.1.31.254 10101100.00000001.00011111.11111110 172.1.31.255 10101100.00000001.00011111.11111111 (broadcast) Number of hosts: 212 – 2 = 4,096 – 2 = 4,094 hosts
Who assigns IP Network Addresses? • Internet Assigned Numbers Authority (IANA) (http://www.iana.net) is the master holder of the IP addresses. • Today, the remaining IPv4 address space has been allocated to various other registries to manage for particular purposes or for regional areas. • Regional Internet Registries(RIRs)
Regional Internet Registries (RIR) • The 5 RIR’s are: • AfriNIC (African Network Information Centre) - Africa Region http://www.afrinic.net • APNIC (Asia Pacific Network Information Centre) - Asia/Pacific Region http://www.apnic.net • ARIN (American Registry for Internet Numbers) - North America Region http://www.arin.net • LACNIC (Regional Latin-American and Caribbean IP Address Registry) - Latin America and some Caribbean Islands http://www.lacnic.net • RIPE NCC (Reseaux IP Europeans) - Europe, the Middle East, and Central Asia http://www.ripe.net
ISP (Internet Service Providers) Most companies or organizations obtain their IPv4 address blocks from an ISP. • Tier 1 ISP: • Large national or international ISPs that are directly connected to the Internet backbone. • Customers of Tier 1 ISPs: • lower-tiered ISPs • large companies and organizations. • Offer reliability and speed • AOL, SPRINT, Global Crossing, AT&T, Level 3, Verizon, NTT, Quest, SAVVIS
ISP (Internet Service Providers) Most companies or organizations obtain their IPv4 address blocks from an ISP. • Tier 2 ISP: • Acquire their Internet service from Tier 1 ISPs. Tier 2 ISPs generally focus on business customers. • Examples: Allstream, AboveNet, British Telecom, Cogent Communications, France Telecom, Teleglobe TeliaSonera International Carrier Time Warner Telecom, Tiscali International Network, XO Communications
ISP (Internet Service Providers) Most companies or organizations obtain their IPv4 address blocks from an ISP. • Tier 3 ISP: • Purchase their Internet service from Tier 2 ISPs. The focus of these ISPs is the retail and home markets in a specific locale.Examples: • Local ISPs
Special Unicast IPv4 Addresses • Default Route • Loopback Address • Special address that hosts use to direct traffic to themselves. • 127.0.0.0 to 127.255.255.255 • Link-Local Addresses • 169.254.0.0 to 169.254.255.255 (169.254.0.0 /16) • Can be automatically assigned to the local host by the operating system in environments where no IP configuration is available. • TEST-NET Addresses • 192.0.2.0 to 192.0.2.255 (192.0.2.0 /24) • Set aside for teaching and learning purposes. • These addresses can be used in documentation and network examples.
Private IP Addresses • RFC 1918 • 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8) • 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12) • 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16) • The addresses will not be routed in the Internet • Need NAT/PAT (next) • Should be blocked by your ISP • Allows for any network to have up to 16,777,216 hosts (/8)
Introducing NAT and PAT • NAT is designed to conserve IP addresses and enable networks to use private IP addresses on internal networks. • These private, internal addresses are translated to routable, public addresses. • IPv4 addresses are almost depleted. • NAT/PAT has allowed IPv4 to be the predominant network protocol, keeping IPv6 at-bay (for now).
NAT Example 1 2 The translation from Private source IP address to Public source IP address. 1 2
NAT Example 4 3 Translation back, from Public destination IP address to Private destination IP address. 4 3
PAT Example NAT/PAT table maintains translation of: DA, SA, SP 1 2
PAT Example NAT/PAT table maintains translation of: SA (DA), DA (SA), DP (SP) 4 3
Subnet Mask Host: “I’m a host on the 192.168.1.0/24 network.” • The subnet mask is used to separate the network portion from the host portion of the address. • On a host, the subnet mask tells the host what network it belongs to. • Why does a host need to know what network it belongs to?
Subnet Mask Host: “I’m a host on the 192.168.1.0/24 network.” • Why does a host need to know what network it belongs to? • So, it knows whether to encapsulate the IP packet into an Ethernet frame with: • The Destination MAC Address of the default gateway • Must know the default gateway’s IP address • The Destination MAC Address of the host with the Destination IP address of the packet • Later when we discuss Ethernet
Subnet Mask Network Host Host IP: 172.16.33.10 10101100.00010000.00100001.00001010 Mask: 255.255.0.0 11111111.11111111.00000000.00000000 ----------------------------------- Net Add: 172.16.0.0 10101100.00010000.00000000.00000000 • Devices such as hosts use the bit-wise AND operation on the: • Host IP address • Subnet mask • AND operation: • 1 AND 1 = 1 • 0 AND anything = 0
Subnet Mask Network Host Host IP: 172.16.33.10 10101100.00010000.00100001.00001010 Mask: 255.255.255.0 11111111.11111111.11111111.00000000 ----------------------------------- Net Add: 172.16.33.0 10101100.00010000.00100001.00000000 • AND operation: • 1 AND 1 = 1 • 0 AND anything = 0
Subnet Mask Network Host Host IP: 172.1.17.9 10101100.00000001.00010001.00001001 Mask: 255.255.240.0 11111111.11111111.11110000.00000000 ----------------------------------- Net Add: 172.1.16.0 10101100.00000001.00010000.00000000 • AND operation: • 1 AND 1 = 1 • 0 AND anything = 0
Subnet Masks: Non-Natural Boundaries • Subnet masks do not have to end on natural octet boundaries 172.1.16.0 10101100.00000001.00010000.00000000 255.255.240.0 11111111.11111111.11110000.00000000 172.1.16.1 10101100.00000001.00010000.00000001 … 172.1.31.254 10101100.00000001.00011111.11111110 172.1.31.255 10101100.00000001.00011111.11111111 (broadcast) Number of hosts: 212 – 2 = 4,096 – 2 = 4,094 hosts
Subnets and Subnet Masks Formalized in 1985, the subnet mask breaks a single network in to smaller pieces. • Allows network administrators to divide their network into small networks or subnets. • Advantages will be discussed later.
Network Network Subnet Host What is subnetting? Network Network Host Host 172 16 0 0 • Subnetting is the process of borrowing bits from the HOST bits, in order to divide the larger network into small subnets. • Subnetting does NOT give you more hosts, but actually costs you hosts. • You lose two host IP Addresses for each subnet, one for the subnet IP address and one for the subnet broadcast IP address. • You lose the last subnet and all of it’s hosts’ IP addresses as the broadcast for that subnet is the same as the broadcast for the network. • In older technology, you would have lost the first subnet, as the subnet IP address is the same as the network IP address. (This subnet can be used in most networks.)
Analogy 98 Apples (100 – 2) Before subnetting: • In any network (or subnet) we can not use all the IP addresses for host addresses. • We lose two addresses for every network or subnet. 1. Network Address - One address is reserved to that of the network. For Example: 172.16.0.0 /16 2. Broadcast Address – One address is reserved to address all hosts in that network or subnet. For Example: 172.16.255.255 This gives us a total of 65,534 usable hosts
Analogy 10 barrels x 10 apples = 100 apples 10 10 10 98 Apples (100 – 2) 10 10 10 • It is the same as taking a barrel of 100 apples and dividing it into 10 barrels of 10 apples each. 10 10 10 10
2 = 1 network address + 1 broadcast address 10 barrels x 8 apples = 80 apples 8 8 8 (less 2) (less 2) (less 2) 98 Apples (100 – 2) 8 8 8 (less 2) (less 2) (less 2) 8 8 8 • However, in subnetting we will see that we lose two apples per subnet: • one for the network address • one for the broadcast address (less 2) (less 2) (less 2) 8 (less 2)
2 = 1 network address + 1 broadcast address 8 barrels x 8 apples = 64 apples X 8 8 8 (less 2) (less 2) (less 2) 98 Apples (100 – 2) 8 8 8 (less 2) (less 2) (less 2) 8 8 8 • In legacy networks, we also lost: • The first basket (subnet) • The network address of the first subnet is the network address of the entire network • The last basket (subnet) • The broadcast address for the last subnet is the same as for the entire network. (less 2) (less 2) (less 2) X 8 (less 2)
172 172 172 172 172 172 172 Network 16 16 Network 16 16 16 16 16 1 Subnet 0 255 254 Etc. 3 2 Host 0 0 0 0 0 0 0 Subnet Example Network address 172.16.0.0 with /16 Base Network Mask Using Subnets: Subnet Mask 255.255.255.0 or /24 Subnet addresses: All 0’s in host portion Subnets Addresses 256 Subnets 28
172 172 172 172 172 172 172 Network 16 16 Network 16 16 16 16 16 Etc. 3 254 2 1 0 Subnet 255 Hosts 1 1 1 1 1 1 1 Subnet Example Network address 172.16.0.0 with /16 Base Network Mask Using Subnets: Subnet Mask 255.255.255.0 or /24 Broadcast 254 255 254 255 254 255 254 255 254 255 254 255 254 255 Each subnet has 254 hosts, 28 – 2
Host IP Address: 172.16.3.50 • A host of the 172.16.3.0 /24 network With NO subnetting: NetworkFirst HostLast HostBroadcast 172.16.0.0 172.16.0.1 172.16.255.254 172.16.255.255 • 65,534 host addresses, one for network address and one for broadcast address. Host IP Address: 172.16.3.50 • A host of the 172.16.0.0 /16 network
Host IP Address: 172.16.3.50 • A host of the 172.16.3.0 /24 network With subnetting: NetworkFirst HostLast HostBroadcast 172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255 172.16.1.0 172.16.1.1 172.16.1.254 172.16.1.255 172.16.2.0 172.16.2.1 172.16.2.254 172.16.2.255 172.16.3.0 172.16.3.1 172.16.3.254 172.16.3.255 172.16.4.0 172.16.4.1 172.16.4.254 172.16.4.255 172.16.5.0 172.16.5.1 172.16.5.254 172.16.5.255 172.16.6.0 172.16.6.1 172.16.6.254 172.16.6.255 172.16.7.0 172.16.7.1 172.16.7.254 172.16.7.255 … 172.16.254.0 172.16.254.1 172.16.254.254 172.16.15.255 172.16.255.0 172.16.255.1 172.16.255.254 172.16.255.255
With subnetting: NetworkFirst HostLast HostBroadcastHosts 172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255 254 172.16.1.0 172.16.1.1 172.16.1.254 172.16.1.255 254 172.16.2.0 172.16.2.1 172.16.2.254 172.16.2.255 254 172.16.3.0 172.16.3.1 172.16.3.254 172.16.3.255 254 172.16.4.0 172.16.4.1 172.16.4.254 172.16.4.255 254 172.16.5.0 172.16.5.1 172.16.5.254 172.16.5.255 254 172.16.6.0 172.16.6.1 172.16.6.254 172.16.6.255 254 172.16.7.0 172.16.7.1 172.16.7.254 172.16.7.255254 … 172.16.254.0 172.16.254.1 172.16.254.254 172.16.15.255 254 172.16.255.0 172.16.255.1 172.16.255.254 172.16.255.255 254 --- 65,024 Total address = 256 subnets * (256 hosts – 2) = 256 * 254 = 65,024 NOTE: It is common for some network administrator to not use the last subnet.
With subnetting: NetworkFirst HostLast HostBroadcast 172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255 172.16.255.0 172.16.255.1 172.16.255.254 172.16.255.255 Major Network Address: 172.16.0.0 Major Network Mask: 255.255.0.0 Major Network Broadcast Address: 172.16.255.255 Subnet Mask: 255.255.255.0 First Subnet: Subnet Address: 172.16.0.0 Subnet Broadcast Address: 172.16.0.255 Last Subnet: Subnet Address: 172.16.255.0 Subnet Broadcast Address: 172.16.255.255
Determining Network and Subnet Information • Use the Classless Subnetting Worksheet (Excel Spreadsheet) to do the following: • Given any IP address and major network mask we can determine: • Major Network Address • First host address of the network • Last host address of the network • Broadcast address of the network • Number of usable hosts in the network • If the network is subnetted and we know the subnet mask we can determine: • Subnet (network) Address • First host address of the subnet • Last host address of the subnet • Broadcast address of the subnet • Number of usable hosts in the subnet • Number of usable subnets in this network
See these spreadsheets on my website Nutshell: Classless Subnetting in a Nutshell (Excel spreadsheet) Worksheet: Classless Subnetting Worksheet (Excel spreadsheet)
Convert IP Address/Network Mask to Binary • First, let’s determine the Major Network Information. • This is the information for the entire network, whether or not there are subnets. • Using the Major Network Mask, determine the major network Address, the broadcast address for the entire network, and the number of hosts for the entire network. • The Major Network Mask (or Base Mask, Subnet Mask) is provided by the ISP. • Convert these addresses to binary. Host IP Address:138.101.114.250 Major Network Mask: 255.255.0.0 (/16)
Determine Network Address • Determine the Network Address by using the AND operation. • Perform a bit-wise AND operation on the IP Address and the Subnet Mask • Note: 1 AND 1 results in a 1, 0 AND anything results in a 0 • Express the result in Dotted Decimal Notation • The result is the Major Network Address of this for this host IP Address is 138.101.0.0
Determine Network Address MD A simple way of doing the AND operation: 1. In the Network mask locate where the 1’s end and the 0’s begin and draw a line. (I call this the “Major Network Divide” or “MD” on the worksheet.) 2. Now copy all of the bits above the 1 bits in the Network mask, to the Network address. 3. For the rest of the bits in the Network address (the bits below the 0’s in the Network mask) write all 0’s. Network Portion Host Portion Copy the bits from the Host IP Address to the Major Network Address Write all 0’s below the 0’s in the Major Network Mask
Network: Determine First Host, Last Host, Broadcast Addresses • Remember that the network mask separates the network portion of the address from the host portion. Major Network Mask: 255.255.0.0 or /16 • The network address has all 0’s in the host portion of the address • The broadcast address has all 1’s in the host portion of the address • The first host is all 0’s and a 1 in the host portion of the address. • The last host is all 1’s and a 0 in the host portion of the address. Network Portion Host Portion
Network: Determine First Host, Last Host, Broadcast Addresses • The network address has all 0’s in the host portion of the address • The broadcast address has all 1’s in the host portion of the address • The first host is all 0’s and a 1 in the host portion of the address. • The last host is all 1’s and a 0 in the host portion of the address. Network Portion Host Portion
Network: Determine the number of usable hosts • By counting the number of host bits we can determine the total number of usable hosts for this network (before subnetting). Host bits:16 Total number of hosts: 216 = 65,536 65,536 – 2 =65,534 (Can’t use the all 0’s address, network address, or the all 1’s address, broadcast address.) Network Portion Host Portion = 16 bits
Convert IP Address/Subnet Mask to Binary • Now we will determine the Subnet Network Information. (Assuming we are subnetted.) • This is the information only for that subnet. • Using the Subnet Mask, determine the Subnet Address, the broadcast address for the entire network, and the number of hosts for the subnet. • The Subnet Mask is determined by the network administrator, depending upon the number of subnets and the number of hosts per subnet that are needed. • Convert these addresses to binary. Host IP Address: 138.101.114.250 Subnet Mask: 255.255.255.192 (/26)