[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simplified protocol?



On Mon, Oct 15, 2018 at 03:54:45PM -0500, Greg Gabelmann wrote:
> Hello,
> 
> I'm interested in implementing a server for the NBD protocol (fixed
> newstyle) as a learning exercise. I've been reading about the protocol on
> NBD's github site and what I'm wondering is if there's a "simplified"
> version that I could implement. For example, no parallel connections, no
> TLS, etc. But the document is lengthy and I'm not sure which other features
> I can ignore safely...

The basic newstyle protocol is quite simple, and you can definitely
ignore both parallel connections and TLS.  Also all of the following
can be *ignored* in an initial implementation: NBD_CMD_DISC,
NBD_CMD_FLUSH, NBD_CMD_TRIM, NBD_CMD_WRITE_ZEROES, NBD_CMD_FLAG_*,
NBD_OPT_STARTTLS, NBD_OPT_GO, Structured Replies, Block Status,
Resize.

I would suggest looking at an existing implementation, as this may be
easier than trying to follow the spec, since the spec is more
concerned about writing an exactly correct implementation and covering
all the optional features.

https://github.com/libguestfs/nbdkit/blob/cde12907c00e215491e83337eb08a5a3b064a49b/src/connections.c#L909

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/


Reply to: