katalix / go-l2tp

Go library for building L2TP applications on Linux systems
MIT License
45 stars 15 forks source link

How to specify circuit id and digest hash type ? for tunneling between mikrotik and ubuntu(l2tpv3) #5

Closed b00tkitism closed 1 year ago

tomparkin commented 1 year ago

Hi @alom4hdi

I think for "circuit ID" you're probably referring to the Remote End ID AVP, and "digest hash type" refers to selection of digest type to be used for the Message Digest AVP, and the Remote End ID AVP.

Both these AVPs are used in L2TPv3 control messages. Currently go-l2tp supports the L2TPv3 dataplane only. There is limited support for the L2TPv2 control plane, but nothing for L2TPv3 at present.

b00tkitism commented 1 year ago

@tomparkin No, Remote End ID AVP and Circuit ID are not the same in L2TPv3. In L2TPv3, Remote End ID is used to identify the remote endpoint of a connection, while Circuit ID is used to identify the virtual circuit being used for the connection. The Circuit ID in L2TPv3 is used to differentiate between multiple connections that may be using the same physical interface.

And Digest Hash type is an hasg algorithm to verify packets for l2tpv3

tomparkin commented 1 year ago

Hi @alom4hdi,

Apologies if I made a poor assumption.

There's no "Circuit ID" in RFC3931 that I can see -- I think perhaps it's a Microtik-specific configuration parameter? From what you've said regarding its use to differentiate between multiple connections over the same physical interface I wonder whether it could possibly be the Router ID AVP (or maybe even the session ID itself)? If you can call out the parameter in terms of the RFC it'll be easier for me to comment more fully since I'm not overly familiar with Mikrotik.

In terms of digest hash, I think that's clearer, and the digest is specifically used as an integrity/authentication check on control messages (5.4.1. General Control Message AVPs, Message Digest), which go-l2tp doesn't currently implement for L2TPv3.

b00tkitism commented 1 year ago

@tomparkin Yeah, I checked RFC and I finded out that CircuitID is Mikrotik-specific configuration

Thanks for your help and Apologies for my mistake