Subnet Masking

 In Blog, Network

images

Every IP address is divided into a network ID portion and a client ID portion. On the internet, routers look at the 3 binary digits on the left of the destination IP address to determine an IP address’s “class.” (An IP address is 32 binary digits.) The router then uses the class to determine how many binary digits make up the network portion of the IP address: 8 for class A’s, 16 for class B’s, and 24 for class C’s. It uses a database in the router (called the routing table) to decide where to send it next.

Once a packet is passed by an Internet router to its destination network, it is either on the LAN segment of the destination computer, or the LAN has been subdivided by the LAN administrators. If its on the destination computer’s LAN segment, the destination computer uses it and it goes no further. If a network administrator has divided the LAN, and the destination computer is not on the current LAN segment, the corporate routers (not Internet routers) must now determine how to forward the packet to the correct LAN segment. These corporate routers are what sub-divide the LAN.

The “network” portion of the IP address doesn’t help the corporate router, because every IP address in the subdivided LAN has the same network ID. This is what the subnet mask is for. Here’s a key point: A subnet mask is used both when a LAN is subdivided, and when it is not subdivided (a single LAN segment).

If the LAN is not subdivided, the subnet mask shows that the LAN is a single segment. For example, with a class C IP address, the first 3 octets (w.x.y in the w.x.y.z format, or the left-most 24 binary digits) are the network ID portion, and a subnet mask of 255.255.255.0 would be used to indicate that there was only one undivided LAN segment. In this case, the client ID portion of the IP address (the z in the w.x.y.z format) is not divided, and all 8 binary digits are used to identify a specific computer on the LAN segment. (In binary, a mask of 255.255.255.0 is 11111111.11111111.11111111.00000000.)

When a LAN is subdivided, the client ID portion of the IP address is split! The part on the left is used to identify the corporate LAN segment, and the part on the right is used to identify a specific computer on that LANimages segment. With a class C IP address, and a subnet mask of 255.255.255.192, the 192 tells the corporate routers that of the eight binary digits making up the client ID in a class C IP address, the 2 on the left are to identify the LAN segment, and the remaining 6 identify the specific computer on that LAN segment. (In binary, a mask of 255.255.255.192 is 11111111.11111111.11111111.11000000, and the digits in red show which digits of the client ID portion are masked, and therefore used to identify a corporate subnet.)

Here’s a class B example. The client ID of a class B IP address is the 16 binary digits on the right (y.z in the w.x.y.z format). A mask of 255.255.248.0 tells the corporate routers that the first 5 of those 16 is to identify the LAN segment, while a mask of 255.255.255.192 tells the corporate routers that the first 10 of those 16 is to identify the LAN segment. (Though the mask of 255.255.255.192 is the same as the mask for the class C address, a class B address has a larger client ID portion, so the digits in red show the first 10 digits of the client ID portion being masked: 11111111.11111111.111111111.11000000.)

Reference 

  1. Bulette, G. TCP/IP MCSE Study Guide, Foster City, CA, IDG Books Worldwide, 1998.
  2. Craft, M., Mayo, B., Pherson, J., et. al., CCNA Cisco Certified Network Associate Study Guide (Exam 640-407), Berkeley, CA, Osborne McGraw-Hill, 1998
  3. Cunningham, S., Frederick, B., First, T., et. al., MCSE Microsoft TCP/IP on Windows NT 4.0 Study Guide, Berkeley, CA, Osborne McGraw-Hill, 1998
  4. Dulaney, E., Sherwood, L., Scrimger, R., MCSE Training Guide TCP/IP, Indianapolis, IN, New Riders Publishing, 1998.
  5. Feit, S. TCP/IP, New York, NY, McGraw-Hill, 1997.
  6. Heywood, D., Scrimger, R., Networking with Microsoft TCP/IP Certified Administrator’s Resource Edition, Indianapolis, IN, New Riders Publishing, 1997.
  7. Lammle, T., CCNA Cisco Certified Network Associate Study Guide (Exam 640-507), 2nd ed., Alameda, CA, SYBEX, 2000
  8. Loshin, P. TCP/IP Clearly Explained, San Diego, CA, Academic Press, 1997.
  9. Odom, W., CCNA Exam Certification Guide, Indianapolis, IN, Cisco Press, 1999
  10. Odom, W., Cisco CCNA Exam #640-507 Certification Guide, Indianapolis, IN, Cisco Press, 2000
  11. Poplar, M., Waters, J., McNutt, S., and Stabenaw, D., CCNA Routing and Switching, Scottsdale, AR, Coriolis, 2000
Recommended Posts

Leave a Comment

Start typing and press Enter to search