Vous êtes sur la page 1sur 20

IP Addressing

For any two systems to communicate, they must be able to identify and locate each other. While these addresses in below Figure are not actual network addresses, they represent and show the concept of address grouping. This uses the A or B to identify the network and the number sequence to identify the individual host. A computer may be connected to more than one network. In this situation, the system must be given more than one address. Each address will identify the connection of the computer to a different network. A device is not said to have an address, but that each of the connection points, or interfaces, on that device has an address to a network. This will allow other computers to locate the device on 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 be given a unique identifier, or IP address. This address, operating at Layer 3, allows one computer to locate another computer on a network. All computers also have a unique physical address, known as a MAC address. These are assigned by the manufacturer of the network interface card. MAC addresses operate at 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, the address is usually written as four decimal numbers separated by periods. For example, an IP address of one computer is 192.168.1.2. Another computer might have the address 128.10.2.1. This way of writing the address is called the dotted decimal format. In this notation, each IP address is written as four parts separated 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 be 11000000.10101000.00000001.00001000 in binary notation. The dotted decimal notation is an easier method to understand than the binary ones and zeros method. This dotted decimal notation also prevents a large number of transposition errors that would result if only the binary numbers were used. Using dotted decimal allows number patterns to be more easily understood. Both the binary and decimal numbers in the Figure represent the same values, but it is easier to see in dotted decimal notation. This is one of the common problems found in working directly with binary number. The long strings of repeated ones and zeros make transposition and omission errors more likely. It is easy to see the relationship between the numbers 192.168.1.8 and 192.168.1.9, where 11000000.10101000.00000001.00001000 and 11000000.10101000.00000001.00001001 are not as easy to recognize. Looking at the binary, it is almost impossible to see that they are consecutive numbers IPv4 addressing A router forwards packets from the originating network to the destination network using the IP protocol. The packets must include an identifier for both the source and destination networks. Using the IP address of destination network, a router can deliver a packet to the correct network. When the packet arrives at a router connected to the destination network, the router uses the IP address to locate the particular computer connected to that network. This system works in much the same way as the national postal system. When the mail is routed, it must first be delivered to the post office at the destination city using the zip code. That post office then must locate the final destination in that city using the street address. This is a two-step process. Accordingly, every IP address has two parts. One part identifies the network where the system is connected, and a second part identifies that particular system on the network.

This kind of address is called a hierarchical address, because it contains different levels. An IP address combines these two identifiers into one number. This number must be a unique number, because duplicate 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 A addresses are assigned to larger networks. Class B addresses are used for medium-sized networks and Class 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 addresses To 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 is broken down into a network part and a host part. A bit or bit sequence at the start of each address determines 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 host addresses available. Class A IP addresses use only the first octet to indicate the network address. The remaining 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 be represented is 00000000, decimal 0. The highest number that can be represented is 01111111, decimal 127. The numbers 0 and 127 are reserved and cannot be used as network addresses. Any address that starts 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 to send 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 B IP address uses the first two of the four octets to indicate the network address. The other two octets specify host addresses. The first two bits of the first octet of a Class B address are always 10. The remaining six bits may be populated with either 1s or 0s. Therefore, the lowest number that can be represented with a Class B address is 10000000, decimal 128. The highest number that can be represented is 10111111, decimal 191. Any address that starts with a value in the range of 128 to 191 in the first octet is a Class B address.

The Class C address space is the most commonly used of the original address classes. This address space 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 is 11000000, decimal 192. The highest number that can be represented is 11011111, decimal 223. If an address 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 a unique network address that directs packets with that destination address to predefined groups of IP addresses. Therefore, a single station can simultaneously transmit a single stream of data to multiple recipients. The Class D address space, much like the other address spaces, is mathematically constrained. The first four bits of a Class D address must be 1110. Therefore, the first octet range for Class D addresses is 11100000 to 11101111, or 224 to 239. An IP address that starts with a value in the range of 224 to 239 in the first octet is a Class D address. A Class E address has been defined. However, the Internet Engineering Task Force (IETF) reserves these addresses for its own research. Therefore, no Class E addresses have been released for use in the Internet. 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

