About Adaptive Data Rate

I am trying to understand how the ADR works and I need some clarification.

First, am I right ?

When the deviceStatutMargin is under the installation_margin, the server will ask it to increase its DR.

If I am right, how many uplinks message does it need to change the DR ? Only one ?

For the descrease of the DR, is it only node-side ? If the device does not receive any ack during N uplinks then it will automatically descrease the DR ? (with N stored in the device).

And, for the activation, how is it working ? I guess that the node tries several DR starting by the highest until it receives a join-accept.

Please refer to the LoRaWAN specification for more details on this. Most of your questions are documented under the LinkADRReq mac-command.

Yes, the server will only increase the data-rate, it will never decrease the data-rate. The device will do this when it detects it became disconnected from the network (also documented in the LoRaWAN spec).