What is the function of nephridia?

Excretion is the function of nephridia