2 IP Addressing IPV4

Embed Size (px)

Citation preview

  • 7/29/2019 2 IP Addressing IPV4

    1/20

    IP Addressing

    For any two systems to communicate, they must be able to identify and locate each other. Whilethese addresses in below Figure are not actual network addresses, they represent and show the conceptof address grouping. This uses the A or B to identify the network and the number sequence to identify theindividual host. A computer may be connected to more than one network. In this situation, the systemmust be given more than one address. Each address will identify the connection of the computer to adifferent network. A device is not said to have an address, but that each of the connection points, orinterfaces, on that device has an address to a network. This will allow other computers to locate the deviceon that particular network. The combination of letter (network address) and the number (host address)create a unique address for each device on the network. Each computer in a TCP/IP network must begiven a unique identifier, or IP address. This address, operating at Layer 3, allows one computer to locateanother computer on a network. All computers also have a unique physical address, known as a MACaddress. These are assigned by the manufacturer of the network interface card. MAC addresses operateat Layer 2 of the OSI model.

    An IP address is a 32-bit sequence of 1s and 0s. To make the IP address easier to use, theaddress is usually written as four decimal numbers separated by periods. For example, an IP address ofone computer is 192.168.1.2. Another computer might have the address 128.10.2.1. This way of writingthe address is called the dotted decimal format. In this notation, each IP address is written as four partsseparated by periods, or dots. Each part of the address is called an octet because it is made up of eight

    binary digits. For example, the IP address 192.168.1.8 would be11000000.10101000.00000001.00001000 in binary notation. The dotted decimal notation is an easiermethod to understand than the binary ones and zeros method. This dotted decimal notation also preventsa large number of transposition errors that would result if only the binary numbers were used. Using dotteddecimal allows number patterns to be more easily understood. Both the binary and decimal numbers inthe Figure represent the same values, but it is easier to see in dotted decimal notation. This is one of thecommon problems found in working directly with binary number. The long strings of repeated ones andzeros make transposition and omission errors more likely. It is easy to see the relationship between thenumbers 192.168.1.8 and 192.168.1.9, where 11000000.10101000.00000001.00001000 and11000000.10101000.00000001.00001001 are not as easy to recognize. Looking at the binary, it is almostimpossible to see that they are consecutive numbers

    IPv4 addressing

    A router forwards packets from the originating network to the destination network using the IPprotocol. The packets must include an identifier for both the source and destination networks. Using theIP address of destination network, a router can deliver a packet to the correct network. When the packetarrives at a router connected to the destination network, the router uses the IP address to locate theparticular computer connected to that network. This system works in much the same way as the nationalpostal system. When the mail is routed, it must first be delivered to the post office at the destination cityusing the zip code. That post office then must locate the final destination in that city using the streetaddress. This is a two-step process.

    Accordingly, every IP address has two parts. One part identifies the network where the system isconnected, and a second part identifies that particular system on the network.

  • 7/29/2019 2 IP Addressing IPV4

    2/20

    This kind of address is called a hierarchical address, because it contains different levels. An IPaddress combines these two identifiers into one number. This number must be a unique number, becauseduplicate addresses would make routing impossible. The first part identifies the system's network address.The second part, called the host part, identifies which particular machine it is on the network.

    IP addresses are divided into classes to define the large, medium, and small networks. Class Aaddresses are assigned to larger networks. Class B addresses are used for medium-sized networks andClass C for small networks. The first step in determining which part of the address identifies the network

    and which part identifies the host is identifying the class of an IP address.

    Class A, B, C, D, and E IP addressesTo accommodate different size networks and aid in classifying these networks, IP addresses are divided

    into groups called classes. This is known as classful addressing. Each complete 32-bit IP address isbroken down into a network part and a host part. A bit or bit sequence at the start of each addressdetermines the class of the address. There are five IP address classes as shown in the Figure below.

    The Class A address was designed to support extremely large networks, with more than 16 million hostaddresses available. Class A IP addresses use only the first octet to indicate the network address. Theremaining three octets provide for host addresses.

    The first bit of a Class A address is always 0. With that first bit a 0, the lowest number that can berepresented is 00000000, decimal 0. The highest number that can be represented is 01111111, decimal127. The numbers 0 and 127 are reserved and cannot be used as network addresses. Any address thatstarts with a value between 1 and 126 in the first octet is a Class A address.

    The 127.0.0.0 network is reserved for loopback testing. Routers or local machines can use this address tosend packets back to themselves. Therefore, this number cannot be assigned to a network.

    The Class B address was designed to support the needs of moderate to large-sized networks. A Class BIP address uses the first two of the four octets to indicate the network address. The other two octetsspecify host addresses.

    The first two bits of the first octet of a Class B address are always 10. The remaining six bits may bepopulated with either 1s or 0s. Therefore, the lowest number that can be represented with a Class Baddress is 10000000, decimal 128. The highest number that can be represented is 10111111, decimal191. Any address that starts with a value in the range of 128 to 191 in the f irst octet is a Class B address.

  • 7/29/2019 2 IP Addressing IPV4

    3/20

    The Class C address space is the most commonly used of the original address classes. This addressspace was intended to support small networks with a maximum of 254 hosts.

    A Class C address begins with binary 110. Therefore, the lowest number that can be represented is11000000, decimal 192. The highest number that can be represented is 11011111, decimal 223. If anaddress contains a number in the range of 192 to 223 in the first octet, it is a Class C address.

    The Class D address class was created to enable multicasting in an IP address. A multicast address is aunique network address that directs packets with that destination address to predefined groups of IPaddresses. Therefore, a single station can simultaneously transmit a single stream of data to multiplerecipients.

    The Class D address space, much like the other address spaces, is mathematically constrained. The firstfour bits of a Class D address must be 1110. Therefore, the first octet range for Class D addresses is11100000 to 11101111, or 224 to 239. An IP address that starts with a value in the range of 224 to 239 inthe first octet is a Class D address.

    A Class E address has been defined. However, the Internet Engineering Task Force (IETF) reservesthese addresses for its own research. Therefore, no Class E addresses have been released for use in theInternet. The first four bits of a Class E address are always set to 1s. Therefore, the first octet range for

    Class E addresses is 11110000 to 11111111, or 240 to 255.

    Address Identifier Network Address Host Address

    0 7 bits Network Address 24 bits Host AddressA

    10 14 bits Network Address 16 bits Host AddressB

    110 21 bits Network Address 8 bits Host AddressC

    1110 Multicast address (224.0.0.0-239.255.255.255)D

    1111 Reserved for future useE

    8 Bits8 Bits 8 Bits 8 Bits

    Class-A:

    Class-B:

    Class-C:

    Class-D:

    Class-E:

    0-127

    128-191

    192-223

    224-239

    240-255

    0 0 0 0 0 0 0 0

    1 0 0 0 0 0 0 0

    1 1 0 0 0 0 0 0

    1 1 1 0 0 0 0 0

    1 1 1 1 0 0 0 0

    0 1 1 1 1 1 1 1

    1 0 1 1 1 1 1 1

    1 1 0 1 1 1 1 1

    1 1 1 0 1 1 1 1

    1 1 1 1 1 1 1 1

  • 7/29/2019 2 IP Addressing IPV4

    4/20

    Reserved IP addressesCertain host addresses are reserved and cannot be assigned to devices on a network. These reserved

    host addresses include the following:

    Network address Used to identify the network itselfIn the below Figure, the section that is identified by the upper box represents the 198.150.11.0 network.Data that is sent to any host on that network (198.150.11.1- 198.150.11.254) will be seen outside of thelocal area network as 198.150.11.0. The only time that the host numbers matter is when the data is on thelocal area network. The LAN that is contained in the lower box is treated the same as the upper LAN,

    except that its network number is 198.150.12.0.

    Broadcast address Used for broadcasting packets to all the devices on a networkIn the Figure, the section that is identified by the upper box represents the 198.150.11.255 broadcastaddress. Data that is sent to the broadcast address will be read by all hosts on that network(198.150.11.1- 198.150.11.254). The LAN that is contained in the lower box is treated the same as theupper LAN, except that its broadcast address is 198.150.12.255.

    An IP address that has binary 0s in all host bit positions is reserved for the network address. In a Class Anetwork example, 113.0.0.0 is the IP address of the network, known as the network ID, containing the host113.1.2.3. A router uses the network IP address when it forwards data on the Internet. In a Class Bnetwork example, the address 176.10.0.0 is a network address.In a Class B network address, the first two octets are designated as the network portion. The last two

    octets contain 0s because those 16 bits are for host numbers and are used to identify devices that areattached to the network. The IP address, 176.10.0.0, is an example of a network address. This address isnever assigned as a host address. A host address for a device on the 176.10.0.0 network might be176.10.16.1. In this example, 176.10 is the network portion and 16.1 is the host portion.

    To send data to all the devices on a network, a broadcast address is needed. A broadcast occurs when asource sends data to all devices on a network. To ensure that all the other devices on the network processthe broadcast, the sender must use a destination IP address that they can recognize and process.

    Broadcast IP addresses end with binary 1s in the entire host part of the address.

    In the network example, 176.10.0.0, the last 16 bits make up the host field or host part of the address.The broadcast that would be sent out to all devices on that network would include a destination address of176.10.255.255. This is because 255 is the decimal value of an octet containing 11111111.

  • 7/29/2019 2 IP Addressing IPV4

    5/20

    Public and private IP addresses

    IANA has reserved the following three blocks of the IP address space for private internets (RFC 1918):

    10.0.0.0 - 10.255.255.255 (10.0.0.0/8 prefix)o 24-bit block

    o Complete class-A network number

    172.16.0.0 - 172.31.255.255 (172.16.0.0/12 prefix)o 20-bit block

    o Set of 16 contiguous class-B network numbers

    192.168.0.0 - 192.168.255.255 (192.168.0.0/16 prefix)o 16-bit block

    The stability of the Internet depends directly on the uniqueness of publicly used networkaddresses. In the Figure below, there is an issue with the network addressing scheme. In looking at thenetworks, both have a network address of 198.150.11.0. The router in this illustration will not be able toforward the data packets correctly. Duplicate network IP addresses prevent the router from performing its

    job of best path selection. Unique addresses are required for each device on a network.

    A procedure was needed to make sure that addresses were in fact unique. Originally, an organization

    known as the Internet Network Information Center (InterNIC) handled this procedure. InterNIC no longerexists and has been succeeded by the Internet Assigned Numbers Authority (IANA). IANA carefullymanages the remaining supply of IP addresses to ensure that duplication of publicly used addresses doesnot occur. Duplication would cause instability in the Internet and compromise its ability to deliver packetsto networks.

    Public IP addresses are unique. No two machines that connect to a public network can have the same IPaddress because public IP addresses are global and standardized. All machines connected to the Internetagree to conform to the system. Public IP addresses must be obtained from an Internet service provider(ISP) or a registry at some expense.

    With the rapid growth of the Internet, public IP addresses were beginning to run out. New addressingschemes, such as classless interdomain routing (CIDR) and IPv6 were developed to help solve the

    problem.

    Private IP addresses are another solution to the problem of the impending exhaustion of public IPaddresses. As mentioned, public networks require hosts to have unique IP addresses. However, privatenetworks that are not connected to the Internet may use any host addresses, as long as each host withinthe private network is unique. Many private networks exist alongside public networks. However, a privatenetwork using just any address is strongly discouraged because that network might eventually beconnected to the Internet. RFC 1918 sets aside three blocks of IP addresses for private, internal use.These three blocks consist of one Class A, a range of Class B addresses, and a range of Class Caddresses. Addresses that fall within these ranges are not routed on the Internet backbone. Internetrouters immediately discard private addresses. If addressing a non-public intranet, a test lab, or a home

  • 7/29/2019 2 IP Addressing IPV4

    6/20

    network, these private addresses can be used instead of globally unique addresses. Private IP addressescan be intermixed with public IP addresses. This will conserve the number of addresses used for internalconnections.

    Connecting a network using private addresses to the Internet requires translation of the private addressesto public addresses. This translation process is referred to as Network Address Translation (NAT). Arouter usually is the device that performs NAT.

    Introduction to subnetting

    Subnetting is another method of managing IP addresses. This method of dividing full networkaddress classes into smaller pieces has prevented complete IP address exhaustion. It is important tounderstand subnetting as a means of dividing and identifying separate networks throughout the LAN. It isnot always necessary to subnet a small network. However, for large or extremely large networks,subnetting is required. Subnetting a network means to use the subnet mask to divide the network andbreak a large network up into smaller, more efficient and manageable segments, or subnets. An examplewould be the U.S. telephone system which is broken into area codes, exchange codes, and localnumbers.

    The system administrator must resolve these issues when adding and expanding the network. It isimportant to know how many subnets or networks are needed and how many hosts will be needed oneach network. With subnetting, the network is not limited to the default Class A, B, or C network masks

    and there is more flexibility in the network design.

    Subnet addresses include the network portion, plus a subnet field and a host field. The subnet field andthe host field are created from the original host portion for the entire network. The ability to decide how todivide the original host portion into the new subnet and host fields provides addressing flexibility for thenetwork administrator.

    To create a subnet address, a network administrator borrows bits from the host field and designates themas the subnet field. The minimum number of bits that can be borrowed is two. When creating a subnet,where only one bit was borrowed the network number would be the .0 network. The broadcast numberwould then be the .255 network. The maximum number of bits that can be borrowed can be any number

    that leaves at least two bits remaining, for the host number.

    IPv4 versus IPv6

    When TCP/IP was adopted in the 1980s, it relied on a two-level addressing scheme. At the time thisoffered adequate scalability. Unfortunately, the designers of TCP/IP could not have predicted that theirprotocol would eventually sustain a global network of information, commerce, and entertainment. Overtwenty years ago, IP Version 4 (IPv4) offered an addressing strategy that, although scalable for a time,resulted in an inefficient allocation of addresses.

  • 7/29/2019 2 IP Addressing IPV4

    7/20

    The Class A and B addresses make up 75 percent of the IPv4 address space, however fewerthan 17,000 organizations can be assigned a Class A or B network number. Class C network addressesare far more numerous than Class A and Class B addresses, although they account for only 12.5 percentof the possible four billion IP addresses.

    Unfortunately, Class C addresses are limited to 254 usable hosts. This does not meet the needsof larger organizations that cannot acquire a Class A or B address. Even if there were more Class A, B,and C addresses, too many network addresses would cause Internet routers to come to a stop under theburden of the enormous size of routing tables required to store the routes to reach each of the networks.

    As early as 1992, the Internet Engineering Task Force (IETF) identified the following two specificconcerns:

    Exhaustion of the remaining, unassigned IPv4 network addresses. At the time, the Class B space was onthe verge of depletion.The rapid and large increase in the size of Internet routing tables occurred as more Class C networkscame online. The resulting flood of new network information threatened the ability of Internet routers to

    cope effectively.

    Over the past two decades, numerous extensions to IPv4 have been developed. These extensions arespecifically designed to improve the efficiency with which the 32-bit address space can be used. Two ofthe more important of these are subnet masks and classless interdomain routing (CIDR).

    Meanwhile, an even more extendible and scalable version of IP, IP Version 6 (IPv6), has beendefined and developed. IPv6 uses 128 bits rather than the 32 bits currently used in IPv4. IPv6 useshexadecimal numbers to represent the 128 bits. IPv6 provides 640 sextrillion addresses. This version of IPshould provide enough addresses for future communication needs. IPv6 fields are 16 bits long. To make

    IANA

    National

    Local

    Consumer

    InterNIC

    America

    RIPE

    Europe

    APNIC

    Asia Regional

    IANA

    NationalNational

    LocalLocal

    ConsumerConsumer

    InterNIC

    America

    RIPE

    Europe

    APNIC

    Asia RegionalInterNIC

    America

    RIPE

    Europe

    APNIC

    Asia

    InterNIC

    America

    RIPE

    Europe

    APNIC

    Asia Regional

  • 7/29/2019 2 IP Addressing IPV4

    8/20

    the addresses easier to read, leading zeros can be omitted from each field. The field :0003: is written :3:.IPv6 shorthand representation of the 128 bits uses eight 16-bit numbers, shown as four hexadecimaldigits.

    After years of planning and development, IPv6 is slowly being implemented in select networks.Eventually, IPv6 may replace IPv4 as the dominant Internet protocol.

    Address Resolution Protocol (ARP)With TCP/IP networking, a data packet must contain both a destination MAC address and a

    destination IP address. If the packet is missing either one, the data will not pass from Layer 3 to the upperlayers. In this way, MAC addresses and IP addresses act as checks and balances for each other. Afterdevices determine the IP addresses of the destination devices, they can add the destination MACaddresses to the data packets.

    Some devices will keep tables that contain MAC addresses and IP addresses of other devicesthat are connected to the same LAN. These are called Address Resolution Protocol (ARP) tables. ARPtables are stored in RAM memory, where the cached information is maintained automatically on each ofthe devices. It is very unusual for a user to have to make an ARP table entry manually. Each device on anetwork maintains its own ARP table. When a network device wants to send data across the network, ituses information provided by the ARP table.

    When a source determines the IP address for a destination, it then consults the ARP table in order

    to locate the MAC address for the destination. If the source locates an entry in its table, destination IPaddress to destination MAC address, it will associate the IP address to the MAC address and then uses itto encapsulate the data. The data packet is then sent out over the networking media to be picked up by

    the destination device.

    There are two ways that devices can gather MAC addresses that they need to add to the encapsulateddata. One way is to monitor the traffic that occurs on the local network segment. All stations on anEthernet network will analyze all traffic to determine if the data is for them. Part of this process is to record

    the source IP and MAC address of the datagram to an ARP table. So as data is transmitted on thenetwork, the address pairs populate the ARP table. Another way to get an address pair for datatransmission is to broadcast an ARP request.

    The computer that requires an IP and MAC address pair broadcasts an ARP request. All the other deviceson the local area network analyze this request. If one of the local devices matches the IP address of therequest, it sends back an ARP reply that contains its IP-MAC pair. If the IP address is for the local areanetwork and the computer does not exist or is turned off, there is no response to the ARP request. In thissituation, the source device reports an error. If the request is for a different IP network, there is anotherprocess that can be used.

  • 7/29/2019 2 IP Addressing IPV4

    9/20

    Routers do not forward broadcast packets. If the feature is turned on, a router performs a proxy ARP.Proxy ARP is a variation of the ARP protocol. In this variation, a router sends an ARP response with theMAC address of the interface, on which the request was received, to the requesting host. The routerresponds with the MAC addresses for those requests in which the IP address is not in the range ofaddresses of the local subnet.

    Another method to send data to the address of a device that is on another network segment is to set up adefault gateway. The default gateway is a host option where the IP address of the router interface is

    stored in the network configuration of the host. The source host compares the destination IP address andits own IP address to determine if the two IP addresses are located on the same segment. If the receivinghost is not on the same segment, the source host sends the data using the actual IP address of thedestination and the MAC address of the router. The MAC address for the router was learned from the ARPtable by using the IP address of that router.

    If the default gateway on the host or the proxy ARP feature on the router is not configured, no traffic canleave the local area network. One or the other is required to have a connection outside of the local areanetwork.

    Establishing the subnet mask addressSelecting the number of bits to use in the subnet process will depend on the maximum number of hosts

    required per subnet. An understanding of basic binary math and the position value of the bits in each octetis necessary when calculating the number of subnetworks and hosts created when bits were borrowed.The last two bits in the last octet, regardless of the IP address class, may never be assigned to thesubnetwork. These bits are referred to as the last two significant bits. Use of all the available bits to createsubnets, except these last two, will result in subnets with only two usable hosts. This is a practical addressconservation method for addressing serial router links. However, for a working LAN this would result inprohibitive equipment costs.

    The subnet mask gives the router the information required to determine in which network and subnet aparticular host resides. The subnet mask is created by using binary ones in the host octet or octets. Thesubnet octet or octets are determined by adding the position value of the bits that were borrowed. If threebits were borrowed, the mask for a Class C address would be 255.255.255.224. This mask may also berepresented, in the slash format, as /27. The number following the slash is the total number of bits that

    were used for the network and subnetwork portion.

    To determine the number of bits to be used, the network designer needs to calculate how many hosts thelargest subnetwork requires and the number of subnetworks needed. As an example, the network requires30 hosts and five subnetworks. A shortcut to determine how many bits to reassign is by using thesubnetting chart. By consulting the row titled Usable hosts, the chart indicates that for 30 usable hoststhree bits are required. The chart also shows that this creates six usable subnetworks, which will satisfythe requirements of this scheme. The difference between usable hosts and total hosts is a result of usingthe first available address as the ID and the last available address as the broadcast for each subnetwork.The ability to use these subnetworks is not provided with classful routing. However, classless routing, canrecover many of these lost addresses.

    The method that was used to create the subnet chart can be used to solve all subnetting problems. Thismethod uses the following formula:

    Number of usable subnets= two to the power of the assigned subnet bits or borrowed bits, minus two(reserved addresses for subnetwork id and subnetwork broadcast)

    (2 power of borrowed bits) 2 = usable subnets(23) 2 = 6

    Number of usable hosts= two to the power of the bits remaining, minus two (reserved addresses forsubnet id and subnet broadcast)

  • 7/29/2019 2 IP Addressing IPV4

    10/20

    (2 power of remaining host bits) 2 = usable hosts(25) 2 = 30

    Applying the subnet maskOnce the subnet mask has been established it then can be used to create the subnet scheme. The chart

    in the Figure is an example of the subnets and addresses created by assigning three bits to the subnetfield. This will create eight subnets with 32 hosts per subnet. Start with zero (0) when numbering subnets.

    The first subnet is always referenced as the zero subnet.When filling in the subnet chart three of the fields are automatic, others require some calculation. Thesubnetwork ID of subnet zero is the same as the major network number, in this case 192.168.10.0. Thebroadcast ID for the whole network is the largest number possible, in this case 192.168.10.255. The thirdnumber that is given is the subnetwork ID for subnet number seven. This number is the three networkoctets with the subnet mask number inserted in the fourth octet position. Three bits were assigned to thesubnet field with a cumulative value of 224. The ID for subnet seven is 192.168.10.224. By inserting thesenumbers, checkpoints have been established that will verify the accuracy when the chart is completed.

    When consulting the subnetting chart or using the formula, the three bits assigned to the subnet field willresult in 32 total hosts assigned to each subnet. This information provides the step count for eachsubnetwork ID. Adding 32 to each preceding number, starting with subnet zero, the ID for each subnet isestablished. Notice that the subnet ID has all binary 0s in the host portion.

    The broadcast field is the last number in each subnetwork, and has all binary ones in the host portion.This address has the ability to broadcast only to the members of a single subnet. Since the subnetwork ID

    for subnet zero is 192.168.10.0 and there are 32 total hosts the broadcast ID would be 192.168.10.31.Starting at zero the 32nd sequential number is 31. It is important to remember that zero (0) is a realnumber in the world of networking.

    The balance of the broadcast ID column can be filled in using the same process that was used in thesubnetwork ID column. Simply add 32 to the preceding broadcast ID of the subnet. Another option is tostart at the bottom of this column and work up to the top by subtracting one from the precedingsubnetwork ID.

    Subnetting Class A and B networks

    The Class A and B subnetting procedure is identical to the process for Class C, except there maybe significantly more bits involved. The available bits for assignment to the subnet field in a Class Aaddress is 22 bits while a Class B address has 14 bits.

  • 7/29/2019 2 IP Addressing IPV4

    11/20

    Assigning 12 bits of a Class B address to the subnet field creates a subnet mask of 255.255.255.240 or /28. All eight bits were assigned in the third octet resulting in 255, the total value of all eight bits. Four bitswere assigned in the fourth octet resulting in 240. Recall that the slash mask is the sum total of all bitsassigned to the subnet field plus the fixed network bits.

    Assigning 20 bits of a Class A address to the subnet field creates a subnet mask of 255.255.255.240 or /28. All eight bits of the second and third octets were assigned to the subnet field and four bits from the

    fourth octet.

    In this situation, it is apparent that the subnet mask for the Class A and Class B addresses appearidentical. Unless the mask is related to a network address it is not possible to decipher how many bitswere assigned to the subnet field.

    Whichever class of address needs to be subnetted, the following rules are the same:

    Total subnets = 2 to the power of the bits borrowedTotal hosts= 2 to the power of the bits remainingUsable subnets = 2 to the power of the bits borrowed minus 2Usable hosts= 2 to the power of the bits remaining minus 2

    Calculating the resident subnetwork through ANDingRouters use subnet masks to determine the home subnetwork for individual nodes. This process is

    referred to as logical ANDing. ANDing is a binary process by which the router calculates the subnetworkID for an incoming packet. ANDing is similar to multiplication.

    This process is handled at the binary level. Therefore, it is necessary to view the IP address and mask inbinary. The IP address and the subnetwork address are ANDed with the result being the subnetwork ID.The router then uses that information to forward the packet across the correct interface.

    Subnetting is a learned skill. It will take many hours performing practice exercises to gain a developmentof flexible and workable schemes. A variety of subnet calculators are available on the web. However, anetwork administrator must know how to manually calculate subnets in order to effectively design thenetwork scheme and assure the validity of the results from a subnet calculator. The subnet calculator willnot provide the initial scheme, only the final addressing.

    VLSM Overview

    A network administrator must anticipate and manage the physical growth of a network, perhaps by buying

    or leasing another floor of the building to house new networking equipment such as racks, patch panels,switches, and routers. The network designer must choose an addressing scheme that allows for growth.Variable-Length Subnet Masking (VLSM) is a technique that allows for the creation of efficient, scalableaddressing schemes.With the phenomenal growth of the Internet and TCP/IP, virtually every enterprise must now implement anIP addressing scheme. Many organizations select TCP/IP as the only routed protocol to run on theirnetwork. Unfortunately, the architects of TCP/IP could not have predicted that their protocol wouldeventually sustain a global network of information, commerce, and entertainment.

    Twenty years ago, IP version 4 (IPv4) offered an addressing strategy that, although scalable for a time,resulted in an inefficient allocation of addresses. IP version 6 (IPv6), with virtually unlimited address

  • 7/29/2019 2 IP Addressing IPV4

    12/20

    space, is slowly being implemented in select networks and may replace IPv4 as the dominant protocol ofthe Internet. Over the past two decades, engineers have successfully modified IPv4 so that it can survivethe exponential growth of the Internet. VLSM is one of the modifications that has helped to bridge the gapbetween IPv4 and IPv6.

    Networks must be scalable in order to meet the changing needs of users. When a network is scalable it isable to grow in a logical, efficient, and cost-effective way. The routing protocol used in a network doesmuch to determine the scalability of the network. Therefore, it is important that the routing protocol be

    chosen wisely. Routing Information Protocol (RIP) is still considered suitable for small networks, but is notscalable to large networks because of inherent limitations. To overcome these limitations yet maintain thesimplicity of RIP version 1 (RIP v1), RIP version 2 (RIP v2) was developed.

    What is VLSM and why is it used?

    As IP subnets have grown, administrators have looked for ways to use their address space moreefficiently. One technique is called Variable-Length Subnet Masks (VLSM). With VLSM, a networkadministrator can use a long mask on networks with few hosts, and a short mask on subnets with manyhosts.In order to use VLSM, a network administrator must use a routing protocol that supports it. Cisco routerssupport VLSM with Open Shortest Path First (OSPF), Integrated Intermediate System to IntermediateSystem (Integrated IS-IS), Enhanced Interior Gateway Routing Protocol (EIGRP), RIP v2, and static

    routing.

    VLSM allows an organization to use more than one subnet mask within the same network address space.Implementing VLSM is often referred to as "subnetting a subnet", and can be used to maximizeaddressing efficiency.

    Classful routing protocols require that a single network use the same subnet mask. Therefore, network192.168.187.0 must use just one subnet mask such as 255.255.255.0.

    VLSM is simply a feature that allows a single autonomous system to have networks with different subnetmasks. If a routing protocol allows VLSM, use a 30-bit subnet mask on network connections,255.255.255.252, a 24-bit mask for user networks, 255.255.255.0, or even a 22-bit mask, 255.255.252.0,for networks with up to 1000 users.

    A waste of spaceIn the past, it has been recommended that the first and last subnet not be used. Use of the first subnet,

    known as subnet zero, for host addressing was discouraged because of the confusion that can occurwhen a network and a subnet have the same addresses. The same was true with the use of the lastsubnet, known as the all-ones subnet. It has always been true that these subnets could be used.However, it was not a recommended practice. As networking technologies have evolved, and IP addressdepletion has become of real concern, it has become acceptable practice to use the first and last subnetsin a subnetted network in conjunction with VLSM.In this network, the network management team has decided to borrow three bits from the host portion ofthe Class C address that has been selected for this addressing scheme.

    If management decides to use subnet zero, it has eight useable subnets. Each may support 30 hosts. Ifthe management decides to use the no ip subnet-zero command, it has seven usable subnets with 30hosts in each subnet. From Cisco IOS version 12.0, remember that Cisco routers use subnet zero bydefault.

    Such an addressing scheme is fine for a small LAN. However, this addressing scheme is extremelywasteful if using point-to-point connections.

  • 7/29/2019 2 IP Addressing IPV4

    13/20

    When to use VLSM?It is important to design an addressing scheme that allows for growth and does not involve wasting

    addresses. This section examines how VLSM can be used to prevent waste of addresses on point-to-pointlinks.

    This time the networking team decided to avoid their wasteful use of the /27 mask on the point-to-pointlinks. The team decided to apply VLSM to the addressing problem.

    To apply VLSM to the addressing problem, the team will break the Class C address into subnets ofvariable sizes. Large subnets are created for addressing LANs. Very small subnets are created for WAN

    links and other special cases. A 30-bit mask is used to create subnets with only two valid host addresses.In this case this is the best solution for the point-to-point connections. The team will take one of the threesubnets they had previously decided to assign to the WAN links, and subnet it again with a 30-bit mask.

    In the example, the team has taken one of the last three subnets, subnet 6, and subnetted it again. Thistime the team uses a 30-bit mask.

  • 7/29/2019 2 IP Addressing IPV4

    14/20

    Calculating subnets with VLSM

    VLSM helps to manage IP addresses. VLSM allows for the setting of a subnet mask that suits thelink or the segment requirements. A subnet mask should satisfy the requirements of a LAN with onesubnet mask and the requirements of a point-to-point WAN with another.Look at the example in the Figure above which illustrates how to calculate subnets with VLSM.

    The example contains a Class B address of 172.16.0.0 and two LANs that require at least 250hosts each. If the routers are using a classful routing protocol the WAN link would need to be a subnet ofthe same Class B network, assuming that the administrator is not using IP unnumbered. Classful routingprotocols such as RIP v1, IGRP, and EGP are not capable of supporting VLSM. Without VLSM, the WANlink would have to have the same subnet mask as the LAN segments. A 24-bit mask (255.255.255.0)would support 250 hosts.

    The WAN link only needs two addresses, one for each router. Therefore there would be 252addresses wasted. If VLSM were used in this example, a 24-bit mask would still work on the LANsegments for the 250 hosts. A 30-bit mask could be used for the WAN link because only two hostaddresses are needed.

    In the Figure the subnet addresses used are those generated from subdividing the 172.16.32.0/20subnet into multiple /26 subnets. The figure illustrates where the subnet addresses can be applied,depending on the number of host requirements. For example, the WAN links use subnet addresses with aprefix of /30. This prefix allows for only two hosts, just enough hosts for a point-to-point connectionbetween a pair of routers.

    To calculate the subnet addresses used on the WAN links, further subnet one of the unused /26subnets. In this example, 172.16.33.0/26 is further subnetted with a prefix of /30. This provides four moresubnet bits and therefore 16 (24) subnets for the WANs. The Figure illustrates how to work through a

    VLSM masking system.

    VLSM allows the subnetting of an already subnetted address. For example, consider the subnetaddress 172.16.32.0/20 and a network needing ten host addresses. With this subnet address, there areover 4000 (212 2 = 4094) host addresses, most of which will be wasted. With VLSM it is possible tofurther subnet the address 172.16.32.0/20 to give more network addresses and fewer hosts per network.For example, by subnetting 172.16.32.0/20 to 172.16.32.0/26, there is a gain of 64 (26) subnets, each ofwhich could support 62 (26 2) hosts.

    Use this procedure to further subnet 172.16.32.0/20 to 172.16.32.0/26:

    Step 1 Write 172.16.32.0 in binary form.Step 2 Draw a vertical line between the 20th and 21st bits, as shown in Figure . /20 was the original

    subnet boundary.Step 3 Draw a vertical line between the 26th and 27th bits, as shown in Figure . The original /20 subnetboundary is extended six bits to the right, becoming /26.Step 4 Calculate the 64 subnet addresses using the bits between the two vertical lines, from lowest tohighest in value. The figure shows the first five subnets available.

    It is important to remember that only unused subnets can be further subnetted. If any address from asubnet is used, that subnet cannot be further subnetted. In the example, four subnet numbers are used onthe LANs. Another unused subnet, 172.16.33.0/26, is further subnetted for use on the WANs.

  • 7/29/2019 2 IP Addressing IPV4

    15/20

    Route aggregation with VLSMWhen using VLSM, try to keep the subnetwork numbers grouped together in the network to allow

    for aggregation. This means keeping networks like 172.16.14.0 and 172.16.15.0 near one another so thatthe routers need only carry a route for 172.16.14.0/23.The use of Classless InterDomain Routing (CIDR) and VLSM not only prevents address waste, but alsopromotes route aggregation, or summarization. Without route summarization, Internet backbone routingwould likely have collapsed sometime before 1997.

    Figure illustrates how route summarization reduces the burden on upstream routers. This complexhierarchy of variable-sized networks and subnetworks is summarized at various points, using a prefixaddress, until the entire network is advertised as a single aggregate route, 200.199.48.0/22. Routesummarization, or supernetting, is only possible if the routers of a network run a classless routing protocol,such as OSPF or EIGRP. Classless routing protocols carry a prefix that consists of 32-bit IP address andbit mask in the routing updates. In Figure , the summary route that eventually reaches the providercontains a 20-bit prefix common to all of the addresses in the organization, 200.199.48.0/22 or11001000.11000111.0011. For summarization to work properly, carefully assign addresses in ahierarchical fashion so that summarized addresses will share the same high-order bits.

    Configuring VLSMIf VLSM is the scheme chosen, it must then be calculated and configured correctly.

    In this example allow for the following:

    Network address: 192.168.10.0

    The Perth router has to support 60 hosts. In this case, a minimum of six bits are needed in the host portionof the address. Six bits will yield 62 possible host addresses, 26 = 64 2 = 62, so the division was192.168.10.0/26.The Sydney and Singapore routers have to support 12 hosts each. In these cases, a minimum of four bitsare needed in the host portion of the address. Four bits will yield 14 possible host addresses, 24 = 16 2= 14, so the division is 192.168.10.96/28 for Sydney and 192.168.10.112/28 for Singapore.The Kuala Lumpur router requires 28 hosts. In this case, a minimum of five bits are needed in the host

    portion of the address. Five bits will yield 30 possible host addresses, 25 = 32 2 = 30, so the divisionhere is 192.168.10.64/27.

    The following are the point-to-point connections:

  • 7/29/2019 2 IP Addressing IPV4

    16/20

    Perth to Kuala Lumpur 192.168.10.128/30 Since only two addresses are required, a minimum of two bitsare needed in the host portion of the address. Two bits will yield two possible host addresses (22 = 4 2 =2) so the division here is 192.168.10.128/30.Sydney to Kuala Lumpur 192.168.10.132/30 Since only two addresses are required, a minimum of twobits are needed in the host portion of the address. Two bits will yield two possible host addresses (22 = 4

    2 = 2) so the division here is 192.168.10.132/30.Singapore to Kuala Lumpur 192.168.10.136/30 Since only two addresses are required, a minimum oftwo bits are needed in the host portion of the address. Two bits will yield two possible host addresses (22

    = 4 2 = 2) so the division here is 192.168.10.136/30.There is sufficient host address space for two host endpoints on a point-to-point serial link. The examplefor Singapore to Kuala Lumpur is configured as follows:

    Singapore(config)#interface serial 0Singapore(config-if)#ip address 192.168.10.137 255.255.255.252

    KualaLumpur(config)#interface serial 1KualaLumpur(config-if)#ip address 192.168.10.138 255.255.255.252

    Remember the following rules:

    A router must know in detail the subnet numbers attached to it.A router does not need to tell other routers about each individual subnet if the router can send oneaggregate route for a set of routers.

    A router using aggregate routes would have fewer entries in its routing table.VLSM allows for the summarization of routes and increases flexibly by basing the summarization

    entirely on the higher-order bits shared on the left, even if the networks are not contiguous.The graphic shows that the addresses, or routes, share each bit up to and including the 20th bit.

    These bits are colored red. The 21st bit is not the same for all the routes. Therefore the prefix for thesummary route will be 20 bits long. This is used to calculate the network number of the summary route.

    The Figure shows that the addresses, or routes, share each bit up to and including the 21st bit.These bits are colored red. The 22nd bit is not the same for all the routes. Therefore the prefix for thesummary route will be 21 bits long. This is used to calculate the network number of the summary route.

    CIDR -- Classless InterDomain Routing

    Now that you understand "classful" IP Subnetting principals, you can forget them . The reason isCIDR -- Classless InterDomain Routing. CIDR was invented several years ago to keep the internet fromrunning out of IP addresses. The "classful" system of allocating IP addresses can be very wasteful;anyone who could reasonably show a need for more that 254 host addresses was given a Class Baddress block of 65533 host addresses. Even more wasteful were companies and organizations that wereallocated Class A address blocks, which contain over 16 Million host addresses! Only a tiny percentage ofthe allocated Class A and Class B address space has ever been actually assigned to a host computer onthe Internet.People realized that addresses could be conserved if the class system was eliminated. By accuratelyallocating only the amount of address space that was actually needed, the address space crisis could beavoided for many years. This was first proposed in 1992 as a scheme called Supernetting. Undersupernetting, the classful subnet masks are extended so that a network address and subnet mask could,

    for example, specify multiple Class C subnets with one address. For example, If I needed about 1000addresses, I could supernet 4 Class C networks together:

    192.60.128.0 (11000000.00111100.10000000.00000000) Class C subnet address192.60.129.0 (11000000.00111100.10000001.00000000) Class C subnet address192.60.130.0 (11000000.00111100.10000010.00000000) Class C subnet address192.60.131.0 (11000000.00111100.10000011.00000000) Class C subnet address--------------------------------------------------------192.60.128.0 (11000000.00111100.10000000.00000000) Supernetted Subnet address255.255.252.0 (11111111.11111111.11111100.00000000) Subnet Mask192.60.131.255 (11000000.00111100.10000011.11111111) Broadcast address

  • 7/29/2019 2 IP Addressing IPV4

    17/20

    In this example, the subnet 192.60.128.0 includes all the addresses from 192.60.128.0 to 192.60.131.255.As you can see in the binary representation of the subnet mask, the Network portion of the address is 22bits long, and the host portion is 10 bits long.Under CIDR, the subnet mask notation is reduced to simplified shorthand. Instead of spelling out the bitsof the subnet mask, it is simply listed as the number of 1s bits that start the mask. In the above example,instead of writing the address and subnet mask as

    192.60.128.0, Subnet Mask 255.255.252.0

    the network address would be written simply as:192.60.128.0/22

    which indicates starting address of the network, and number of 1s bits (22) in the network portion of theaddress. If you look at the subnet mask in binary (11111111.11111111.11111100.00000000), you caneasily see how this notation works.The use of a CIDR notated address is the same as for a Classful address. Classful addresses can easilybe written in CIDR notation (Class A = /8, Class B = /16, and Class C = /24)

    It is currently almost impossible for an individual or company to be allocated its own IP address blocks.You will simply be told to get them from your ISP. The reason for this is the ever-growing size of the

    internet routing table. Just 10 years ago, there were less than 5000 network routes in the entire Internet.Today, there are over 100,000. Using CIDR, the biggest ISPs are allocated large chunks of address space(usually with a subnet mask of /19 or even smaller); the ISP's customers (often other, smaller ISPs) arethen allocated networks from the big ISP's pool. That way, all the big ISP's customers (and theircustomers, and so on) are accessible via 1 network route on the Internet. But I digress.

    It is expected that CIDR will keep the Internet happily in IP addresses for the next few years at least. Afterthat, IPv6, with 128 bit addresses, will be needed. Under IPv6, even sloppy address allocation wouldcomfortably allow a billion unique IP addresses for every person on earth! The complete and gory detailsof CIDR are documented in RFC1519, which was released in September of 1993.

    Without CIDR

    198.32.1.0

    NAP

    198.0.0.0 through

    198.255.255.0

    ISP3

    198.32.0.0 through

    198.32.255.0

    ISP1

    198.33.0.0 through

    198.33.255.0

    ISP2

    198.32.2.0 198.32.3.0 198.33.1.0198.32.1.0

    NAP

    198.0.0.0 through

    198.255.255.0

    ISP3

    198.32.0.0 through

    198.32.255.0

    ISP1

    198.33.0.0 through

    198.33.255.0

    ISP2

    198.32.2.0 198.32.3.0 198.33.1.0

  • 7/29/2019 2 IP Addressing IPV4

    18/20

    With CIDR

    Summary

    1. The IP address is of the form .2. The address is not really separated but is read as a whole.3. The address is 32 bits in length which is further separated into 4 bytes of 8 bits each.4. The address can be expressed in decimal, octal, hexadecimal or binary.5. Most common IP address form is Dotted Decimal Notation i.e. Decimal equivalent of each byte is

    separated by a dot.6. In decimal the address range is 0.0.0.0 to 255.255.255.255.7. Two types of addressing schemes for IPv4

    Classful

    ClasslessClassful

    Original style of addressing based on first few bits of the address.Generally used in customer sites.

    ClasslessA new type of addressing that disregards the class bit of an address and applies avariable prefix (mask) to determine the network number.

    There are five classes of addresses A, B, C, D & E.

    A, B & C classes are used to represent host and network address.

    Class D is a special type of address used for multicasting.

    Class E is reserved for experimental use.

    In classful addressing a range of bits is applied to an address, most of which are wasted

    Having 16777214 hosts for Class-A and 254 hosts for Class-C were not working well.

    Every IP address requires one entry in the routing table. Addresses were arbitrarily handed out without regard to geographic location.

    Class C addresses were overtaxing the Internet routing tables.

    Class A stopped being handed out and Class-B was exhausted.

    The host portion of address can not be set to all 0s or all 1s.

    Any address with all 0s in the network portion of the address space is meant to be this network.

    Addresses can not be out of the 255 range for each byte.0.0.0.0Used as source address in a boot (BOOTP/DHCP) configuration request.Also denotes the default route in a routing table.

    198.32.1.0

    NAP

    198.0.0.0/8

    ISP3

    198.32.0.0/16

    ISP1

    198.32.2.0 198.32.3.0 198.33.1.0

    198.33.0.0/16

    ISP2

    198.32.1.0

    NAP

    198.0.0.0/8

    ISP3

    198.32.0.0/16

    ISP1

    198.32.2.0 198.32.3.0 198.33.1.0

    198.33.0.0/16

    ISP2

  • 7/29/2019 2 IP Addressing IPV4

    19/20

    Chopping up of a network into a number of smaller networks is called subnetting.

    Allows assigning some of the bits, normally used by the host portion of the address, to thenetwork portion of the address.

    The format of subnetted IP address would be

    Efficiently uses the full network address.

    Provides for another hierarchy of routing.

    Subnet is a real network under a network.

    Any of the classes can be subnetted. Subnetting creates subnets with equal number of hosts, in a network.

    The number of bits subnetted i.e. the length of subnet mask will be same for all the subnets.

    To co-op with the variable number of hosts in subnets, in a network, number subnetted bits i.e. thelength of subnet mask for the subnets will also vary.

    The method of achieving subnetting, with variable length of subnet mask, is known as VariableLength Subnet Mask.

    Subnetting is based on the following:HostsSubnetsSerial LinesRouting Protocols

    Class-A assignments at the IANAs discretion.

    To get a Class-B address, the organisation:o should present a subnetting plan which documents more than 32 subnets within its

    organisational network.o should have more than 4096 hosts.

    Class-C addresses are assigned from the address blocks allocated for each region.o Organisation requiring more than a single class-c address will be assigned bit-wise

    contiguous blocks.

    Organisation requirement (Based on 24 month projection):Fewer than 256 addresses 1 Class-CFewer than 512 addresses 2 contiguous Class-CFewer than 1024 addresses 4 contiguous Class-CFewer than 2048 addresses 8 contiguous Class-CFewer than 4096 addresses 16 contiguous Class-C

    Maximum 16 contiguous Class-C networks can be assigned to an organisation.

    Organisation having requirement of more than 4096 hosts is likely to get a Class-B address.

    Whole world has been divided into 4 zones.

    Each zone is given a portion of Class-C addresses.194.0.0.0 to 195.255.255.255 (Europe)198.0.0.0 to 199.255.255.255 (North America)200.0.0.0 to 201.255.255.255 (C&S.America)202.0.0.0 to 203.255.255.255 (Asia & the Pacific)

    An Internet Registry is an organization that is responsible for distributing IP address space to itsmembers or customers and for registering those distributions. IRs can be classified as:

    RIRs (Regional Internet Registery)NIRs (National Internet Registery)LIRs (Local Internet Registery

    IANA has reserved the following three blocks of the IP address space for private internets (RFC1918):

    10.0.0.0 - 10.255.255.255 (10.0.0.0/8 prefix)24-bit blockComplete class-A network number

    172.16.0.0 - 172.31.255.255 (172.16.0.0/12 prefix)20-bit blockSet of 16 contiguous class-B network numbers

    192.168.0.0 - 192.168.255.255 (192.168.0.0/16 prefix)16-bit block

  • 7/29/2019 2 IP Addressing IPV4

    20/20