MAC for Machine-Type Communications in Industrial IoT - Part I: Protocol Design and Analysis