Subnetwork

From Wikipedia, the free encyclopedia

A graphic representation of relationships and source of the various variables representing a chunk of C subnets
A graphic representation of relationships and source of the various variables representing a chunk of C subnets

In computer networks, a subnetwork or subnet is a range of logical addresses within the address space that is assigned to an organization. Subnetting is a hierarchical partitioning of the network address space of an organization (and of the network nodes of an autonomous system) into several subnets. Routers constitute borders between subnets. Communication to and from a subnet is mediated by one specific port of one specific router, at least momentarily.

A typical subnet is a physical network served by one router, for instance an Ethernet network (consisting of one or several Ethernet segments or local area networks, interconnected by switches and bridges) or a Virtual Local Area Network (VLAN). However, subnetting allows the network to be logically divided regardless of the physical layout of a network, since it is possible to divide a physical network into several subnets by configuring different host computers to use different routers.

The address to all nodes in a subnet starts with the same binary sequence, which is its network id and subnet id. In IPv4, the subnet may be identified by its base address and subnet mask.

Subnetting simplifies routing, since each subnet typically is represented by one row in the routing tables in each connected router.

Subnetting was originally introduced before the introduction of classful network addresses in IPv4, to allow a single larger network to have a number of smaller networks within it, controlled by several routers. Subnetting made classless Inter-Domain Routing possible.

In order for computers to communicate on one network they will all need their own IP address -- but what if you have two or more networks? Now instead of purchasing different numbers for each network you could easily divide one IP address range amongst all the hosts in your network. This is called subnetting. A direct definition of subnetting is “Used in IP networks to break up larger networks into smaller network.” Subnetting involves manually calculating the bits of an IP address and taking them from the host side of bits and adding them to the network side.

Contents

[edit] Network address and logical address

The term network address sometimes refers to logical address, i.e. network layer address such as the IP address, and sometimes to the first address (the base address) of a classful address range to an organization.

Computers and devices that are part of internetworking network such as the Internet all have a logical address. The network address is unique to that device and can either be dynamically or statically configured. This address allows the device to communicate with other devices connected to the network. The most common network addressing scheme is IPv4. The IPv4 network address consists of a 32 bit address divided into 4 octets and a subnet mask of like size. In order to facilitate the routing process the address is divided into two pieces, the network address and the host address. This works much like a postal address where the network address would represent the city and the host address would represent the street address. The subnet mask is used in conjunction with the network address to determine which part of the address is the network address and which part is the host address.

[edit] Binary subnet masks

While subnet masks are often represented in dot-decimal form their use becomes clearer in binary. Looking at a network address and a subnet mask in binary a device can determine which part of the address is the network address and which part is the host address. To do this, it performs a bitwise "AND" operation.

Example

Dot-decimal Address Binary
Full Network Address 192.168.5.10 11000000.10101000.00000101.00001010
Subnet Mask 255.255.255.0 11111111.11111111.11111111.00000000
Network Portion 192.168.5.0 11000000.10101000.00000101.00000000

Subnet masks consist of a series of 1s in binary followed by 0s. The 1s designate that part of the address as being part of the network portion and the 0s designate that part as being part of the host address. Subnet masks do not have to fill a given octet. This allows a classful network to be broken down into subnets. A classful network is a network that has a subnet mask of 255.0.0.0, 255.255.0.0 or 255.255.255.0. Subnet masks can also be expressed in a shorter form, known as Classless Inter-Domain Routing (CIDR) notation, which gives the network number followed by a slash ("/") and the number of 'one' bits in the binary notation of the netmask (i.e. the number of relevant bits in the network number). For example, 192.0.2.96/24 indicates an IP address where the first 24 bits are used as network address (same as 255.255.255.0).

[edit] IPv4 classes

IPv4 addresses are broken down into three parts: the network part, the subnet part (now often considered part of the network part, although originally it was part of the rest part), and the host part. There are three classes of IP address which determine how much is which

Class Leading bits Start End Default Subnet Mask in dotted decimal CIDR notation
A 0 0-127.x.x.x 126.255.255.255 255.0.0.0 /8
B 10 128-191.x.x.x 191.255.255.255 255.255.0.0 /16
C 110 192-223.x.x.x 223.255.255.255 255.255.255.0 /24
D 1110 224-239.x.x.x 239.255.255.255
E 1111 240-255.x.x.x 255.255.255.0

The 127.0.0.1 network is left out because it is designated for loopback and cannot be assigned to a network

