summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
AgeCommit message (Collapse)Author
2018-07-07follow Standard Go Project LayoutFUJITA Tomonori
https://github.com/golang-standards/project-layout Now you can see clearly what are private and public library code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-06api: remove table/ usage in util.goFUJITA Tomonori
This is a part of work removing table/ usage in api/. api/ will depend on only protobuf stuff and packet/. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-29server: exclude RTC for softreset if not specifiedFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-27server: Avoid calling os.Exit() in BgpServer.Shutdown()IWASE Yusuke
In case that GoBGP is used as Go native library, calling os.Exit() can cause unexpected termination including application which uses GoBGP. This patch removes calls of os.Exit() derived from BgpServer.Shutdown(). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-23potential - Found a bug in the python testsJeff Bean
2018-06-22Fixing all megacheck errors.Jeff Bean
2018-06-20server: fix AddPath to return uuidFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-13api: Implement AddCollector()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-05server: fix GetRib() with rpkiFUJITA Tomonori
fix a bug that doesn't return validation results at all. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-05table: support nexthop match policyurban
2018-05-31server: reject route without origin attribute via AddPath()FUJITA Tomonori
We should do stricter validation. Probably, we should use packet/bgp/validate.go. close #1660 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: update accepted number in adj-in rib after softreset-inFUJITA Tomonori
update accepted number in adj-in rib after AllowOwnAs has changed. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: remove unused id in AdjRib strctureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28server: Apply rtfilter on eBGP sessionIWASE Yusuke
The outgoing Route Target Constraint filter should be applied to eBGP session, but currently applied to only iBGP session. This patch fixes to apply rtfilter on eBGP session. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-28server: Prefer RTC route from RR clientIWASE Yusuke
In case that a Route Reflector(RR) and a non RR client peering, peering of different RR clusters for example, the RR should send the RTC route from its client even if the RTC route from non RR client is better path based on the best path algorithm in order to notify that some RR clients are interested in the given Route Target. Currently, only source peer address is concerned, the RTC route from RR client can have lower priority than non RR client and it can not be advertised. This patch fixes to prefer the route from RR client when selecting the candidate to be advertised. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-26server: fix infinite rtc update loop with addpathFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-24server: Gather informations for BMPPeerDownMessageSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-24server/server: Add field to WatchEventPeerState for PeerDownEventSatoshi Fujimoto
To include the PeerDownReason and data in BMP messages, this commit adds some field to WatchEventPeerState. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-24server/server: Restart peers when capabilities are changedSatoshi Fujimoto
If capabilities are added or removed by updating peer configs, it is needed to resend Open Message contains the new capabilities. But currently, GoBGP does not resend Open Message for Add-Path and Graceful Restart capabilities. This commit fixes it to resend Open Message for them. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-24server: Withdraw routes when received RTM withdrawalIWASE Yusuke
Because the RTM is removed from adj-RIB-in before collecting the candidate routes to be withdrawn, the candidates are unexpectedly filtered before sending withdraw messages. Then on the peers, the VPN routes are left on. This patch fixes to selects candidates from the filtered paths and send withdraw messages as expected. Also resolves the TODO in "test/scenario_test/rtc_test.py". Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-24fix withdraw with addpath and rtc enabledFUJITA Tomonori
Needs withdrawn paths that includes attributes. The attributes are necessary because they are used with rtc table to check if the paths were sent. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-23server: use negotiated family instead configuredFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-22fix graceful-restart when not all peers are restartingPatrick Hemmer
This fixes an issue where GoBGP would incorrectly defer sending routes to a peer on a graceful restart. RFC4724 states: > Once the session between the Restarting Speaker and the Receiving > Speaker is re-established, the Restarting Speaker will receive and > process BGP messages from its peers. However, it MUST defer route > selection for an address family until it either (a) receives the > End-of-RIB marker from all its peers (excluding the ones with the > "Restart State" bit set in the received capability and excluding the > ones that do not advertise the graceful restart capability) or (b) > the Selection_Deferral_Timer referred to below has expired. The scenario that this fixes is where you have 3 (or more) peers, and 2 of the peers ("A" and "B") perform a graceful restart at the same time, but the 3rd ("C") does not. If after restart peer C sends EOR to peer A before peer B reaches BGP_FSM_ESTABLISHED with peer A, it defers the route selection. However once peer B does reach BGP_FSM_ESTABLISHED, peer A still wouldn't send any updates to peer C until the deferral expired. This commit changes the behavior so that upon restart, once the peer receives EOR from all non-restarting peers and reaches BGP_FSM_ESTABLISHED for all restarting peers, the routes are sent to all peers.
2018-05-11fix add-path with vrf-neighborFUJITA Tomonori
close #1661 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-10bmp: avoid huge memory allocation for sending paths initiallyFUJITA Tomonori
We had to serialize all the paths once because the paths could be modified later. Now they are immutable so we don't need. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-10make Path objects in rib read-onlyFUJITA Tomonori
Now you can read Path objects in rib safely. Nobody modifies them. GetRib() API doesn't need to clone the objects. With full routes, this avoid allocating temporary huge memory. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-09server/server: Fix typoSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-07table: use shorter key for map of ipv4 and ipv6 prefixesFUJITA Tomonori
save about 100MB memory. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove uuid member in originInfo structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove VrfIds member in Path structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-07table: remove withdraw/newPath/oldPath Lists in DestinationFUJITA Tomonori
Shrink memory usage. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07preparation for shrinking Destination structureFUJITA Tomonori
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-18server: Fix outgoing rtfilterIWASE Yusuke
Currently, the result of Route Target Constraint filter is unexpectedly ignored when Route Reflector reflecting the VPN routes because "ignore" flag can be overwritten without evaluated. This patch fixes to return "nil" before "ignore" flag overwritten and enable to filter outgoing VPN routes based on RTC. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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>
2018-03-27server/server: Set rsRib to RS client in adding dynamic neighborSatoshi Fujimoto
Currently, globalRib is always set to dynamic neighbors even if they are route server clients. This patch fixes to set rsRib when the neighbor is a route server client. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-02-08config: Option to disable best path selectionIWASE Yusuke
Note: When this option is specified, no path will be redistributed to any peer, because there is no best path. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-01server: fix dynamic neighbor crashFUJITA Tomonori
close #1575 if L854 is executed before L924, we hit a crash because of closing a channel twice. This fixes the isseu but We had better to refactor the code to delete a peer. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-26server: Avoid to delete received paths with DeletePath APIIWASE Yusuke
"cli-command-syntax.md" describes "rib del all" command should delete all locally generated paths, but currently this command deletes all paths including received path from neighbors unexpectedly. This patch fixes the DeletePath API to delete only locally generated paths and solves this problem. Current: $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 0.0.0.0 00:00:00 [{Origin: ?}] * 10.12.1.0/24 10.0.0.1 65001 00:00:00 [{Origin: ?}] $ gobgp global rib -a ipv4 del all $ gobgp global rib -a ipv4 Network not in table With this patch: $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 0.0.0.0 00:00:00 [{Origin: ?}] * 10.12.1.0/24 10.0.0.1 65001 00:00:00 [{Origin: ?}] $ gobgp global rib -a ipv4 del all $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 10.0.0.1 65001 00:00:10 [{Origin: ?}] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-11server: Empty path list in initial WatchEventUpdateIWASE Yusuke
Currently, MonitorRib API with ADJ_IN type and "current" flag returns the initial response with an empty path list when gRPC client connecting to GoBGP daemon. This causes the client can not receive the current paths which GoBGP daemon already has. This patch fixes to compose the initial MonitorRib response with the current paths. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-12-16config/util: Refactor to make arguments to receiversSatoshi Fujimoto
For code readability, this commit make some arguments to receivers. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-26cmd: fix getNeighbor() to take bogus neighbor nameFUJITA Tomonori
This fixes the ae7e572550df919c1b9990da8787fc1e860bc20d commit regression. gobgp neighbor command takes a bogus neighbor name like the following: fujita@ubuntu:~/go/src/github.com/osrg/gobgp/gobgp$ ./gobgp n 1 BGP neighbor is 172.17.0.2, remote AS 65001 BGP version 4, remote router ID unknown BGP state = active, up for 17496d 14:21:50 BGP OutQ = 0, Flops = 0 Hold time is 0, keepalive interval is 0 seconds Configured hold time is 60, keepalive interval is 20 seconds Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-22server: adminDown operation wrongly resets State.PeerAsFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-21server: Auto derived ES-Import RT for EVPN Ethernet Segment routeIWASE Yusuke
According to RFC7432, the ES-Import RT can be derived automatically when using the ESI Types 1, 2 and 3. This patch enables to derive automatically the ES-Import RT for the given path from BgpServer's API. 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-07*: Support BGP Confederations (RFC 5065)Satoshi Fujimoto
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-02server: function notifyPrePolicyUpdateWatcherIWASE Yusuke
The function for notifying WATCH_EVENT_TYPE_PRE_UPDATE event hasn't been defined yet, this patch defines a function for it. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>