1 / 65

Network layer (Part III)

Network layer (Part III). Basics of Subnetting : Classical IP Addressing. Network administrators sometimes need to divide networks, especially large ones, into smaller networks. These smaller divisions are called subnetworks and provide addressing flexibility.

obelia
Télécharger la présentation

Network layer (Part III)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network layer (Part III)

  2. Basics of Subnetting: Classical IP Addressing • Network administrators sometimes need to divide networks, especially large ones, into smaller networks. • These smaller divisions are called subnetworks and provide addressing flexibility. • Most of the time subnetworks are simply referred to as subnets

  3. Basics of Subnetting: Classical IP Addressing • Similar to the host number portion of Class A, Class B, and Class C addresses, subnet addresses are assigned locally, usually by the network administrator. • Also, like other IP addresses , each subnet address is unique.

  4. Basics of Subnetting: Subnetwork • Subnet addresses include the Class A, Class B, or Class C 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 original host portion and designates them as the subnet field.

  5. Figure 1

  6. Basics of Subnetting: Subnetwork • Internally, networks may be divided into smaller networks called sunetworks, or simply sub-nets. • By providing a third level of addressing, subnets provide extra flexibility for the network administrator. • For example, a class “B” network provided by the interNIC, can be broken up into many networks. • In this example, 131.108.1.0, 131.108.2.0 and 131.108.3.0 are all subnets within the network 131.108.0.0 • Figures 1 and 2 illustrate the hierarchical nature of subnet addresses. 

  7. Figure 2

  8. Basics of Subnetting: Subnetwork • 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 2. • If you were to borrow only 1 bit, to create a subnet, then you would only have a network number - the .0 network - and the broadcast number - the .1 network. • maximum number of bits that can be borrowed can be any number that leaves at least 2 bits remaining, for the host number. • In this example of a Class C IP Address, bits from the host field for the subnet field have been borrowed. 

  9. Basics of Subnetting: Purpose for subnetting • A primary reason for using subnets is to reduce the size of a broadcast domain. • Broadcasts are sent to all hosts on a network or subnetwork. • When broadcast traffic begins to consume too much of the available bandwidth, network administrators may choose to reduce the size of the broadcast domain.

  10. Basics of Subnetting:Subnet mask • The subnet mask (formal term: extended network prefix), tells the network devices which part of an address is the network field and which part is the host field. • A subnet mask is 32 bits long and has 4 octets, just like an IP address. 

  11. Basics of Subnetting:Subnet mask • To determine the subnet mask for a particular subnetwork IP address follow these steps. • (1) Express the subnetwork IP address in binary form. • (2) Replace the network and subnet portion of the address with all 1s. • (3) Replace the host portion of the address with all 0s. • (4) As the last step convert the binary expression back to dotted-decimal notation. • Note: The extended network prefix includes the class A, B, or C network number, plus the subnet field (or subnet number) that is being used to extend the routing information (which is otherwise just the network number).

  12. Basics of Subnetting: Boolean operations: AND, OR, and NOT • The term "operations" in mathematics refers to rules that define how one number combines with other numbers. • Decimal number operations include addition, subtraction, multiplication, and division. • There are related, but different, operations for working with binary numbers. • The basic Boolean operations are AND, OR, and NOT. • AND is like multiplication • OR is like addition • NOT changes 1 to 0, and 0 to 1

  13. Basics of Subnetting: Performing the AND function • The lowest numbered address in an IP network is the network address (the network number plus 0 in the entire host field). • This also applies to a subnet: the lowest numbered address is the address of the subnet.

  14. Basics of Subnetting: Boolean operations: AND, OR, and NOT • In order to route a data packet, the router must first determine the destination network/subnet address by performing a logical AND using the destination host's IP address and the subnet mask. • The result will be the network/subnet address. • In the Figure, the router has received a packet for host 131.108.2.2 - it uses the AND operation to learn that this packet should be routed to subnet 131.108.2.0.

  15. Creating a Subnet:Range of bits needed to create subnets • To create subnets, you must extend the routing portion of the address. • The Internet knows your network as a whole, identified by the Class A, B, or C address, which defines 8, 16, or 24 routing bits (the network number). • The subnet field will become additional routing bits, so that the routers within your organization can recognize different locations, or subnets, within the whole network

  16. Creating a Subnet :Range of bits needed to create subnets • Question: In the address 131.108.0.0, which are the routing bits?Answer: 131.108 - That's the 16 bit Class B network number. • Question: What are the other two octets (16 bits) of the address 131.108.0.0 used for? Answer: Well, as far as the Internet knows, that's just a 16 bit host field, because that's what a Class B address is - a 16 bit network number and a 16 bit host number.

  17. Creating a Subnet :Range of bits needed to create subnets • Question: What part of the address 131.108.0.0 is the subnet field?Answer:  When you decide to create subnets, you must divide the original host field (16 bits in the case of Class B) into two parts - the subnet field and the host field. This is sometimes referred to as "borrowing" some of the original host bits to create the subnet field. The other networks in the Internet won't care - they look at the address the same - all they really see is the Class A, B, or C network number, and send the packet on to its destination. The minimum number of bits that you can borrow is 2, regardless of whether you're working with a Class A, B, or C network1 because at least 2 bits must remain for host numbers2, the maximum varies by address class. 

  18. Creating a Subnet :Range of bits needed to create subnets

  19. Creating a Subnet :Range of bits needed to create subnets • The subnet field always follows immediately after the network number. • That is, the borrowed bits must be the first n bits of the default host field, where n is the desired size of the new subnet field.  • The subnet mask is the tool used by the router to determine which bits are routing bits and which bits are host bits

  20. Creating a Subnet :Range of bits needed to create subnets • Previous standards did not allow for the use of subnets obtained by borrowing 1 bit  (with only 1 subnet bit, the subnet field can only have two values: subnet 0 is part of the network address, and subnet 1 would be part of the network broadcast address) – although many devices can now support subnets obtained by borrowing 1 bit, it is still common practice to avoid doing this to insure compatibility with legacy devices; for our purposes here, you will always borrow at least 2 bits. • Similarly, a 1 bit host field would allow only for host 0, which is part of the network address, and host 1, which is part of the broadcast address, leaving 0 valid host addresses.

  21. Creating a Subnet: Determining subnet mask size • Subnet masks use the same format as IP addresses. • They are 32 bits long and are divided into four octets, written in dotted decimal format. • Subnet masks contain all 1s in the network bit positions (determined by the address class) as well as the desired subnet bit positions, and contain all 0s in the remaining bit positions, designating them as the host portion of an address.

  22. Creating a Subnet: Determining subnet mask size • By default, if you borrow no bits, the subnet mask for a Class B network would be 255.255.0.0, which is the dotted decimal equivalent of 1s in the 16 bits corresponding to the Class B network number. • If 8 bits were to be borrowed for the subnet field, the subnet mask would include 8 additional 1 bits, and would become 255.255.255.0.

  23. Creating a Subnet: Determining subnet mask size • For example, if the subnet mask 255.255.255.0 were associated with the Class B address 130.5.2.144 (8 bits borrowed for subnetting), the router would know to route this packet to subnet 130.5.2.0 rather than to just network 130.5.0.0

  24. Creating a Subnet: Determining subnet mask size • Another example is the Class C address 197.15.22.131, with a subnet mask of 255.255.255.224. • With a value of 224 in the final octet (11100000 in binary), the 24 bit Class C network portion has been extended by 3 bits, to make the total 27 bits. • The 131 in the last octet now presents the third usable host address in the subnet 197.15.22.128. • The routers in the Internet (that don't know the subnet mask) will only worry about routing to the Class C network 197.15.22.0, while the routers inside that network, knowing the subnet mask, will be looking at 27 bits to make a routing decision.

  25. Creating a Subnet: Computing subnet mask and IP address • Whenever you borrow bits from the host field, it is important to note the number of  additional subnets that are being created each time you borrow one more bit. • You have already learned that you cannot borrow only 1 bit; the fewest you may borrow is 2 bits.

  26. Creating a Subnet: Computing subnet mask and IP address • Borrowing 2 bits creates four possible subnets (22) (but you must always remember that there are two reserved/unusable subnets). Each time you borrow another bit from the host field, the number of subnets created increases by a power of 2.

  27. Creating a Subnet: Computing subnet mask and IP address • The eight possible subnets that are created by borrowing 3 bits is equal to 23 (2 x 2 x 2). • The sixteen possible subnets created by borrowing 4 bits is equal to 24 (2 x 2 x 2 x 2). • From these examples, it is easy to see that each time you borrow another bit from the host field, the number of possible subnets doubles.

  28. Creating a Subnet: Computing subnet mask and IP address • Question: How many bits are being borrowed (how long is the subnet field) for a Class B network using a subnet mask of 255.255.240.0?Answer: The first two octets of the mask (255.255) correspond with the 16 bits in a Class B network number. Remember that the subnet field is represented by all the additional "1" bits past that. The number 240 decimal is 11110000 in binary, and you can see that you are using 4 bits for the subnet field. • Question: How many possible subnets are there with a 4 bit subnet field?  Answer: Start with finding the smallest 4 bit number - 0000 - then the largest 4 bit number - 1111 (15). So the possible subnets are 0-15, or sixteen subnets. However, you know you cannot use subnet 0 (it's part of the network address), and you cannot use subnet 15 (1111) either (broadcast address). So this 4 bit subnet field gives you fourteen usable subnets (1-14).

  29. Creating a Subnet: Computing hosts per subnetwork • Each time you borrow 1 bit from a host field, there is 1 less bit remaining in the field that can be used for host numbers. • Specifically, each time you borrow another bit from the host field, the number of host addresses that you can assign decreases by a power of 2 (gets cut in half).

  30. Creating a Subnet: Computing hosts per subnetwork • To help you understand how this works, use a Class C network address as an example. • If there is no subnet mask, all 8 bits in the last octet are used for the host field. • Therefore, there are 256 (28) possible addresses available to assign to hosts (254 usable addresses, after you subtract the 2 you know you can't use). • Now, imagine that this Class C network is divided into subnets. If you borrow 2 bits from the default 8 bit host field, the host field decreases in size to 6 bits. • If you write out all of the possible combinations of 0s and 1s that could occur in the remaining 6 bits, you would discover that the total number of possible hosts that could be assigned in each subnet would be reduced to 64 (26). • The number of usable host numbers would be reduced to 62.

  31. Creating a Subnet: Computing hosts per subnetwork • In the same Class C network, if you borrow 3 bits, the size of the host field decreases to 5 bits and the total number of hosts that you could assign to each subnet would be reduced to 32 (25). • The number of usable host numbers would be reduced to 30.

  32. Creating a Subnet: Computing hosts per subnetwork • The number of possible host addresses that can be assigned to a subnet is related to the number of subnets that have been created. • In a Class C network, for example, if a subnet mask of 255.255.255.224 has been applied, then 3 bits (224 = 11100000) would have been borrowed from the host field. • The useable subnets created are 6 (8 minus 2), each having 30 (32 minus 2) useable host addresses

  33. Creating a Subnet: Computing hosts per subnetwork • Exercise:Divide the last octet into two parts: a subnet field and a host field. If there are 32 possible host addresses that can be assigned to each subnet, then their IP addresses would fall within the range of numbers (but remember the 2 unusable host addresses in each subnet!). • In a Class C network 199.5.12.0 with subnet mask 255.255.255.224, to which subnet would host 199.5.12.97 belong? (hint: 97 = 01100001 binary) A. subnet 0? B. subnet 1? C. subnet 2? D. subnet 3? E. subnet 4? F. none of the above?

  34. Creating a Subnet: Boolean AND operation • As you have already learned, the lowest numbered address in an IP network is the network address (the network number plus 0 in the entire host field). • This also applies to a subnet; the lowest numbered address is the address of the subnet

  35. Creating a Subnet: Boolean AND operation • In order to route a data packet, the router must first determine the destination network/subnet address. • To accomplish this the router performs a logical AND using the destination host's IP address and the subnet mask for that network. • Imagine that you have a Class B network with the network number 172.16.0.0. • After assessing the needs of your network, you decide to borrow 8 bits in order to create subnets. • As you learned earlier, when you borrow 8 bits with a Class B network, the subnet mask is 255.255.255.0

  36. Creating a Subnet: Boolean AND operation • Someone outside the network sends data to the IP address 172.16.2.120. • In order to determine where to deliver the data, the router ANDs this address with the subnet mask. • When the two numbers are ANDed, the host portion of the result will always be 0. • What is left is the network number, including the subnet. • Thus, the data is sent to subnet 172.16.2.0, and only the final router notices that the packet should be delivered to host 120 in that subnet.

  37. Creating a Subnet: Boolean AND operation • Now, imagine that you have the same network, 172.16.0.0. • This time, however, you decide to borrow only 7 bits for the subnet field. • The binary subnet mask for this would be 11111111.11111111.11111110.00000000. What would this be in dotted decimal notation?

  38. Creating a Subnet: Boolean AND operation • Again, someone outside the network sends data to host 172.16.2.120. • In order to determine where to send the data, the router again ANDs this address with the subnet mask. • As before, when the two numbers are ANDed, the host portion of the result is 0. • So what is different in this second example? Everything looks the same - at least in decimal. • The difference is in the number of subnets available, and the number of hosts that can be in each subnet. • You can only see this by comparing the two different subnet masks.

  39. Creating a Subnet: Boolean AND operation • With 7 bits in the subnet field, there can be only 126 subnets. • How many hosts can there be in each subnet? • How long is the host field? • With 9 bits for host numbers, there can be 510 hosts in each of those 126 subnets.

  40. Creating a Subnet: Boolean AND operation • The two graphics on this page include something you'll learn more about later - an alternate way to express the subnet mask. • You learned that the 1s of the mask represent the routing bits - the network plus the subnet. • 255.255.255.0 indicates there are 24 total routing bits. • This is sometimes indicated by following an IP address with "/24", as in 131.108.3.1 /24 - this says the same thing as the longer subnet mask.

More Related