Class D multicasting

Class E reserved

Subnetting is the process of allocating bits from the host portion as a network portion. The above example shows the bitwise "AND" process being performed on a classful network. The following example shows bits being borrowed to turn a classful network into a subnet.

Subnetting
Subnetting

Example

Dot-decimal Address Binary
Full Network Address 192.168.5.130 11000000.10101000.00000101.10000010
Subnet Mask 255.255.255.192 11111111.11111111.11111111.11000000
Network Portion 192.168.5.128 11000000.10101000.00000101.10000000

In this example two bits were borrowed from the original host portion. This is beneficial because it allows a single network portion to be split into several smaller network portions. By design IPv4 address are limited in number and each classful network portion is capable of supporting a finite number of hosts. A classful C address for example has space for 254 hosts. If a network were to be split into four parts using classful address four different class C addresses would have to be used to serve those networks. Using the subnetting example above if each subnetwork were to have 62 hosts or less (see below for math) a single class C address could be split up to service the entire network while wasting the fewest host addresses.

[edit] Subnets and host count

It is possible to determine the amount of hosts and subnetworks available for any subnet mask. In the above example two bits were borrowed to create subnetworks.

22 = 4
possible subnets available according to RFC 1812, otherwise using the old RFC 950 standard the number of usable subnets is 2. This is due to RFC 950 (section 2.1, page 5) not supporting subnets with either all 1s or all 0s.

26 − 2 = 62
possible hosts available to each subnetwork (2 addresses are reserved and cannot be used for hosts: subnet identifier (the first) and broadcast address (the last)).

[edit] Private subnets

The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private networks:

Network address range CIDR notation
10.0.0.0 - 10.255.255.255 /8
172.16.0.0 - 172.31.255.255 /12
192.168.0.0 - 192.168.255.255 /16

For example, let's say you have a Class C address and you wish to subnet it to contain 6 different internal networks. Let’s say you have the network ID of 192.168.1.0. This specific ID is only one network and you will have to borrow bits in order to make more networks. The subnet mask for this IP is 255.255.255.0, but this is only for one network. In order for it to have any impact you have to borrow at least 2 bits from the left turning the subnet mask into 255.255.255.192 (its 192 because the two bits to the far left are 128 and 64). Looking closer at the bits it would give us these networks

192.168.1.0
192.168.1.64
192.168.1.128
192.168.1.192
192.168.1.255

Now as you can see we have a total of 5 networks, but as stated earlier you can not use the networks that have either all the bits off or on (without special commands). So that takes away the .0 (The .0 network pertaining to our original IP address of 192.168.1.0) and the 255 networks leaving us with the networks 64 and 128 and (192?). The main rule of thumb for networks is when you calculate how many networks you have subtract 2 so you will be left with the actual amount of usable networks. If we turn on the first 3 bits (turning our subnet mask into 255.255.255.224 because 128+64+32) we would get 8 networks but by subtracting 2 you're left with 6

Now that we have our networks you must look at the remaining bits to determine how many hosts you want to configure on each network. The same rules apply that you can not have all the bits turned off or on so 8-3=5 (Total bits – The bits we used for the networks = Bits usable for the hosts) so 2^5 is 32, minus the 2 for the network ID and the broadcast ID equals 30 usable hosts for each network. So an example of one network would look like-- IP address Subnet mask 192.168.1.32 255.255.255.224 Now the usable IP addresses are 192.168.1.33 to 192.168.1.62 You should consider subnetting when you want to gain more networks from one IP address. This is extremely helpful in dividing connectivity between multiple hosts. Additionally, by breaking up networks into smaller chunks you alleviate some of the bandwidth on the Ethernet cable allowing for faster transfers. Isolating problems on a network will also be easier because they will be contained in each different network.

[edit] References

  • RFC 950 Internet Standard Subnetting Procedure
  • RFC 1812 New Internet Subnetting Procedure
  • RFC 917 Utility of subnets of Internet networks
  • RFC 1101 DNS Encodings of Network Names and Other Type

Blank, Andrew G. TCP/IP Foundations Technology Fundamentals for IT Success. San Francisco, London: Sybex, Copyright 2004

Lammle, Todd. CCNA Cisco Certified Network Associate Study Guide 5th Edition. San Francisco, London: Sybex, Copyright 2005

Groth, David and Toby Skandier. Network + Study Guide 4th Edition. San Francisco, London: Whiley Publishing, Inc., Copyright 2005

[edit] See also

[edit] External links