repair protocol and decoding