1
0
mirror of https://github.com/osrg/gobgp.git synced 2024-05-11 05:55:10 +00:00
Commit Graph

316 Commits

Author SHA1 Message Date
FUJITA Tomonori
c593d7c8b3 switch to Go API v2 for protobuf
seems that sticking to Go API v1 for protobuf is headache for projects
using GoBGP.

This breaks the compatibility so bumps up the major version to 3.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-08 07:22:50 +00:00
Donatas Abraitis
27b80a935b bgp: Implement BGP link-bandwidth extended community
Receiving
=========

Extended communities sent from FRR side:

```
route-map lb permit 10
 set extcommunity bandwidth 10
 set extcommunity soo 65001:123
exit
```

On GoBGP side it's decoded as 125000 as IEEE floating-point.

```
% sudo ./gobgp global rib 192.168.100.1/32 --json | jq '."192.168.100.1/32"'
[
  {
    "nlri": {
      "prefix": "192.168.100.1/32"
    },
    "age": 1632128843,
    "best": true,
    "attrs": [
      {
        "type": 1,
        "value": 2
      },
      {
        "type": 2,
        "as_paths": [
          {
            "segment_type": 2,
            "num": 1,
            "asns": [
              65534
            ]
          }
        ]
      },
      {
        "type": 3,
        "nexthop": "192.168.10.123"
      },
      {
        "type": 4,
        "metric": 0
      },
      {
        "type": 16,
        "value": [
          {
            "type": 64,
            "subtype": 4,
            "asn": 65534,
            "bandwidth": 1250000
          },
          {
            "type": 0,
            "subtype": 3,
            "value": "65001:123"
          }
        ]
      }
    ],
    "stale": false,
    "source-id": "192.168.100.2",
    "neighbor-ip": "192.168.10.123"
  }
]
```

Sending
=======

When sending from GoBGP side:

```
[[policy-definitions]]
    name = "policy1"
    [[policy-definitions.statements]]
        [policy-definitions.statements.actions.bgp-actions.set-ext-community]
			options = "replace"
			[policy-definitions.statements.actions.bgp-actions.set-ext-community.set-ext-community-method]
				communities-list = ["lb:65021:125000"]

```

We get properly encoded/decoded in FRR as well:

```
~# vtysh -c 'show ip bgp 10.33.0.0/16 json' | grep 'LB:'
        "string":"RT:300:400 SoO:100:200 LB:65021:125000 (1.000 Mbps)"
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-04 20:12:58 +09:00
Donatas Abraitis
c114e04958 Handle ttl-security option correctly
It wasn't configurable at all.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-30 10:55:06 +09:00
zvfvrv
92f37d65aa SegmentTypeB proto definition 2021-06-30 07:38:00 +09:00
Donatas Abraitis
94d720ff40 Add FQDN capability
It's not kinda RFC (draft), but it's implemented and used in various
other open-source software like FRRouting, Bird, ExaBGP.

It's very handy when dealing with lots of peers.

Exampe between GoBGP and FRRouting:
```
% ./cmd/gobgp/gobgp neighbor 192.168.10.123 | grep -A4 fqdn:
    fqdn:       advertised and received
      Local:
         name: donatas-pc, domain:
      Remote:
         name: exit1-debian-9, domain:
```

```
% vtysh -c 'show bgp neighbors 192.168.10.17 json' | jq .'"192.168.10.17".neighborCapabilities.hostName'
{
  "advHostName": "exit1-debian-9",
  "advDomainName": "n/a",
  "rcvHostName": "donatas-pc",
  "rcvDomainName": "n/a"
}
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-24 09:55:03 +03:00
Carl Baldwin
9e98fcf1d6 Do not suppress initial non-established peer state in MonitorPeer
The issue with the initial update was that sometimes a connection had
not yet been established. Trying to get remote and local connection
data caused a segmentation violation because `fsm.conn` was nil.

Also adds a flag to MonitorPeerRequest in the GRPC API to enable the
new behavior to avoid backward incompatibility.

fixes #2047
2021-04-22 17:40:15 -06:00
Marcus Wichelmann
34ed2a2ce5 Update proto 2021-03-29 20:57:36 +02:00
Marcus Wichelmann
3c437e5aec Added ListDynamicNeighbor message to API 2021-03-29 20:53:53 +02:00
Marcus Wichelmann
76f40ede0d Added DeleteDynamicNeighbor message to API 2021-03-29 20:53:45 +02:00
Marcus Wichelmann
c1e7463e36 Added ListPeerGroup message to API 2021-03-29 20:53:25 +02:00
Mikael Magnusson
390e3127ce add support for tunnel egress endpoint sub-TLV
As specified in draft-ietf-idr-tunnel-encaps-22.

Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2021-03-14 08:46:44 +09:00
Faicker Mo
cd5671baee policy: add nexthop unchanged
Support config set-next-hop = "unchanged" and also cli command.

Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
2021-03-03 09:47:50 +09:00
Milan Lenco
3339f97722 feat: add option to bind listener to a (VRF) device
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2021-02-13 18:54:31 +09:00
Mikael Magnusson
c70d99cc91 add pb for UDP destination port sub-TLV
Generated with tools/grpc/genproto.sh

Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2021-01-23 09:03:18 +09:00
Mikael Magnusson
4c8ab0d4b5 support UDP destination port sub-TLV
As specified in draft-ietf-idr-tunnel-encaps.

Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2021-01-23 09:03:18 +09:00
Serguei Bezverkhi
57068b16fd Add documentation, fix typo in proto and add marshal for tunne encal sub tlvs
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-12-02 07:21:01 +09:00
Serguei Bezverkhi
63b958b2a7 API chages
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-11-30 07:21:40 +09:00
Serguei Bezverkhi
66413b5335 API changes
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-11-25 17:28:18 -05:00
Valli A. Vallimamod
b44362fddd api: keeps backward compatibility when extending LsAddrPrefix 2020-11-10 22:17:26 +09:00
Valli A. Vallimamod
c595b56166 api: adds LS attributes to LsAddrPrefix
Includes `gobgp.LsNLRI` attibutes to `api.LsAddrPrefix` so that they are
distributed to all derived types (LsNodeNLRI, LsPrefixV4NLRI, and LsPrefixV6NLRI)
2020-11-10 22:17:26 +09:00
Steve Shaw
393d82f955 Adding gRPC support for modified logging level
Signed-off-by: Steve Shaw <shaw38@gmail.com>
2020-11-06 21:15:10 +09:00
FUJITA Tomonori
3d3d6f3438 api: add ListPathRequest's option to get binary of nlri and attributes
put the binary of nlri and path attribute to the response.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-10-21 21:09:12 +09:00
Serguei Bezverkhi
833188f526 extend attributes proto for Prefix SID support
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-05-13 12:58:51 +09:00
Serguei Bezverkhi
e3001f9fe1 additional changes
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-05-05 16:10:24 -04:00
Serguei Bezverkhi
8409507a7c coding the feature
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-05-05 14:31:28 -04:00
Tom Shine
f11b9c7afb Add BGP-LS SRLG support 2020-04-24 00:25:59 +01:00
Carl Baldwin
72a0e55287 Use correct import paths for protobuf packages
The packages `any`, `empty`, and `timestamp` ship with protoc so there
is no need to pull them out of the go package. This simplifies the
generation script and also corrects the import paths for the standard
protobuf types.

Fixes: #2095
2019-11-06 17:59:21 +00:00
FUJITA Tomonori
853944f785 server: speed up session establishment
The unittest on pkg/server finishes quicker.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-21 16:10:40 +09:00
Hitoshi Irino
2f5a4d59cb BGP connection on a speecified interface (including which is associated VRF) using syscall SO_BINDTODEVICE 2019-07-02 11:40:22 +09:00
Hitoshi Irino
7d2823d4c0 zebra: supporting FRRouting version 7
- the "version" parameter (which means ZAPI) 6 in zebra config changes supporting FRRouting version 7 instead of FRRouting version 6.
 - the "software-name" parameter which supports backward compatibility is added in zebra config.
   (GoBGP support FRRouting version 6 when "version = 6" and "software-name = frr6" is configured.)