A B C D E

0 7 bits Network Address 10 110 1110 1111 14 bits Network Address

24 bits Host Address 16 bits Host Address 8 bits Host Address

21 bits Network Address

Multicast address (224.0.0.0-239.255.255.255) Reserved for future use

8 Bits 8 Bits 8 Bits 8 Bits


Class-A: Class-B: Class-C: Class-D: Class-E: 00000000 10000000 11000000 11100000 11110000 01111111 10111111 11011111 11101111 11111111 0-127 128-191 192-223 224-239 240-255

Reserved IP addresses Certain 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 itself In 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 the local area network as 198.150.11.0. The only time that the host numbers matter is when the data is on the local 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 network
In the Figure, the section that is identified by the upper box represents the 198.150.11.255 broadcast address. 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 the upper 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 A network example, 113.0.0.0 is the IP address of the network, known as the network ID, containing the host 113.1.2.3. A router uses the network IP address when it forwards data on the Internet. In a Class B network 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 are attached to the network. The IP address, 176.10.0.0, is an example of a network address. This address is never assigned as a host address. A host address for a device on the 176.10.0.0 network might be 176.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 a source sends data to all devices on a network. To ensure that all the other devices on the network process the 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 of 176.10.255.255. This is because 255 is the decimal value of an octet containing 11111111.

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 network addresses. In the Figure below, there is an issue with the network addressing scheme. In looking at the networks, both have a network address of 198.150.11.0. The router in this illustration will not be able to forward 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 longer exists and has been succeeded by the Internet Assigned Numbers Authority (IANA). IANA carefully manages the remaining supply of IP addresses to ensure that duplication of publicly used addresses does not occur. Duplication would cause instability in the Internet and compromise its ability to deliver packets to networks. Public IP addresses are unique. No two machines that connect to a public network can have the same IP address because public IP addresses are global and standardized. All machines connected to the Internet agree 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 addressing schemes, 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 IP addresses. As mentioned, public networks require hosts to have unique IP addresses. However, private networks that are not connected to the Internet may use any host addresses, as long as each host within the private network is unique. Many private networks exist alongside public networks. However, a private network using just any address is strongly discouraged because that network might eventually be connected 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 C addresses. Addresses that fall within these ranges are not routed on the Internet backbone. Internet routers immediately discard private addresses. If addressing a non-public intranet, a test lab, or a home

network, these private addresses can be used instead of globally unique addresses. Private IP addresses can be intermixed with public IP addresses. This will conserve the number of addresses used for internal connections. Connecting a network using private addresses to the Internet requires translation of the private addresses to public addresses. This translation process is referred to as Network Address Translation (NAT). A router usually is the device that performs NAT. Introduction to subnetting Subnetting is another method of managing IP addresses. This method of dividing full network address classes into smaller pieces has prevented complete IP address exhaustion. It is important to understand subnetting as a means of dividing and identifying separate networks throughout the LAN. It is not 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 and break a large network up into smaller, more efficient and manageable segments, or subnets. An example would be the U.S. telephone system which is broken into area codes, exchange codes, and local numbers.

The system administrator must resolve these issues when adding and expanding the network. It is important to know how many subnets or networks are needed and how many hosts will be needed on each 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 and the host field are created from the original host portion for the entire network. The ability to decide how to divide the original host portion into the new subnet and host fields provides addressing flexibility for the network administrator. To create a subnet address, a network administrator borrows bits from the host field and designates them as 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 number would 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 this offered adequate scalability. Unfortunately, the designers of TCP/IP could not have predicted that their protocol would eventually sustain a global network of information, commerce, and entertainment. Over twenty years ago, IP Version 4 (IPv4) offered an addressing strategy that, although scalable for a time, resulted in an inefficient allocation of addresses.

