smartbgp / yabgp Goto Github PK
View Code? Open in Web Editor NEW:bowtie:Yet Another BGP Python Implementation
Home Page: http://yabgp.readthedocs.org
License: Apache License 2.0
:bowtie:Yet Another BGP Python Implementation
Home Page: http://yabgp.readthedocs.org
License: Apache License 2.0
yabgp支持python3.6吗
In file: https://github.com/smartbgp/yabgp/blob/master/yabgp/message/attribute/nlri/ipv6_unicast.py
line 45: prefix_addr = str(netaddr.IPAddress(int(binascii.b2a_hex(nlri_data[1:offset]), 16))) \ + '/%s' % prefix_bit_len
It returns an address with extra leading zeros when prefix_bit_len is non-zero.
For example, an original IP prefix a::/96 will turn out to be 0:0: a::/96, because the parser netaddr.IPAddress
does not know there are some zeros masked, it will put the missing zeros at the start of the IP address, causing this issue.
One possible correction is prefix_addr = str(netaddr.IPAddress(int(binascii.b2a_hex(nlri_data[1:offset]), 16)<<(full_length-prefix_bit_len))) \ + '/%s' % prefix_bit_len
where full_length is 32 for ipv4 and 128 for ipv6.
Hi,
I'm using yabgp to inject sr policy. I was able to sucessfully inject a sr policy into cisco router, but something is missing, because the show bgp does not show the sr path. maybe the Tunnel encap attribute type that should be 15 (SR policy)
here goes my sr_policy message:
{
"attr": {
"1": 0,
"2": [[2, [65000]]],
"3": "10.121.216.208",
"5": 200,
"8": ["NO_ADVERTISE"],
"14": {
"afi_safi": [1, 73],
"nexthop": "172.31.255.64",
"nlri": {
"distinguisher": 1,
"color": 14,
"endpoint": "172.31.255.64"
}
},
"16": ["route-target:172.31.255.63:01"],
"23": {
"0": "old",
"6": 100,
"7": 25102,
"128": [ {
"9": 10,
"1": [ {
"1": {
"label": 24004,
"TC": 0,
"S": 0,
"TTL": 255
}
},
{
"3": {
"node": "172.31.255.64",
"SID": {
"label": 24002,
"TC": 0,
"S": 0,
"TTL": 255
}
}
}
]
}
]
}
}
}
RP/0/RP0/CPU0:rr-9k-ios-xrv-6.3.3#sh bgp ipv4 sr-policy [1][14][172.31.255.64]/96
Wed Jan 16 11:11:28.717 BRST
BGP routing table entry for [1][14][172.31.255.64]/96
Versions:
Process bRIB/RIB SendTblVer
Speaker 20 20
Last Modified: Jan 16 10:53:27.852 for 00:18:01
Paths: (1 available, best #1, not advertised to any peer)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
65000
172.31.255.64 (metric 10) from 10.121.216.208 (10.121.216.208)
Origin IGP, localpref 200, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 20
Community: no-advertise
Extended community: RT:172.31.255.63:1
RP/0/RP0/CPU0:rr-9k-ios-xrv-6.3.3#
Any help is welcome. Thanks!
netaddr==0.8.0
length of prefix is variable,
nlri_hex += binascii.unhexlify(hex(prefix.ip)[2:math.ceil(prefix.prefixlen / 8)*2+2])
eg.
2001:db8::/40
1 2 3 4 5 6
40 20 01 0d b8 0
1 byte for length, math.ceil(40/8) = 5byte for prefix
I am not able to advertise the route-target extended community with IPv4 SR-TE update:
2018-03-13 18:28:32,392.392 12597 INFO yabgp.api.utils decorated_function 37 [-] API POST data {u'attr': {u'1': 0, u'23': {u'128': [{u'9': 10, u'1': [{u'1': {u'label': 999990}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 999991}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 999992}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 999993}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}], u'0': u'new', u'13': 965537, u'12': 4200}, u'2': [[2, [10, 2, 3]]], u'14': {u'afi_safi': [1, 73], u'nexthop': u'172.24.64.97', u'nlri': {u'color': 20, u'endpoint': u'89.0.0.1', u'distinguisher': 6001}}, u'16': [u'route-target:89.1.1.1']}}
2018-03-13 18:28:32,392.392 12597 DEBUG yabgp.api.utils decorated_function 38 [-] API request environ {'HTTP_AUTHORIZATION': 'Basic YWRtaW46YWRtaW4=', 'HTTP_ACCEPT': 'text/plain', 'CONTENT_TYPE': 'application/json', 'werkzeug.request': <Request 'http://172.24.64.97:8801/v1/peer/172.24.76.178/send/update' [POST]>, 'wsgi.multithread': True, 'SCRIPT_NAME': '', 'wsgi.input': <twisted.web.wsgi._InputStream object at 0x7f25c92dbb90>, 'REQUEST_METHOD': 'POST', 'HTTP_HOST': '172.24.64.97:8801', 'PATH_INFO': '/v1/peer/172.24.76.178/send/update', 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': '', 'wsgi.version': (1, 0), 'HTTP_CONTENT_TYPE': 'application/json', 'HTTP_CONTENT_LENGTH': '640', 'CONTENT_LENGTH': '640', 'HTTP_USER_AGENT': 'python-requests/2.18.4', 'HTTP_CONNECTION': 'keep-alive', 'SERVER_NAME': '172.24.64.97', 'REMOTE_ADDR': '172.24.77.6', 'wsgi.run_once': False, 'wsgi.errors': <twisted.web.wsgi._ErrorStream object at 0x7f25cb0e6b10>, 'wsgi.multiprocess': False, 'wsgi.url_scheme': 'http', 'SERVER_PORT': '8801', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate'}
2018-03-13 18:28:32,392.392 12597 DEBUG yabgp.api.v1 send_update_message 108 [-] Try to send update message to peer 172.24.76.178
2018-03-13 18:28:32,392.392 12597 ERROR yabgp.core.protocol send_update 284 [-] need more than 1 value to unpack
Hi, thank you so much for creating the YABGP platform. I was having a look at the config file and it says that in order to have multiple peers a different config file (config_file) is required. I couldn't find the location of this. I was trying to set up multiple MPLS L3VPN peers and also EVPN (L2VPN) - all need to be in the same process. thank you in advance.
Respected yabgp developer team,
I've been using yabgp for several tests,
during these tests i use tcpdump to get traffic instances,
when the --nouse-stderr isn't set and the output is being printed on the screen the negotiation and neighborship isn't set,
actually no bgp traffic transfers except 3 way handshake.
RT
2017-08-08 15:46:45,160.160 9719 ERROR yabgp.core.protocol connectionMade 100 [-] argument of type 'DictDotLookup' is not iterable
2017-08-08 15:46:45,162.162 9719 DEBUG yabgp.core.protocol connectionMade 102 [-] Traceback (most recent call last):
File "/Users/penxiao/tmp/yabgp/yabgp/core/protocol.py", line 95, in connectionMade
if 'IPv6' in local_host_addr.info:
TypeError: argument of type 'DictDotLookup' is not iterable
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 08:49:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
>>> ip = netaddr.IPAddress('10.1.1.1')
>>> ip.info
{'IPv4': [{'date': '1995-06',
'designation': 'IANA - Private Use',
'prefix': '10/8',
'status': 'Reserved',
'whois': ''}]}
>>> 'IPv6' in ip.info
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument of type 'DictDotLookup' is not iterable
>>>
(yabgp-virl)~/yabgp/bin @host> python yabgpd -h
Traceback (most recent call last):
File "yabgpd", line 38, in
from yabgp.agent.cmd import main
File "/home/solomonyang/yabgp/yabgp/agent/init.py", line 30, in
from yabgp.api.app import app
File "/home/solomonyang/yabgp/yabgp/api/app.py", line 21, in
from yabgp.api import v1
File "/home/solomonyang/yabgp/yabgp/api/v1.py", line 21, in
from flask.ext.httpauth import HTTPBasicAuth
ImportError: No module named ext.httpauth
according to https://flask-httpauth.readthedocs.io/en/latest/, changed the following line in yabgp/api/v1.py
from flask.ext.httpauth import HTTPBasicAuth
to
from flask_httpauth import HTTPBasicAuth
then it works well.
Hi any clue or advice about this error:
2019-12-20 13:58:50,413.413 1662 INFO yabgp.api.utils [-] API request url http://10.219.83.232:8801/v1/peer/192.168.14.1/send/update?Content-Type=application%2Fjson
2019-12-20 13:58:50,413.413 1662 INFO yabgp.api.utils [-] API query string Content-Type=application/json
2019-12-20 13:58:50,413.413 1662 INFO yabgp.api.utils [-] API request method POST
2019-12-20 13:58:50,413.413 1662 INFO yabgp.api.utils [-] API POST data None
2019-12-20 13:58:50,413.413 1662 ERROR flask.app [-] Exception on /v1/peer/192.168.14.1/send/update [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2284, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1807, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1710, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1805, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1791, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python2.7/dist-packages/flask_httpauth.py", line 61, in decorated
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/yabgp/api/utils.py", line 39, in decorated_function
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/yabgp/api/utils.py", line 48, in decorator
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/yabgp/api/v1.py", line 120, in send_update_message
attr = json_request.get('attr') or {}
Thanks!
/Kevin Chao
The API assumes that if peer negotiates the 4B capability, then it encodes all route-target extended communities as 4B ASN, even if ASN is < 65535.
eg:
Line 138 in 7aa769a
I think the wording in section 3 of RFC5668 states that 2B ASN converted to 4B ASN community format is undesirable, and for backward compatibility; "
Autonomous Systems that use 2-octet Autonomous System numbers SHOULD use 2-octet AS specific extended communities rather than 4-octet AS specific extended communities.
If you're in agreement with the above, I have a patch I'll happily submit
If the last message in BGP message file is uncompleted(invalid json format), the yabgp will return error because once start yabgp, it will read the BGP message file and get the last sequence number.
like:
{"msg": "Connection was refused by other side: 61: Connection refused.", "type": 0, "t": 1506318584.736146, "seq": 1}
{"msg": "Connection was refused by other side: 61: Connection refused.", "type": 0, "t": 1506318614.747854, "seq": 2}
{"msg": "Connection was refused by other side: 61: Connection refused.", "type": 0, "t": 1506318644.757879, "seq": 3}
{"msg": {"version": 4, "hold_time": 180, "asn": 65001, "bgp_id": "192.168.0.1", "capabilities": {"cisco_route_refresh": true, "four_bytes_as": true, "afi_safi": [[1, 1]], "route_refresh": true}}, "type": 1, "t": 1506318735.287288, "seq": 4}
{"msg": {"afi_safi": null, "attr": {}, "withdraw": [],
Hi,
I seek your advice for the next step since I run into these errors:
(yabgp-virl)root@ubuntu-14-04-6-server-amd64:~/yabgp# yabgpd --bgp-local_addr=192.168.14.4 --bgp-local_as=1234 --bgp-remote_add=192.168.14.1 --bgp-remote_as=1234
Traceback (most recent call last):
File "/usr/local/bin/yabgpd", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(requires)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: stevedore>=1.5.0
I have the following configuration for my BGP SR-TE udpate -
{'attr': {'1': 0, '2': [[2, [100, 2]]], '14': {'nlri': {'color': 250, 'endpoint': '206.1.0', 'distinguisher': 6001}, 'afi_safi': [1, 73], 'nexthop': '47.8.1.1'}, '23': {'0': 'new', '13': 965540, '12': 4200, '128': [{'9': 10, '1': [{'1': {'label': 999980}}, {'1': {'label': 900003}}, {'1': {'label': 900002}}]}]}, '8': ['NO_ADVERTISE']}}
I was looking to add ENLP functionality described in https://tools.ietf.org/html/draft-ietf-idr-segment-routing-te-policy-07#section-2.4.4 What is the option to be used. The documentation at https://yabgp.readthedocs.io/en/latest/msg_format.html#ipv4-sr-policy doesn't mention about it.
I am trying to push multiple sid lists with diff weights. Not able to do it, does anyone have it working? if so can you post your json please?
BGP flowspec is partly supported because we haven't implemented operator
field correctly.
According to the RFC 5575 https://tools.ietf.org/html/rfc5575
The operator byte is encoded as:
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| e | a | len | 0 |lt |gt |eq |
+---+---+---+---+---+---+---+---+
Numeric operator
e - end-of-list bit. Set in the last {op, value} pair in the
list.
a - AND bit. If unset, the previous term is logically ORed
with the current one. If set, the operation is a logical
AND. It should be unset in the first operator byte of a
sequence. The AND operator has higher priority than OR
for the purposes of evaluating logical expressions.
len - The length of the value field for this operand is given
as (1 << len).
lt - less than comparison between data and value.
gt - greater than comparison between data and value.
eq - equality between data and value.
The bits lt, gt, and eq can be combined to produce "less or
equal", "greater or equal", and inequality values.
we should support Cisco IOSXR format flowspec nlri like:
Dest:10.0.1.0/24,Source:192.0.0.0/8,Proto:=6|=17|=1,DSCP:=10
for our json POST, it should be:
{
"attr":{
"1": 0,
"2": [],
"5": 100,
"14": {
"afi_safi": [1, 133],
"nexthop": "",
"nlri": [{"1": "10.0.1.0/24", "2": "192.0.0.0/8", "3": "=1|=6|=17", "11": "=10"}]
},
"16":[[32774, "100:6250000"]]
}
}
All the value of NLRI type should be string, like port number "=1|=6|=17" or "=17"
for ext-community, we should improve based on Cisco IOSXR format like:
RP/0/RP0/CPU0:R1#sh bgp ipv4 flowspec Dest:10.0.1.0/24,Source:192.0.0.0/8,Proto:=6|=17|=1,DSCP:=10
Wed Oct 18 23:58:15.605 UTC
BGP routing table entry for Dest:10.0.1.0/24,Source:192.0.0.0/8,Proto:=6|=17|=1,DSCP:=10/144
Versions:
Process bRIB/RIB SendTblVer
Speaker 12 12
Last Modified: Oct 18 23:57:25.972 for 00:00:52
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.1
Path #1: Received by speaker 0
Advertised to update-groups (with more than one peer):
0.1
Local
10.75.44.1 from 0.0.0.0 (192.168.0.1)
Origin IGP, localpref 100, valid, redistributed, best, group-best
Received Path ID 0, Local Path ID 0, version 12
Extended community: FLOWSPEC Redirect-IP:0 FLOWSPEC Traffic-rate:65001,62
RP/0/RP0/CPU0:R1#
RP/0/RP0/CPU0:R1#
Binding SID value of IPv4 SR-policy incorrectly interpreted by Junos 17.4R1.
2018-03-08 19:23:02,712.712 15399 INFO yabgp.api.utils [-] API POST data {u'attr': {u'1': 0, u'8': [u'NO_ADVERTISE'], u'2': [], u'14': {u'afi_safi': [1, 73], u'nexthop': u'10.1.2.2', u'nlri': {u'color': 10, u'distinguisher': 0, u'endpoint': u'4.4.4.4'}}, u'23': {u'128': [{u'9': 10, u'1': [{u'1': {u'S': 0, u'TTL': 255, u'TC': 0, u'label': 10003}}, {u'1': {u'S': 0, u'TTL': 255, u'TC': 0, u'label': 10002}}]}], u'0': u'new', u'13': 1}}}
When yabgp sends BSID=1, Junos interprets it as 4096, when BSID = 2, it is interpreted as 8192.
I think this is because yabgp shifts 12bits to the left on BSID field by tunnelencaps.py.
When i tried to send an update and its the example that you have using postman, getting below error. Please let me know if you need any other info.
Junos version - 18.1
Junos Side -
Apr 4 03:39:24 vmx-18.1 rpd[5852]: bgp_read_v4_update:12457:
NOTIFICATION sent to 192.168.1.133 (Internal AS 1): code 3 (Update
Message Error) subcode 1 (invalid attribute list), Data: d0 17 00 50
00 0f
Apr 4 03:39:24 vmx-18.1 rpd[5852]: Received malformed update from
192.168.1.133 (Internal AS 1)
Apr 4 03:39:24 vmx-18.1 rpd[5852]: Family inet-unicast, prefix 0.0.0.0/0
Apr 4 03:39:24 vmx-18.1 rpd[5852]: Malformed Attribute
TUNNEL_ENCAPS(23) flag 0xc0 length 80.
Apr 4 03:41:40 vmx-18.1 rpd[5852]: bgp_read_v4_update:12457:
NOTIFICATION sent to 192.168.1.133 (Internal AS 1): code 3 (Update
Message Error) subcode 1 (invalid attribute list), Data: d0 17 00 50
00 0f
Apr 4 03:41:40 vmx-18.1 rpd[5852]: Received malformed update from
192.168.1.133 (Internal AS 1)
Apr 4 03:41:40 vmx-18.1 rpd[5852]: Family inet-unicast, prefix 0.0.0.0/0
Apr 4 03:41:40 vmx-18.1 rpd[5852]: Malformed Attribute
TUNNEL_ENCAPS(23) flag 0xc0 length 80.
Yabgp -
2018-04-03 23:38:58,704.704 5901 INFO yabgp.core.fsm [-]
[192.168.1.134]State is now:ESTABLISHED
2018-04-03 23:39:23,324.324 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]A BGP KeepAlive message was received from peer.
2018-04-03 23:39:28,506.506 5901 INFO yabgp.core.fsm [-] Keep alive
timer expires
2018-04-03 23:39:28,506.506 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]Send a BGP KeepAlive message to the peer.
2018-04-03 23:39:52,549.549 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]A BGP KeepAlive message was received from peer.
2018-04-03 23:39:58,506.506 5901 INFO yabgp.core.fsm [-] Keep alive
timer expires
2018-04-03 23:39:58,507.507 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]Send a BGP KeepAlive message to the peer.
2018-04-03 23:40:17,304.304 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]A BGP KeepAlive message was received from peer.
2018-04-03 23:40:28,507.507 5901 INFO yabgp.core.fsm [-] Keep alive
timer expires
2018-04-03 23:40:28,507.507 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]Send a BGP KeepAlive message to the peer.
2018-04-03 23:40:44,546.546 5901 INFO yabgp.api.utils [-] API request
url http://192.168.1.133:8801/v1/peer/192.168.1.134/send/update
2018-04-03 23:40:44,546.546 5901 INFO yabgp.api.utils [-] API request
method POST
2018-04-03 23:40:44,547.547 5901 INFO yabgp.api.utils [-] API POST
data {u'attr': {u'14': {u'afi_safi': [1, 73], u'nexthop':
u'192.168.5.5', u'nlri': {u'color': 10, u'distinguisher': 0,
u'endpoint': u'192.168.76.1'}}, u'16':
[u'route-target:10.75.195.199:00'], u'23': {u'128': [{u'9': 2, u'1':
[{u'1': {u'label': 5000}}, {u'1': {u'S': 0, u'TTL': 255, u'TC': 0,
u'label': 4000}}]}, {u'9': 10, u'1': [{u'1': {u'label': 2000}}, {u'3':
{u'node': u'10.1.1.1', u'SID': {u'S': 0, u'TTL': 255, u'TC': 0,
u'label': 3000}}}]}], u'0': u'old', u'7': 25102, u'6': 100}, u'1': 0,
u'3': u'192.168.5.5', u'2': [], u'5': 200, u'8': [u'NO_ADVERTISE']}}
2018-04-03 23:40:44,551.551 5901 INFO yabgp.core.protocol [-]
[192.168.1.134]Notification message received, error: UPDATE Message
Error, sub error: Malformed Attribute List, data=ÐPL€ 8€ÿúÿ€
}ÿ
Hi,
I was wondering if there is a way to use the python script which I use for route-advertisements with the yabgp config file itself? I have to manually run the python script after the bgp session gets established.
I tried setting the 'pid-file' option to point to the python script:
pid-file = '/home/deep/advertise_ipv4_routes.py'
But this does not seem to work. Am I missing something? I am looking for a way to automate the route advertisement process as soon as bgp session is established.
Removed
I was wondering if you have considered removing the dependency on netaddr and moving to ipaddress which is included with python3 and has been backported to python2.
我最近对原理性的东西很感兴趣,哪位大大给我安利一下这个项目的原理,以及使用方法?
Do you support link bandwidth extended community?
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-07
hello,
in the yabgp.ini, it has the option that following, my question is how to get the rib of yabgp using GET?
Whether maintain bgp rib table
rib = True
Original: rfc8669#section-3
Extend: rfc9252#section-2
More: Advertising_srv6_service_tlvs
RT
I get this error while trying to establish a BGP-LU relationship. It works with EXABGP but not with YABGP. Any know issue around this? The end point is an Arista switch.
2018-08-21 18:20:27,713.713 24959 INFO yabgp.core.fsm [-] [172.30.154.56]State is now:OPENSENT
2018-08-21 18:20:27,714.714 24959 ERROR yabgp.core.protocol [-] unpack requires a string argument of length 4
2018-08-21 18:20:27,715.715 24959 INFO yabgp.core.protocol [-] [172.30.154.56]A BGP KeepAlive message was received from peer.
Hi,
I'm getting an invalid attribute list
.... NOTIFICATION sent to 10.97.97.2 (Internal AS xxxx): code 3 (Update Message Error) subcode 1 (invalid attribute list), Data: c0 17 34 00 0f 00
I'm using the following post , just as an example ... but this happens if i use type 1 only.
{
"attr": {
"1": 0,
"2": [[2, []]],
"3": "10.99.99.2",
"5": 200,
"8": ["NO_ADVERTISE"],
"14": {
"afi_safi": [1, 73],
"nexthop": "192.168.5.5",
"nlri": {
"distinguisher": 0,
"color": 0,
"endpoint": "192.168.76.1"
}
},
"16": [[258, "10.75.195.199:00"]],
"23": {
"6": 100,
"7": 2,
"128": [
{
"9": 10,
"1": [
{
"1": {
"label": 2000
}
},
{
"3": {
"node": "10.1.1.1",
"SID": {
"label": 3000,
"TC": 0,
"S": 0,
"TTL": 255
}
}
}
]
}
]
}
}
}
For a first release, the code is clean and quite easy to read. I wish you all the best with openbgp.
It is just unfortunate that a popular open source daemon called "openbgpd" already exists ( http://www.openbgpd.org/ ). You may want to consider another name for your project ( it is not too late ) or at least make sure the daemon is not called the same as openbsd's one.
Oh, and do not do my mistake and use str for anything: like you did with "construct", use a different function to generate string representation of BGP objects.
Best of luck.
hi,
thank you for releasing yabgp, is looking very promising,
at the moment am using exabgp and gobgp,
and i would like to ask you a couple of questions about it.
[1]
when running yabgp in 'standalone' mode, i really do not understand how it is possible to tail the
file created in write_dir for parsing the bgp updates.
what i mean is that yabgp will write the bgp updates in a file of specific file, and if i write another process that tails that file, there is no synchronisation between them.
so even if i log rotate the output file after reading it (tail), how can i know if the yabgp process wrote an extra line(s) after i tail it and before i log rotate it ?
when running yabgp in 'non-standalone' mode, according to the docs you specify the rabbitmq exchange url, is the queue name hard-coded ? if yes, what is its name ?
why mongodb has to be configured ? if i would like to queue the bgp updates in rabbitmq only, is that possible ?
[2] are you planning to implement all types of evpn ? is it in the roadmap ?
many thanks
when attr 29 is before NLRI in the message, attr 29 is unparsed because protocol id has not been parsed yet
data_bin = b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" \
b"\x00\x89\x02\x00\x00\x00" \
b"\x72\x40\x01\x01\x00\x40\x02\x00\x40\x05\x04\x00\x00\x00\x64\x80" \
b"\x1d\x31\x04\x00\x00\x01\x00\x04\x02\x00\x19\x53\x47\x50\x2d\x45" \
b"\x51\x49\x58\x2d\x54\x43\x2d\x52\x4f\x55\x54\x45\x52\x2d\x30\x31" \
b"\x2e\x53\x47\x50\x04\x03\x00\x03\x65\x00\x01\x04\x04\x00\x04\xac" \
b"\x1d\x20\xfa\x90\x0e\x00\x2c\x40\x04\x47\x04\xac\x1f\x16\xee\x00" \
b"\x00\x01\x00\x1f\x02\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00" \
b"\x12\x02\x00\x00\x04\x00\x00\xff\xfd\x02\x03\x00\x06\x17\x20\x29" \
b"\x03\x22\x50"
When I download the master as a .zip file and run command "pip install yabgp-master.zip", an error occured and installation failed. The last line of error info is:
ValueError: path 'etc/yabgp/' cannot end with '/'
After considerable efforts, I solved it by removing the second '/' in line 38 of file setup.cfg
Hi,
I have been encountering this error on Yabgp version 0.4.0 when trying to advertise a SR-TE update with 8 segment-lists. This are the logs from Yabgp:
2018-02-28 16:43:44,013.013 1349 INFO yabgp.api.utils [-] API POST data {u'attr': {u'1': 0, u'8': [u'NO_ADVERTISE'], u'2': [[2, [10, 2, 3]]], u'14': {u'afi_safi': [1, 73], u'nexthop': u'172.24.64.97', u'nlri': {u'color': 20, u'endpoint': u'20.0.255.1', u'distinguisher': 6256}}, u'23': {u'128': [{u'9': 20, u'1': [{u'1': {u'label': 900020}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900021}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900022}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900023}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900024}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900025}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900026}}, {u'1': {u'label': 900004}}, {u'1': {u'label': 900002}}]}, {u'9': 10, u'1': [{u'1': {u'label': 900027}}, {u'1': {u'label': 900003}}, {u'1': {u'label': 900002}}]}], u'0': u'new', u'13': 965796, u'12': 4200}}}
2018-02-28 16:43:44,013.013 1349 ERROR yabgp.core.protocol [-] ubyte format requires 0 <= number <= 255
Hi,
I have been using Yabgp 0.4.0 for some time for sending IPv4 SR-TE policies. I am wondering if there is a way for segment-lists to be empty in the updates?
Currently, I am using the following json parameters to advertise the label stack:
payload['attr'] = { "1": 0, "2": [[2,[10,2,3]]], "8": [ "NO_ADVERTISE"], "14": { "afi_safi": [1, 73], "nexthop": nh, "nlri": { "distinguisher": dist, "color": color, "endpoint": prefix }}, "23": { "0": "new", "12": 4200, "13": bsid, "128": [ { "9": 10, "1" : [ { "1": { "label": 900002 } } ] } ] } }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.