$ns set-address-format hierarchical <#n hierarchy levels> <#bits for level1> <#bits for level 2> ....<#bits for nth level>
An example configuration would be:
$ns set-address-format hierarchical 2 8 15
where 2 levels of hierarchy is specified, assigning 8 bits for the 1st level and 15 bits for the second.