In this webcast we'll talk about address space, the purpose of the network mask and the reasons we manipulate network masks. Presented by: Bruce Hartpence
1. Ch. 7 Subnetting and Other
Masking Acrobatics
Bruce Hartpence
The Packet Guide to Core Network
Protocols
2. Introduction
⢠Letâs start with the idea of a network
â The 10,000 foot view is that it is a bunch of
computers connected together
â But the technical view is a little more precise
⢠Computers on the same network
â Share the same IP address range
â Have the same default gateway (router)
â Have the same broadcast address
3. What is a Mask?
⢠192.168.100.0 255.255.255.0
⢠Used to determine the network for a host
⢠Also used by routers to determine forwarding
information
⢠The normal or natural network mask
(netmask) is defined by address class type
⢠Not much flexibility
4. How do we use the mask?
â˘Classes vary in size and the number of hosts.
â˘Each class has itâs own address range and mask.
â˘Early networks could be given an entire class.
â˘For example, RIT has a Class B network address.
â˘But, this is inefficient and with more and more folks desiring
connectivity, was not sustainable.
6. Example: Class C network host
200.150.100.95
⢠Steps 1 & 2: Convert the address and mask to
binary
11001000.10010110.01100100.01011111
11111111.11111111.11111111.00000000
⢠Perform the ANDing operation from RT to LT
11001000.10010110.01100100.00000000
⢠Convert back to base 10 numbers
200.150.100.0
⢠Easy right?
7. IP packets
⢠Network Masks
are not included
in the IP packet
⢠All of the
processing is
done on devices
⢠But, you never
know the mask
for the other
end
8. Revisiting the mask structure
⢠From the class structure
â for a class A address: 255.0.0.0
â for a class B address: 255.255.0.0
â for a class C address: 255.255.255.0
⢠When we convert to binary
â There 1âs indicate the network portion
â The 0âs indicate the host portion
9. From an earlier chapter
⢠So for our example, the network address is 200.150.100.0 (all
0âs) and the broadcast address is 200.150.100.255 (all 1âs)
⢠This also means that after ANDing, the host addresses from
200.150.100.1 to 200.150.100.254 are on the same network.
10. What is a subnet?
⢠âLogically visible sub- ⢠Created by
sectionsâ RFC 917 manipulating the
⢠Work exactly like the network mask
classful network and ⢠This splits the network
they still have: into smaller networks
â Network (subnetwork) ⢠Bits are âstolenâ from
address the host portion of the
â Broadcast address network
â All hosts on the subnet
typically use the same
⢠A third portion is added
gateway to the IP address
11. OK, we can subnet but why?
⢠As a network grows in terms of the number of
hosts, the traffic grows as well
â Broadcast (ARP, Windows, DHCP, etc.)
⢠Users or departments may have varying
security concerns
⢠The desire to provide different quality of
service options
⢠Other overhead: SNMP, routing
⢠Rule of thumb: 100/30
12. Subnet behavior
⢠Local traffic is limited to the subnet
â ARP traffic (and everything else) is now limited
â Limited broadcast address 255.255.255.255
â Broadcast frame address ff-ff-ff-ff-ff-ff
⢠MAC addresses belong to the subnet, not the
classful network
⢠A router (or routing function) is required to
get traffic between subnets
13. So how do you decide?
⢠First, how many subnets do you need?
â Organization of the groups
â Addresses required
â Growth
â Current equipment
⢠Once this has been determined, âsteal the bitsâ
â Number of bits stolen is determined by the number of
required subnets
â In the host portion, work to the right, converting 0s to
1âs as you go
14. Common subnet patterns
⢠As bits are stolen, the number of subnets
increases and the number of hosts/subnet
decreases
15. Simple example
⢠A company desires 4 internal subnets within their
200.150.100.0 network
⢠This requires 2 bits to be stolen because there are
four possibilities in 2 bits
â 00, 01, 10, 11
â These are seen in the subnet field
â Stolen bits are revealed in the mask
⢠New mask
â Instead of 255.255.255.0 we have 255.255.255.192
16. Wait, how did this work?
⢠The classful network characteristics
â Network 200.150.100.0 mask 255.255.255.0
â Low useable address 200.150.100.1
â High useable address 200.150.100.254
⢠Often for the router
â Broadcast address 200.150.100.255
⢠ANDing puts everyone on the same network
⢠Mask binary
11111111.11111111.11111111.00000000
Network portion Host portion
17. Conât
⢠Stealing 2 bits changes the mask
â 255.255.255.192
â 11111111.11111111.11111111.11000000
⢠The red bits represent the subnet field
⢠But what about the binary patterns?
â The classful network address
â 200.150.100.0
â 11001000.10010110.01100100.00000000
â The red bits are affected by the change to the
mask
19. Letâs look at an example address
⢠Node IP address: 200.150.100.137
⢠Binary: 11001000.10010110.01100100.10001011
⢠Subnet mask: 255.255.255.192
⢠Binary: 11111111.11111111.11111111.11000000
⢠AND
⢠11001000.10010110.01100100.10001011
⢠11111111.11111111.11111111.11000000
⢠11001000.10010110.01100100.10000000
⢠Base 10: 200.150.100.128
⢠This is the new subnet for this node
20. Binary value details
⢠Node 200.150.100.137
⢠11001000.10010110.01100100.10001011
⢠Subnet mask: 255.255.255.192
⢠11111111.11111111.11111111.11000000
⢠Put all 0âs in for the host portion, you get the subnet
ID
⢠11001000.10010110.01100100.10000000
⢠Put all 1âs in the host portion, you get the broadcast
address
⢠11001000.10010110.01100100.10111111
21. Another look at the binary patterns
⢠Subnet address and binary
⢠200.150.100.0: 11001000.10010110.01100100.00000000
⢠200.150.100.64: 11001000.10010110.01100100.01000000
⢠200.150.100.128: 11001000.10010110.01100100.10000000
⢠200.150.100.192: 11001000.10010110.01100100.11000000
⢠So, where are the routers?
â 200.150.100.62
â 200.150.100.126
â 200.150.100.190
â 200.150.100.254
22. Another problem: 2 techniques
⢠Problem: Class B network 172.30.0.0, 8 subnets
desired
â Another way to ask this is âHow many hosts do you
need in each subnet?â
⢠Method 1 â Algebra
â How many hosts total? 65536
â How many subnets? 8
â Hosts/subnet? 65536/8 = 8192
â Bits for subnets? 3
â Mask? 255.255.224.0
â Always start at the classful network address.
23. Subnets
⢠The only tough question: What does 8191 look like in
dotted quad notation?
⢠172.30.0.0 - 172.30.31.255
⢠What is the next possible value?
â 172.30.32.0 â this is the next subnet? Follow the pattern.
⢠172.30.32.0 â 172.30.63.255
⢠172.30.64.0 â 172.30.95.255
⢠172.30.96.0 â 172.30.127.255
⢠172.30.128.0 â 172.30.159.255
⢠172.30.160.0 â 172.30.191.255
⢠172.30.192.0 â 172.30.223.255
⢠172.30.224.0 â 172.30.225.255
24. Method 2 â to the binary!
⢠Having selected the mask, start at the classful address
and work through the binary patterns (172.30.0.0)
â 172.30.00000000.00000000
â 172.30.00100000.00000000
â 172.30.01000000.00000000
â 172.30.01100000.00000000
â 172.30.10000000.00000000
â 172.30.10100000.00000000
â 172.30.11000000.00000000
â 172.30.11100000.00000000
⢠Remember that these are the subnet addresses
25. Upper end of the range
⢠Broadcast addresses insert 1âs in the host portion
â 172.30.00011111.11111111 (172.30.31.255)
â 172.30.00111111.11111111
â 172.30.01011111.11111111
â 172.30.01111111.11111111
â 172.30.10011111.11111111
â 172.30.10111111.11111111
â 172.30.11011111.11111111
â 172.30.11111111.11111111
⢠Routers would typically be high/low in the range
26. Review and other ideas
⢠You should be able to go back to the simpler
example and work both techniques
⢠Related ideas
â Supernetting (combining networks)
â Classless inter-domain routing (CIDR)
â Variable length subnet masks (VLSM)
â Aggregation
⢠All of these represent different ways to
manipulate address space via the subnet mask
28. Visit http://oreilly.com
to purchase your copy
of Core Network
Protocols and enter
code 4CAST to save
40% off print book &
50% off ebook with
special code 4CAST
Visit http://oreilly.com webcasts to view upcoming webcasts and online events.