2019-05-08 08:48:26 +09:00
FUJITA Tomonori
bec61c4f38 server: make ListPath API show filtered paths
This adds the feature to show filtered paths by policies to ListPath
API.

with EnableFiltered in ListPathRequest enabled:

- ListPath for adj-in sets filtered on paths filtered by policys
- ListPath for adj-out includes paths filtered by policys with filtered set.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-16 12:40:36 +09:00
JieJhih Jhang
eb37217981 Add evpn I-PMSI to proto file 2019-04-10 10:03:27 +09:00
FUJITA Tomonori
2965e8092e add script to generate api/gobgp.pb.go
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-06 21:48:21 +09:00
FUJITA Tomonori
ccdc2e6277 add secondary-route feature for router server
if an export policy rejects a selected route, try the next route in
order until one that is accepted is found or all routes for the peer
are rejected.

the default is disabled. You can enable this feature in the following
way:

[neighbors.route-server.config]
  route-server-client = true
  secondary-route = true

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-02 16:01:29 +09:00
JieJhih Jhang
80ff3a325c support BMP sysName and sysDescr configuration 2019-03-25 20:11:44 +09:00
Hitoshi Irino
3a79ad3fdc Supporting BGP/MPLS L3VPNs with Frrouting Zebra API 6
- This commit aims to solve reported problem on issues #1611, #1648 and #1912
 - Partial changes of this commit duplicate with changes on PR #1587 (not merged) and PR #1766 (not merged and already closed)
 - This commit is tested with only FRRouting version 6.0.2 (which uses Zebra API 6)
 - This commit fixes lack of LABEL_MANAGER_CONNECT_ASYNC for ZAPI6.
   (This bug is introduced on commit 2bdb76f2dc "Supporting Zebra API version 6 which is used in FRRouting version 6")
2019-03-14 21:20:31 +09:00
Artur Makutunowicz
192480fc71 Add experimental BGP-LS feature 2019-01-26 12:40:45 +09:00
FUJITA Tomonori
d7e5bf22a6 fix bmp statistics
fix the regression of the adj counter due to
301b48532d

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2018-12-28 23:27:53 +09:00
FUJITA Tomonori
8e7741a0a8 api: rename ValidationDetail to Validation
Let's simply use 'validation' because there is no other validation
structure.

We could add validation results from other than rpki so drop rpki name.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2018-12-24 10:13:00 +09:00
FUJITA Tomonori
8d0a8b0ffa make the usage of type name in protobuf consistent
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2018-12-23 23:40:37 +09:00
FUJITA Tomonori
301b48532d support received, accepted, and advertised counters per family
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-26 17:49:48 +09:00
FUJITA Tomonori
a5763c20d4 api: remove AddPaths from Peer and PeerGroup
AddPaths in AfiSafi should be used; it can handle configuration per
family.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-25 23:27:02 +09:00
FUJITA Tomonori
7ec6a96962 api: move RouterId to PeerState from PeerConf
It's not configuration.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-25 20:15:04 +09:00
FUJITA Tomonori
79a461c147 api: move remote_cap and local_cap to PeerState from PeerConf
Both should be in PeerState like OpenConfig.

Also remove unused supported_capabilities.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-23 21:01:03 +09:00
FUJITA Tomonori
6b05d9db0f api: rename NlriAny in api.Path to Nlri
Also rename PathAttrsAny to PathAttrs. Both are the first choice
rather than the binary format members.

Support SortType member to ListPathRequest to add an option to return
unordered paths.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-16 16:49:49 +09:00
FUJITA Tomonori
c1bca25559 use google/protobuf/timestamp.proto
use google/protobuf/timestamp.proto instead of our own way to
represent time.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-16 12:23:18 +09:00
Eiichiro Watanabe
fa387c9065 Fix Statistics Report in BMP 2018-11-14 19:32:24 +09:00
Eiichiro Watanabe
0eb3dcede5 Fix intervals for MRT 2018-11-12 21:32:07 +09:00
Eiichiro Watanabe
4cc7a81e8f Support AdminDown from config 2018-11-12 14:41:58 +09:00
FUJITA Tomonori
475818dd3c api: remove unused members
fixes #1816

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-28 22:14:41 +09:00