Comments (5)
I just found https://github.com/YoshiyukiYamauchi/mrtparse/wiki/%5BExaBGP%5D-How-to-send-the-routes-using-the-API and https://github.com/YoshiyukiYamauchi/mrtparse/wiki/%5BExaBGP%5D-How-to-reduce-parsing-by-grouping-updates-with-the-same-attributes. Maybe therefore it's necessary that it doesn't finish.
By the way:
Your approach doesn't scale for multiple calls with huge amounts of prefixes (600k for example). At each call mrtparse has to parse 600k routes again (with python[not pypy] over one hour). Then better parse the routes once to a text file and copy it to the messages section of a python script like this:
#!/usr/bin/env python
import sys
import time
messages = [
'announce route 100.10.0.0/24 next-hop 192.168.0.27',
'announce route 200.20.0.0/24 next-hop 192.168.0.27'
]
time.sleep(2)
while messages:
message = messages.pop(0)
sys.stdout.write( message + '\n')
sys.stdout.flush()
time.sleep(1)
#Loop endlessly to allow ExaBGP to continue running
while True:
time.sleep(1)
sys.stdin.readline()
this script could be imported in the config as usual:
...
process route_inject {
run ./route_inject.run;
encoder json;
}
...
from mrtparse.
responsible part of mrt2exabgp.py:
if flags & FLAG_T['API']:
while True:
time.sleep(1)
from mrtparse.
Maybe therefore it's necessary that it doesn't finish.
it's necessary as you wrote. Without a loop, it would continues processing.
Then better parse the routes once to a text file and copy it to the messages section of a python script like this:
That's right. I will add a support for both ways.
from mrtparse.
I added "-P" option to output ExaBGP API program:smile:
pypy mrt2exabgp.py -P -G latest-bview.gz > route_inject.run
And use the generated script as API program in the config.
group route_inject {
neighbor 192.168.1.101 {
router-id 127.0.0.2;
local-address 127.0.0.2;
local-as 64512;
peer-as 65000;
graceful-restart;
process mrtparse {
run /usr/bin/pypy ./route_inject.run;
}
}
}
from mrtparse.
perfect :)
from mrtparse.
Related Issues (20)
- potential bug: mrt2exabgp.py with BGP4MP_MESSAGE HOT 4
- ExaBGP API grouping format syntax change HOT 6
- mrt2exabgp bails out with CRC error HOT 3
- mrt2bgpdump.py crashes with Updates messages HOT 3
- module 'signal' has no attribute 'SIGPIPE' on jupyter notebook , python 3.6 on windows HOT 3
- TypeError: object of type 'NoneType' has no len() in a Route Views update file HOT 5
- MRTPARSE to exabgp config hangs when using -G & -P flags HOT 1
- IPv4 addresses decoded as IPv6 in print_all.py HOT 3
- Bug in __init__.py line 930 HOT 2
- Error parsing RIPE MRT data HOT 2
- Python3 Error in mrtparse HOT 9
- Convert the RAW BGP data from RIPE HOT 9
- Key error when converting MRT to JSON HOT 4
- Error in Example mrt2bgpdump HOT 1
- mrt2exabgp mrt2bgpdump key issue for prefix length HOT 4
- AttributeError: 'Reader' object has no attribute 'mrt' HOT 2
- Replace `val_dict` by a better solution HOT 3
- Extended NLRI Encodings HOT 4
- Upload to pypi HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mrtparse.