The Class A and B addresses make up 75 percent of the IPv4 address space, however fewer than 17,000 organizations can be assigned a Class A or B network number. Class C network addresses are far more numerous than Class A and Class B addresses, although they account for only 12.5 percent of the possible four billion IP addresses. Unfortunately, Class C addresses are limited to 254 usable hosts. This does not meet the needs of 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 the burden 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 specific concerns: Exhaustion of the remaining, unassigned IPv4 network addresses. At the time, the Class B space was on the verge of depletion. The rapid and large increase in the size of Internet routing tables occurred as more Class C networks came online. The resulting flood of new network information threatened the ability of Internet routers to cope effectively.

IA A N
InterN IC A erica m R E IP E urope A N P IC A sia
R io al eg n

N atio al n

L cal o Cn m o su er

Over the past two decades, numerous extensions to IPv4 have been developed. These extensions are specifically designed to improve the efficiency with which the 32-bit address space can be used. Two of the 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 been defined and developed. IPv6 uses 128 bits rather than the 32 bits currently used in IPv4. IPv6 uses hexadecimal numbers to represent the 128 bits. IPv6 provides 640 sextrillion addresses. This version of IP should provide enough addresses for future communication needs. IPv6 fields are 16 bits long. To make

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 hexadecimal digits. 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 upper layers. In this way, MAC addresses and IP addresses act as checks and balances for each other. After devices determine the IP addresses of the destination devices, they can add the destination MAC addresses to the data packets. Some devices will keep tables that contain MAC addresses and IP addresses of other devices that are connected to the same LAN. These are called Address Resolution Protocol (ARP) tables. ARP tables are stored in RAM memory, where the cached information is maintained automatically on each of the devices. It is very unusual for a user to have to make an ARP table entry manually. Each device on a network maintains its own ARP table. When a network device wants to send data across the network, it uses 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 IP address to destination MAC address, it will associate the IP address to the MAC address and then uses it to 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 encapsulated data. One way is to monitor the traffic that occurs on the local network segment. All stations on an Ethernet 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 the network, the address pairs populate the ARP table. Another way to get an address pair for data transmission is to broadcast an ARP request. The computer that requires an IP and MAC address pair broadcasts an ARP request. All the other devices on the local area network analyze this request. If one of the local devices matches the IP address of the request, it sends back an ARP reply that contains its IP-MAC pair. If the IP address is for the local area network and the computer does not exist or is turned off, there is no response to the ARP request. In this situation, the source device reports an error. If the request is for a different IP network, there is another process that can be used.

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 the MAC address of the interface, on which the request was received, to the requesting host. The router responds with the MAC addresses for those requests in which the IP address is not in the range of addresses 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 a default 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 and its own IP address to determine if the two IP addresses are located on the same segment. If the receiving host is not on the same segment, the source host sends the data using the actual IP address of the destination and the MAC address of the router. The MAC address for the router was learned from the ARP table 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 can leave the local area network. One or the other is required to have a connection outside of the local area network. Establishing the subnet mask address Selecting 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 octet is 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 the subnetwork. These bits are referred to as the last two significant bits. Use of all the available bits to create subnets, except these last two, will result in subnets with only two usable hosts. This is a practical address conservation method for addressing serial router links. However, for a working LAN this would result in prohibitive equipment costs. The subnet mask gives the router the information required to determine in which network and subnet a particular host resides. The subnet mask is created by using binary ones in the host octet or octets. The subnet octet or octets are determined by adding the position value of the bits that were borrowed. If three bits were borrowed, the mask for a Class C address would be 255.255.255.224. This mask may also be represented, 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 the largest subnetwork requires and the number of subnetworks needed. As an example, the network requires 30 hosts and five subnetworks. A shortcut to determine how many bits to reassign is by using the subnetting chart. By consulting the row titled Usable hosts, the chart indicates that for 30 usable hosts three bits are required. The chart also shows that this creates six usable subnetworks, which will satisfy the requirements of this scheme. The difference between usable hosts and total hosts is a result of using the 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, can recover many of these lost addresses. The method that was used to create the subnet chart can be used to solve all subnetting problems. This method 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 for subnet id and subnet broadcast)

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


