You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Christofer Dutz <ch...@c-ware.de> on 2023/05/05 13:17:33 UTC
[DISCUSS] Have some sort of multi-connection?
Hi all,
while going through Cesar’s changes I noticed that he actually addressed something I keept on avoiding ;-) ... Multi-Connections. I know I needed them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP base transport and UDP config) ... I solved the problem by implementing the UDP stuff manually, completely avoiding Netty .. but I think it would be more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did it.
However, Cesars version is hard-coded for S7 and S7HA. I would suggest to build a more generic solution ... what do you folks think?
Chris
AW: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Christofer Dutz <ch...@c-ware.de>.
Well I think the Connection Pool doesn’t quite match in this case.
It’s more of a fixed group of connections, where each serves a different purpose.
And they share the metadata and functionality ... so for example if one connection detects that the S7 is a 300 or 400, then the driver supports subscriptions and the main connection is used to setup the subscription on the second subscription connection.
Chris
Von: Jinlin Hong <my...@gmail.com>
Datum: Donnerstag, 11. Mai 2023 um 03:07
An: dev@plc4x.apache.org <de...@plc4x.apache.org>
Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
Hello Chris.
Now that we have PlcConnection, is MultiConnection or AggregatedConnection
something like a connection pool to store PlcConnection?
Jinlin
Christofer Dutz <ch...@c-ware.de> 於 2023年5月10日 週三 下午8:13寫道:
> Hi Sebastian,
>
> Yeah ... like your name more :-)
>
> And I’ve sort of dug a bit more ... and currently we have the
> “PlcConnection” which contains the TagBuilder, PlcValueBuilder, the read,
> write, subscribe stuff ... I think we don’t even want to proxy these ...
> the interesting part might be the Protocol ... as this seems to be the
> thing that is associated with the individual connections.
>
> In ADS the Protocol for the UDP Config stuff is different from the ADS TCP
> stuff ... in PROFINET the raw subscription stuff is separate from the
> Read/Write/Config ....
>
> So possibly even worth thinking of a Multi-Protocol or AggregatedProtocol
> ...
>
> Chris
>
>
> Von: Sebastian Rühl <sr...@apache.org>
> Datum: Mittwoch, 10. Mai 2023 um 13:34
> An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
> Hi Chris,
>
> I also had the name AggregatedConnection flying around in my head (maybe I
> think to much of multi vitamin when reading MultiConnection :D)
>
> What would be helpful is to list the scenarios in a wiki site and then
> think through what each connection would have to to in which usecases. This
> might help to better find edge cases and surprises. Also approaching that
> with TDD might be super helpful to get a better feeling for your proposed
> design.
>
> - Sebastian
>
> On 2023/05/10 09:27:15 Christofer Dutz wrote:
> > Hi all,
> >
> > I’ve been thinking about this for the last few days now and I think I’ve
> got an idea:
> >
> >
> > * We add some sort of “MultiConnection” ... it has the same general
> interface as our other connections do
> > * Internally the MultiConnection has named-connections which are
> stored in a map
> > * When connecting, we somehow need to be able to pass in these
> multiple connections
> > * All Disconnect/Connect etc. functions simply relay to all named
> connections
> > * Additionally the MultiConnection has a “getConnectionNames” and a
> “getConnection(name)” method
> > * The integration testsuite gets extended to you can pass in an
> optional connection name which it then uses to select the right internal
> connection
> >
> > One thing I’m not quite sure about how to handle it ... we currently
> have the idea of a driver being able to provide a default transport. This
> can be overridden by the user. Like in modbus-rcp, which defaults to
> serial, but you can switch it to TCP.
> >
> > This mechanism will be difficult with MultiConnection.
> >
> > We could mark one connection as “default connection” and this one keeps
> the felxibility we had, but the others would be fixed.
> > Or we simply not allow this flexibility for MultiConnection connections.
> >
> > I think now allowing the overrides would be the simpler solution and for
> all the drivers I know that need multiple connections, you can’t really run
> them with anything different anyway.
> >
> > So, what do you folks think?
> >
> > So I would opt for doing the MultiConnection thing as described (not
> fixed on the name though) and simply not allowing transport overrides for
> multi-connection drivers (We could always add that feature later, if we
> find out to require it)
> >
> > Chris
> >
> > Von: Ben Hutcheson <be...@gmail.com>
> > Datum: Samstag, 6. Mai 2023 um 19:39
> > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> > Hi,
> >
> > Definitely +1, it would be great to be able to have multiple
> > connections/protocols handled in a consistent way. PROFINET is a prime
> > example of one that would benefit, as it uses multiple protocols (LLDP,
> > DCP, PNIO) as well as multiple end devices.
> >
> > Let me know if I can help.
> >
> > Ben
> >
> > On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
> >
> > > +1 for building a more generic solution for multi-connections as it
> helps
> > > for PROFINET and ADS as well
> > >
> > > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > > christofer.dutz@c-ware.de>:
> > >
> > > > Hi all,
> > > >
> > > > while going through Cesar’s changes I noticed that he actually
> addressed
> > > > something I keept on avoiding ;-) ... Multi-Connections. I know I
> needed
> > > > them for PROFINET (Raw base transport and UDP config) as well as ADS
> (TCP
> > > > base transport and UDP config) ... I solved the problem by
> implementing
> > > the
> > > > UDP stuff manually, completely avoiding Netty .. but I think it
> would be
> > > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar
> did
> > > it.
> > > >
> > > > However, Cesars version is hard-coded for S7 and S7HA. I would
> suggest to
> > > > build a more generic solution ... what do you folks think?
> > > >
> > > > Chris
> > > >
> > >
> >
>
AW: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi all,
So, I quickly went through our Java stuff and wrote down an initial version:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=255069989
Please review it, update and correct it where needed.
So far I see ADS, Profinet and S7 in need of some solution.
Chris
Von: Ben Hutcheson <be...@gmail.com>
Datum: Donnerstag, 11. Mai 2023 um 04:11
An: dev@plc4x.apache.org <de...@plc4x.apache.org>
Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
Hey,
It sounds like a plausible way of doing things. I like Sebastian's idea of
exploring all the use cases that we have.
One thing I'm not 100% sure about is when we have multiple devices on the
network and we need to share a connection between them all.
For Profinet we have shared LLDP, UDP and PNIO Endpoints on the controller,
which all devices use.
Ben
On Thu, May 11, 2023 at 3:08 AM Jinlin Hong <my...@gmail.com> wrote:
> Hello Chris.
> Now that we have PlcConnection, is MultiConnection or AggregatedConnection
> something like a connection pool to store PlcConnection?
> Jinlin
>
> Christofer Dutz <ch...@c-ware.de> 於 2023年5月10日 週三 下午8:13寫道:
>
> > Hi Sebastian,
> >
> > Yeah ... like your name more :-)
> >
> > And I’ve sort of dug a bit more ... and currently we have the
> > “PlcConnection” which contains the TagBuilder, PlcValueBuilder, the read,
> > write, subscribe stuff ... I think we don’t even want to proxy these ...
> > the interesting part might be the Protocol ... as this seems to be the
> > thing that is associated with the individual connections.
> >
> > In ADS the Protocol for the UDP Config stuff is different from the ADS
> TCP
> > stuff ... in PROFINET the raw subscription stuff is separate from the
> > Read/Write/Config ....
> >
> > So possibly even worth thinking of a Multi-Protocol or AggregatedProtocol
> > ...
> >
> > Chris
> >
> >
> > Von: Sebastian Rühl <sr...@apache.org>
> > Datum: Mittwoch, 10. Mai 2023 um 13:34
> > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
> > Hi Chris,
> >
> > I also had the name AggregatedConnection flying around in my head (maybe
> I
> > think to much of multi vitamin when reading MultiConnection :D)
> >
> > What would be helpful is to list the scenarios in a wiki site and then
> > think through what each connection would have to to in which usecases.
> This
> > might help to better find edge cases and surprises. Also approaching that
> > with TDD might be super helpful to get a better feeling for your proposed
> > design.
> >
> > - Sebastian
> >
> > On 2023/05/10 09:27:15 Christofer Dutz wrote:
> > > Hi all,
> > >
> > > I’ve been thinking about this for the last few days now and I think
> I’ve
> > got an idea:
> > >
> > >
> > > * We add some sort of “MultiConnection” ... it has the same general
> > interface as our other connections do
> > > * Internally the MultiConnection has named-connections which are
> > stored in a map
> > > * When connecting, we somehow need to be able to pass in these
> > multiple connections
> > > * All Disconnect/Connect etc. functions simply relay to all named
> > connections
> > > * Additionally the MultiConnection has a “getConnectionNames” and a
> > “getConnection(name)” method
> > > * The integration testsuite gets extended to you can pass in an
> > optional connection name which it then uses to select the right internal
> > connection
> > >
> > > One thing I’m not quite sure about how to handle it ... we currently
> > have the idea of a driver being able to provide a default transport. This
> > can be overridden by the user. Like in modbus-rcp, which defaults to
> > serial, but you can switch it to TCP.
> > >
> > > This mechanism will be difficult with MultiConnection.
> > >
> > > We could mark one connection as “default connection” and this one keeps
> > the felxibility we had, but the others would be fixed.
> > > Or we simply not allow this flexibility for MultiConnection
> connections.
> > >
> > > I think now allowing the overrides would be the simpler solution and
> for
> > all the drivers I know that need multiple connections, you can’t really
> run
> > them with anything different anyway.
> > >
> > > So, what do you folks think?
> > >
> > > So I would opt for doing the MultiConnection thing as described (not
> > fixed on the name though) and simply not allowing transport overrides for
> > multi-connection drivers (We could always add that feature later, if we
> > find out to require it)
> > >
> > > Chris
> > >
> > > Von: Ben Hutcheson <be...@gmail.com>
> > > Datum: Samstag, 6. Mai 2023 um 19:39
> > > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > > Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> > > Hi,
> > >
> > > Definitely +1, it would be great to be able to have multiple
> > > connections/protocols handled in a consistent way. PROFINET is a prime
> > > example of one that would benefit, as it uses multiple protocols (LLDP,
> > > DCP, PNIO) as well as multiple end devices.
> > >
> > > Let me know if I can help.
> > >
> > > Ben
> > >
> > > On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com>
> wrote:
> > >
> > > > +1 for building a more generic solution for multi-connections as it
> > helps
> > > > for PROFINET and ADS as well
> > > >
> > > > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > > > christofer.dutz@c-ware.de>:
> > > >
> > > > > Hi all,
> > > > >
> > > > > while going through Cesar’s changes I noticed that he actually
> > addressed
> > > > > something I keept on avoiding ;-) ... Multi-Connections. I know I
> > needed
> > > > > them for PROFINET (Raw base transport and UDP config) as well as
> ADS
> > (TCP
> > > > > base transport and UDP config) ... I solved the problem by
> > implementing
> > > > the
> > > > > UDP stuff manually, completely avoiding Netty .. but I think it
> > would be
> > > > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar
> > did
> > > > it.
> > > > >
> > > > > However, Cesars version is hard-coded for S7 and S7HA. I would
> > suggest to
> > > > > build a more generic solution ... what do you folks think?
> > > > >
> > > > > Chris
> > > > >
> > > >
> > >
> >
>
Re: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Ben Hutcheson <be...@gmail.com>.
Hey,
It sounds like a plausible way of doing things. I like Sebastian's idea of
exploring all the use cases that we have.
One thing I'm not 100% sure about is when we have multiple devices on the
network and we need to share a connection between them all.
For Profinet we have shared LLDP, UDP and PNIO Endpoints on the controller,
which all devices use.
Ben
On Thu, May 11, 2023 at 3:08 AM Jinlin Hong <my...@gmail.com> wrote:
> Hello Chris.
> Now that we have PlcConnection, is MultiConnection or AggregatedConnection
> something like a connection pool to store PlcConnection?
> Jinlin
>
> Christofer Dutz <ch...@c-ware.de> 於 2023年5月10日 週三 下午8:13寫道:
>
> > Hi Sebastian,
> >
> > Yeah ... like your name more :-)
> >
> > And I’ve sort of dug a bit more ... and currently we have the
> > “PlcConnection” which contains the TagBuilder, PlcValueBuilder, the read,
> > write, subscribe stuff ... I think we don’t even want to proxy these ...
> > the interesting part might be the Protocol ... as this seems to be the
> > thing that is associated with the individual connections.
> >
> > In ADS the Protocol for the UDP Config stuff is different from the ADS
> TCP
> > stuff ... in PROFINET the raw subscription stuff is separate from the
> > Read/Write/Config ....
> >
> > So possibly even worth thinking of a Multi-Protocol or AggregatedProtocol
> > ...
> >
> > Chris
> >
> >
> > Von: Sebastian Rühl <sr...@apache.org>
> > Datum: Mittwoch, 10. Mai 2023 um 13:34
> > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
> > Hi Chris,
> >
> > I also had the name AggregatedConnection flying around in my head (maybe
> I
> > think to much of multi vitamin when reading MultiConnection :D)
> >
> > What would be helpful is to list the scenarios in a wiki site and then
> > think through what each connection would have to to in which usecases.
> This
> > might help to better find edge cases and surprises. Also approaching that
> > with TDD might be super helpful to get a better feeling for your proposed
> > design.
> >
> > - Sebastian
> >
> > On 2023/05/10 09:27:15 Christofer Dutz wrote:
> > > Hi all,
> > >
> > > I’ve been thinking about this for the last few days now and I think
> I’ve
> > got an idea:
> > >
> > >
> > > * We add some sort of “MultiConnection” ... it has the same general
> > interface as our other connections do
> > > * Internally the MultiConnection has named-connections which are
> > stored in a map
> > > * When connecting, we somehow need to be able to pass in these
> > multiple connections
> > > * All Disconnect/Connect etc. functions simply relay to all named
> > connections
> > > * Additionally the MultiConnection has a “getConnectionNames” and a
> > “getConnection(name)” method
> > > * The integration testsuite gets extended to you can pass in an
> > optional connection name which it then uses to select the right internal
> > connection
> > >
> > > One thing I’m not quite sure about how to handle it ... we currently
> > have the idea of a driver being able to provide a default transport. This
> > can be overridden by the user. Like in modbus-rcp, which defaults to
> > serial, but you can switch it to TCP.
> > >
> > > This mechanism will be difficult with MultiConnection.
> > >
> > > We could mark one connection as “default connection” and this one keeps
> > the felxibility we had, but the others would be fixed.
> > > Or we simply not allow this flexibility for MultiConnection
> connections.
> > >
> > > I think now allowing the overrides would be the simpler solution and
> for
> > all the drivers I know that need multiple connections, you can’t really
> run
> > them with anything different anyway.
> > >
> > > So, what do you folks think?
> > >
> > > So I would opt for doing the MultiConnection thing as described (not
> > fixed on the name though) and simply not allowing transport overrides for
> > multi-connection drivers (We could always add that feature later, if we
> > find out to require it)
> > >
> > > Chris
> > >
> > > Von: Ben Hutcheson <be...@gmail.com>
> > > Datum: Samstag, 6. Mai 2023 um 19:39
> > > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > > Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> > > Hi,
> > >
> > > Definitely +1, it would be great to be able to have multiple
> > > connections/protocols handled in a consistent way. PROFINET is a prime
> > > example of one that would benefit, as it uses multiple protocols (LLDP,
> > > DCP, PNIO) as well as multiple end devices.
> > >
> > > Let me know if I can help.
> > >
> > > Ben
> > >
> > > On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com>
> wrote:
> > >
> > > > +1 for building a more generic solution for multi-connections as it
> > helps
> > > > for PROFINET and ADS as well
> > > >
> > > > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > > > christofer.dutz@c-ware.de>:
> > > >
> > > > > Hi all,
> > > > >
> > > > > while going through Cesar’s changes I noticed that he actually
> > addressed
> > > > > something I keept on avoiding ;-) ... Multi-Connections. I know I
> > needed
> > > > > them for PROFINET (Raw base transport and UDP config) as well as
> ADS
> > (TCP
> > > > > base transport and UDP config) ... I solved the problem by
> > implementing
> > > > the
> > > > > UDP stuff manually, completely avoiding Netty .. but I think it
> > would be
> > > > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar
> > did
> > > > it.
> > > > >
> > > > > However, Cesars version is hard-coded for S7 and S7HA. I would
> > suggest to
> > > > > build a more generic solution ... what do you folks think?
> > > > >
> > > > > Chris
> > > > >
> > > >
> > >
> >
>
Re: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Jinlin Hong <my...@gmail.com>.
Hello Chris.
Now that we have PlcConnection, is MultiConnection or AggregatedConnection
something like a connection pool to store PlcConnection?
Jinlin
Christofer Dutz <ch...@c-ware.de> 於 2023年5月10日 週三 下午8:13寫道:
> Hi Sebastian,
>
> Yeah ... like your name more :-)
>
> And I’ve sort of dug a bit more ... and currently we have the
> “PlcConnection” which contains the TagBuilder, PlcValueBuilder, the read,
> write, subscribe stuff ... I think we don’t even want to proxy these ...
> the interesting part might be the Protocol ... as this seems to be the
> thing that is associated with the individual connections.
>
> In ADS the Protocol for the UDP Config stuff is different from the ADS TCP
> stuff ... in PROFINET the raw subscription stuff is separate from the
> Read/Write/Config ....
>
> So possibly even worth thinking of a Multi-Protocol or AggregatedProtocol
> ...
>
> Chris
>
>
> Von: Sebastian Rühl <sr...@apache.org>
> Datum: Mittwoch, 10. Mai 2023 um 13:34
> An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
> Hi Chris,
>
> I also had the name AggregatedConnection flying around in my head (maybe I
> think to much of multi vitamin when reading MultiConnection :D)
>
> What would be helpful is to list the scenarios in a wiki site and then
> think through what each connection would have to to in which usecases. This
> might help to better find edge cases and surprises. Also approaching that
> with TDD might be super helpful to get a better feeling for your proposed
> design.
>
> - Sebastian
>
> On 2023/05/10 09:27:15 Christofer Dutz wrote:
> > Hi all,
> >
> > I’ve been thinking about this for the last few days now and I think I’ve
> got an idea:
> >
> >
> > * We add some sort of “MultiConnection” ... it has the same general
> interface as our other connections do
> > * Internally the MultiConnection has named-connections which are
> stored in a map
> > * When connecting, we somehow need to be able to pass in these
> multiple connections
> > * All Disconnect/Connect etc. functions simply relay to all named
> connections
> > * Additionally the MultiConnection has a “getConnectionNames” and a
> “getConnection(name)” method
> > * The integration testsuite gets extended to you can pass in an
> optional connection name which it then uses to select the right internal
> connection
> >
> > One thing I’m not quite sure about how to handle it ... we currently
> have the idea of a driver being able to provide a default transport. This
> can be overridden by the user. Like in modbus-rcp, which defaults to
> serial, but you can switch it to TCP.
> >
> > This mechanism will be difficult with MultiConnection.
> >
> > We could mark one connection as “default connection” and this one keeps
> the felxibility we had, but the others would be fixed.
> > Or we simply not allow this flexibility for MultiConnection connections.
> >
> > I think now allowing the overrides would be the simpler solution and for
> all the drivers I know that need multiple connections, you can’t really run
> them with anything different anyway.
> >
> > So, what do you folks think?
> >
> > So I would opt for doing the MultiConnection thing as described (not
> fixed on the name though) and simply not allowing transport overrides for
> multi-connection drivers (We could always add that feature later, if we
> find out to require it)
> >
> > Chris
> >
> > Von: Ben Hutcheson <be...@gmail.com>
> > Datum: Samstag, 6. Mai 2023 um 19:39
> > An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> > Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> > Hi,
> >
> > Definitely +1, it would be great to be able to have multiple
> > connections/protocols handled in a consistent way. PROFINET is a prime
> > example of one that would benefit, as it uses multiple protocols (LLDP,
> > DCP, PNIO) as well as multiple end devices.
> >
> > Let me know if I can help.
> >
> > Ben
> >
> > On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
> >
> > > +1 for building a more generic solution for multi-connections as it
> helps
> > > for PROFINET and ADS as well
> > >
> > > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > > christofer.dutz@c-ware.de>:
> > >
> > > > Hi all,
> > > >
> > > > while going through Cesar’s changes I noticed that he actually
> addressed
> > > > something I keept on avoiding ;-) ... Multi-Connections. I know I
> needed
> > > > them for PROFINET (Raw base transport and UDP config) as well as ADS
> (TCP
> > > > base transport and UDP config) ... I solved the problem by
> implementing
> > > the
> > > > UDP stuff manually, completely avoiding Netty .. but I think it
> would be
> > > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar
> did
> > > it.
> > > >
> > > > However, Cesars version is hard-coded for S7 and S7HA. I would
> suggest to
> > > > build a more generic solution ... what do you folks think?
> > > >
> > > > Chris
> > > >
> > >
> >
>
AW: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Sebastian,
Yeah ... like your name more :-)
And I’ve sort of dug a bit more ... and currently we have the “PlcConnection” which contains the TagBuilder, PlcValueBuilder, the read, write, subscribe stuff ... I think we don’t even want to proxy these ... the interesting part might be the Protocol ... as this seems to be the thing that is associated with the individual connections.
In ADS the Protocol for the UDP Config stuff is different from the ADS TCP stuff ... in PROFINET the raw subscription stuff is separate from the Read/Write/Config ....
So possibly even worth thinking of a Multi-Protocol or AggregatedProtocol ...
Chris
Von: Sebastian Rühl <sr...@apache.org>
Datum: Mittwoch, 10. Mai 2023 um 13:34
An: dev@plc4x.apache.org <de...@plc4x.apache.org>
Betreff: Re: AW: [DISCUSS] Have some sort of multi-connection?
Hi Chris,
I also had the name AggregatedConnection flying around in my head (maybe I think to much of multi vitamin when reading MultiConnection :D)
What would be helpful is to list the scenarios in a wiki site and then think through what each connection would have to to in which usecases. This might help to better find edge cases and surprises. Also approaching that with TDD might be super helpful to get a better feeling for your proposed design.
- Sebastian
On 2023/05/10 09:27:15 Christofer Dutz wrote:
> Hi all,
>
> I’ve been thinking about this for the last few days now and I think I’ve got an idea:
>
>
> * We add some sort of “MultiConnection” ... it has the same general interface as our other connections do
> * Internally the MultiConnection has named-connections which are stored in a map
> * When connecting, we somehow need to be able to pass in these multiple connections
> * All Disconnect/Connect etc. functions simply relay to all named connections
> * Additionally the MultiConnection has a “getConnectionNames” and a “getConnection(name)” method
> * The integration testsuite gets extended to you can pass in an optional connection name which it then uses to select the right internal connection
>
> One thing I’m not quite sure about how to handle it ... we currently have the idea of a driver being able to provide a default transport. This can be overridden by the user. Like in modbus-rcp, which defaults to serial, but you can switch it to TCP.
>
> This mechanism will be difficult with MultiConnection.
>
> We could mark one connection as “default connection” and this one keeps the felxibility we had, but the others would be fixed.
> Or we simply not allow this flexibility for MultiConnection connections.
>
> I think now allowing the overrides would be the simpler solution and for all the drivers I know that need multiple connections, you can’t really run them with anything different anyway.
>
> So, what do you folks think?
>
> So I would opt for doing the MultiConnection thing as described (not fixed on the name though) and simply not allowing transport overrides for multi-connection drivers (We could always add that feature later, if we find out to require it)
>
> Chris
>
> Von: Ben Hutcheson <be...@gmail.com>
> Datum: Samstag, 6. Mai 2023 um 19:39
> An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> Hi,
>
> Definitely +1, it would be great to be able to have multiple
> connections/protocols handled in a consistent way. PROFINET is a prime
> example of one that would benefit, as it uses multiple protocols (LLDP,
> DCP, PNIO) as well as multiple end devices.
>
> Let me know if I can help.
>
> Ben
>
> On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
>
> > +1 for building a more generic solution for multi-connections as it helps
> > for PROFINET and ADS as well
> >
> > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > christofer.dutz@c-ware.de>:
> >
> > > Hi all,
> > >
> > > while going through Cesar’s changes I noticed that he actually addressed
> > > something I keept on avoiding ;-) ... Multi-Connections. I know I needed
> > > them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP
> > > base transport and UDP config) ... I solved the problem by implementing
> > the
> > > UDP stuff manually, completely avoiding Netty .. but I think it would be
> > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did
> > it.
> > >
> > > However, Cesars version is hard-coded for S7 and S7HA. I would suggest to
> > > build a more generic solution ... what do you folks think?
> > >
> > > Chris
> > >
> >
>
Re: AW: [DISCUSS] Have some sort of multi-connection?
Posted by Sebastian Rühl <sr...@apache.org>.
Hi Chris,
I also had the name AggregatedConnection flying around in my head (maybe I think to much of multi vitamin when reading MultiConnection :D)
What would be helpful is to list the scenarios in a wiki site and then think through what each connection would have to to in which usecases. This might help to better find edge cases and surprises. Also approaching that with TDD might be super helpful to get a better feeling for your proposed design.
- Sebastian
On 2023/05/10 09:27:15 Christofer Dutz wrote:
> Hi all,
>
> I’ve been thinking about this for the last few days now and I think I’ve got an idea:
>
>
> * We add some sort of “MultiConnection” ... it has the same general interface as our other connections do
> * Internally the MultiConnection has named-connections which are stored in a map
> * When connecting, we somehow need to be able to pass in these multiple connections
> * All Disconnect/Connect etc. functions simply relay to all named connections
> * Additionally the MultiConnection has a “getConnectionNames” and a “getConnection(name)” method
> * The integration testsuite gets extended to you can pass in an optional connection name which it then uses to select the right internal connection
>
> One thing I’m not quite sure about how to handle it ... we currently have the idea of a driver being able to provide a default transport. This can be overridden by the user. Like in modbus-rcp, which defaults to serial, but you can switch it to TCP.
>
> This mechanism will be difficult with MultiConnection.
>
> We could mark one connection as “default connection” and this one keeps the felxibility we had, but the others would be fixed.
> Or we simply not allow this flexibility for MultiConnection connections.
>
> I think now allowing the overrides would be the simpler solution and for all the drivers I know that need multiple connections, you can’t really run them with anything different anyway.
>
> So, what do you folks think?
>
> So I would opt for doing the MultiConnection thing as described (not fixed on the name though) and simply not allowing transport overrides for multi-connection drivers (We could always add that feature later, if we find out to require it)
>
> Chris
>
> Von: Ben Hutcheson <be...@gmail.com>
> Datum: Samstag, 6. Mai 2023 um 19:39
> An: dev@plc4x.apache.org <de...@plc4x.apache.org>
> Betreff: Re: [DISCUSS] Have some sort of multi-connection?
> Hi,
>
> Definitely +1, it would be great to be able to have multiple
> connections/protocols handled in a consistent way. PROFINET is a prime
> example of one that would benefit, as it uses multiple protocols (LLDP,
> DCP, PNIO) as well as multiple end devices.
>
> Let me know if I can help.
>
> Ben
>
> On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
>
> > +1 for building a more generic solution for multi-connections as it helps
> > for PROFINET and ADS as well
> >
> > Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> > christofer.dutz@c-ware.de>:
> >
> > > Hi all,
> > >
> > > while going through Cesar’s changes I noticed that he actually addressed
> > > something I keept on avoiding ;-) ... Multi-Connections. I know I needed
> > > them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP
> > > base transport and UDP config) ... I solved the problem by implementing
> > the
> > > UDP stuff manually, completely avoiding Netty .. but I think it would be
> > > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did
> > it.
> > >
> > > However, Cesars version is hard-coded for S7 and S7HA. I would suggest to
> > > build a more generic solution ... what do you folks think?
> > >
> > > Chris
> > >
> >
>
AW: [DISCUSS] Have some sort of multi-connection?
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi all,
I’ve been thinking about this for the last few days now and I think I’ve got an idea:
* We add some sort of “MultiConnection” ... it has the same general interface as our other connections do
* Internally the MultiConnection has named-connections which are stored in a map
* When connecting, we somehow need to be able to pass in these multiple connections
* All Disconnect/Connect etc. functions simply relay to all named connections
* Additionally the MultiConnection has a “getConnectionNames” and a “getConnection(name)” method
* The integration testsuite gets extended to you can pass in an optional connection name which it then uses to select the right internal connection
One thing I’m not quite sure about how to handle it ... we currently have the idea of a driver being able to provide a default transport. This can be overridden by the user. Like in modbus-rcp, which defaults to serial, but you can switch it to TCP.
This mechanism will be difficult with MultiConnection.
We could mark one connection as “default connection” and this one keeps the felxibility we had, but the others would be fixed.
Or we simply not allow this flexibility for MultiConnection connections.
I think now allowing the overrides would be the simpler solution and for all the drivers I know that need multiple connections, you can’t really run them with anything different anyway.
So, what do you folks think?
So I would opt for doing the MultiConnection thing as described (not fixed on the name though) and simply not allowing transport overrides for multi-connection drivers (We could always add that feature later, if we find out to require it)
Chris
Von: Ben Hutcheson <be...@gmail.com>
Datum: Samstag, 6. Mai 2023 um 19:39
An: dev@plc4x.apache.org <de...@plc4x.apache.org>
Betreff: Re: [DISCUSS] Have some sort of multi-connection?
Hi,
Definitely +1, it would be great to be able to have multiple
connections/protocols handled in a consistent way. PROFINET is a prime
example of one that would benefit, as it uses multiple protocols (LLDP,
DCP, PNIO) as well as multiple end devices.
Let me know if I can help.
Ben
On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
> +1 for building a more generic solution for multi-connections as it helps
> for PROFINET and ADS as well
>
> Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> christofer.dutz@c-ware.de>:
>
> > Hi all,
> >
> > while going through Cesar’s changes I noticed that he actually addressed
> > something I keept on avoiding ;-) ... Multi-Connections. I know I needed
> > them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP
> > base transport and UDP config) ... I solved the problem by implementing
> the
> > UDP stuff manually, completely avoiding Netty .. but I think it would be
> > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did
> it.
> >
> > However, Cesars version is hard-coded for S7 and S7HA. I would suggest to
> > build a more generic solution ... what do you folks think?
> >
> > Chris
> >
>
Re: [DISCUSS] Have some sort of multi-connection?
Posted by Ben Hutcheson <be...@gmail.com>.
Hi,
Definitely +1, it would be great to be able to have multiple
connections/protocols handled in a consistent way. PROFINET is a prime
example of one that would benefit, as it uses multiple protocols (LLDP,
DCP, PNIO) as well as multiple end devices.
Let me know if I can help.
Ben
On Sat, May 6, 2023 at 1:20 PM Lukas Ott <ot...@gmail.com> wrote:
> +1 for building a more generic solution for multi-connections as it helps
> for PROFINET and ADS as well
>
> Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
> christofer.dutz@c-ware.de>:
>
> > Hi all,
> >
> > while going through Cesar’s changes I noticed that he actually addressed
> > something I keept on avoiding ;-) ... Multi-Connections. I know I needed
> > them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP
> > base transport and UDP config) ... I solved the problem by implementing
> the
> > UDP stuff manually, completely avoiding Netty .. but I think it would be
> > more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did
> it.
> >
> > However, Cesars version is hard-coded for S7 and S7HA. I would suggest to
> > build a more generic solution ... what do you folks think?
> >
> > Chris
> >
>
Re: [DISCUSS] Have some sort of multi-connection?
Posted by Lukas Ott <ot...@gmail.com>.
+1 for building a more generic solution for multi-connections as it helps
for PROFINET and ADS as well
Am Fr., 5. Mai 2023 um 15:17 Uhr schrieb Christofer Dutz <
christofer.dutz@c-ware.de>:
> Hi all,
>
> while going through Cesar’s changes I noticed that he actually addressed
> something I keept on avoiding ;-) ... Multi-Connections. I know I needed
> them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP
> base transport and UDP config) ... I solved the problem by implementing the
> UDP stuff manually, completely avoiding Netty .. but I think it would be
> more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did it.
>
> However, Cesars version is hard-coded for S7 and S7HA. I would suggest to
> build a more generic solution ... what do you folks think?
>
> Chris
>
Re: [DISCUSS] Have some sort of multi-connection?
Posted by Łukasz Dywicki <lu...@code-house.org>.
We do have SingleProtocolStackConfigurer which suggests that somewhere
in the past there was an intent to have a
"MultiProtocolStackConfigurer". ;-)
Since we are reaching that point it raises a question what is the role
of PlcConnection and how to coordinate it, in case if it covers multiple
streams.
As far I remember one of protocols where we struggled with TCP and UDP
was Ethernet/IP which uses first for setup and other for subscriptions.
I believe that with work you are starting we will be able to get closer
to EIP spec.
One important point is - whether we isolate netty completely from the
game, and make protocol stack configurer a more independent thing or we
keep pushing everything over netty. We have a number of troubles caused
by netty - timeouts (with pending PR), we laso used to have connection
and thread leaks. Netty, with all its optimizations, is fairly
complicated underneath. Sometimes I feel we don't even get it. Its use
also seems to be a bit historic, cause first drivers which got
implemented by hand uses netty codecs.
Since our current way of setting up connection feels quite complicated,
I fear that we will make it even harder to debug over time. Now we pack
i.e. ether or canbus frames into a byte buffer just to spin netty's
old-io loop which fires our handler which with decoding logic.
Best,
Łukasz
On 5.05.2023 15:17, Christofer Dutz wrote:
> Hi all,
>
> while going through Cesar’s changes I noticed that he actually addressed something I keept on avoiding ;-) ... Multi-Connections. I know I needed them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP base transport and UDP config) ... I solved the problem by implementing the UDP stuff manually, completely avoiding Netty .. but I think it would be more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did it.
>
> However, Cesars version is hard-coded for S7 and S7HA. I would suggest to build a more generic solution ... what do you folks think?
>
> Chris
>
Re: [DISCUSS] Have some sort of multi-connection?
Posted by Łukasz Dywicki <lu...@code-house.org>.
We do have SingleProtocolStackConfigurer which suggests that somewhere
in the past there was an intent to have a
"MultiProtocolStackConfigurer". ;-)
Since we are reaching that point it raises a question what is the role
of PlcConnection and how to coordinate it, in case if it covers multiple
streams.
As far I remember one of protocols where we struggled with TCP and UDP
was Ethernet/IP which uses first for setup and other for subscriptions.
I believe that with work you are starting we will be able to get closer
to EIP spec.
One important point is - whether we isolate netty completely from the
game, and make protocol stack configurer a more independent thing or we
keep pushing everything over netty. We have a number of troubles caused
by netty - timeouts (with pending PR), we laso used to have connection
and thread leaks. Netty, with all its optimizations, is fairly
complicated underneath. Sometimes I feel we don't even get it. Its use
also seems to be a bit historic, cause first drivers which got
implemented by hand uses netty codecs.
Since our current way of setting up connection feels quite complicated,
I fear that we will make it even harder to debug over time. Now we pack
i.e. ether or canbus frames into a byte buffer just to spin netty's
old-io loop which fires our handler which with decoding logic.
Best,
Łukasz
On 5.05.2023 15:17, Christofer Dutz wrote:
> Hi all,
>
> while going through Cesar’s changes I noticed that he actually addressed something I keept on avoiding ;-) ... Multi-Connections. I know I needed them for PROFINET (Raw base transport and UDP config) as well as ADS (TCP base transport and UDP config) ... I solved the problem by implementing the UDP stuff manually, completely avoiding Netty .. but I think it would be more in the spirit of PLC4X to do it in a cleaner way ... as Cesar did it.
>
> However, Cesars version is hard-coded for S7 and S7HA. I would suggest to build a more generic solution ... what do you folks think?
>
> Chris
>