Planning the Addressing Structure Working at a Small-to-Medium Business or ISP – Chapter 4 Copyleft 2012 Vincenzo Bruno (www.vincenzobruno.it) Released under Crative Commons License 3.0 By-Sa Cisco name, logo and materials are Copyright Cisco Systems Inc. 1 Objectives 2 Implementation of IP Addressing in the LAN IP addresses are made up of 32 total bits – divided into 4 octets with a decimal separating them – AKA: dotted decimal notation 3 IP Addressing IP addresses are HIERARCHIAL (like a family tree) – there are parents (networks) – there are children (hosts) 4 IP Address Classes Classes A – C – assigned to users Reserved: Class D (multicasts), Class E (experimental use) 5 Private IP Addressing Private IP addresses assigned by IETF (Internet Engineering Task Force) – reduces the number of public IP addresses assigned to organizations 6 Implementation of IP Addressing in the LAN ● Old 2 level hierarchy: Network –> Host ● Classful and Classless ● Default Subnet Mask for A, B, C classes SUBNETS 7 Traditional classful subnetting the same number of host bits is used to designate the subnet ID for all the subnetworks fixed number of subnets and a fixed number of hosts per subnet known as fixed-length subnetting 8 IP Addressing Practice Class C address with a default subnet mask. – – Question 1 – What is the default subnet mask • 255.255.255.0 Question 2 – How many usable hosts are available? • 254 IPv4 – Question 1 – Class which provides the largest number of network bits? • Class C – Question 2 – Class which provides the largest number of hosts per network? • Class A 9 IP Addressing Practice Class B address – Question 1 – What is the default subnet mask • 255.255.0.0 – Question 2 – The IP address is 155.14.0.0 with a default subnet mask. What is the broadcast address for this network? • 155.14.255.255 IPv4 – Question 1 – The IP address is 192.168.4.0 with a subnet mask of 255.255.255.224. What is the maximum number of sub networks that could be created. • 6 networks – Question 2 – The IP address is 192.133.219.0/27. What is the first usable host address in the first usable range? • 192.133.219.33 10 IP Versions IPv4 IPv6 32 bits 128 bits Separated by a period Separated by colons 133.15.6.4 RFC 791 RFC 2460 More address space Better address mgmt 11 Custom Subnet Mask Custom subnet masks take bits from the host ID portion of the IP address and add them to the default subnet mask 12 Custom Subnet Mask Example /26 13 VLSM and Classless Inter-Domain Routing (CIDR) The original classful subnetting design required that all subnets of a single classed network be the same size Fixed-length subnet masks can waste a significant number of IP addresses VLSM addressing allows an address space to be divided into networks of various sizes Routing information includes the IP address of the network CIDR ignores network classes based on the value of the high-order bits CIDR identifies networks based solely on the number of bits in the network prefix 14 Using Network Address Translation in a Network (NAT) Translates addresses from one network to another Allows a large group of private users to access the Internet by sharing a small group of public IPs – comparable to a company with a few phone lines, but many extensions Developed to help save registered IP addresses Provides security to PCs, servers, devices, etc 15 Using Network Address Translation in a Network (NAT) 16 Advantages & Disadvantages of NAT Advantages Disadvantages Reuse of IP addresses Router CPU load Sharing of a global IP address Poor network performance Security Remote access may be denied if trying to access a server with a private IP Scalability 17 NAT Terminology Inside local network – any network connected to a router interface that is part of the privately addressed LAN Outside global network – any network attached to a router that is external to the LAN 18 NAT: Inside and Outside Networks 19 More NAT Terminology Inside local address – Private IP address of a host on the local network – Must be translated to a public IP before it can travel outside Outside global address – Actual public IP address of an external host 20 NAT: Inside and Outside Addresses 21 More NAT Terminology - 2 Inside global address – IP address of inside host as it APPEARS to the outside network Outside local address – Destination address of packet while on the local network – Usually the same as outside global address 22 NAT: Inside and Outside Addresses - 2 23 Static NAT Provides access to a local host from the Internet Allows hosts on public network to access selected hosts on a private network 24 Static NAT Example The host with the IP address of 192.168.32.10 will always translate to 213.18.123.110. 25 Dynamic NAT Maps an unregistered IP address to a registered IP address from a group of registered IP addresses. The host with the IP address of 192.168.32.10 will translate to the first available address in the range of 213.18.123.10 to 213.18.123.150 Limited by number of Outside Global addresses 26 PAT (NAT Overload) A form of dynamic NAT that maps multiple private IP addresses to a single registered IP address by using different ports. This is known also as PAT (Port Address Translation), single address NAT or port-level multiplexed NAT. Each computer on the private network is translated to the same IP address (213.18.123.100), but with a different port number assignment. Outside users are unable to initiate communication to a host if using PAT 27 PAT (Overloading) Uses unique source port numbers in the inside global IP address Uses first available port number These port numbers must be above 1024 Let's see how it works -> 28 PAT: send 29 PAT: receive 30 Summary IP addressing can be tailored to the needs of the network design through the use of custom subnet masks. Classless subnetting gives classful IP addressing schemes more flexibility through the use of variable length subnet masks. Network Address Translation (NAT) is a way to shield private addresses from outside users. Port Address Translation (PAT) translates multiple local addresses to a single global IP address, maximizing the use of both private and public IP addresses. 31