summaryrefslogtreecommitdiffhomepage
path: root/table/message.go
AgeCommit message (Collapse)Author
2017-12-20table: fix converting 2bytes to 4bytes AS PATHFUJITA Tomonori
On some conditions, we add some ASes to As4PathParam.AS but don't update As4PathParam.Num (the number of ASes). It breaks serialization of AS4PathParam. Instead of modifying the internal of As4PathParam, let's create a new As4PathParam object. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-23table: fix merging of v4 paths with addpath enabledFUJITA Tomonori
V4 NLRI needs more 4 bytes with addpath enabled. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-23table: use Path's hash value for mergingFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-23table: avoid unnecessary attributes in Path objectFUJITA Tomonori
- withdraw path doesn't need any attributes. - mp reach path doesn't need mp unreach attribute (some bgp speackers send an update message including both mp reach and mp unreach). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-03table/message: Send EoR as the last of UPDATE messagesSatoshi Fujimoto
EoR should be sent at the end of the UPDATE messages, but currently, EoR may be sent before RIB. This commit fixes this problem. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-08-07table: exclude mpreach and mpunreach attribute for normal v4 updatesWataru Ishida
It is possible that gobgp's v4 path structure contains mpreach or mpunreach attribute. (we store entire path attributes in path structure as they are received) Since we use a NLRI field of BGP update message for v4 updates and don't aggregate update/withdrawal messages for other address families, we need to exclude these attribute before sending out v4 updates. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-08-07table: fix handling of update with both mpunreach and mpreach attributeWataru Ishida
some implementations send a mpunreach attribute piggy backed on an update message. Since it is stored in pathattrs of gobgp's path structure, we need to exclude it before sending out update messages. Signed-off-by: Wataru Ishida <ishida.wataru@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-04table: handle paths with IPv4 NLRI and IPv6 nexthop properlyISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2016-09-28table: MP_UNREACH_NLRI shouldn't carry any other path attributesFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2016-07-30all logging is done with log.WithFieldsdsp
Signed-off-by: dsp <dsp@2f30.org> Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-06-28fix support AGGREGATOR and AS4_AGGREGATOR conversionFUJITA Tomonori
Fix the following commit: commit de58be441150daf8943a5a66ced6703b8201303e Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Date: Sun Jun 26 23:18:23 2016 +0900 support AGGREGATOR and AS4_AGGREGATOR conversion Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-26support AGGREGATOR and AS4_AGGREGATOR conversionFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-31table: fix creation of update message from path with multiple NLRIsFUJITA Tomonori
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 <fujita.tomonori@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-02-10table: support sending/receiving EOR msgISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
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>
2016-01-09table: copy path-attr list before converting to as2 pathISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-12-25table: fix UpdatePathAttrs2ByteAs and UpdatePathAttrs4ByteAsISHIDA Wataru
2015-12-17bmp: fix post-policy bmp message creationFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2015-12-16table: always try to merge NLRIs to one messageFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@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-09-08*: kill bgp.NLRInfo and bgp.WithdrawnRouteISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-29table: disable merging NLRIs if we don't have many NLRIsFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-29table: merge NLRIs in one message in hard wayFUJITA Tomonori
Actually comapring all the attributes to see if packing NLRIs. It takes long but gobgpd sends minimum messages. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-26table: remove the limit of the number of packed NLRI in one messageFUJITA Tomonori
With experiments about the full routes, we hit the limit. Let's remove it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24pack multiple NLRIs into one BGP update messageFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2015-08-12table: remove unnecessary else if conditionISHIDA Wataru
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-03server: update path attrs when sending update msg outISHIDA Wataru
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-04server: clone paths before storing to adj-rib-outISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-04-04table: change Path.clone to copy path attributes and make it publicISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-04-04table: fix bug of update msg creationISHIDA Wataru
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-20peer: update pathattr for non-route-server clientISHIDA Wataru
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-09table: disable update mergingFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-07message: disable merging updates for ipv6FUJITA Tomonori
Looks broken. disable for now. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-01-07table: fix UpdatePathAttrs2ByteASFUJITA Tomonori
Fix the bug that UpdatePathAttrs2ByteAS modifies the _ORIGINAL_ path attributes in rib. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-31table: fix UpdatePathAttrs2ByteAsFUJITA Tomonori
Needs to clone PathAttributes. We can't touch PathAttributes in table. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-31server: merge bgp update messages if possibleFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-31table: fix 2byte AS peer helper functionsFUJITA Tomonori
If AS_PATH attribute doesn't exist, just return. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-30table: Path's getnlri, getpathattrs, getpathattr privateFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-30table: make path.Clone privateFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2014-12-30serve: move functions about path and bgp message to table/message.goFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-12-30table: add helper functions to modify PathAttributes for 4 and 2 byte AS.FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>