58 Commits
Author SHA1 Message Date
FUJITA Tomonori d65df0b045 replace github.com/Sirupsen/logrus with github.com/sirupsen/logrus
The usage of "github.com/sirupsen/logrus" is recommended.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-06-07 21:04:11 +09:00
lspgnandFUJITA Tomonori a766d23310 table: Fixed bug when looking up prefixes with a default route. 2017-04-21 17:42:06 +09:00
FUJITA Tomonori 4284355568 server: fix table query with shorter-prefixes option
$ gobgp g r 168.181.21.128/25 shorter-prefixes
Network not in table
$ gobgp g r 168.181.21.0/25 shorter-prefixes
   Network             Next Hop             AS_PATH              Age       Attrs
*> 168.181.21.0/24     187.16.221.202       61580                04:17:41  [{Origin: i}]

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-03-27 15:37:26 +09:00
Nils JuenemannandGitHub 61240f45b0 Fix for gobgp global rib <ip> 2017-03-21 20:03:24 +01:00
ISHIDA WataruandFUJITA Tomonori 52356c26f8 server: add a current option to WatchBestPath()
also, use it for zebra integration

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-15 00:10:15 +09:00
Wataru Ishida 1f4a3192af cli/api: support getting table summary information
$ gobgp global rib summary -a ipv4
$ gobgp neighbor 10.0.0.1 local summary
$ gobgp neighbor 10.0.0.1 adj-in summary
$ gobgp neighbor 10.0.0.1 adj-out summary

Signed-off-by: Wataru Ishida <[email protected]>
2016-10-16 14:07:06 +00:00
Wataru IshidaandFUJITA Tomonori a795d2452a table: fix route filtering with IP address
close #1081

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-13 00:49:17 -07:00
Wataru IshidaandFUJITA Tomonori 1156fc33fa cli/table: support filtering of IPv4/IPv6 MPLS routes
close #1086

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-13 00:49:17 -07:00
Wataru IshidaandFUJITA Tomonori c8bb5752f6 table: add Best/MultiPath option to SelectOption
Signed-off-by: Wataru Ishida <[email protected]>
2016-08-25 15:53:14 +09:00
Wataru IshidaandFUJITA Tomonori 3235c0618c api/cli: kill cmd package custom path/destination structs
reuse table package

Signed-off-by: Wataru Ishida <[email protected]>
2016-08-25 15:53:14 +09:00
Wataru IshidaandFUJITA Tomonori b3c874da25 server/api: fix GetRib API to return sorted destination
the feature has been broken.

Signed-off-by: Wataru Ishida <[email protected]>
2016-08-25 15:53:14 +09:00
Wataru IshidaandFUJITA Tomonori a17ee18e5b server: fix RIB lookup with longer-prefixes option
the feature was somehow broken.

Signed-off-by: Wataru Ishida <[email protected]>
2016-08-25 15:53:14 +09:00
FUJITA Tomonori 55f473d7fe gobgp: support mrt injecting only best paths
$ gobgp mrt inject global --only-best your-mrt-dump-file

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-07-31 16:31:50 +09:00
Ben AgricolaandFUJITA Tomonori dcdc6f7a05 Fix longer-prefix search using radix trie walk
Bug-Url: #1006

