On Tue, Jun 27, 2000 at 04:43:00PM -0500, David Frascone wrote:
> 1) DIAMETER can run on any port (it's configurable), and the most common
> port to run on is the RADIUS port. How can I register two protocols
> types to the same UDP port? (If it is a DIAMETER message, the first
> byte is 0xfe) For now, I'm using a secondary port, 2645.
Given that
ftp://ftp.isi.edu/internet-drafts/draft-calhoun-diameter-16.txt
says
RADIUS PCC
The RADIUS Packet Compatibility Code (PCC) field is a one octet
field which is used for backward compatibility with RADIUS and
MUST be set to 254. In order to easily distinguish DIAMETER
messages from RADIUS, the value of 254 has been reserved and
allows implementations to support both protocols by using the
first octet in the header.
this indicates that, at least for port 1812, the correct behavior of a
dissector would be to check whether the first octet is 254; if so, treat
the packet as DIAMETER, otherwise treat it as RADIUS, to handle
implementations that support both protocols.
For other ports (e.g. 1645, which RFC 2138 says was used for "the early
deployment of RADIUS", which was an error as that was used by the
"datametrics" service), either the same strategy could be used, or the
packets could be handed to an always-RADIUS or always-DIAMETER
dissector.
So a dissector function would be registered for UDP port 1812 which
checks the first octet of the packet, and:
if it's 254, dissects it as DIAMETER;
if it's not 254, hands it to the RADIUS dissector.
This would neither require registering two protocols for the same UDP
port nor having dissectors return Boolean values.
It's not a general solution, but I'm not sure whether there *is* a
general solution; in this particular case, the draft in question
indicates how the port conflict is to be resolved, which may not apply
to other port conflicts.