Home / Network / What is the best way of subnetting?

What is the best way of subnetting?

In this post, let’s recall what is subnetting (for routing and switching purposes) and how it is done.

introduction and motivation

Network subnetting is very important subject that maybe referred to as VLSM for variable length subnetting. The basic idea is about managing a space of IP addresses (IPv4). Historically, a network length or space was fixed and known at advance: we distinguish class A network, from B, C and D. A class C network is 8 bit long offering almost 2^8=256 IP address to assign to hosts, network nodes, servers, objects, etc wheras a class B is 16 bit long, a class A 24 bit long (an IP address is 32 bit long and divided into two parts: a network part that identifies the network of association and host part that identifies the host in the network). With internet growth, this way of doing things showed big limitations and waste of usable IP addresses… VLSM is supposed to overcome these limitations by allowing more control of this allocation of IP address in the form of subnets of any length (not limited to classes A, B and C).

Then, given a network ip address, what would be the optimal subnetting (subdividing the network address into subnetworks) method? optimal, such as to use the less possible ip addresses, the less possible subnets, a subnet per vlan or multiple subnets per vlan, etc. depending on our need and the case (hosting (hosts and servers), segmenting (security) switching or routing, etc.)

A top down approach

Let’s suppose that we’ve been assigned this network x.y.z.w/L and a need for n department (this seperation maybe for security or routing reasons, etc.). Each i department needs d_i ip addresses (host IP addresses), where i is any number between 1 and n.

a flat network

If we use a flat network assignment, the total of ip addresses we need are d_1 + d_2 + … + d_i + … + d_n = D. D must be at least less than 2^(32-L) the total available users of host space in a flat network assignment… we need to find L in such way that D is fullfilled with the minimum waste of host space.

from the biggest network need to the smallest

In a top-down approach we start by the biggest d_i. We process x number such as 2^x > d_i > 2^(x-1). x must satisfy this condition, L-x >= 0. Then we have 2^(32-L-x) new /32-x sub networks. The first network is used to satisfy d_i need. For the next biggest department we’re sure that the next available /32-x network would fit.

Our next job is to try to optimize this network usage of ip addresses… and redo the same for the remaining subnets (ordered by size, from the biggest to the smallest); we’re sure that this method is less efficient than the flat network method but allowes other features (routing, etc.). A flat network may burden the network at OSI level 2: a huge broadcast domain is not a good idea… (requires CPU processing).

top down approach some limitations

This approach have some limitations. For example:

  • a d_i = 1023 may require a 2048 subnet block instead of a 1024. To d_i we need to add the broadcast and network addresses that are not usable by hosts in non point-to-point network (/31 masks). The result is that 2048 – 1023 + 2 = 1023 addresses are reserved but not used…
  • many subnets like the previous one may deplete rapidly our available space…
  • the processing of subnets is dependent of their order by size. If the initial size varies for any reason, the calculation needs to be done for all the space…

A down top approach

The down-top approach helps resolve some top-down aproach limitations.

infinite small subnetting

Let’s suppose now that we all our space is subnetted into /31 point network. In such way, if d_i is even, d_i/2 subnetwork of /31 fits its need totally. The worst case is when d_i/ is odd, then we need d_i/2 + 1, /31 subnets to fit d_i need…

We’ve realized the most optimal subnetting using only /31 subnets. It is optimal in terms of effective usage of the reserved ip address space…

small subnet and aggregate to fit the need

to fit the need of any subnet we just aggregate those micro subnets (the same applied to formatting of hard drives)

issues of down to top subnetting

This approach resolves some top-down approach limitations but causes other issues:

  • each /31 subnet would correspond to a vlan? router sub interface? router interface?
  • two /31 subnets pertaining to the same department would communicate through a layer 3 versus a layer 2 path which is not always optimal
  • the available vlan space could be rapidly exhausted if we need to assign each subnetwork to a vlan id
  • the routing table would grow rapidly… subnetting like this requires more routing work against switching

What else… an hybrid

An hybrid approach would take advantages of the both down-top and top-down approach in building an efficient subnetting technique…

Leave a Reply

adsense (1) application (2) architecture (4) asm (4) automatisation (2) backbone (1) cef (1) chd (2) cisco (6) cloud (1) command (5) controller (1) cost (6) coverage (2) debug (9) distance (6) fiber (1) gns3 (1) google (1) hpe (1) http (1) igmp (5) igp (8) internet (2) ip (2) label (1) ldp (1) logique (2) loop (5) lsp (1) mac (3) meraki (1) model (2) mpls (3) mroute (4) multicast (5) nat (1) ndp (2) network (3) next-hop (5) osi (5) pat (1) pim (4) poisoning (6) projet (2) qos (1) radio (3) rib (5) rip (5) route (6) router (6) routing (14) rpf (4) rrm (3) security (3) show (5) simulation (2) solution (2) split-horizon (5) sql (1) ssm (4) static (6) stp (2) summarization (5) switching (1) tcp/ip (1) telecom (1) template (1) traffic engineering (1) translation (1) travail (2) vpn (2) vrf (3) wifi (4) wlan (2)

  • What is the best way of subnetting?
    In this post, let’s recall what is subnetting (for routing and switching purposes) and how it is done. introduction and motivation Network subnetting is very important subject that maybe referred to as VLSM for variable length subnetting. The basic idea is about managing a space of IP addresses (IPv4). Historically, a network length or space
  • SSL VPN to my home network
    In this blog let’s try to connect to a home network from outside (internet) in a secure manner using SSL. NAT and PAT NAT and PAT is what allowed local IP addresses translation or mapping to some routable public IP address (over the internet). This mapping can be one to one (NAT) or many to
  • Routing from scratch… Part 1
    In this serie of posts we’ll explore routing operation. Let’s start from the general idea of how could we manage trafic, a move from one location to another… In the example of the figure presented next, the person in A wants to join its colleagues in location B through the network topology described in the
  • When a gateway says: “I’am not a good gateway… set redirection!”
    In this blog we explore how a gateway (a router) present in a LAN handles routing to the outside of this network and use redirection to enhance this operation. lab setup Our lab setup is 3 routers: R1, R2 and R3, in addition to 2 PC: PC1 and PC2. In this lab, PC1 tries to
  • Multicast: rather than dense, sparse it and let’s meet at rendez-vous point… Part 5
    in this post let’s detail the operation of PIM (Protocol Independent Multicast) in sparse mode. Previous posts tackled the operation of PIM dense mode. Let’s recall that PIM is the multicast routing protocol that allows PIM routers exchange information needed distribute multicast traffic to receivers. lab setup In our setup, Client1 is configured to join
September 2025
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  
Table of Contents
Copied!