What causes knocking in drain pipes when hot water drains?
materials tend to expand when they get hot, and that is true for sewer pipe material as well. Whether it’s cast iron or ABS, the pipes will try to expand when they get hot and when they try to get longer they’ll slide across wood or other materials. The “knocking” noise is the pipe fitting tightly against the wood and when the pipe has expanded enough it moves suddently and for a short distance, producing a “pop” type of sound. If you can expose the pipe you can cut out the wood where it is tight and possibly put in other material so that the pipe doesn’t rub so hard.