summaryrefslogtreecommitdiffhomepage
path: root/server
AgeCommit message (Collapse)Author
2017-06-23server: Enable to configure static TTL for BGP packetsIWASE Yusuke
Like "ttl" configuration of Junos OS, this patch enables to set static TTL value for outgoing BGP packets. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-23server: Implement TTL securityIWASE Yusuke
This patch enable to configure Generalized TTL Security Mechanism (GTSM). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-23server/sockopt: Support to set minimum TTLIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-09bmp: Support number of withdraw updates and prefixesIWASE Yusuke
This patch enables to send BMP statistics reports for the following types; - Stat Type = 11: (32-bit Counter) Number of updates subjected to treat-as-withdraw treatment. - Stat Type = 12: (32-bit Counter) Number of prefixes subjected to treat-as-withdraw treatment. Note: Currently, this implementation considers only updates or prefixes received from neighbors, but not enough to follow the handling process described in RFC7606. Signed-off-by: IWASE Yusuke <iwase.yusuke0@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-06server_test: Test for Graceful Restart timer expiredIWASE Yusuke
This test case checks whether BGP session is freed or not when Graceful Restart timer expired. If BGP session is not freed as expectedly, this test case will exit with state 1 after waiting 120 seconds and will output the following. FATA[0147] failed to free the fsm.h.t for 127.0.0.1 BGP_FSM_OPENSENT BGP_FSM_IDLE Topic=Peer Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-06server_test: Add a sleep for stabilityIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-06server: Close conn when graceful restart timer expiredWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-06-06server_test: stop listeningIWASE Yusuke
Listening on well-known port require the root privileges. This patch stop listening to avoid that because this test doesn't need to accept a peer. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-06server_test: Confirm BgpServer started and stoppedIWASE Yusuke
For each test case, this patch enables to confirm BgpServer is started successfully and stopped at the of each test case, otherwise the context of some test cases might affect other test cases. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-06-03bmp: Enable to send BMP Route Mirroring messagesIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-03server: Implement event for BGP message watcherIWASE Yusuke
This patch enables to watch events for monitoring received BGP messages before the state comparison. Note: Currently, this event nortifies UPDATE message only, because the other messages will be handled in FSMHandler and not received at BgpServer, so BgpServer cannot send event for these messages. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-01Fix RouteDistinguisher parsing and VPNV6 VRF rib parsingLamanna
2017-06-01packet/mrt: BGP Additional Path Extensions (RFC8050)IWASE Yusuke
This patch enables to decode/encode MRT format with BGP Additional Path Extensions which described in RFC8050. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23bmp: Implement Information TLV on Termination messagesIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23bmp: Implement Information TLV on Initiation messageIWASE Yusuke
Currently, the TLV fields are implemented as BMPTLV on the Initiation messages, but not enough decoded and required to be constructed in binary format. This patch introduces BMPInfoTLV and makes easy to handle the TLV fields. Note: This patch obsoletes BMPTLV structure. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-22bmp: Stats reports for Adj-RIBs-In and Loc-RIB routesIWASE Yusuke
This patch enable to send BMP statistics reports for the following types; - Stat Type = 7: Number of routes in Adj-RIBs-In = Regarding number of "accepted" routes in AdjTable state - Stat Type = 8: Number of routes in Loc-RIB = Regarding number of "advertised" and "filtered" routes in AdjTable state which means the all routes selected by the local BGP speaker's Decision Process. Signed-off-by: IWASE Yusuke <iwase.yusuke0@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-22bmp: Obsolete "both" option for route-monitoring-policyIWASE Yusuke
Because of the introduction of "local-rib" and "all" options for route-monitoring-policy, this patch obsoletes "both" option. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-22bmp: Fix peer header info in Loc-RIB route messageIWASE Yusuke
"draft-evens-grow-bmp-local-rib" says the peer header for Loc-RIB monitoring should include the following values; - Peer Address: Zero-filled as remote peer address is not applicable. - Peer AS: Set to the BGP instance global or default ASN value. - Peer BGP ID: Set to the BGP instance global or RD (e.g. VRF) specific router-id. This patch fixes the peer header construction to follow this specification. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-22bmp: Enable to specify all route monitoring policiesIWASE Yusuke
This patch adds the new key "all" for specifying the all BMP route monitoring policies. Configuration Example: [[bmp-servers]] [bmp-servers.config] address = "127.0.0.1" port=11019 route-monitoring-policy = "all" Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-17server/fsm_test.go: fix race condition during testsChris Stockton
Add sync.Mutex to guard access to MockConnection to prevent tests ran with -race from failing. In addition change the calls to the fmt package to use t.Log show they only show with the -v flag to prevent unwanted noise between test runs. It has the added benefit of providing a file and line number as well.
2017-05-14server: avoid sending unwanted withdrawals to iBGP peersWataru Ishida
when the old best was from iBGP, we don't need to send withdrawals to iBGP peers. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
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-09server: ignore routes when local AS is in AS_PATHISHIDA Wataru
RFC4271 9.1.2 Phase 2: Route Selection If the AS_PATH attribute of a BGP route contains an AS loop, the BGP route should be excluded from the Phase 2 decision function. AS loop detection is done by scanning the full AS path (as specified in the AS_PATH attribute), and checking that the autonomous system number of the local system does not appear in the AS path. Operations of a BGP speaker that is configured to accept routes with its own autonomous system number in the AS path are outside the scope of this document. Also this commit adds support for allow-own-as option to relax this. Signed-off-by: ISHIDA Wataru <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-05-06cli: speed up showing a specific defined-setWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-04-27server: fix handling bgp messages right after moving to idle state from ↵FUJITA Tomonori
established currently gobgpd continues to handle update messages even if becomedidle state from establised. Signed-off-by: FUJITA Tomonori <fujita.tomonori@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-20improve performance of getting single neighbor informationFUJITA Tomonori
avoid calculation of the number of adjout that will not be used. 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-17bmp: BMP Route Monitoring for Local RIB routesIWASE Yusuke
This patch enable to send BMP Route Monitoring message for Local RIB routes described in bmp-draft-evens-grow-bmp-local-rib. Configuration Example: gobgpd.toml ... [[bmp-servers]] [bmp-servers.config] address = "127.0.0.1" port=11019 route-monitoring-policy = "local-rib" ... Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-04-17packet/bmp: Obsolete policy argument for BMPPeerHeaderIWASE Yusuke
According to "draft-evens-grow-bmp-local-rib", the L flag in the Peer Flags is NOT used for the locally sourced routes and the F flag is defined into the same bit. This patch removes "policy" argument and add "flags" argument for BMPPeerHeader and NewBMPPeerHeader in order to distinguish which flag is set (the L flag or the F flag). Then introduce IsPostPolicy() func to show if the L flag is set or not. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-04packet/bgp: add extended-nexthop capabilityISHIDA Wataru
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-04-04server: fix bug of wrongly set <nil> to PeerInfo.LocalAddressISHIDA Wataru
config.TransportState.LocalAddress may have zone info with ipv6 address like "fe80::x%eth0". In this case, net.ParseIP() returns <nil>, which leads to set <nil> to PeerInfo.LocalAddress. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-01server: fix GetRib() to handle error properlyhepeng
fix a bug that GetRib() doesn't return an error even if an error happens.
2017-03-27server/zclient: Retry Zebra message version negotiationIWASE Yusuke
Currently, the Zebra message version used by ZClient is configurable (default 2), but if the given version is miss-matched with that of Zebra daemon, ZCient will fail to connect. This patch fixes ZClient to retry the version negotiation. For example, if failed with the version 2, retry with the version 3. Note: In order to receive the first message from Zebra daemon when instantiating ZClient, this patch fixes ZClient to send HELLO and ROUTER_ID_ADD messages automatically. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-03-06server/zclient: Dampening for Nexthop TrackingIWASE Yusuke
This patch implents dampening for the Nexthop Tracking as Cisco's routers doing. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-03-06server/zclient: Update nexthop state based on NEXTHOP_UPDATEIWASE Yusuke
This patch enables server/zclient to update the metric or the reachability state to the nexthop for implementing the Nexthop Tracking features. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-03-06server/zclient: Register nexthop for Nexthop TrackingIWASE Yusuke
This patch enables server/zclient to register the interested nexthop for implementing the Nexthop Tracking features.
2017-03-05server: fix withdraw with ibgpFUJITA Tomonori
with two ibgp peers (a and b), when peer a advertizes one route and then withdraw it, there are two bugs: - gobgp sends withdrawal to peer a. - gobgp sends withdrawal to peer b. this fixes both. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-05server: avoid sending withdraw to peer just sent withdrawFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-03-05server: add filterpath() unittestFUJITA Tomonori
Test a scenario where peer A and B advertized the same prefix, and A's one was best then peer A withdraws. peer B should get withdrawal. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>