(25) 2 = 30

Applying the subnet mask


Once 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 subnet field. 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. The subnetwork ID of subnet zero is the same as the major network number, in this case 192.168.10.0. The broadcast ID for the whole network is the largest number possible, in this case 192.168.10.255. The third number that is given is the subnetwork ID for subnet number seven. This number is the three network octets with the subnet mask number inserted in the fourth octet position. Three bits were assigned to the subnet field with a cumulative value of 224. The ID for subnet seven is 192.168.10.224. By inserting these numbers, 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 will result in 32 total hosts assigned to each subnet. This information provides the step count for each subnetwork ID. Adding 32 to each preceding number, starting with subnet zero, the ID for each subnet is established. 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 real number in the world of networking. The balance of the broadcast ID column can be filled in using the same process that was used in the subnetwork ID column. Simply add 32 to the preceding broadcast ID of the subnet. Another option is to start at the bottom of this column and work up to the top by subtracting one from the preceding subnetwork ID. Subnetting Class A and B networks The Class A and B subnetting procedure is identical to the process for Class C, except there may be significantly more bits involved. The available bits for assignment to the subnet field in a Class A address is 22 bits while a Class B address has 14 bits.

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 bits were assigned in the fourth octet resulting in 240. Recall that the slash mask is the sum total of all bits assigned 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 appear identical. Unless the mask is related to a network address it is not possible to decipher how many bits were 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 borrowed Total hosts= 2 to the power of the bits remaining Usable subnets = 2 to the power of the bits borrowed minus 2 Usable hosts= 2 to the power of the bits remaining minus 2 Calculating the resident subnetwork through ANDing Routers 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 subnetwork ID 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 in binary. 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 development of flexible and workable schemes. A variety of subnet calculators are available on the web. However, a network administrator must know how to manually calculate subnets in order to effectively design the network scheme and assure the validity of the results from a subnet calculator. The subnet calculator will not 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, scalable addressing schemes. With the phenomenal growth of the Internet and TCP/IP, virtually every enterprise must now implement an IP addressing scheme. Many organizations select TCP/IP as the only routed protocol to run on their network. Unfortunately, the architects of TCP/IP could not have predicted that their protocol would eventually 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

