Gateway and Sub-Device