43 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
ISHIDA WataruandFUJITA Tomonori 6f102593b7 table: handle paths with IPv4 NLRI and IPv6 nexthop properly
when a path has IPv4 NLRI and IPv6 nexthop, handle it in MPBGP manner.
(use mp-reach-nlri path attribute instead of nexthop path attibute)

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-04 22:07:46 +09:00
FUJITA Tomonori a042bb3bf8 table: MP_UNREACH_NLRI shouldn't carry any other path attributes
RFC4760 says:

An UPDATE message that contains the MP_UNREACH_NLRI is not required to
carry any other path attributes.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-09-28 18:35:39 -07:00
dspandFUJITA Tomonori c4fe45902e all logging is done with log.WithFields
Signed-off-by: dsp <[email protected]>
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-07-30 12:17:37 +09:00
FUJITA Tomonori c5b7496d0b fix support AGGREGATOR and AS4_AGGREGATOR conversion
Fix the following commit:

commit de58be4411
Author: FUJITA Tomonori <[email protected]>
Date:   Sun Jun 26 23:18:23 2016 +0900

    support AGGREGATOR and AS4_AGGREGATOR conversion

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-28 12:26:47 +09:00
FUJITA Tomonori de58be4411 support AGGREGATOR and AS4_AGGREGATOR conversion
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-26 23:18:23 +09:00
FUJITA Tomonori 315a553ec1 table: fix creation of update message from path with multiple NLRIs
Fix a bug that gobgp creates a wrong update message from path having
MP_REACH with multiple NLRIs. gobgp always allocates a path per NRLI
(that is, multiple paths from an update message having MP_REACH with
multiple NLRIs).

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-31 09:49:00 +09: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
ISHIDA WataruandFUJITA Tomonori 36f8911cee table: support sending/receiving EOR msg
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-02-10 22:15:04 -08: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 Wataru f42b8fbae6 table: copy path-attr list before converting to as2 path
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-01-09 15:29:01 +09:00
ISHIDA WataruandFUJITA Tomonori fdaa6da2cd table: fix UpdatePathAttrs2ByteAs and UpdatePathAttrs4ByteAs 2015-12-25 20:20:13 -08:00
FUJITA Tomonori f892946298 bmp: fix post-policy bmp message creation
post-policy code creates paths from bgp update and then create the
message from the modified paths. MP_UNREACH needs to be handled
diffently.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-12-17 21:49:32 -08:00
FUJITA Tomonori 1ac95d5869 table: always try to merge NLRIs to one message
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-12-16 07:56:47 -08: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 Wataru 9298e5eeca *: kill bgp.NLRInfo and bgp.WithdrawnRoute
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-09-08 13:13:34 +09:00
FUJITA Tomonori 70a8399e0d table: disable merging NLRIs if we don't have many NLRIs
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-08-29 23:21:20 +09:00
FUJITA Tomonori c46d51f46a table: merge NLRIs in one message in hard way
Actually comapring all the attributes to see if packing NLRIs. It
takes long but gobgpd sends minimum messages.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-08-29 22:51:40 +09:00
FUJITA Tomonori 7150d02500 table: remove the limit of the number of packed NLRI in one message
With experiments about the full routes, we hit the limit. Let's remove
it.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-08-26 22:28:40 +09:00
FUJITA Tomonori 64ddb52890 pack multiple NLRIs into one BGP update message
With this patch, bobgpd packs multiple NLRIs into one BGP update
message (IOW, multiple paths into one update message).

We do only with ipv4 since we could have lots of routes. If you don't
have lots, it's not worth having the complicated logic for such route
families.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-08-24 13:02:28 +09:00
ISHIDA WataruandFUJITA Tomonori 95540c2e8a table: remove unnecessary else if condition
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-08-12 08:04:30 +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 WataruandFUJITA Tomonori b7b1e18eec server: update path attrs when sending update msg out
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-07-03 06:29:07 +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 WataruandFUJITA Tomonori 6f8db811e0 server: clone paths before storing to adj-rib-out
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-04 21:50:50 +09:00
ISHIDA WataruandFUJITA Tomonori 3febf8129e table: change Path.clone to copy path attributes and make it public
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-04 13:50:53 +09:00
ISHIDA WataruandFUJITA Tomonori 9c37e5aee0 table: fix bug of update msg creation
Signed-off-by: ISHIDA Wataru <[email protected]>
2015-04-04 13:28:48 +09: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
ISHIDA WataruandFUJITA Tomonori 9355715ea3 peer: update pathattr for non-route-server client
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-03-20 22:10:09 +09:00
FUJITA Tomonori 5b7e1e6846 table: disable update merging
Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-09 14:20:30 +09:00
FUJITA Tomonori 564a4a0bd2 message: disable merging updates for ipv6
Looks broken. disable for now.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-07 01:57:00 -08:00
FUJITA Tomonori 4bd5611c10 table: fix UpdatePathAttrs2ByteAS
Fix the bug that UpdatePathAttrs2ByteAS modifies the _ORIGINAL_ path
attributes in rib.

Signed-off-by: FUJITA Tomonori <[email protected]>
2015-01-07 01:02:52 -08:00
FUJITA Tomonori 875e89292a table: fix UpdatePathAttrs2ByteAs
Needs to clone PathAttributes. We can't touch PathAttributes in table.

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-31 23:34:58 +09:00
FUJITA Tomonori 3f324d55bd server: merge bgp update messages if possible
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-31 23:18:04 +09:00
FUJITA Tomonori bb7f960572 table: fix 2byte AS peer helper functions
If AS_PATH attribute doesn't exist, just return.

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-31 01:03:57 +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 7cac8709ad table: make path.Clone private
table_manager.go clones withdraw path before passing it to peer.go

clone() doesn't clone pathattributes. This patch adds a helper
funciton to clone PathAttributes to message.go (it is used by
createing BGPUpdate message to withdraw ipv6. later it will be used
for 2 byte AS peer).

Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-30 23:31:52 +09:00
FUJITA Tomonori 40e40449ff serve: move functions about path and bgp message to table/message.go
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-30 22:08:08 +09:00
FUJITA Tomonori de9a26d9f3 table: add helper functions to modify PathAttributes for 4 and 2 byte AS.
Signed-off-by: FUJITA Tomonori <[email protected]>
2014-12-30 21:04:01 +09:00