input and output ring buffers