WireGuard Archive on lore.kernel.org
 help / color / Atom feed
* Introduce Wireguard support to bird
@ 2019-06-07 18:21 Janne Heß
  2019-06-07 21:57 ` Ondrej Zajicek
  2019-06-07 22:18 ` Toke Høiland-Jørgensen
  0 siblings, 2 replies; 6+ messages in thread
From: Janne Heß @ 2019-06-07 18:21 UTC (permalink / raw)
  To: bird-users; +Cc: wireguard

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

Hey everyone,

as advertised, I have completed the Wireguard support.
You might see that I am not really a C expert, but I hope the code is good enough.
If you need me to change anything or have additional questions, just let me know.

Regards
Janne

[-- Attachment #2: 0001-sysdep-linux-Introduce-Wireguard-support.patch --]
[-- Type: application/octet-stream, Size: 57736 bytes --]

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Introduce Wireguard support to bird
  2019-06-07 18:21 Introduce Wireguard support to bird Janne Heß
@ 2019-06-07 21:57 ` Ondrej Zajicek
  2019-06-07 22:20   ` Toke Høiland-Jørgensen
  2019-06-07 22:18 ` Toke Høiland-Jørgensen
  1 sibling, 1 reply; 6+ messages in thread
From: Ondrej Zajicek @ 2019-06-07 21:57 UTC (permalink / raw)
  To: Janne Heß; +Cc: bird-users, wireguard

On Fri, Jun 07, 2019 at 06:21:42PM +0000, Janne Heß wrote:
> Hey everyone,
> 
> as advertised, I have completed the Wireguard support.
> You might see that I am not really a C expert, but I hope the code is good enough.
> If you need me to change anything or have additional questions, just let me know.

Hi

Could you explain what the Wireguard support broadly does (compared to
regular route update)?

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Introduce Wireguard support to bird
  2019-06-07 18:21 Introduce Wireguard support to bird Janne Heß
  2019-06-07 21:57 ` Ondrej Zajicek
@ 2019-06-07 22:18 ` Toke Høiland-Jørgensen
  2019-07-06 21:05   ` Janne Heß
  1 sibling, 1 reply; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-06-07 22:18 UTC (permalink / raw)
  To: Janne Heß, bird-users; +Cc: wireguard

Janne Heß <janne@hess.ooo> writes:

> Hey everyone,
>
> as advertised, I have completed the Wireguard support.
> You might see that I am not really a C expert, but I hope the code is good enough.
> If you need me to change anything or have additional questions, just
> let me know.

Hi Janne

Awesome that you have taken the time to implement this!

I'll let the Bird maintainers comment on the approach of embedding the
wireguard netlink library; but I have two other concerns:

- As far as I can tell there's nothing preventing Bird from removing
  AllowedIPs that it did not itself install from an interface, right?

- The algorithm is basically O(P*M*N) for inserting N routes on an
  interface with P peers that each have M existing AllowedIPs. That is
  not going to scale very far :/

-Toke
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Introduce Wireguard support to bird
  2019-06-07 21:57 ` Ondrej Zajicek
@ 2019-06-07 22:20   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-06-07 22:20 UTC (permalink / raw)
  To: Ondrej Zajicek, Janne Heß; +Cc: bird-users, wireguard

Ondrej Zajicek <santiago@crfreenet.org> writes:

> On Fri, Jun 07, 2019 at 06:21:42PM +0000, Janne Heß wrote:
>> Hey everyone,
>> 
>> as advertised, I have completed the Wireguard support.
>> You might see that I am not really a C expert, but I hope the code is good enough.
>> If you need me to change anything or have additional questions, just let me know.
>
> Hi
>
> Could you explain what the Wireguard support broadly does (compared to
> regular route update)?

Wireguard ties prefixes to public keys to figure out which peer to send
a packet to. This supersedes any regular routing on that interface, so
it needs to be done in addition to installing the route on the
interface. See https://www.wireguard.com/#cryptokey-routing

-Toke
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Introduce Wireguard support to bird
  2019-06-07 22:18 ` Toke Høiland-Jørgensen
@ 2019-07-06 21:05   ` Janne Heß
  2019-07-08 11:36     ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 6+ messages in thread
From: Janne Heß @ 2019-07-06 21:05 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, bird-users; +Cc: wireguard


On 6/8/19 12:18 AM, Toke Høiland-Jørgensen wrote:
> Janne Heß <janne@hess.ooo> writes:
> 
>> Hey everyone,
>>
>> as advertised, I have completed the Wireguard support.
>> You might see that I am not really a C expert, but I hope the code is good enough.
>> If you need me to change anything or have additional questions, just
>> let me know.
> 
> Hi Janne
> 
> Awesome that you have taken the time to implement this!
> 
> I'll let the Bird maintainers comment on the approach of embedding the
> wireguard netlink library; but I have two other concerns:
> 
> - As far as I can tell there's nothing preventing Bird from removing
>    AllowedIPs that it did not itself install from an interface, right?
> 
> - The algorithm is basically O(P*M*N) for inserting N routes on an
>    interface with P peers that each have M existing AllowedIPs. That is
>    not going to scale very far :/
> 
> -Toke
> 

Hi Toke,

thanks for your review.

Your first observation is correct. Due to differences in semantics, this 
cannot be implemented in the same way it is implemented in the KRT 
protocol because AllowedIPs don't have a notion of the proto field.

Addressing your second point, the WireGuard netlink interface and 
library only offer and understand the peers and allowed IPs as a linked 
list.
As we only get each route seperately, we cannot process multiple routes 
in one run. We're open to suggestions and patches.

Regards
Janne
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Introduce Wireguard support to bird
  2019-07-06 21:05   ` Janne Heß
@ 2019-07-08 11:36     ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 6+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-07-08 11:36 UTC (permalink / raw)
  To: Janne Heß, bird-users; +Cc: wireguard

Janne Heß <janne@hess.ooo> writes:

> On 6/8/19 12:18 AM, Toke Høiland-Jørgensen wrote:
>> Janne Heß <janne@hess.ooo> writes:
>> 
>>> Hey everyone,
>>>
>>> as advertised, I have completed the Wireguard support.
>>> You might see that I am not really a C expert, but I hope the code is good enough.
>>> If you need me to change anything or have additional questions, just
>>> let me know.
>> 
>> Hi Janne
>> 
>> Awesome that you have taken the time to implement this!
>> 
>> I'll let the Bird maintainers comment on the approach of embedding the
>> wireguard netlink library; but I have two other concerns:
>> 
>> - As far as I can tell there's nothing preventing Bird from removing
>>    AllowedIPs that it did not itself install from an interface, right?
>> 
>> - The algorithm is basically O(P*M*N) for inserting N routes on an
>>    interface with P peers that each have M existing AllowedIPs. That is
>>    not going to scale very far :/
>> 
>> -Toke
>> 
>
> Hi Toke,
>
> thanks for your review.
>
> Your first observation is correct. Due to differences in semantics, this 
> cannot be implemented in the same way it is implemented in the KRT 
> protocol because AllowedIPs don't have a notion of the proto field.

Yeah, not sure what a good way to handle that might be. You could add
this capability to the upstream wireguard? 

> Addressing your second point, the WireGuard netlink interface and 
> library only offer and understand the peers and allowed IPs as a linked 
> list.
> As we only get each route seperately, we cannot process multiple routes 
> in one run. We're open to suggestions and patches.

Well, there are a couple of options, I guess:

- Fix the wireguard netlink interface to work better with
  insertion/deletion semantics.

- Cache the kernel response in a data structure that allows more
  efficient lookups.


Before doing any of this, you may want to wait for feedback on whether
this approach to adding the support is the right way to go. Personally,
I tend to think that the "right" way to add the support is by
introducing a new 'wireguard' protocol type to Bird. But that's up to
Ondrej et al, of course :)

-Toke
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 18:21 Introduce Wireguard support to bird Janne Heß
2019-06-07 21:57 ` Ondrej Zajicek
2019-06-07 22:20   ` Toke Høiland-Jørgensen
2019-06-07 22:18 ` Toke Høiland-Jørgensen
2019-07-06 21:05   ` Janne Heß
2019-07-08 11:36     ` Toke Høiland-Jørgensen

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox