summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
AgeCommit message (Collapse)Author
2018-05-07avoid updating Path in the rib via MarkStale()FUJITA Tomonori
A path object in the adj-in is also in the master rib. We can't update such. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07use sorted single master table for route server setupFUJITA Tomonori
https://github.com/osrg/gobgp/issues/1249 The IN policy was removed. The modification by the IMPORT policy are visible to all route server peers. This saves some dozens bytes memory per a path. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-04-09server: Avoid infinite UPDATE loop of RTM NLRIIWASE Yusuke
When GoBGP dropped adj-Rib-out per Peer, we fixed to send the same Route Target Membership (RTM) NLRI even if it is already sent. This can cause the infinite UPDATE loop when Route Reflector(RR) reflects RTM NLRI to its clients. For example, the following situation causes the infinite UPDATE loop. Topology: +----- RR -----+ | | Client1 Client2 When Client1 has VRF with RT 65000:1 and sends a RTM NLRI to RR, then RR reflects the NLRI to Client2. If a new VRF with the same RT 65000:1 on Client2 is created, Client2 will notify it to RR, then RR calculates the best, but RR will send the NLRI from Client2 to Client1 even if it is not the best. Client1 receives the NLRI again, calculates the best and re-sends the best. Then, RR reflects the received NLRI ... (infinite loop). This patch fixes to compare the candidate path to be sent with the old path and assume the given candidate path was already sent before if the candidate path and the old path is the same path. Then avoids the infinite UPDATE loop. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-08config: Properly set config of PeerGroup memberSatoshi Fujimoto
Currently, the config of PeerGroup members are not set properly. For example, if LocalAs of the neighbor is not set in the config file, LocalAs will be set to Global.As as a default value. After this, however, if the neighbor is a member of a peer group, LocalAs will be unexpectedly overwritten by the peer group config. This commit fixes this by setting default values after applying the peer group config. Adding to this, this commit avoids unnecessary applying the peer group config. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-07config: Pass Global Config to SetDefaultNeighborConfigSatoshi Fujimoto
In neighbor config, there are some parameters whose default value can be changed depending on the global config. This commit modifies the argument of config.SetDefaultNeighborConfigValues() to pass the global config. It enables to change the default settings of neighbor depending on the global config. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-07server: Avoid local paths left on iBGP peersIWASE Yusuke
Currently, with iBGP peering, the CLI injected path will not be withdrawn when the deletion if any other path exists on RIB, then the CLI injected path will be left on iBGP peers even if the route is deleted on the originator router. This problem can cause routing loops in some case. This patch fixes to withdraw the old best path when it was the CLI (or gRPC) injected path. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some spelling for spell checker's testIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-03config: add-paths structure per AFI-SAFIIWASE Yusuke
This patch introduce "add-paths" structure per AFI-SAFI in order to enable to store add-paths feature config/state per AFI-SAFI. Also, this patch renames a few variables to avoid the name collisions. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-14config: Introduce Family field into AfiSafiStateIWASE Yusuke
To reduce the translations of "AfiSafiName" into "bgp.RouteFamily", this patch introduces "Family" field into "AfiSafiState" and stores the translated value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-26add addpath send supportFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-20peer: Set NeighborAddress before initializing dynamic peersSatoshi Fujimoto
If State.NeighborAddress is not set, setting default configs for the dynamic peers will fail. This patch set State.NeighborAddress before setting default configs. And this patch avoids overwriting State.NeighborAddress if it is set. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-06-20peer: Check errors in creating Dynamic PeersSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-06-16server: Support Dynamic NeighborSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-06-16config: Use State to get NeighborAddress instead of ConfigSatoshi Fujimoto
By introducing dynamic neighbor feature, GoBGP can have dynamic neighbors, and corresponding Config.NeighboAddress can be empty. This patch sets State.NeighborAddress for all neighbors, and gets the neighbor's address from them. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-06-07replace github.com/Sirupsen/logrus with github.com/sirupsen/logrusFUJITA Tomonori
The usage of "github.com/sirupsen/logrus" is recommended. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-05*: Support Peer-Group ConfigurationSatoshi Fujimoto
This patch enables to create peer-groups, also supports dynamic configuration to peer-groups. Manually set fields in neighbor configs have priority over its peer-group's config, except some fields, like "peer-as", or "minimum-advertisement-interval" and so on. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-05-22server/peer: Number of filtered routes to advertiseIWASE Yusuke
This patch extend the "AdjTable" container to store the number of the "filtered" routes which should not be advertised to the given neighbor. This routes mean the filterd routes because of RTC, VRFs, policy and other constraints. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-10*: support replace-peer-as (aka as-override)Wataru Ishida
we use the term replace-peer-as instead of as-override since openconfig is using it. cli ``` $ gobgp n add <neighbor-addr> as <asn> replace-peer-as ``` config ``` neighbor: config: peer-as: <asn> neighbor-address: <neighbor-addr> as-path-options: config: replace-peer-as: true ``` Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-05-09api: fix api/server struct conversionWataru Ishida
convert default in/import/export policy type remove remote-private-as, send-community since we are not using them Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-04-27server: avoid unnecessary path clone with route serverFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-04-18policy: send a withdrawal if export policy blocks an existing routeISHIDA Wataru
This patch fixes a bug of export policy and implicit withdrawal. When a path is filtered by export policy, we need to check whether the old path (implicit withdrawn path) was sent before the new path. If it has been sent, we need to send a withdrawal message. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04skip asn negotiation for BGP unnumbered peersISHIDA Wataru
since BGP unnumbered peers are typically trusted, skip asn negotiation for easy configuration. from configuration file: ```toml [[neighbors]] [[neighbors.config]] neighbor-interface = "eth0" ``` from cli: ``` $ gobgp neighbor add interface eth0 ``` Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04table: fix bug of UpdatePathAttrs() with ipv6 link-local peerISHIDA Wataru
config.Neighbor.Transport.State.LocalAddress may have zone info and not be valid ip address format. Use PeerInfo.LocalAddress instead. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-02-09server: fix in-policy bugISHIDA Wataru
When a path is rejected by in-policy, the prefix must be withdrawn since it might already exist in the rib. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-11-18server: disable advertised number calculation with multiple neighborsFUJITA Tomonori
AdjRibOut isn't in memory so needs to be calculated on the fly. Doing such for multiple neighbors consumes too much CPU (especially there are lots of routes). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-14config/api: create admin-state typeWataru Ishida
align with session-state Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-11-14config: use struct type instead of []byte for capability and open msgWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-11-12server: remove adj-out usageFUJITA Tomonori
With this change, we could send unncessary messages but it's harmless (wastefull though). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-12table: use old best path instead of withdrawn pathsFUJITA Tomonori
Preparation for removing in-memory adj-out. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-06server: fix bug of disable/enable/softreset behavior for vrfed neighborWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-11-04support neighbor belongs to VRFWataru Ishida
$ gobgp vrf add red rd 100:100 rt both 100:100 $ gobgp neighbor add 10.0.0.1 as 2 vrf red $ gobgp vrf red neighbor Peer AS Up/Down State |#Advertised Received Accepted 10.0.0.1 2 never Active | 0 0 0 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-09*: support long lived graceful restartWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-09-16server/table: don't modify/delete path attributes for route server clientWataru Ishida
RFC7947 2.2 says Optional recognized and unrecognized BGP attributes, whether transitive or non-transitive, SHOULD NOT be updated by the route server (unless enforced by local IXP operator configuration) and SHOULD be passed on to other route server clients Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-26add RemoteRouterId to config.NeighborStateFUJITA Tomonori
Stop using config.NeighborState's Description in a hacky way for the remote Router Id. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-08-03server: fix advertising multiple local withdrawals with same prefixISHIDA Wataru
a bug introduced by 332766189685028c4f9852e4285fb1a9025223cc Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-07-20remove gRPC dependency from peer.goFUJITA Tomonori
move gRPC dependency from peer.go to grpc_server.go Preparation for the removal of gRPC dependency from packages except for api package. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-14server: replace SenderMsg workaround with InfiniteChannelFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-13drop unknown optional non-transitive attributesFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-26policy: add support setting self ip address as next-hopISHIDA Wataru
from configuration file [policy-definitions.statements.actions.bgp-actions] set-next-hop = "self" from cli $ gobgp policy statement stmt1 add action next-hop self Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-25policy: add local-pref actionISHIDA Wataru
$ gobgp policy statement st01 add action local-pref 110 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-23server/table: fix intra-AS RTC route distributionISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-23policy: apply export-policy after normal path-attribute updatesISHIDA Wataru
fix incomplete 42ab0376359f1ee378958b7ae37eaf8fbc7a811b Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-23server: improve log messageISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-21policy: apply export-policy after normal path-attribute updatesISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-21cli: include route-reflector/route-server infomation in Peer messageISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-10docs: add comment for dubious codeFUJITA Tomonori
[ci skip] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-05fix 332766189685028c4f9852e4285fb1a9025223cc regressionFUJITA Tomonori
We can't send a path to a peer if the peer isn't configured for its family. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-25remove collector mode supportFUJITA Tomonori
We need to update yang config collector mode (split into config and state). before that, let's remove the feature itself to see if there is any user of it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21config: simplify config structuresISHIDA Wataru
stop generating self-contained leafref fields in openconfig model. (e.g. bgp:neighbor/bgp:neighbor-address ) Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19server: support prefix-limit re-configuration via configuration fileISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>