Signed-off-by: Ben Agricola <[email protected]>
2016-07-11 18:52:33 +09:00
ISHIDA WataruandFUJITA Tomonori c5fae01b02 vrf: fix rtc withdraw handling
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA Wataru b281f7f4ff server: return flowspec routes in rfc compliant manner
The order of the flowspec routes matters because they will be used
as ACL rules and what rule will be applied depends on the order.
RFC5575 specifies how flowspec routes should be sorted.
This commit implements what it says.

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-19 00:44:47 +00:00
FUJITA Tomonori 311324fab8 move packet/*.go to packet/bgp/*.go for Go's convention
Later, we move non-bgp protocol stuff like mrt under their own
direcotries.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-03-31 13:19:17 +09:00
Naoto Hanaue e9b32cb56e table: initialize the destinations when the destinations is empty
In the current implementation, the destinations map management area in the table has not been initialized even if destinations removed all.
Therefore, to explicitly initialize the destinations.
2016-03-25 16:11:31 +09:00
ISHIDA Wataru 40ce51137a table: remove unnecessary copy of path attributes
the result of memory profile (500 route-server-clients each of them advertises
100 routes)

before:
(pprof) top5
9330.48MB of 9367.53MB total (99.60%)
Dropped 157 nodes (cum <= 46.84MB)
Showing top 10 nodes out of 17 (cum >= 9334.17MB)
flat       flat%   sum%        cum   cum%
6163.04MB 65.79% 65.79%  6163.04MB 65.79% github.com/osrg/gobgp/table.NewPath
1155.05MB 12.33% 78.12%  7302.59MB 77.96% github.com/osrg/gobgp/table.(*Path).Clone
986.31MB  10.53% 88.65%  1388.81MB 14.83% github.com/osrg/gobgp/table.(*AdjRib).Update
402.51MB   4.30% 92.95%   402.51MB  4.30%  fmt.Sprintf
402.51MB   4.30% 97.24%   402.51MB  4.30% net.parseIPv4

after:
(pprof) top
3913.02MB of 3978.69MB total (98.35%)
Dropped 148 nodes (cum <= 19.89MB)
Showing top 10 nodes out of 11 (cum >= 21MB)
flat       flat%   sum%        cum   cum%
2970.30MB 74.66% 74.66%  2975.80MB 74.79% github.com/osrg/gobgp/server.filterpath
810.09MB  20.36% 95.02%   810.59MB 20.37% github.com/osrg/gobgp/table.(*AdjRib).Update
115.60MB   2.91% 97.92%   119.10MB  2.99% github.com/osrg/gobgp/table.createUpdateMsgFromPath
10MB       0.25% 98.17%  1878.02MB 47.20% github.com/osrg/gobgp/server.(*BgpServer).propagateUpdate
4.50MB     0.11% 98.29%   144.60MB  3.63% github.com/osrg/gobgp/table.CreateUpdateMsgFromPaths

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-01-16 18:22:13 +09:00
ISHIDA WataruandFUJITA Tomonori a719a3de6e server/table: use only one rib for multiple route server clients
speed up and reduce memory footprint

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-12-08 14:45:37 +09:00
ISHIDA WataruandFUJITA Tomonori 093945ee30 table: sort all known paths instead of just selecting best
this is a preparation for add-path recv/send feature

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-12-02 09:53:38 +09:00
ISHIDA Wataru 1d8c71e22b *: better log msg
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-25 11:45:23 +09:00
ISHIDA WataruandFUJITA Tomonori 856f867aea vrf: withdraw route-target constraint routes when deleting a vrf
another partial implementation of RFC4686

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-19 13:29:33 +09:00
ISHIDA WataruandFUJITA Tomonori c14a63575c table: withdraw self-generated vrfed routes when a vrf deleted
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-19 13:29:33 +09:00
ISHIDA WataruandFUJITA Tomonori 0d14f7dca2 table: clean up
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-05 17:24:36 +09:00
ISHIDA WataruandFUJITA Tomonori bf54d911b2 table: publicate Table.getDestination()
we use this later from server module

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-05 17:24:36 +09:00
ISHIDA WataruandFUJITA Tomonori a4501ccc3f mrt: support mrt dump
$ gobgp mrt dump 10 -o ./dump

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-07-22 14:49:46 +09:00
ISHIDA Wataru 9b35be7382 table: refactor Path/Destination/Table struct
Path/Destination/Table was defined as interface.
Simplify by making them normal struct.

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-07-01 11:06:04 +09:00
ISHIDA Wataru 4867124319 table: add Equal() method to compare PeerInfo
this patch fixes the wrong behavior shown below

$ gobgp global rib add 10.0.0.0/24
$ gobgp global rib del 10.0.0.0/24
$ gobgp global rib
Network     Next Hop AS_PATH Age        Attrs
*> 10.0.0.0/24 0.0.0.0  65000   00:05:48   [{Origin: IGP}]

since we used to compare path's source by PeerInfo's pointer, locally
originated routes is considered as a different route even if they have
same prefix.

this patch introduce Equal() method to compare PeerInfo's content and
fix this wrong behavior.

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-06-23 11:13:40 +09:00
ISHIDA Wataru 232b30117c table: add support for route target constraint nlri
add rtc route

$ gobgp global rib add 65000 77 -a rtc

check it

$ gobgp global rib -a rtc

   Network        Next Hop AS_PATH Age        Attrs
*> 65001:65000:75 0.0.0.0  [65001] 00:15:35   [{Origin: IGP}]

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-05-01 10:16:09 +00:00
ISHIDA Wataru 99cccf9812 table: add support for encapsulation nlri
add encap end point route(10.0.0.1) with vni 20

$ gobgp global rib add 10.0.0.1 20 -a encap

check it

$ gobgp global rib -a encap

Please specify one command of: add or del
   Network            Next Hop        AS_PATH    Age        Attrs
*> 10.0.0.1           0.0.0.0         [64512]    00:00:01   [{Origin: IGP} {Encap: < VXLAN | color: 20 >}]

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-25 15:16:45 +00:00
ISHIDA Wataru d405c203ad table: sort peers/routes at client side instead of bgpd side
peer/route sorting is for pretty priting. do it at the client side.

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-15 05:31:40 +00:00
ISHIDA Wataru 3f6876df0b api: add a method to convert internal structs to protobuf structs
- add ToApiStruct() for convertion of internal structs to protobuf structs
  to avoid ugly convertion by json.Marshal() && json.Unmarshal()
- move grpc server code under /server instead of /api
- update proto file to include more detailed path information

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-15 05:24:58 +00:00
ISHIDA Wataru cd0d357a55 table: support displaying evpn destination through cli
evpn nlri key is not expressed in CIDR format.
in that case give up sorting.

we can think later how to sort evpn nlri after we decided the way to
express evpn nlri key(current evpn nlri key is insufficient to keep evpn nlris
unique in evpn table).

this patch also add a MarshalJSON method to EVPNDestination for displaying
evpn routes through cli

Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-03 08:02:56 +00:00
Naoto HanaueandFUJITA Tomonori 8fb175eb2c policy: add prefix filter
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-03-24 19:38:27 +09:00
Yuji OshimaandFUJITA Tomonori 28feabe1ef table: add EVPN route family support
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-03-21 08:08:43 +09:00
Yuji OshimaandFUJITA Tomonori 2ada912601 table: IPv4_VPN route family 2015-03-11 19:52:53 +09:00
FUJITA Tomonori 564cbd9638 table: use github.com/tchap/go-patricia/patricia instead of our fork
The fix for sorting is merged:

https://github.com/tchap/go-patricia/commit/f8d475d887c8f22feb1c7d6748f2864681be53b3

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-03-10 00:48:20 +09:00
FUJITA Tomonori ef594f98c0 table: use forked go-patricia
until the fix for sorting is merged.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-02-18 13:45:29 +09:00
Hiroshi Yokoi e53a0b5352 table: revise table logs 2015-01-28 14:53:24 +09:00
ISHIDA WataruandFUJITA Tomonori 5445305188 table: sort destinations when marshaling
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-11 09:54:45 +09:00
FUJITA Tomonori 900cb321fb table: fix tableKey()
tableKey() must use Prefix (address + mask) as key.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-09 13:21:41 +09:00
FUJITA Tomonori 52ddad958f table: remove Path's source version
Even if a connection with peer is down and up, table code gets
BGPmessages belonging the first connection before the event of the
peer down in order. So we don't need source version stuff inherent
from Ryu BGP code.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-04 20:30:51 +09:00
FUJITA Tomonori 8fd86716d0 table: use 4byte AS as internal data structure
Always use 4byte for AS internally. Convert AS for 2byte AS peer when
necessary.

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-31 00:01:50 +09:00
FUJITA Tomonori a9160a0061 table: Path's getnlri, getpathattrs, getpathattr private
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-30 23:42:21 +09:00
FUJITA Tomonori a3c1e53ded RouteFamily cleanup
RouteFamily is defined in two files.

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-27 06:58:50 -08:00
FUJITA Tomonori eff70c2137 support IPv6_UC route family
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-27 06:27:00 -08:00
FUJITA Tomonori d9d527a65d table: make table json prettier
Even 'jq' command makes the output very nicer.

$ curl  http://localhost:8080/v1/bgp/neighbor/10.0.0.1/local-rib |jq '.'

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-25 05:59:42 -08:00
FUJITA Tomonori 35145891c5 table: add MarshalJSON to Destination and Table
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-25 02:00:20 -08:00
FUJITA Tomonori 6ecf5e15ce clean up logger usage
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-22 04:33:09 -08:00