MRTdump

Pavel Tvrdík pavel.tvrdik at nic.cz
Tue Aug 23 13:11:23 CEST 2016


Hi, Job!

On 2016-08-22 21:21, Job Snijders wrote:
> Hi,
> 
> Sorry for resurrecting an old thread like this, but I was wondering
> whether any progress has been made for automatic MRT dump file 
> rotation?
> 
> I believe there is a patch, and i thought it would be merged into 1.6.0
> - but than little happened :(
> 
> The use case is that I have a big route collector with 41,000,000 
> routes
> in RIB, which i'd like to dump into long term archives for research
> purposes, but without file rotation that will be hard to do.

BIRD (>=1.2.0) supports MRTdump BGP4MP type [1]. It makes continual log 
of BGP packets into one file. If you need to rotate this file the 
easiest way is to change name in configuration file and call reconfigure 
command.

We implemented MRTdump TABLE_DUMP_V2 type too [2], but haven't merged 
into master branch yet, so this feature isn't in the BIRD v1.6.0. 
However you can clone our GIT branch 'mrtdump-core' [3] with the BIRD 
v1.6.0 and MRTdump TABLE_DUMP_V2 support or apply the patch from email 
attachment on BIRD v1.6.0 source code.

  conf/conf.c          |   2 +-
  conf/conf.h          |  35 ++++-
  doc/bird.sgml        |  73 +++++++---
  nest/Makefile        |   2 +-
  nest/config.Y        |  74 ++++++++++-
  nest/mrtdump.c       | 275 ++++++++++++++++++++++++++++++++++++++
  nest/mrtdump.h       | 113 ++++++++++++++--
  nest/route.h         |   9 ++
  nest/rt-table.c      | 368 
++++++++++++++++++++++++++++++++++++++++++++++++++-
  proto/bgp/Makefile   |   2 +-
  proto/bgp/bgp.c      |   3 +
  proto/bgp/bgp.h      |   2 +
  proto/bgp/mrt.c      | 172 ++++++++++++++++++++++++
  proto/bgp/mrt.h      |  11 ++
  proto/bgp/packets.c  |  17 ++-
  sysdep/unix/config.Y |  14 +-
  sysdep/unix/io.c     |  21 ++-
  sysdep/unix/log.c    |  15 ++-
  sysdep/unix/timer.h  |   6 +
  sysdep/unix/unix.h   |   8 +-
  20 files changed, 1152 insertions(+), 70 deletions(-)

This MRTdump makes only instant dumps of routes to unique named files. 
An automatic deleting of too old files isn't implemented but I believe 
that you can reach the same result with cron.


Example of usage in configuration:

   router id 1.1.1.1;

   table tableA;

   mrtdump routes {
   	filename "%f-%s.mrt";	# dumps will be saved into files named like 
'tableA-1437119435.mrt'
   	table "t*";		# only routes from tables starts with character 't'
   	period 10;		# 10 seconds interval between dumps
   	where source = RTS_BGP;	# only routes from BGP protocols
   }
   ...

See doc/bird.sgml for more details. Enjoy!


Best regards,
Pavel

[1] https://tools.ietf.org/html/rfc6396#section-4.4
[2] https://tools.ietf.org/html/rfc6396#section-4.3
[3] https://gitlab.labs.nic.cz/labs/bird/tree/mrtdump-core


> 
> Kind regards,
> 
> Job
> 
> On Fri, May 30, 2014 at 08:57:39AM +0200, Job Snijders wrote:
>> On Thu, May 29, 2014 at 11:21:01PM +0200, Ondrej Zajicek wrote:
>> > On Tue, May 27, 2014 at 08:42:04PM +0900, Ilias Pallikarakis wrote:
>> > > Hi,
>> > > I figured out that my problem was simply not configuring BIRD for
>> > > multihop neighbour.
>> > > I have, however, another question if someone would care to answer. From my
>> > > search so far I came to the conclusion that in BIRD you cannot mrtdump
>> > > to more
>> > > than one file (per process) and that it is still not possible to
>> > > periodically dump a
>> > > table. Is that correct ?
>> >
>> > That is true. MRTdump was on border of my interests but it could be
>> > easily extended. What features w.r.t. MRTdump would be considered
>> > useful?
>> 
>> Automatic file rollover would be a great feature!
>> 
>> Have the BIRD process periodically (say every hour) close the MRT 
>> file,
>> and open a new one with a new filename which has the date in it.
>> Bonuspoints for making these intervals configurable :-)
>> 
>> Kind regards,
>> 
>> Job
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bird1.6.0..mrtdump-core.patch
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20160823/8fdff6da/attachment.ksh>


More information about the Bird-users mailing list