I am travelling with a baby of 20 months. Is there a specific etiquette to respect when staying at a Japanese traditional ryokan?
I don't think there is a specific etiquette to follow. Common sense and good parenting though are key to insure a pleasant stay for both you and othe guests. Of course this is true for all travelling situations, regardless of location or accommodation type.
Having said this, internet kinda shows that several families with babies have successfully and enjoyably stayed in Ryokans. According to Red from the Japan: Stippy blog, bringing a baby to a Ryokan is feasible. Indeed it would seem that more and more Ryokans are adapting to families with children, and are offering dedicated facilities for these travellers. The blog post also suggests to check with the management before booking:
Japanese ryokan and hotels are also pretty well set up for a family with a little baby, although it’s often worth checking with the manager first to make sure they don’t mind you bringing a little child. It’s also worth confirming that they have a kettle in each room as you can use that to sterilise things or boil water for formula etc.
A quick google search did reveal a few facilities offering services for families with babies, or explicitly advertising themselves as baby-friendly. This is of course good news for you. These services revolve mostly around ensuring the family has privacy, be it by having them book a private family bath or by bringing meals to the room. In my opinion this is a very smart method: a child screaming in a private environment is less likely to disturb others but their family.
For more information on Ryokans, see the website of the Japanese Ryokan Association.