Skip to content

Lab · Computer Networking (CCNA level)

Lab: a VLSM plan for a college

Labbeginner· about 2 hours· 5 steps

The brief

An engineering college in Coimbatore has one /24 for its two computer labs, the staff room, the office and a router link. Size each subnet, split blocks into equal subnets, build a VLSM plan largest first, list the gateway for each subnet, and number the IPv6 /64 LANs from the college's /48.

Why it matters

Every new office, college or branch network starts with an IP plan, and VLSM is how engineers fit many differently sized subnets into a small block without waste. The gateway table you produce is what the people configuring the routers and the DHCP server work from, and IPv6 numbering is now asked for in every government and enterprise tender.

Skills you practise

  • hosts to prefix length
  • equal-size subnetting
  • VLSM, largest first
  • masks, gateways and broadcasts
  • IPv6 /48 and /64 numbering
  • the ipaddress module

What you will have at the end

subnets.py and the college's IP plan: five IPv4 subnets with masks, gateways and broadcasts, and the IPv6 /64 for each LAN.

How it is marked (rubric, 100 points)
Correct planThe VLSM plan, masks, gateways and IPv6 LANs all match the checks, with no overlaps.45
Edge casesExact fits (62 hosts), a block that is too small and an IPv6 number out of range are handled.20
Readable codevlsm() reuses size_for(); names say what each value is.15
Can check by handYou can work out one of the subnets on paper (block size, boundary, broadcast) and it agrees with the code.20

0/5 steps done

Step 1 of 5

How big a subnet?

size_for(hosts) returns (prefix, block size) for the smallest subnet with enough usable hosts, for example size_for(50) == (26, 64).

A subnet with h host bits has 2 ** h addresses, and 2 ** h - 2 usable ones (the network and broadcast addresses are not usable). Start with h = 2 (a /30, the smallest normal subnet) and add one bit until 2 ** h - 2 is at least the number of hosts. The prefix is 32 - h and the block size is 2 ** h.

Run shows what your code prints. Check runs the step's tests. Ctrl+Enter checks too.