The majority of the nucleon masses comes from quark interactions! the differences between the proton (udu) and neutron (udd) is that the has neutron's second down quark is heavier than the proton's second up quark. So the greater mass of this down quark gives the neutron a greater mass than the proton