[erlang-bugs] EPMD protocol documentation

Bjorn Gustavsson bgustavsson@REDACTED
Thu Oct 16 15:32:27 CEST 2008


2008/9/12 Michael Regen <michael.regen@REDACTED>

> Hi,
>
> I think there are a couple of problems with the documentation of the EPMD
> protocol at http://erlang.org/doc/apps/erts/erl_dist_protocol.html#9.1 (in
> R12B-3 and R12B-4) as well as erts/emulator/internal_doc/erl_ext_dist.txt
> (in R12B-3):
>

Thanks!

The document should need much more work, but for R12B-5 I have corrected the
most glaring errors that you pointed out.



>
> * ALIVE2_REQ:
> DistrvsnRange is 4 bytes, not 2. "Four bytes where MSB (2 bytes) =
> Highestvsn and LSB (2 bytes) = Lowestvsn. For erts-4.6.x (OTP-R3)the vsn = 0
> For erts-4.7.x (OTP-R4) = ?????."
>

Corrected.


>
> * PORT2_RESP:
> Elen is described as 2 byte field. But at least if during ALIVE2_REQ no
> extra field was provided (as I think erts usually does) then PORT2_RESP just
> returns Elen as one byte = 0. And erts does not seem to work correctly if we
> send back a packet as specified.
>

The version number fields had the wrong size. Corrected.

The Erlang system ignores the name field and everything following it. That
Elen is shorter seems to be because of a bug in EPMD that has not
been noticed (because it is harmless because the Erlang system doesn't care
anyway).



>
> * NAMES_RESP:
> In the documentation it looks like one packet should be sent back
> containing the whole answer whereas in reality EPMDPortNo and each answer
> are sent back in different packets.
>

TCP/IP is stream-oriented and has no packets, so the documentation is
correct.


>
> * DUMP_RESP:
> Same as for NAMES_RESP: different packets are expected.
>

Same answer as for NAMES_RESP.

>
> Furthermore the documentation speficies NodeInfo as expressed in Erlang:
> io:format("active name     ~s at port ~p, fd = ~p ~n", [NodeName, Port,
> Fd]).
> for registered nodes. Correct would be:
> io:format("active name     <~s> at port ~p, fd = ~p~n", [NodeName, Port,
> Fd]).
> Notice the <> characters!
>

The documentation should really document the binary format, so I see no
point in changing this.


> For unregistered nodes:
> io:format("old/unused name ~s at port ~p, fd = ~p~n", [NodeName, Port,
> Fd]).
> io:format("old/unused name <~s>, port = ~p, fd = ~p ~n", [NodeName, Port,
> Fd]).
> Notice the <> characters as well as the last space before the new line!
>
> Furthermore it might be good to mention that all answers are followed by a
> close of the socket except for ALIVE2_RESP.
>

I added a note about that to the description of PORT2_RESP.


> Might also be good to mention that all integers are in big-endian format.
>

I have done that.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20081016/ec4f21ae/attachment.htm>


More information about the erlang-bugs mailing list