What two ways are networks classified?