![]() |
|
|
|||||||
| Computer Networking Discuss Networking and Internet connections. Tips on building a LAN or connecting a router. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
|
IP Addressing and Subnetting
Just thought I would post some useful information. Most of this stuff is right out of the Networking Essentials Books I used in earning my MCSE.
Just like a letter that you mail to a friend, packets on a network need some form of addressing so they can be sent from one node to another. There are actually several different addresses that are attached to Ethernet packets: A port number is assigned at the Transport Layer so the application that is sending the data, and the application that is the intended receiver can be identified. The Internet Layer adds an IP address so the packet can be routed from one logical network to another. Last, but not least, the Network Layer adds a Media Access Control (MAC) address that is used to get a packet from on node to another on the same logical network. A node is anything on a network that needs an IP address to communicate (a PC, server, router, etc). For more information on how packets move across a network, see the Getting Connected article. For now we are just going to focus on the Internet Layer and IP addresses. So kick back, relax, and keep reading...
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." |
|
|
|
|
|
#2 |
|
Senior Member
|
IP addresses are used to route data between different IP networks (to get an Ethernet packet between your PC and A web site. IP uses a four-octet dot notation to define an address. Note: Four octet dot notation is defined as four, eight bit binary coded decimal numbers separated by periods. Each eight-bit binary coded decimal number is called an "octet". For example: IP address 250.45.36.12 is actually:
11111010.00101101.00100100.00001100 Each eight bit Binary Coded Decimal (BCD) digit has a decimal value based on its position. The left most bit is the Most Significant Bit (MSB) and has the highest value. The right most bit is the Least Significant Bit (LSB) and has the lowest value. The decimal values for BCD are as follows: MSB LSB BCD Value 128 64 32 16 8 4 2 1 250 = 1 1 1 1 1 0 1 0 45 = 0 0 1 0 1 1 0 1 36 = 0 0 1 0 0 1 0 0 12 = 0 0 0 0 1 1 0 0 It's very simple: If a bit is set (a binary one) then the BCD equivalent is added. If a bit is clear (a zero) then the BCD equivalent is ignored. Subnet Mask The subnet mask is used to determine where the network number in an IP address ends and the node number in an IP address begins. Because of the way a subnet mask is used to filter an IP address, the bits in a subnet mask have to be set consecutively from left to right. For example a subnet mask of 255.0.0.0 is valid (255 is all eight bits set in the first octet). 255.128.0.0 is also valid (all eight bits set in the first octet, the MSB set in the second octet). 255.64.0.0 is not valid -the first bit (the MSB) in the second octet has been skipped. There are three classes of IP addresses*: Class A: 1.0.0.0 to 126.255.255.255 (standard subnet mask is 255.0.0.0). Available nodes per address: 16,777,214 Class B: 128.0.0.0 to 191.255.255.255(standard subnet mask is 255.255.0.0). Available nodes per address: 65534 Class C: 192.0.0.0 to 223.255.255.255(standard subnet mask in 255.255.255.0). Available nodes per address: 254 IP addresses from 127.0.0.0 to 127.255.255.255 are used for loop back addresses. The following addresses are reserved for Intranets (INTeRnAl NETworkS) and are not routable across the Internet (depending on the software that a router is running, routers will not pass packets using reserved IP addresses to other routers). Anybody can use them for Intranets -no registration needed. 10.0.0.0 to 10.255.255.255 (10/8 prefix) 172.16.0.0 to 172.31.255.255 (172.16/12 prefix) 192.168.0.0 to 192.168.255.255 (192.168/16 prefix) There is a fourth class of IP addresses called class D. The range for class D networks is 224.0.0.0 to 239.255.255.255, and they are used for IP multicasting (sending data to multiple destination IP addresses). Details on IP Multicasting can be found in RFC1112. The fifth class of IP addressing is class E. The range of addresses is from 240.0.0.0 to 247.255.255.255, but class E addresses are not currently being used. Decoding an IP Address Lets take a look at an IP address and break it down by applying the subnet mask: IP Address 203 85 17 5 Subnet Mask 255 255 255 0 Just by looking at the first octet in the IP address we know that it is in the class C range. The subnet mask is standard for a class C, and it is "masking out" the first three octets. That means that 203.85.17.0 is the network number. The last octet (the "5") is the node number -the address of an individual network interface on the 203.85.17.0 network. Also on every network there are two IP addresses that are reserved and you cannot assign them to a node. Node address "0" is the network address and is used by routers to route packets between different IP networks. Node address 255 (or "all ones") is used for broadcast traffic. If a node sent a packet addressed to 203.85.17.255 all of the nodes on the 205.85.17.0 network would "listen" to the packet and accept the data in the broadcast. Sub Netting This is the part that usually leads people to drink! Lets see if I can make it painless for you. You have been assigned the IP network 203.85.17.0 by the Internic, but you need four networks. Because of the size of your Local Area Networks (LANs) the Internic isn't going to give you any more addresses. What do you do? You can't change the first three octets because that is your network number. But you can do anything you want with the last octet, so why not create sub networks using bits from the last octet in your network address? Since you want four networks you could take the first three bits in the last octet and use them to make sub networks. Here's the formula for calculating the number of available subnets: 2x - 2 = the number of subnets 2 because binary is a base two numbering system (zero and one are the only digits). x = the number of bits we are going to use from the node portion of the network address to make subnets. - 2 because all zeros (the network number) and all ones (the broadcast) are reserved. Looking at the formula the minimum number of node bits that we need is three (22-2 = 2 isn't enough, 23 -2 = 6 more than we need , but it works). If we set the first three bits and add their corresponding BCD equivalents we get 128+64+32=224.Here is our network with the new subnet mask: Network Address 203 85 17 0 Subnet Mask 255 255 255 224 Now we can do a little binary counting to figure out our subnetworks: BCD 128 64 32 Reserved for the network 0 0 0 Sub Net 32 0 0 1 Sub Net 64 0 1 0 Sub Net 96 0 1 1 Sub Net 128 1 0 0 Sub Net 160 1 0 1 Sub Net 192 1 1 0 Reserved for Broadcasts 1 1 1 The first sub network is 203.85.17.32, the first node IP address is203.85.17.33, and the broadcast address for the "32 network" is 203.85.17.63 (one less than the next sub network in the table above). It really is VERY simple -it just looks complex at first. There is also an interesting pattern at work here. Notice how every subnetwork using a 224 mask is a multiple of 32. That's because the least significant digit in the subnet mask is equal to 32. If the subnet mask was 252, then the least significant digit in the subnet mask would be 4 (128+64+32+16+8+4 = 252) and every network would be a multiple of 4. So, if you were to look at the configuration file on a router and see a serial port with an IP address of 210.185.10.21 and a subnet mask of 255.255.255.252 then you would know that the subnetwork for that IP address is 210.185.10.20 because 20 is evenly divisible by 4 (the least significant digit in the subnet mask). Who needs a subnet calculator Do you want to know how to figure out how many IP addresses are in each subnetwork without having to write them all out? Use the same formula that we used to determine the number of sub nets, only now we are going to plug in the node bits: 2x- 2 = the number of nodes. 2 because binary is a base two numbering system (zero and one are the only digits). x is now the number of node bits. - 2 because all zeros (the network) and all ones (the broadcast) are reserved. Since we have five binary bits left in the last octet for nodes the number of nodes will be 25 -2 = 30 so we can have 30 nodes on each sub network. The range of available nodes for any network is always one more than the network number and two less than the next network (for example: The"32" subnet has node addresses ranging from 33 to 62). The broadcast is always one less than the next network number -for the "32" subnet the broadcast address is 63. For the last sub network the range is one more than the network number to two less than the subnet mask. For the "192" network the available nodes range from 193 to 222. The broadcast address is 223. After you use this for a while it all starts falling into place. Just looking at the table above you should be able to tell that the 128 sub network has nodes ranging from 129 to 158 and that node 159 is the broadcast (the 160 sub network minus one). The 160 sub network has nodes ranging from 161 to 190 and node 191 is the broadcast (the192 subnet minus one). Soon you will be as crazy as I am (I can do this in my head for any sub network mask...). You can also determine the available nodes in a subnet by subtracting the subnet mask from 256. For example: If we use the same subnet mask as before we would get 256 - 224 = 32 (remember to subtract another 2 nodes for the subnetwork and broadcast addresses). If you want to subnet a class "A" or "B" network the rules don't change -you just have more node bits to manipulate. The same rules and formulas apply. A quick and easy example is a class "B" network like 180.60.0.0 that you could split up into 254 networks with 254 nodes each just by using a subnet mask of 255.255.255.0 -normally a class "C" mask. So instead of having one class "B" you could mask out all eight bits of the third octet and have 28 - 2 = 254 networks with 28 - 2 = 254 nodes. The network numbers would range from 180.60.1.0 to 180.60.254.0 (180.60.0.0 is still the network number and 180.60.255.0 is still the broadcast so they cannot be used). You could also subnet the subnets -but that can get very confusing...
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." Last edited by vantim; 04-23-2005 at 03:46 AM. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2004
Posts: 20
|
ok correct me if I am wrong
255-8bit -1 254-7bit -2 252-6bit -4 248-5bit -8 240-4bit -16 224-3bit -32 192-2bit -64 128-1bit so class C addy is /24 with 32 possible used /24 so 8 bits left for nodes or computers? so why not create sub networks using bits from the last octet in your network address? Since you want four networks you could take the first three bits in the last octet and use them to make sub networks. Here's the formula for calculating the number of available subnets: 2x - 2 = the number of subnets 2x2x2=8-2=6? gives us 6 subnets using 3 bits plus used 3 bits for our networks so we have 2 bits left ? Last edited by pgwrink; 04-23-2005 at 05:00 AM. |
|
|
|
|
|
#4 |
|
Senior Member
|
Your formula is incorrect. Look here and use the subnet calculator. It will kinda show you how it works. There is no way to mask the networks differently the way your thinking.
http://www.telusplanet.net/public/sparkman/netcalc.htm
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Dec 2004
Posts: 20
|
ok just trying to get this straight in my head am a slow learner. Try this?
paid for addy is 203.85.17.0 #2 203.85.17.32 broadcast 203.85.17.31? #3 203.85.17.64 .63 #4 203.85.17.96 .95 |
|
|
|
|
|
#6 |
|
Senior Member
|
What your talking about here is called supernetting. Do a google search and you'll see the difference. They can break up a normal network to squeeze more addresses out of it. I'll do a small explanation:
Supernetting allows the use of multiple IP networks on the same interface. It is the reverse of subnetting, which allows the use of a single IP network on multiple interfaces. Another document in the REDNET Resource Centre describes subnetting. Officially, supernetting is the term used when multiple network addresses of the same Class are combined into blocks. If the IP networks are contiguous, you may be able to use a supernet. If the IP networks are not contiguous, you would need to use sub-interfaces. These are not currently supported on Compatible Systems routers but are supported on routers from Cisco Systems. A prerequisite for supernetting is that the network addresses be consecutive and that they fall on the correct boundaries. To combine two Class C networks, the first address' third octet must be evenly divisible by 2. If you would like to supernet 8 networks, the mask would be 255.255.248.0 and the first address' third octet needs to be evenly divisible by 8. For example, 198.41.15.0 and 198.41.16.0 could NOT be combined into a supernet, but you would be able to combine 198.41.18.0 and 198.41.19.0 into a supernet. An IP address is a 32-bit number (4 bytes, called "octets", separated by periods, commonly called "dots.") Supernetting is most often used to combine Class C addresses (the first octet has values from 192 through 223). A single Class C IP network has 24 bits for the network portion of the IP address, and 8 bits for the host portion of the IP address. This gives a possibility of 256 hosts within a Class C IP network (2^8=256). The subnet mask for a Class C IP network is normally 255.255.255.0. To use a supernet, the number of bits used for the subnet mask is REDUCED. For example, by using a 23 bit mask (255.255.254.0 -- 23 bits for the network portion of the IP network, and 9 bits for the host portion), you effectively create a single IP network with 512 addresses. Supernetting, or combining blocks of IP networks, is the basis for most routing protocols currently used on the Internet. For Example: Two Class "C" network numbers of 198.41.78.0 and 198.41.79.0 The addresses pass the prerequisites. They are consecutive and the third octet of the first address is divisible by 2 (78 Mod 2 = 0). To further illustrate what is being done, let's look at the addresses in binary. The third octet of the first address (78) is 01001110. The second (79) is 01001111. The binaries are the same except for the last bit of the address (the 24th bit of the IP address). The 78 network is supernet 0 and the 79 network is supernet 1. The subnet mask for this example supernet is 23 bits, or 255.255.254.0. ALL devices on the network MUST be using this subnet mask. Any device that is not using this subnet mask would be unreachable. The broadcast address for ALL devices on the example supernet is 198.41.79.255. Most modern devices don't require you to fill out the broadcast address, as it can be deduced from the IP address and the subnet mask. The broadcast address is used as a special destination signifying ALL hosts on the network. As with any IP network, the first number in the range (.0 in a class "C") has special significance, and can't be assigned to any hosts on the network. The first number in the range is referred to as the "network number". Conversely, the last, or highest number in the range (.255 in a class "C") is called the broadcast address, and also can't be used by any host on the network. Because of these unique addresses, it would probably be wise not to use the 198.41.78.255 and 198.41.79.0 addresses (in the above example), even though these SHOULD be perfectly legal addresses for hosts when using a supernet. There is one additional prerequisite for supernetting, you MUST EITHER be running static routing EVERYWHERE or be using a classless routing protocol such as RIP2 (or OSPF) which include subnet mask information and can pass supernetting information in order for this to work. Standard RIP does not transmit the subnet mask information. All this information was taken from: http://www.red.net/support/resourcec...line/intro.php
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Dec 2004
Posts: 20
|
I am currently in cisco ccna 150 second of 4 phases of networking. Your input is very much appreciated. It is alsways good to have different slant on what material is saying. I am stuck on the following and will reread it over and over till I get it.
A prerequisite for supernetting is that the network addresses be consecutive and that they fall on the correct boundaries. To combine two Class C networks, the first address' third octet must be evenly divisible by 2. If you would like to supernet 8 networks, the mask would be 255.255.248.0 and the first address' third octet needs to be evenly divisible by 8. For example, 198.41.15.0 and 198.41.16.0 could NOT be combined into a supernet, but you would be able to combine 198.41.18.0 and 198.41.19.0 into a supernet. |
|
|
|
|
|
#8 |
|
Senior Member
|
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." |
|
|
|
|
|
#9 |
|
Member
Join Date: Jul 2005
Posts: 43
|
That is Awsome
I was over @ LearntoSubnet.Com and I actually am starting to understand Bianary Math... It is pretty cool.. I am still going to have to go over it a few times, maybe more.. to understand it..
Question: @ the end of one of the lessons the statement was made: Learn to communicate with everyone on the Network. What did that exactly mean? It had something to do with the last sentence before that statement about Remote Access can you explain.. Thanks MtnClimber |
|
|
|
|
|
#10 |
|
Senior Member
|
I think what they are getting at is how to connect to the remote computers. Binary is a pretty simple and very effective language. If you get into IP addressing and subnetting, google for TCP/IP version 6. They will be changing over to Hexidecimal format. The current scheme (version 4) is running out of available addresses. In other words the Internet is filling up. Also if you want some cool geek reading google for "Internet2" and "grid Computing" and see what the next generation internet will be like.
__________________
"Hardware, n.: The parts of a computer system that can be kicked." "BUG, n.: An undesirable, poorly-understood undocumented feature." |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|