Subnetting

Subnetting is a networking technique used to separate hosts within a network which involves sliding a portion of the #host bits. The network that doesn’t implement this technique is called a flat network.

Router uses the subnet mask (32-bit number in the same format to #IPv4 Address) to distinguish the network, the subnet and the host address space. It has a consecutive 1s starting from the most significant bits (MSB) followed by 0s. The former represents the network bits, the latter shows the host bits. Currently, there are two ways to do subnetting:

It provides several advantages compare to not using it:

Links to this page
  • Virtual LAN (VLAN)

    We can apply access rules and provision services to the users of same or similar responsibilities without the need to change the topology of the network or changing the IP Address. Furthermore, VLAN can also create their own Broadcast Domain# without the help from Network Layer Network Device (modern #Switch and #Router). Basically, we could assign the hosts in a subnet# to be in the same VLAN. By using VLAN, we could have different broadcast domains even in a single switch so that broadcast flooding affects only those in the same grouping. If a link needs to handle more than one VLAN, #VLAN Trunking will be used.

  • Variable-Length Subnet Masking (VLSM)

    VLSM is basically #Subnetting the subnet. The process is almost identical to of Fix-Length Subnet Masking with the exception where it reduces \(BL\) to only include enough number of hosts in the network, that is \(2^{BL}\) should be close to \(\lg{n}\). The bits deducted from \(BL\), denoted as \(BD\) will be the bits that used to build up a subnet mask (though in reality it is counted as part of the prefix). \(2^{BD}\) will be the total number of subnets that could be subnetted from their parent.

  • IPv4 Address

    IPv4 Address can be divided into two parts: network and host bits. Depending on the Address Classes#, the size of the network and host bits can be varying, plus with the introduction of the Subnetting#, host bits can be quite small.

  • Fix-Length Subnet Masking

    Fix-Length Subnet Masking is a #Subnetting technique utilises the default subnet mask of an Address Class#. All non-reserved address classes has a default subnet mask, shown in the following table:

  • Distance Vector Routing Protocol

    It is best used simple and flat network or specific types of networks such as hub-and-spoke networks#. If the worst-case Convergence# times in the network is not a concern, which is the worst disadvantage of using a Distance Vector Routing Protocol.

  • Collision Domain
  • Cisco Switch Configuration

    To configure #Virtual LAN (VLAN) with Switch#, there is a need to set up an IP Address, subnet mask, and default gateway (router to direct switch management traffic for remote access such as Telnet and Secure Shell (SSH)) in a switch. The configuration could be done in IOS# with the command vlan {number} in Interface Configuration Mode follows by the IP address assigned to the VLAN. We can attach a name to a VLAN by simply running the command name {vlan-name} right after vlan {number} command in Global Configuration Mode. Define the VLAN membership mode for the assigned interface (port) as access (see Dynamic Trunking Protocol (DTP)# for other possible modes) with switchport mode {mode} and assign VLAN to it by switchport access vlan {number} in the Interface Configuration Mode.

  • Cisco OSPF Router Configuration

    To enable an interface to send and receive OSPF packets, we need to specify it with the command network {network-address} {wildcard-mask} area {area-id} where the wildcard mask is derived from the subtraction of the subnet mask 255.255.255.255 with the interface’s network subnet mask#. The area ID specifies a group of OSPF routers that can share link-state information. It is the mechanism to prevent flooding from affecting other networks or Autonomous System (AS). Instead of specifying the network address, we could specify the interface’s exact IP address. In this way, we can just pass in the subnet mask quad zero or 0.0.0.0 instead of calculating the wildcard mask without worrying about it. We can go even further by execute the command ip ospf {process-id} area {area-id} inside each interface of the router without typing out any explicit addresses.

  • Address Classes

    The network usually reserve the first address and last address of the octet for network identification (which network is it) and broadcast (local) respectively. From here, we can know the total number of assignable hosts in the network by the formula \(2^{BL} - 2\) where \(BL\) denoted the number of assigned host bits (\(2^{BL}\) is the total number of hosts including the network address and broadcast address). The total number of hosts calculation can be more sophisticated with the introduction of #Subnetting. We also get a magic number by dividing \(2^{BL}\) by 256 until there is a remainder, which will be the gap between assignable subnets.

#networking