Software-defined segmentation