Calculate segment_id for VLAN mode