space, is slowly being implemented in select networks and may replace IPv4 as the dominant protocol of the Internet. Over the past two decades, engineers have successfully modified IPv4 so that it can survive the exponential growth of the Internet. VLSM is one of the modifications that has helped to bridge the gap between IPv4 and IPv6. Networks must be scalable in order to meet the changing needs of users. When a network is scalable it is able to grow in a logical, efficient, and cost-effective way. The routing protocol used in a network does much 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 not scalable to large networks because of inherent limitations. To overcome these limitations yet maintain the simplicity 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 more efficiently. One technique is called Variable-Length Subnet Masks (VLSM). With VLSM, a network administrator can use a long mask on networks with few hosts, and a short mask on subnets with many hosts. In order to use VLSM, a network administrator must use a routing protocol that supports it. Cisco routers support VLSM with Open Shortest Path First (OSPF), Integrated Intermediate System to Intermediate System (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 maximize addressing efficiency. Classful routing protocols require that a single network use the same subnet mask. Therefore, network 192.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 subnet masks. 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 space In 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 occur when a network and a subnet have the same addresses. The same was true with the use of the last subnet, 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 address depletion has become of real concern, it has become acceptable practice to use the first and last subnets in a subnetted network in conjunction with VLSM. In this network, the network management team has decided to borrow three bits from the host portion of the 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. If the management decides to use the no ip subnet-zero command, it has seven usable subnets with 30 hosts in each subnet. From Cisco IOS version 12.0, remember that Cisco routers use subnet zero by default. Such an addressing scheme is fine for a small LAN. However, this addressing scheme is extremely wasteful if using point-to-point connections.

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-point links. This time the networking team decided to avoid their wasteful use of the /27 mask on the point-to-point links. 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 of variable 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 three subnets 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. This time the team uses a 30-bit mask.

Calculating subnets with VLSM VLSM helps to manage IP addresses. VLSM allows for the setting of a subnet mask that suits the link or the segment requirements. A subnet mask should satisfy the requirements of a LAN with one subnet 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 250 hosts each. If the routers are using a classful routing protocol the WAN link would need to be a subnet of the same Class B network, assuming that the administrator is not using IP unnumbered. Classful routing protocols such as RIP v1, IGRP, and EGP are not capable of supporting VLSM. Without VLSM, the WAN link 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 252 addresses wasted. If VLSM were used in this example, a 24-bit mask would still work on the LAN segments for the 250 hosts. A 30-bit mask could be used for the WAN link because only two host addresses are needed. In the Figure the subnet addresses used are those generated from subdividing the 172.16.32.0/20 subnet 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 a prefix of /30. This prefix allows for only two hosts, just enough hosts for a point-to-point connection between a pair of routers. To calculate the subnet addresses used on the WAN links, further subnet one of the unused /26 subnets. In this example, 172.16.33.0/26 is further subnetted with a prefix of /30. This provides four more subnet 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 subnet address 172.16.32.0/20 and a network needing ten host addresses. With this subnet address, there are over 4000 (212 2 = 4094) host addresses, most of which will be wasted. With VLSM it is possible to further 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 of which 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 subnet boundary 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 to highest 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 a subnet is used, that subnet cannot be further subnetted. In the example, four subnet numbers are used on the LANs. Another unused subnet, 172.16.33.0/26, is further subnetted for use on the WANs.

Route aggregation with VLSM When 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 that the 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 also promotes route aggregation, or summarization. Without route summarization, Internet backbone routing would likely have collapsed sometime before 1997. Figure illustrates how route summarization reduces the burden on upstream routers. This complex hierarchy of variable-sized networks and subnetworks is summarized at various points, using a prefix address, until the entire network is advertised as a single aggregate route, 200.199.48.0/22. Route summarization, 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 and bit mask in the routing updates. In Figure , the summary route that eventually reaches the provider contains a 20-bit prefix common to all of the addresses in the organization, 200.199.48.0/22 or 11001000.11000111.0011. For summarization to work properly, carefully assign addresses in a hierarchical fashion so that summarized addresses will share the same high-order bits. Configuring VLSM If 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 portion of the address. Six bits will yield 62 possible host addresses, 26 = 64 2 = 62, so the division was 192.168.10.0/26. The Sydney and Singapore routers have to support 12 hosts each. In these cases, a minimum of four bits are 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 division here is 192.168.10.64/27. The following are the point-to-point connections:

Perth to Kuala Lumpur 192.168.10.128/30 Since only two addresses are required, a minimum of two 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.128/30. Sydney to Kuala Lumpur 192.168.10.132/30 Since only two addresses are required, a minimum of two 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.132/30. Singapore to Kuala Lumpur 192.168.10.136/30 Since only two addresses are required, a minimum of two 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 example for Singapore to Kuala Lumpur is configured as follows: Singapore(config)#interface serial 0 Singapore(config-if)#ip address 192.168.10.137 255.255.255.252 KualaLumpur(config)#interface serial 1 KualaLumpur(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 one aggregate 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 the summary 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 the summary 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 is CIDR -- Classless InterDomain Routing. CIDR was invented several years ago to keep the internet from running 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 B address block of 65533 host addresses. Even more wasteful were companies and organizations that were allocated Class A address blocks, which contain over 16 Million host addresses! Only a tiny percentage of the allocated Class A and Class B address space has ever been actually assigned to a host computer on the Internet. People realized that addresses could be conserved if the class system was eliminated. By accurately allocating only the amount of address space that was actually needed, the address space crisis could be avoided for many years. This was first proposed in 1992 as a scheme called Supernetting. Under supernetting, 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 1000 addresses, I could supernet 4 Class C networks together: 192.60.128.0 (11000000.00111100.10000000.00000000) Class C subnet address 192.60.129.0 (11000000.00111100.10000001.00000000) Class C subnet address 192.60.130.0 (11000000.00111100.10000010.00000000) Class C subnet address 192.60.131.0 (11000000.00111100.10000011.00000000) Class C subnet address -------------------------------------------------------192.60.128.0 (11000000.00111100.10000000.00000000) Supernetted Subnet address 255.255.252.0 (11111111.11111111.11111100.00000000) Subnet Mask 192.60.131.255 (11000000.00111100.10000011.11111111) Broadcast address

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 22 bits 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 bits of 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 the address. If you look at the subnet mask in binary (11111111.11111111.11111100.00000000), you can easily see how this notation works. The use of a CIDR notated address is the same as for a Classful address. Classful addresses can easily be 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) are then allocated networks from the big ISP's pool. That way, all the big ISP's customers (and their customers, 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. After that, IPv6, with 128 bit addresses, will be needed. Under IPv6, even sloppy address allocation would comfortably allow a billion unique IP addresses for every person on earth! The complete and gory details of CIDR are documented in RFC1519, which was released in September of 1993. Without CIDR

NP A

1 8 .0 th u h 9 .0 .0 ro g 1 8 5 .2 5 9 .2 5 5 .0 IS 3 P 1 8 2 .0th u h 9 .3 .0 ro g 1 8 2 5 .0 9 .3 .2 5 IS 1 P 1 8 2 .0 9 .3 .1 1 8 2 .0 9 .3 .2 1 8 2 .0 9 .3 .3 1 8 3 .0th u h 9 .3 .0 ro g 1 8 3 5 .0 9 .3 .2 5 IS 2 P 1 8 3 .0 9 .3 .1

With CIDR

N P A

198.0.0.0/8 IS 3 P

198.32.0.0/16 IS 1 P 198.32.1.0 198.32.2.0 198.32.3.0

198.33.0.0/16 IS 2 P

198.33.1.0

Summary 1. 2. 3. 4. 5. The IP address is of the form <networkID,hostID>. The address is not really separated but is read as a whole. The address is 32 bits in length which is further separated into 4 bytes of 8 bits each. The address can be expressed in decimal, octal, hexadecimal or binary. 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 Classless Classful Original style of addressing based on first few bits of the address. Generally used in customer sites. Classless A new type of addressing that disregards the class bit of an address and applies a variable 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.0 Used as source address in a boot (BOOTP/DHCP) configuration request. Also denotes the default route in a routing table.

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 the network portion of the address. The format of subnetted IP address would be <network number, subnet number, host number> 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. the length of subnet mask for the subnets will also vary. The method of achieving subnetting, with variable length of subnet mask, is known as Variable Length Subnet Mask. Subnetting is based on the following: Hosts Subnets Serial Lines Routing 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-C Fewer than 512 addresses 2 contiguous Class-C Fewer than 1024 addresses 4 contiguous Class-C Fewer than 2048 addresses 8 contiguous Class-C Fewer 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 its members 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 (RFC 1918): 10.0.0.0 - 10.255.255.255 (10.0.0.0/8 prefix) 24-bit block Complete class-A network number 172.16.0.0 - 172.31.255.255 (172.16.0.0/12 prefix) 20-bit block Set of 16 contiguous class-B network numbers 192.168.0.0 - 192.168.255.255 (192.168.0.0/16 prefix) 16-bit block

Vous aimerez peut-être aussi