/23/24/25/26/27/28/29/30
Number of Addresses51225612864321684

General Routing Table for Router A

I’ll be basing this of VLSM Example 1 under topic 7 in your E-learn

Our subnets arranged by Network Address:

NetworkNetwork AddressMaskRange(network to broadcast) of Forth octet(x.x.x._) in binary
C192.168.160.0/250000 0000 to 0111 1111
A192.168.160.128/261000 0000 to 1011 1111
B192.168.160.192/271100 0000 to 1101 1111
AB192.168.160.224/301110 0000 to 1110 0011
AC192.168.160.228/301110 0100 to 1110 0111
BC192.168.160.232/301110 1000 to 1110 1011

Red: Network portion of the binary (Masked bits)

Okay! let’s build the generalised routing table for Router A

PortsNetworks
pa0A
pa1B, AB, BC
pa2C, AC
pa3Internet

We notice that 3 addresses route to the same port, so let’s make a general address that will match all of them.

  1. The smallest mask of the 3 is ‘/27’ and it belongs to network B
  2. Network B is 192.168.160.192/27
  3. Network B’s address range(network to broadcast): 192.168.160.192-223
  4. We can see that networks AB and BC which start from x.x.x.224 and x.x.x.232 respectively, do not fall into Network B’s range (obviously)
  5. So let’s take Network B’s address and shorten the mask from /27 to /26
  6. Doing so, we get the new range of 192.168.160.192-255
    1. We went from (/27): 1100 0000 to 1101 1111
    2. To (/26): 1100 0000 to 1111 1111
  7. Now this new range matches all the possible addresses of networks B, AB and BC!

Now for C and AC.

  1. Use the same steps as above
  2. You should get the general route: 192.168.160.0/24 which ranges from .0-255!

Something feels off… but lets try and make the routing table:

NetworksTarget AddrPort
A192.168.160.128/26pa0
B, AB, BC192.168.160.192/26pa1
C, AC192.168.160.0/24Pa2
Internet0.0.0.0/0pa3

We now have 2 general addresses:

  • 192.168.160.0-255 (/24) & 192.168.160.192-255 (/26)
  • They overlap.
  • This is not always a problem… But in this case it is. (see bellow for an example of when overlaps are okay)
  • Remember that the router will choose the most specific route!
  • AC’s network address is: 192.168.160.228
  • Instead of following the route we want (192.168.160.0-255 (/24))
  • It will follow the more specific route (192.168.160.192-255 (/26))
  • and we don’t want that… So! we have to choose to get rid of one of them…
  • So to maximise efficiency, we get rid of the general route that matches the least networks (C, AC)!
  • Here’s a table that visualises this better

Thus, giving us:

NetworksTarget AddrMaskPort
AC192.168.160.228/30pa2
A192.168.160.128/26pa0
B, AB, BC192.168.160.192/26pa1
C192.168.160.0/25Pa2
Internet0.0.0.0/0pa3

This table is ordered by most specific first for the sake of clarity. But, the order doesn’t actually matter, write it in any order that u wish.

Networks: The networks routed by this Target Address

Target Addr: The Address used to match an IP and specify its route

Port: The port the route should take

An Example Where it is Okay to Have Overlapping General Routes

Here’s what the full routing table looks like for our example router D:

NetworkNetwork AddrAddr RangePort
A192.168.0.0/26192.168.0.0-63pd0
B192.168.0.64/27192.168.0.64-95pd1
C192.168.0.96/27192.168.0.96-127pd1
D192.168.0.128/27192.168.0.128-159pd0
E192.168.0.160/27192.168.0.160-191pd0

This table is ordered by Increasing Network Address, I recommend ordering the full routing tables this way, as it makes it easier to generalise.

Let’s do the generalisation for Networks attached to pd0 (A, D, E):

  1. Find a general address that can encapsulate A, D and E
    • We can’t use 192.168.0.0/25 because that’s only ranges: 192.168.0.0-127
    • So we have to use 192.168.0.0/24. Which ranges: 192.168.0.0-255
  2. Find a general address that can encapsulate B & C
    • 192.168.0.64/26 ranges: 192.168.0.64-127
      • 192.168.0.64 → 192.168.0. 0100 0000
      • 192.168.0.127 → 192.168.0. 0111 1111

So! let’s make the Generalised Routing Table:

NetworkAddrMaskMatches Addresses in RangePort
B, C192.168.0.64/26192.168.0.64-127pd1
A, D, E192.168.0.0/24192.168.0.0-255pd0

This is perfectly fine! Our general address for network B & C only matches networks B & C.

Visualisations for when overlaps are ok