Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use socket connection to bird instead of calling birdc #25

Open
stv0g opened this issue Apr 26, 2020 · 4 comments
Open

Use socket connection to bird instead of calling birdc #25

stv0g opened this issue Apr 26, 2020 · 4 comments

Comments

@stv0g
Copy link
Contributor

stv0g commented Apr 26, 2020

I would propose to use bird's socket interface instead of spawning birdc.
The protocol is almost the the same as the stdout of birdc.

There is already a golang package for it: https://github.com/czerwonk/bird_socket

We gain:

We loose:

  • Restricted mode (birdc -r)
@stv0g
Copy link
Contributor Author

stv0g commented Apr 26, 2020

Here is an example of the socket protocol:

Output of birdc show memory

BIRD memory usage
Routing tables:    165 MB
Route attributes:  298 MB
Protocols:         495 kB
Total:             466 MB

Socket communication

Sniffed with socat

< 2020/04/26 04:10:38.820683  length=23 from=0 to=22
0001 BIRD 2.0.7 ready.
BIRD 2.0.7 ready.
> 2020/04/26 04:10:38.820889  length=12 from=0 to=11
show memory
< 2020/04/26 04:10:39.302258  length=137 from=23 to=159
1018-BIRD memory usage
 Routing tables:    165 MB
 Route attributes:  298 MB
 Protocols:         495 kB
 Total:             466 MB
0000

See also: https://github.com/alice-lg/birdwatcher/blob/master/docs/bird-client-server.txt

@annikahannig
Copy link
Member

Using the socket directly was our first approach back at the hackathon. :)

I'll checkout Daniels bird socket library! Thanks for the hint!

@annikahannig
Copy link
Member

Not sure if it will really reduce the memory footprint though...

@johannesmoos
Copy link
Member

We loose:

* Restricted mode (`birdc -r`)

Yes, this is exactly the reason why we changed it to use birdc(being aware of the benefits you named).
Can we quantify the performance and memory overhead of using birdc?

Maybe we can implement a config option to have the choice of communicating directly with the socket or via birdc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants