Rene Fichtmueller 344ee15338 feat(bio-rd): add local RIB integration via bio-rd gRPC client
Adds real-time local BGP RIB data as a complement to external APIs
(RIPE Stat, bgproutes.io) which have rate limits and 15min+ delays.

- bio-rd-client.js: gRPC client for bio-routing/bio-rd RIS service
  - LPM, Get, GetLonger, GetRouters, DumpRIB, ObserveRIB methods
  - IPv4/IPv6 encoding as uint64 pair (bio.net format)
  - Full BGP path decode: AS paths, communities, large communities
  - Graceful fallback if RIS unavailable (null/empty returns)
- protos/: bio-rd proto definitions (ris, bgp, session, route, net)
- server.js: three new endpoints + WebSocket stream
  - GET /api/rib/prefix — LPM + more-specifics via GetLonger
  - GET /api/rib/routers — list BMP-monitored routers
  - GET /api/rib/dump — full RIB dump with ASN filter + limit
  - WS /ws/rib — live ObserveRIB stream (add/withdraw events)
- package.json: @grpc/grpc-js + @grpc/proto-loader dependencies
2026-04-05 11:44:50 +02:00

105 lines
2.0 KiB
Protocol Buffer

syntax = "proto3";
package bio.ris;
import "net/api/net.proto";
import "route/api/route.proto";
option go_package = "github.com/bio-routing/bio-rd/cmd/ris/api";
service RoutingInformationService {
rpc LPM(LPMRequest) returns (LPMResponse) {};
rpc Get(GetRequest) returns (GetResponse) {};
rpc GetRouters(GetRoutersRequest) returns (GetRoutersResponse) {};
rpc GetLonger(GetLongerRequest) returns (GetLongerResponse) {};
rpc ObserveRIB(ObserveRIBRequest) returns (stream RIBUpdate);
rpc DumpRIB(DumpRIBRequest) returns (stream DumpRIBReply);
}
message LPMRequest {
string router = 1;
uint64 vrf_id = 2;
string vrf = 4;
bio.net.Prefix pfx = 3;
}
message LPMResponse {
repeated bio.route.Route routes = 1;
}
message GetRequest {
string router = 1;
uint64 vrf_id = 2;
string vrf = 4;
bio.net.Prefix pfx = 3;
}
message GetResponse {
repeated bio.route.Route routes = 1;
}
message GetLongerRequest {
string router = 1;
uint64 vrf_id = 2;
string vrf = 4;
bio.net.Prefix pfx = 3;
}
message GetLongerResponse {
repeated bio.route.Route routes = 1;
}
message ObserveRIBRequest {
string router = 1;
uint64 vrf_id = 2;
string vrf = 4;
enum AFISAFI {
IPv4Unicast = 0;
IPv6Unicast = 1;
}
AFISAFI afisafi = 3;
bool allow_unready_rib = 5;
}
message RIBFilter {
uint32 originating_asn = 1;
uint32 min_length = 2;
uint32 max_length = 3;
}
message RIBUpdate {
bool advertisement = 1;
bool is_initial_dump = 3;
bool end_of_rib = 4;
bio.route.Route route = 2;
}
message DumpRIBRequest {
string router = 1;
uint64 vrf_id = 2;
string vrf = 4;
enum AFISAFI {
IPv4Unicast = 0;
IPv6Unicast = 1;
}
AFISAFI afisafi = 3;
RIBFilter filter = 5;
}
message DumpRIBReply {
bio.route.Route route = 1;
}
message GetRoutersRequest {
}
message Router {
string sys_name = 1;
repeated uint64 vrf_ids = 2;
string address = 3;
}
message GetRoutersResponse {
repeated Router routers = 1;
}