0% found this document useful (0 votes)
46 views

IP Addressing and Subnetting For New Users - Cisco

Uploaded by

Rifat Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
46 views

IP Addressing and Subnetting For New Users - Cisco

Uploaded by

Rifat Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 11
zrnv2016 IP ressing and Subnet for New Users - Cisco Home | Skipto content | Skip to footer othiertys o IP Addressing and Subnetting for New Users Update ug 10, 201Bocument ID: 1456953685377642 Contents Introduction Prerequisites Requirements Components Used Additional Information Understand IP Addresses Network Masks Understand Subnetting Examples Sample Exercise 1 Sample Exercise 2 VLSM Example VLSM Example CIDR Appendix Sample Config Router A Router B Host/Subnet Quantities Table Related Information Introduction This document provides basic information needed in order to configure your router for routing IP, such as how adresses are broken down and how subnetting works. You leam how to assign each interface on the router an IP address with a unique subnet. There are examples included in order to help tie everything together. Prerequisites Requirements Cisco recommends that you have a basic understanding of binary and decimal numbers. Components Used This document is not restricted to specific software and hardware versions. ‘The information in this document was created from tho dovices in a specific lab environment. All of the davices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command Additional Information If definitions are helpful to you, use these vocabulary terms in order to get you started: ‘Address - The unique number ID assigned to one host or interface in a network. hnpilwwn.cisco.conveferWus'supportics/ploutng-nformaton-protocl-rip!13788-3.hml am zrii2a16 IP Adéressing and Subtirg for New Users - Cisco ‘Subnet - A portion of a network that shares a particular subnet address. ‘Subnet mask - A 32-bit combination used to describe which portion of an address refers to the subnet and which part refers to the host. Interface - A network connection. I you have already received your legitimate address(es) from the Intemet Network Information Center (InterNIC), you are ready to begin. If you do not plan to connect to the Intemel, Cisco strongly suggests that you use reserved addresses from RFC 1918 cP. Understand IP Addresses ‘An IP address is an address used in order to uniquely identify a device on an IP network, The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits), Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary. Here is how binary octets convert to decimal: The right most bit, or least significant bit, of an octet holds a value of 2°, The bit just to the left ofthat holds a value of 2". This continues until the left-most bit, or most significant bit, Which holds a value of 27. So if all binary bits are a one, the decimal equivalent would be 255 as shown here: aaa Here is a sample octet conversion when not all of the bits are set to 1 And this sample shows an IP address represented in both binary and decimal. 10 1 2a 19. (decinall ‘These octets are broken down to provide an addressing scheme that can accommodate large and small networks, ‘There are five different classes of networks, A to E, This document focuses on classes A to C, since classes D and E are reserved and discussion of them is beyond the scope of this document, Note: Also note that the terms "Class A, Class B” and so on are used in this document in order to help facilitate the understanding of IP addressing and subnetting. These terms are rarely used in the industry anymore because of the introduction of classless interdomain routing (CIDR). Given an IP address, its class can be determined from the three high-order bits (the three left-most bits in the first ‘octel), Figure 1 shows the significance in the three high order bits and the range of addresses that fal into each class. For informational purposes, Class D and Class E addresses are also shown. Figure 1 hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml am zrini2a16 IP Adéressing and Subtirg for New Users - Cisco cee ome [Fe 4SETONZZ4SHTOTZ2 34567 JAIL TP IE TP et euns fel aie Bits Node) | y92.00.0-220.255.255255 ———_ rt» —_______, Or aa4SH7 OZ 24 Se TONR EES ETOTA 34567 111 PEPE UTAI LITT I Ie cus [Tite turieast Group 0 (28 bts) 224.00.0-239.255.258255, Mutticast deserorzsasarorzsacer eee oao-sssamassass Reserved fo futore uae (7 bits) Experimental Ina Class A address, the first octet is the network portion, so the Class A example in Figure 1 has a major network address of 1.0.0.0 - 127.255.255.255. Octets 2, 3, and 4 (the next 24 bits) are for the network manager to divide into ‘subnets and hosts as he/she sees fit. Class A addresses are used for networks that have more than 65,536 hosts (actually, up to 16777214 hosts!) Ina Class B address, the first two octets are the network portion, so the Class B example in Figure 1 has a major network address of 128.0.0.0 - 191.255.255.255. Octets 3 and 4 (16 bits) are for local subnets and hosts. Class B addresses are used for networks that have between 256 and 65534 hosts. Ina Class C address, the first three octets are the network portion. The Class C example in Figure 1 has a major network address of 192,0.0.0 - 223.255.255.255. Octet 4 (8 bits) is for local subnets and hosts - perfect for networks. with less than 254 hosts Network Masks Annetwork mask helps you know which portion of the address identifies the network and which portion of the address identifies the node. Class A, B, and C networks have default masks, also known as natural masks, as shown here: An IP address on a Class A network that has not been subnetted would have an address/mask pair similar to: 8.20.15.1 255.0.0.0. In order to see how the mask helps you identify the network and node parts of the address, convert the address and mask to binary numbers, 8.20,19.1 ~ 00901900.900:0100, 90001111 ,a090000 255.0.0.0 121,09000000.0 oaooa00 (Once you have the address and the mask represented in binary, then identification of the network and host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the network ID. Any address bits that have corresponding mask bits set to 0 represent the nade ID. 8.20.15.1 - 00001000.000:0100.00001121 .ooa00002 255.0,0.9 = 11111121,00000000, 09000000.00900000 hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml an zrii2a16 IP Adéressing and Subtirg for New Users - Cisco Understand Subnetting ‘Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you do not subnet, you are only able to use one network from your Class A, B, or C network, which is unrealistic, Each data link on a network must have a unique network 1D, with every node on that link being a member of the same network. If you break a major network (Class A, B, or C) into smaller subnetworks, it allows you to create 2 network of interconnecting subnetworks. Each data link on this network would then have a unique network/subnetwork ID. Any device, or gateway, that connects n networks/subnetworks has n distinct IP addresses, ‘one for each network / subnetwork that it interconnects. In order to subnet a network, extend the natural mask with some of the bits {rom the host ID portion of the address in order to create a subnetwork ID. For example, given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner: 111100000 295.255.255.224 - By extending the mask to be 255.255.255.224, you have taken three bits (Indicated by “sub") from the original host portion of the address and used them to make subnets, With these three bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of all zeros or all ones are not allowed (it is very important to remember this). So, with this in mind, these subnets have been created. 0 295.255.255.224 host address range 1 to 30 32 295.289.25 ost 32 to 62 204 204.17.5.96 255.255.255.224 host 97 eo 126 204.17.5,128 255.255.255.224 host addvees range 129 to 158 zou.a7. 259.255.255.224 host ad 0 190 zona? 255.295.255.224 host addvess range 193 to 222 @ range 225 to 204.17.5.228 255.255.255.224 host adds 4 Note: There are two ways to denote these masks, First, since you use three bits more than the “natural” Class C mask, you can denote these addresses as having a 3-bit subnet mask. Or, secondly, the mask of 255.258.255.224 can also be denoted as /27 as there are 27 bits that are set in the mask. This second method is used with CIDR, With this method, one of these networks can be described with the notation prefix/length. For example, 204.17.5.32/27 denotes the network 204.17.5.92 255.255.255.224. When ‘appropriate, the prefix/length notation is used to denote the mask throughout the rest of this document. The network subnetting scheme in this section allows for eight subnets, and the network might appear as: Figure 2 204.17.5.32027 208.17.5.12827 204.17.564/27 5 7 204.17.5.160°27 gs] * naazsonr ~ — |.193 204.17.5.20127 204.17.5.192027 Notice that each of the routers in Figure 2 is attached lo four subnetworks, one subnetwork is common to both routers. Also, each router has an IP address for each subnetwork to which it is attached. Each subnetwork could potentially support up to 30 host addresses. hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml ant zrii2a16 IP Adressing and Subnet for New Users - Cisco This brings up an interesting point. The more host bits you use for a subnet mask, the more subnets you have. available. However, the more subnets available, the less host addresses available per subnet. For example, a Class C network of 204,17,5.0 and a mask of 255.255.255.224 (/27) allows you to have eight subnets, each with 32 host addresses (30 of which could be assigned to devices). If you use a mask of 255.255.255.240 (/28), the break down 204.17.5.0 = 259.259.295.240 ~ Since you now have four bits to make subnets with, you only have four bits left for host addresses. So in this case you can have up to 16 subnets, each of which can have up {o 16 host addresses (14 of which can be assigned to devices) Take a look at how a Class 8 network might be subnetted, If you have network 172,16,0.0 ,then you know that its natural mask is 255.255.0.0 or 172, 16.0.0/16. Extending the mask to anything beyond 255.255.0.0 means you are subnetting. You can quickly see that you have the ability to create a lot more subnets than with the Class C network, If you use a mask of 255.255.248.0 (/21), how many subnets and hosts per subnet does this allow for? 285.285.248.0 - 11211211.11211111.11111000, 99000000, You use five bits from the original host bits for subnets. This allows you to have 32 subnets (28). After using the five bits for subnetting, you are left with 11 bits for host addresses. This allows each subnet so have 2048 host addresses (2"), 2046 of which could be assigned to devices, Note: In the past, there were limitations to the use of a subnet 0 (all subnet bits are set to zero) and all ones subnet (all subnet bits set to one). Some devices would not allow the use of these subnets. Cisco Systems devices allow the use of these subnets when the Ip subnet zero command is configured, Examples Sample Exercise 1 Now that you have an understanding of subnetting, put this knowledge to use. In this example, you are given two address / mask combinations, written with the prefix/lenath notation, which have been assigned to two devices, Your task is to determine if these devices are on the same subnet or different subnets. You can use the address and mask of each device in order to determine to which subnet each address belongs. Device: 172.16.17.20/20 DeviceB: 172.16.26.15/20 Determine the Subnet for DevicoA: 16.17.30 - 0101100 10902 .000: Looking at the address bits that have a corresponding mask bit set to one, and setting all the other address bits to Zero (this is equivalent to performing a logical "AND" between the mask and address), shows you to which subnet this address belongs. In this case, DeviceA belongs to subnet 172.16.16.0. Determine the Subnet for DeviceB: 16.28 2 = 10101200, 0020000. 000 260.0 = undsii21j2a1aanat.at net 0101100 eub 0ai0900. co00000: From these determinations, DeviceA and DeviceB have addresses that are part of the same subnet, Sample Exercise 2 hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml si zrii2a16 IP Adéressing and Subtirg for New Users - Cisco Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in Figure 3 with the host requirements shown. Figure 3 nett: 14 hosts net0:7 hosts netC: 2hosts netB: 28 hosts net: 28 hosts Looking at the network shown in Figure 3, you can see that you are required to create five subnets. The largest subnet must support 28 host addresses. Is this possible with a Class C network? and if so, then how? You can statt by looking at the subnet requirement. In order to create the five needed subnets you would need to use three bits from the Class C host bits. Two bits would only allow you four subnets (2?). 1@ address, How many hosts Since you need three subnet bits, that leaves you with five bits for the host portion of t does this support? 2 = 32 (80 usable). This meets the requirement, ‘Therefore you have determined that itis possible to create this network with a Class C network. An example of how you might assign the subnetworks is: notB: 32/2 address etc 61/27 addeese net 3.96/27 © address ete 128/ address VLSM Example In all of the previous examples of subnetting, notice that the same subnet mask was applied for all the subnets. ‘This means that each subnet has the same number of available host addresses. You can need ths in some cases, but, in most cases, having the same subnet mask for all subnets ends up wasting address space, For example, in the Sample Exercise 2 section, a class C network was split into eight equal-size subnets; however, each subnet did not utilize all available host addresses, which results in wasted address space. Figure 4 illustrates this wasted addross space, Figure 4 hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml ant arian6 1P Adéressing and Subnet for New Users - Cisco Network 204.15.5.0/24 NetA: 204.15.5.0/27 NetB: 204.19.5.32/27 NotC: 204.15.5.64/27 NetD: 204.15.5.96/27 Net: 204.15.5.128/27 204.15.5.160/27 raiassam7 subnet 204.15.5.224/27 host addresses allocated host addresses unused Figure 4 illustrates that of the subnets that are being used, Net, NetC, and NetD have a lot of unused host address space. It is possible that this was a deliberate design accounting for future growth, but in many cases this is just wasted address space due to the fact that the same subnet mask is used for all the subnets. Variable Length Subnet Masks (VLSM) allows you to use different masks for each subnet, thereby using address space efficiently. VLSM Example Given the same network and requirements as in Sample Exercise 2 develop a subnetting scheme with the use of VLSM, given: not support 16 hosts Determine what mask allows the required number of hosts, The easiest way to assign the subnets is to assign the largest first. For example, you can assign in this manner: net range 1 t0 30 net hipiiwww.cisco.convelewus'suppertidocs/poutng-nformaton-protoclripi13788-3.hml am am 016 1P Adéressing and Subnet for New Users - Cisco This can be graphically represented as shown in Figure 6: Figure 5 Network 204.15.6.0/24 NetE: 204.19.9.32/27 NetA: 204.15.5.64/28 NetD: 204.15.5.80/28 Net: 204.15.5.98.130 rosorved for future use Figure 6 illustrates how using VLSM helped save more than half of the address space, CIDR Classless Interdomain Routing (CIDR) was introduced in order to imorove both address space utlization and routing scalability in the Intemet, It was needed because of the rapid growth of the Internet and growth of the IP routing {ables held in the Intemet routers. CIDR moves way from the traditional IP classes (Class A, Class 8, Class C, and so on). In CIDR , an IP network is represented by a prefix, which is an IP address and some indication of the length of the mask. Length means the number of left-most contiguous mask bits that are set to one, So network 172,16.0.0 255,255,0.0 can be represented as 172.16.0.0116, CIDR also depicts a more hierarchical Intemet architecture, where each domain takes its IP addresses from a higher level. Ths allows for the summarization of the domains to be done at the higher level, For example, if an ISP owns network 172,16.0.0/16, then tho ISP can offer 172,16.1.0124, 172.16.2.0/24, and 50 on to customers. Yet, when advertising to other providers, the ISP only needs to advertise 172.16.0.0176. For more information on CIDR, see RFC 1518 oF and RFC 1519 oF Appendix Sample Config Routers A and B are connected via serial interface. Router A Hevbret 60 ° hnipitwwu.cisco.comiciertus'supportidostproutng-inormaton-protoclrip!13788-3.hml an zrii2a16 IP Adressing and Subnet for New Users - Cisco ip address 172.16.65.1 255.255.285.0 (subnet 65), 15 0 connects te router 2 router 3p network 272.16.0.0 Router B noatname couterb ip routing ip address 192.1.10.200 2! H(eabret 192) sated ip address 152,1,10.66 258.285.25! Heubree 66) int #0 \dress 172-16.65.2 (same subs 0 connecte Lo router A souter rip network 192.1.10.0 network 172.16.0.0 255.755.240 as roster A's = 0) Host/Subnet Quantities Table clase B Effective Effective pots ack ‘Subnets 1 2255) 2 2 255 4 3 1255. 8 8190 4 1255 1s gga 5 255 32 ana. 6 1255. se 1022 7 255 128 510 a 255 256. 234 9 255 512 126 10 1255. 1024 62 a 1255 2048 20 2 1255. 2096 a fe 255 e192 6 ue 255 reaee 2 class © Effective Effective Foes Mask Hoses 1 255 2 126 2 1255 4 62 5 255 a 39 4 255 16 uu 5 255 32 6 6 255 6 2 ssapnet all zeroes and all Right rot be supported or sone Legacy s shost all zeroes and all ones excluded. 128 included. These Related Information IP Subnet Calculator ( registered customers only) IP Routing Protocols Technology Support Subnet Zero and the All-Ones Subnet Host and Subnet Quantities Technical Support & Documentation - Cisco Systems hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml ant zrii2a16 IP Adéressing and Subtirg for New Users - Cisco Contributed by Cisco Engineers Was this Document Helpful? Yes W Feedback Viewers of This Document Also Viewed Host and Subnet Quantities Subnet Zero and the Al-Ones Subnet Configuring IP Addressing + Show 3 More Let Us Help Open a Support Case @ (Requires a Cisco Service Contract) Ready to Replace an Old Switch? Upgrade your network and get discounts on replacement switches and support services Leam How Related Support Community Discussions Routing Information Protocol (RIP) Configuration on UC320W Last Reply 4 months ago in Voice Systems Configure Dynamic Routing using RIP for SRP520 Series Last Reply 4 months ago in Small Business Routers How to configure RIP v1 and RIP v2 Last Reply 7 years ago in WAN, Routing and Switching Cisco Support Community hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml 10H zrvan8 IP ressing and Subnet for New Users - Cisco Share © 2016 Cisco and/or its affiliates, All rights reserved. hnpilwwu.cisc0.conveferlus'supportics/plrouting-informaton-protocl-rip!13788-3.hml se

You might also like