A subnet (short for "sub-network") is a logical grouping of connected network devices in an organization. Typically, a subnet may represent all the machines at one geographic location, in one building, or on the same local area network (LAN). Network designers employ subnets as a way to partition networks into logical segments for better administration, improving performance and enhance network security. In addition, having an organization's network divided into subnets allows it to be connected to the Internet with a single shared network address, which help easing the problem of Internet IP address exhaustion.
On TCP/IP networks, each communication carries the address of the source and destination networks and the particular machine within the network associated with the user or host computer at each end. This address is called the IP address. For IPv4, it is a 32-bit number with two parts: one part identifies the network and the other part identifies the specific machine or host within the network. An organization can use some of the bits in the machine or host part of the address to identify a specific subnet. Effectively, the IP address then contains three parts: the network number, the subnet number, and the machine number.
Subnetting an IP Network can be done for a variety of reasons, including organization, use of different physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space, and security. The most common reason is to control network traffic. In an Ethernet network, all nodes on a segment see all the packets transmitted by all the other nodes on that segment. Performance can be adversely affected under heavy traffic loads, due to collisions and the resulting retransmissions. A router is used to connect IP subnets to minimize the amount of traffic each segment must receive.
IP networks are divided using a subnet mask which defines the boundaries of an IP subnet. Applying a subnet mask to an IP address allows you to identify the network and node parts of the address. Default subnet masks:
- Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000
- Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000
- Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000
Classless Inter Domain Routing (CIDR) was invented to keep the Internet from running out of IP addresses. The original "classful" system of allocating IP addresses can be very wasteful Only a small percentage of the allocated Class A and Class B address space has ever been actually assigned to a host computer on the Internet. Under CIDR, the subnet mask notation is reduced to a simplified shorthand. Instead of spelling out the bits of the subnet mask, it is simply listed as the number of 1s bits that start the mask.
IPv6 with 128 bit addresses will provide a better solution for the IP address problems because IPv6 can provide a few orders of magnitude more of IP addresses. However, subnetting is still necessary for other subnet benefits.

Subnet and IP Subnetting
