A sender will send a packet with DF (Don't fragment) bit on to the destination. If any of the device in the middle or destination device having smaller MTU Compare the sender device then that device will drop this packet and send back an ICMP "Fragment to XXXX B) message and now sender get the smallest MTU in the path. And this process is called PDMTU.
Tye to understand the same with an example:
R1 is the sender and R3 is receiver then
R1 (MTU 1500)-------->R2 (MTU1400)--------->R3 (MTU 1500)
The 1st packet with 1480+20 (1500) Sent from the R1 to R3 with DF bit set ON
R2 Receive the Packet and dropped due to DF bit set ON and he failed to Defragment.
R2 Sent an ICMP reply to R1 with its own MTU value.
R1 will send next packet in 1380+20 (1400B).
Here, ICMP is playing a good role and always recommended to not block the Complete ICMP protocol. If you want to block the PING then only block the certain packet.
MTU settings change only request when needed, so it is only for testing when you have issue fragmentation in the network.
you can use below tool