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

21 Commits

Author SHA1 Message Date
wenovus
7ef2f0bb82 Add CommunityCount BGP Policy Condition
This is intended to have the same behaviour as [these OpenConfig paths](https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-routing-policy.html#routing-policy-policy-definitions-policy-definition-statements-statement-conditions-bgp-conditions-community-count):
* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/community-count/config/operator
* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/community-count/config/value
2024-04-11 07:48:16 +09:00
Rinat Baygildin
ed87360952 Add EOR type to Table's filter on Watch method
Signed-off-by: Rinat Baygildin <bayrinat@yandex-team.ru>
2024-03-20 08:45:34 +00:00
FUJITA Tomonori
9d05544d1e Revert "Add EOR type to Table's filter on Watch method"
This reverts commit aff055b44d.

This breaks WatchEvent API:
https://github.com/osrg/gobgp/issues/2777
2024-03-05 07:42:25 +00:00
Rinat Baygildin
aff055b44d Add EOR type to Table's filter on Watch method
Signed-off-by: Rinat Baygildin <bayrinat@yandex-team.ru>
2024-03-02 08:35:54 +00:00
Donatas Abraitis
c556ca4f8d Add SoftwareVersion capability
https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability

Working example with FRR
```
% ./gobgp neighbor 192.168.10.124
BGP neighbor is 192.168.10.124, remote AS 65001
  BGP version 4, remote router ID 200.200.200.202
  BGP state = ESTABLISHED, up for 00:01:14
  BGP OutQ = 0, Flops = 0
  Hold time is 3, keepalive interval is 1 seconds
  Configured hold time is 90, keepalive interval is 30 seconds

  Neighbor capabilities:
    multiprotocol:
        ipv6-unicast:	advertised
        ipv4-unicast:	advertised and received
    route-refresh:	advertised and received
    extended-nexthop:	advertised
        Local:  nlri: ipv4-unicast, nexthop: ipv6
    UnknownCapability(6):	received
    UnknownCapability(9):	received
    graceful-restart:	advertised and received
        Local: restart time 10 sec
	    ipv6-unicast
	    ipv4-unicast
        Remote: restart time 120 sec, notification flag set
	    ipv4-unicast, forward flag set
    4-octet-as:	advertised and received
    add-path:	received
      Remote:
         ipv4-unicast:	receive
    enhanced-route-refresh:	received
    long-lived-graceful-restart:	advertised and received
        Local:
	    ipv6-unicast, restart time 10 sec
	    ipv4-unicast, restart time 20 sec
        Remote:
	    ipv4-unicast, restart time 0 sec, forward flag set
    fqdn:	advertised and received
      Local:
         name: donatas-pc, domain:
      Remote:
         name: spine1-debian-11, domain:
    software-version:	advertised and received
      Local:
         GoBGP/3.10.0
      Remote:
         FRRouting/8.5-dev-MyOwnFRRVersion-gdc92f44a4
    cisco-route-refresh:	received
  Message statistics:
```

FRR side:

```
root@spine1-debian-11:~# vtysh -c 'show bgp neighbor 192.168.10.17 json' | \
> jq '."192.168.10.17".neighborCapabilities.softwareVersion.receivedSoftwareVersion'
"GoBGP/3.10.0"
root@spine1-debian-11:~#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31 23:09:24 +09:00
Yuya Kusakabe
0a18fce70d Fix typo in SRv6 SID Structure Sub-Sub-TLV
See https://www.rfc-editor.org/rfc/rfc9252.html#section-3.2.1
2022-10-16 16:42:59 +09:00
FUJITA Tomonori
229d11635e clean up FQDNCapability message
- we don't need hostlen and domainlen.
- use camel case.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2022-01-16 23:45:44 +00:00
FUJITA Tomonori
6fc43b1114 proto: avoid global enum definitions when possible
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-11 10:13:12 +00:00
FUJITA Tomonori
6eeabdf01b proto: replace 'as' with 'asn'
For consistency, always use 'asn' instead of 'as', 'as_number', etc.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-11 01:36:20 +00:00
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
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
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
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
Artur Makutunowicz
192480fc71 Add experimental BGP-LS feature 2019-01-26 12:40:45 +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
FUJITA Tomonori
97ad6b32ee api: change Family
fixes #1812

Avoid the cast and use strightforward data strcuture; two variables
for afi and safi instead of squashing two into one variable.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-28 15:36:50 +09:00
FUJITA Tomonori
71e56c542e rpc cleanup
- clean up RPC function names
- rewrite gobgp command to use the api instead of config package
- delete unused client package

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-08 21:24:48 +09:00
IWASE Yusuke
493d024701 api: Define protobuf for BGP Capabilities
Example of protoc command:
$ export PROTOBUF=${HOME}/protobuf/src
$ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp
$ protoc \
    -I ${PROTOBUF} \
    -I ${GOBGP}/api \
    --go_out=plugins=grpc:${GOBGP}/api \
    ${GOBGP}/api/gobgp.proto \
    ${GOBGP}/api/attribute.proto \
    ${GOBGP}/api/capability.proto

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-21 10:40:25 +09:00