[haiku-development] Re: How to use RemoteDisk?

  • From: Andreas Färber <andreas.faerber@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 11 Jan 2010 02:24:03 +0100


Am 02.01.2010 um 05:40 schrieb François Revol:

"remote disk" is a simple hown-brewn protocol for serving a disk
image over
UDP.

Okay, I was somehow assuming that it was standardized, so I didn't
assume to find a server inside Haiku's sources. Been reading too much
about netcat, nbd and iSCSI it seems.

Actually there is a simple nbd client driver too, but it's not usable
as boot drive since it requires TCP.

Still, some TCP/IP stacks exist that are embedded in microcontrollers
with few kB of memory, so it should be doable ;p

It is. I gave it a try this weekend and just posted a proof of concept. :P

http://dev.haiku-os.org/ticket/5240

I mostly built this based on Tanenbaum's Computer Networks, 4th ed., and the related RFCs with some explanations from Wikipedia.

It can successfully exchange SYNs and FINs. Since my test server does an immediate Close(), you are likely to observe overlapping FINs during the teardown rather than the client-initiated "active close" sequence of events (FIN / FIN+ACK / ACK).

There's also some preparations for queueing, dequeuing and retransmitting actual data packets, but it needs more love - I believe queuing whole packets as for UDP is overkill here, as is the frequent translation between tcp_header and TCPPacket. Most packets are being leaked currently anyway, and congestion control is not implemented. :)

For some of the initializations I'd be in need of a PRNG but didn't find such a thing in that part of code, so I'm misusing system_time() for port and sequence number, with mixed success: If you try connecting from the same port again too quickly it will fail.

It would be nice if someone could look at
http://dev.haiku-os.org/ticket/5234
and commit a fix, in order for the checksums to work. Thanks!

Andreas

Other related posts: