home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / tcpsub.txt < prev    next >
Text File  |  1997-05-27  |  8KB  |  159 lines

  1. TCP/IP Subnet Mask Tutorial
  2. Copyright 1995 by Dorothy A. Creswell, CDP, CNE
  3.  
  4. What's the most frightening thing you can think of?  The Federal 
  5. Budget?  Doing your taxes?  For some network managers it's dealing 
  6. with TCP/IP subnet masks, that not-too-friendly boulder blocking their 
  7. on-ramp to the Information Superhighway.  
  8.  
  9. With the growing interest in the Internet, and more wide area 
  10. network support of remote offices, an increasing number of networks 
  11. are implementing Transmission Control Protocol/Internet Protocol 
  12. (TCP/IP).  Often that includes learning about IP subnet masks.  Or, as 
  13. one network manager summed it up:  "I've learned more than I ever 
  14. wanted to know!"  This brief tutorial will take a quick look at IP 
  15. addresses, why subnet masks are used, and some survival hints.
  16.  
  17. IP addresses are based on a structured, two-part, 4-byte address.  The 
  18. first portion identifies the network, and the second portion 
  19. identifies the host.  If your network will be connected to the 
  20. Internet, then you must apply to the InterNIC* for an assigned 
  21. address.  If your network won't be connected to the Internet, then you 
  22. can select any network address.  However, if you change your mind 
  23. later and decide to connect to the Internet, you'll need to apply for 
  24. a network address at that time, and someone (guess who?) will need to 
  25. change the network address in every host system to match the new 
  26. assignment.  Once you have your network address, you then assign a 
  27. host address to each computer that will actively participate in the IP 
  28. network.
  29.  
  30. Although every IP address today is 4-bytes in length, the length of 
  31. the network and host portion varies depending on the class of the 
  32. address.  The major classes are A, B and C (D and E also exist).  IP 
  33. addresses are written in "dotted decimal" notation where the 4 bytes 
  34. are written in a string and separated by decimals.  For example, 
  35. 128.66.12.2 is a valid class B IP address.  In this case, the network 
  36. address is 128.66, and the host address is 12.2.
  37.  
  38. The following tables outline the IP address structure and capacity:
  39.  
  40.        Address Address
  41.        #bytes  #bytes                        Maximum#  Maximum#
  42. Class  Network Host   Range  Rules           Networks  Hosts
  43. -----  ------- ----   -----  --------------  --------  -----
  44. A      1       3      1-126  bit  1   = 0    126       16 million
  45. B      2       2    128-191  bits 1-2 = 10   16,000    65,000
  46. C      3       1    192-223  bits 1-3 = 110  2 million 254
  47.  
  48. For the host portion, an address of all binary ones is used for 
  49. broadcast, and all binary zeros is used for the network address.  
  50. These are reserved and should not be used.
  51.  
  52. All class A addresses have been assigned, and most class B have been 
  53. assigned.  That means that you may need to apply creativity when using 
  54. your assigned network address.  And that's where subnet masking comes 
  55. into play.  As a side note, a greatly expanded addressing scheme will 
  56. be available with "IP next generation," or "IPng," but implementation 
  57. is still in the future.
  58.  
  59. Why use subnet masks, and how?
  60.  
  61. If you've received a class B network address, and want to define your 
  62. internal host addresses, there are several design factors.  You may 
  63. want to divide your local network to reduce congestion, improve 
  64. management or add security.  You may plan use routers for network 
  65. performance and security reasons when connecting multiple branch 
  66. offices to your main facility.  However, routers connect different 
  67. networks and different networks need unique network addresses.  If you 
  68. have only one IP network address but need to use multiple network 
  69. addresses, it's time to roll up your sleeve and dive into subnet 
  70. masking.
  71.  
  72. Subnetworks are created by using a subnet mask.  The mask is a simple 
  73. 4-byte binary structure used to filter and identify which portion of 
  74. an IP address is the network, and which portion is the host.  The 
  75. default subnet masks are 255.0.0.0 for class A networks, 255.255.0.0 
  76. for class B, and 255.255.255.0 for class C.  Each position in the mask 
  77. which contains a binary 1 will be evaluated as part of the network 
  78. address, while a binary 0 is used for a position that is not (i.e., 
  79. part of the host portion).  For example, below is the default class B 
  80. mask, our earlier class B IP address example, and the network address:
  81.  
  82. Dotted 
  83. Decimal        Binary                                  Description
  84. -----------    -----------------------------------     -----------
  85. 255.255.0.0    11111111.11111111.00000000.00000000     mask
  86. 128.66.12.2    10000000.01000010.00001100.00000010     IP address
  87. 128.66.0.0     10000000.01000010.00000000.00000000     network
  88.  
  89. Notice that whenever the mask contains a binary 1, that bit of the 
  90. example IP address is used to determine the network address.
  91.  
  92. Subnetting allows you to use portions of your host address range to 
  93. create subnetworks under your control.  It's important to remember 
  94. that the rest of the network community won't be aware of your subnets.  
  95. Also remember not all network equipment can be configured to work with 
  96. subnet masks.
  97.  
  98. Suppose that you have 7 branch offices you wish to connect to your IP 
  99. network.  You could define a subnetwork by using the first four bits 
  100. of your host address portion.  In this case, your mask would be 
  101.  
  102. 255.255.240.0   11111111.11111111.11110000.00000000 (binary)
  103.  
  104. You would then be able to use the remaining 4 bits of that byte, plus 
  105. the last full byte to construct host addresses.  This would allow you 
  106. to have over 4,000 unique host addresses at each branch.  Remember for 
  107. each subnet you should not use host addresses of all 1's or all 0's.  
  108. You should also avoid subnetwork numbers of that type.  The potential 
  109. number of subnetworks will the number two raised to the power of the 
  110. number of bits to be used and then subtracting two from the result.  
  111. In this case, for four bits it would be 2 to the 4th power minus 2: 
  112. ((2**4) -2) = (16 - 2) = 14 subnetworks.  Examples of valid subnetwork 
  113. numbers could include 16, 144, and 224 but 33 and 190 would be wrong.  
  114. Your host addresses could vary from 1 to 4094, though addresses are 
  115. still written in dotted decimal notation.  
  116.  
  117. Suppose your assigned class B network address is 128.66.  Here are 
  118. some examples:
  119.  
  120.                <----network----> <sn><----host--->
  121. 255.255.240.0  11111111.11111111.11110000.00000000  subnet mask
  122. 128.66.16.254  10000000.01000010.00010000.11111110  subnet 16, host 254
  123. 128.66.17.0    10000000.01000010.00010001.00000000  subnet 16, host 256
  124. 128.66.225.254 10000000.01000010.11100001.11111110  subnet 224, host 510
  125. 128.66.225.0   10000000.01000010.11100001.00000000  subnet 224, host 256
  126.  
  127. If you work with the binary structures, you should begin to get a 
  128. better picture about what is happening.  The process is very clear 
  129. once you understand the mechanics involved. There are shareware and 
  130. commercial utilities available to help the "binarily-challenged" 
  131. network manager with interpreting, assigning and tracking IP 
  132. addresses.
  133.  
  134. Now that you have a firm grasp of TCP/IP subnet masking, you can turn 
  135. your attention to balancing the Federal Budget!
  136.  
  137. ___________________________
  138. *To reach InterNIC registration services information:  telephone, 1-
  139. 800-444-4365; Registration support:  703-742-4777.  By mail:  Network 
  140. Solutions Inc.; ATTN: InterNIC Registration Services; 505 Huntmar Park 
  141. Dr.; Herndon, VA 22070; or send registration questions by electronic 
  142. mail to: hostmaster@internic.net.
  143.  
  144. Dorothy A. Creswell, CDP, CNE is president of D C Consulting, 
  145. Inc. in Ankeny, Iowa.  D C Consulting provides computer network 
  146. planning and support including electronic mail services and sales 
  147. automation.  She may be reached at CompuServe 74774,1152, 
  148. Internet 74774.1152@compuserve.com, telephone 515-964-9034, or 
  149. FAX 515-964-5745. 
  150.  
  151. ==========================
  152. Note:  
  153.  
  154. Permission to reprint this copyright article without charge is granted to 
  155. chapters of DPMA, ICCA and similar not-for-profit associations.  Article 
  156. must be published unedited including author contact information.  
  157.  
  158. Please mail a copy of the issue in which the reprint appeared to the author 
  159. at D C Consulting, Inc.; PO Box 195; Ankeny IA 50021-0195.