R-gram: Inferring message formats of service protocols with relative positional n-grams