A class of topological nodal rings and its realization in carbon networks