A Reliable Communication Framework and Its Use in Internet of Things (IoT)