summaryrefslogtreecommitdiffhomepage
path: root/table/table.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-05table: fix potential panics in tableKeyChris Stockton
It is possible for a call from other Table methods for an interface that does not match the tables route family to reach the type assertion and panic. This change better reflects the intention of the code by checking the concrete type using a type switch instead.
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-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>
2017-12-21cli: Enable to filter EVPN routes by Route TypeIWASE Yusuke
Currently, "gobgp" command supports only to display all routes on RIBs, but with huge RIBs, it is convenient to select routes by a part of NLRI fields. This patch enables to filter routes by EVPN Route Type. For example, when 5 routes for each route type; $ gobgp global rib -a evpn Network Labels Next Hop AS_PATH Age Attrs *> [type:A-D][rd:65000:100][esi:single-homed][etag:10] [10] 0.0.0.0 00:01:09 [{Origin: ?}] *> [type:Prefix][rd:65000:100][etag:10][prefix:10.0.0.0/24] [0] 0.0.0.0 00:00:04 [{Origin: ?} [ESI: single-homed] [GW: 0.0.0.0]] *> [type:esi][rd:65000:100][esi:single-homed][ip:10.0.0.1] 0.0.0.0 00:00:19 [{Origin: ?}] *> [type:macadv][rd:65000:100][etag:10][mac:aa:bb:cc:dd:ee:ff][ip:10.0.0.1] [20,30] 0.0.0.0 00:00:54 [{Origin: ?} [ESI: single-homed]] *> [type:multicast][rd:65000:100][etag:10][ip:10.0.0.1] 0.0.0.0 00:00:33 [{Origin: ?}] You can select multicast route as following; $ gobgp global rib -a evpn multicast Network Labels Next Hop AS_PATH Age Attrs *> [type:multicast][rd:65000:100][etag:10][ip:10.0.0.1] 0.0.0.0 00:03:02 [{Origin: ?}] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-08-02table: allocate bitmap for path id dynamicallyFUJITA Tomonori
allocating 256 bytes per prefix isn't a good idea. Let's allocate 8 bytes by default and expand dynamically if necessary. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-26table: assign local identifier to pathFUJITA Tomonori
The local identifier for path is sent to remote peers. To simplify the implementation, 1) the local identifier is unique per prefix not peer. 2) always assign the local identifier even without addpath-rx-capable peer. In the future, we might need to improve 2) to avoid the unnecessary overhead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-04-21table: Fixed bug when looking up prefixes with a default route.lspgn
2017-03-27server: fix table query with shorter-prefixes optionFUJITA Tomonori
$ 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 <fujita.tomonori@lab.ntt.co.jp>
2017-03-21Fix for gobgp global rib <ip>Nils Juenemann
2017-02-15server: add a current option to WatchBestPath()ISHIDA Wataru
also, use it for zebra integration Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-10-16cli/api: support getting table summary informationWataru Ishida
$ 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 <ishida.wataru@lab.ntt.co.jp>
2016-09-13table: fix route filtering with IP addressWataru Ishida
close #1081 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-09-13cli/table: support filtering of IPv4/IPv6 MPLS routesWataru Ishida
close #1086 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-25table: add Best/MultiPath option to SelectOptionWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-25api/cli: kill cmd package custom path/destination structsWataru Ishida
reuse table package Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-25server/api: fix GetRib API to return sorted destinationWataru Ishida
the feature has been broken. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-25server: fix RIB lookup with longer-prefixes optionWataru Ishida
the feature was somehow broken. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-07-31gobgp: support mrt injecting only best pathsFUJITA Tomonori
$ gobgp mrt inject global --only-best your-mrt-dump-file Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11Fix longer-prefix search using radix trie walkBen Agricola
Bug-Url: #1006 Signed-off-by: Ben Agricola <bagricola@squiz.co.uk>
2016-05-23vrf: fix rtc withdraw handlingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-19server: return flowspec routes in rfc compliant mannerISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2016-03-31move packet/*.go to packet/bgp/*.go for Go's conventionFUJITA Tomonori
Later, we move non-bgp protocol stuff like mrt under their own direcotries. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-25table: initialize the destinations when the destinations is emptyNaoto Hanaue
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-01-16table: remove unnecessary copy of path attributesISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2015-12-08server/table: use only one rib for multiple route server clientsISHIDA Wataru
speed up and reduce memory footprint Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-12-02table: sort all known paths instead of just selecting bestISHIDA Wataru
this is a preparation for add-path recv/send feature Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-25*: better log msgISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-19vrf: withdraw route-target constraint routes when deleting a vrfISHIDA Wataru
another partial implementation of RFC4686 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-19table: withdraw self-generated vrfed routes when a vrf deletedISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-05table: clean upISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-05table: publicate Table.getDestination()ISHIDA Wataru
we use this later from server module Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-22mrt: support mrt dumpISHIDA Wataru
$ gobgp mrt dump 10 -o ./dump Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-01table: refactor Path/Destination/Table structISHIDA Wataru
Path/Destination/Table was defined as interface. Simplify by making them normal struct. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-06-23table: add Equal() method to compare PeerInfoISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2015-05-01table: add support for route target constraint nlriISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2015-04-25table: add support for encapsulation nlriISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2015-04-15table: sort peers/routes at client side instead of bgpd sideISHIDA Wataru
peer/route sorting is for pretty priting. do it at the client side. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-04-15api: add a method to convert internal structs to protobuf structsISHIDA Wataru
- 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 <ishida.wataru@lab.ntt.co.jp>
2015-04-03table: support displaying evpn destination through cliISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2015-03-24policy: add prefix filterNaoto Hanaue
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-21table: add EVPN route family supportYuji Oshima
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-03-11table: IPv4_VPN route familyYuji Oshima
2015-03-10table: use github.com/tchap/go-patricia/patricia instead of our forkFUJITA Tomonori
The fix for sorting is merged: https://github.com/tchap/go-patricia/commit/f8d475d887c8f22feb1c7d6748f2864681be53b3 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-18table: use forked go-patriciaFUJITA Tomonori
until the fix for sorting is merged. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-28table: revise table logsHiroshi Yokoi