summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-05-28table: fix accepted number in adj-in ribFUJITA Tomonori
fix accepted number in adj-in rib when it has an as-looped path. adding another member to Path struct is pain. Should be fixed later. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: remove unused Exists method in AdjRib strctureFUJITA Tomonori
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-28test/aspath: check accepted and received numbersFUJITA Tomonori
make sure that an adj-rib return the accepted and received numbers when it has an as-looped path. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28rtc_test: Test cases for infinite RTC UPDATE loopIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-28rtc_test: Test cases for inter-ASIWASE Yusuke
This patch adds test cases for the Route Target Constraint of the inter-AS route distribution and combination of the inter-AS and intra-AS route distribution. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-28rtc_test: Enhance test cases for intra-AS RTCIWASE Yusuke
This patch adds assertion points for the counts of advertised and received routes. Also adds comments for the states of VRFs and routes. 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-24packet/bmp: Don't include data for some peer down reasonsSatoshi Fujimoto
RFC 7854 says that Peer Down Notification messages have "data" field only if its peer down reason is "The local system closed the session. No notification message was sent". 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-24test/rtc: Add test for conflict RTC configSatoshi Fujimoto
Add test for the issue reported on #1682 (https://github.com/osrg/gobgp/issues/1682). Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@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-23bgp_zebra_nht_test: Test cases when nexthop unreachableIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23bgp_zebra_nht_test: Improve pylint resultIWASE Yusuke
Also removes a debug print. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23bgp_zebra_nht_test: Use utility functions of test/libIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23zclient: Avoid flapping of nexthop reachabilityIWASE Yusuke
Currently, GoBGP sends the ROUTE_DELETE messages to Zebra for the paths whose nexthop was determined as unreachable by IGP, but when Zebra received the ROUTE_DELETE messages for the unreachable nexthop, Zebra will send the NEXTHOP_UPDATE message with the given nexthop is reachable via the default interface. This message unexpectedly causes updates of the unreachable path to be reachable (not true though). Then GoBGP will send ROUTE_ADD messages to Zebra, but those paths soon will be invalidated via the NEXTHOP_UPDATE message, GoBGP will send the ROUTE_DELETE messages and ... (infinite loop). This patch fixes to avoid sending the ROUTE_DELETE messages for the unreachable paths because those paths are inactivated on Zebra and not installed to FIB. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23zebra: Improve logs for received messages from ZebraIWASE Yusuke
Currently, the received messages from Zebra are printed as byte slice and it is difficult to determine which message was received. This patch fixes to output the received message as the decoded structure for the readability. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23fix: missing validateCondition in ReplaceStatementlnever
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-22cmd: Remove uncaught error on ParseCIDR()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-21test/lib/quagga: Minimize advertisement-intervalIWASE Yusuke
Quagga seems to advertise routes to neighbors by intervals of 30 seconds (eBGP) or 5 seconds (iBGP) by default. Because of this delay, timer in "bgp_confederation_test.py", 60 seconds, can be exceeded when the UPDATE messages need to go through multi ASs. This patch fixes to use minimum advertisement-interval and reduces the time of test cases. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-21bgp_confederation_test: Improve pylint resultIWASE Yusuke
Also removes a debug print Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-21bgp_router_test: Retry assertions of RIB for stabilityIWASE Yusuke
To improve the stability of "bgp_router_test.py", this patch fixes to retry assertions of RIB on a Quagga router after shutting down a neighbor. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-15scenario_test: Wait for GoBGP starting upIWASE Yusuke
For the stability of some scenario tests, this patch fixes to wait for GoBGP starting up after restarting GoBGP daemon. Currently, there are cases that CLI command can be called without checking whether GoBGP daemon is surely started or not. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-15test/lib/gobgp: Rename graceful_restart() to stop_gobgp()IWASE Yusuke
GoBGPContainer.graceful_restart() does not "restart" GoBGP daemon, but just stops (kills) GoBGP daemon. Then this patch renames graceful_restart() to stop_gobgp() to avoid confusion. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-15graceful_restart_test: Remove redundant parenthesesIWASE Yusuke
Improves pylint result. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-11fix add-path with vrf-neighborFUJITA Tomonori
close #1661 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-11packet/bgp: remove bogus debug printFUJITA Tomonori
fix a mess in the commit 388ef503f2c9cae. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-11packet/bgp: fix OpenMessage Parse crash with bogus dataFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-11mrt: Improve golint resultIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-11mrt: Enable to dump locally generated routesIWASE Yusuke
For reloading locally generated routes by using MRT dump file, this patch enables to include locally generated routes into TABLE_DUMPv2 records. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-10test: avoid fabric version 2.0FUJITA Tomonori
Seems that fabric v2 doesn't work with the current files. Let's keep using v1.X for now. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-10config: Enable to configure VRF via config fileIWASE Yusuke
This patch enables to configure VRF tables by using config file. This feature is useful when using VRF-Neighbor feature. Example of Usage: ```toml [[vrfs]] [vrfs.config] name = "vrf1" id = 1 rd = "65000:100" both-rt-list = ["65000:100"] ``` Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-09server/server: Fix typoSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-08gobgp/cmd: add router-mac option for BGP EVPN Type 2Paul Greenberg
The `router-mac` option in `gobgp` CLI allows sending Router's MAC Extended Community via BGP EVPN Type 2 and Type 5 advertisements. As explained in below RFC draft, this community is used to carry the MAC address of the VTEP where MAC-IP pair resides. More info: For example, GoBGP router (R1) peers with Cisco router (R2). R1 is used by an orchestraction platform, e.g. OpenStack, Docker Swarm, etc., to advertise container MAC-IP bindings. When R1 advertises the binding it also sets next hop for the route as the host where the MAC-IP binding (i.e. container) resides. When R2 receives the route, it will not install it unless Router's MAC Extended Community is present. R2 will use the MAC address in the community to create an entry in MAC address table of R2 pointint to NVE interface. ``` gobgp global rib -a evpn add macadv e9:72:d7:aa:1f:b4 \ 172.16.100.100 etag 0 label 34567 rd 10.1.1.1:100 \ rt 65001:100 encap vxlan nexthop 10.10.10.10 \ origin igp router-mac e9:72:d7:aa:1f:b4 gobgp global rib -a evpn add nexthop 10.10.10.10 origin igp \ prefix 172.16.100.100/32 esi 0 etag 0 rd 10.1.1.1:100 \ rt 65001:100 gw 10.10.10.10 label 34567 encap vxlan \ router-mac e9:72:d7:aa:1f:b4 ``` In the above example, a host with IP of `10.10.10.10` runs a container connected to an Open vSwitch instance. The container's IP address is `172.16.100.100` and MAC address `e9:72:d7:aa:1f:b4`. The Open vSwitch is VTEP with `tunnel_key=34567`, i.e. VNID `34567`. GoBGP (R1) and Cisco (R2) routers are in BGP AS 65001. R1's IP is `10.1.1.1`. R2 used RT of `65001:100` to import routes and place them into appropriate VRF. In this case the VRF is associated with L2VNI from VLAN 300. Upon the receipt of the above BGP EVPN Type 2 and Type 5 routes, R2 will create create a MAC address entry pointing to it's NVE interface with destination IP address of `10.10.10.10`. ``` Legend: * - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC age - seconds since last seen,+ - primary entry using vPC Peer-Link, (T) - True, (F) - False, C - ControlPlane MAC VLAN MAC Address Type age Secure NTFY Ports ---------+-----------------+--------+---------+------+----+------------------ * 300 e972.d7aa.1fb4 static - F F nve1(10.10.10.10) ``` The R2 will use the `router-mac e9:72:d7:aa:1f:b4` as the destination MAC address of the inner VXLAN packet. For example, an underlay host `20.20.20.20` ping the container. The inner VXLAN L2 destination address is `e9:72:d7:aa:1f:b4`. The inner VXLAN L2 source address is R2's MAC. The outer VXLAN L3 source address, i.e. `10.2.2.2` is R2' NVE address. ``` OUTER VXLAN L2: 10:20:08:d0:ff:23 > b2:0e:19:6a:8d:51 OUTER VXLAN L3: 10.2.2.2.45532 > 10.10.10.10.4789: VXLAN, flags [I] (0x08), vni 34567 INNER VXLAN L2: 4e:f4:ca:aa:f6:7b > e9:72:d7:aa:1f:b4 INNER VXLAN L3: 20.20.20.20 > 172.16.100.100: ICMP echo reply, id 66, seq 1267, length 64 ``` See also: https://tools.ietf.org/html/draft-sajassi-l2vpn-evpn-inter-subnet-forwarding-05#section-6.1 Signed-off-by: Paul Greenberg <greenpau@outlook.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 Radixkey member in Destination structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove key member in Path structureFUJITA Tomonori
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>