It looks VRRPManager can't handle virtual_ip_address properly as bellow.
$ sudo ryu-manager ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.manager
instantiating app ryu.services.protocols.vrrp.manager of VRRPManager
instantiating app ryu.services.protocols.vrrp.rpc_manager.py of RpcVRRPManager
instantiating app None of VRRPInterfaceMonitorNetworkDevice
instantiating app None of VRRPRouterV3
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: None -> Initialize
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: Initialize -> Backup
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in _launch
func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 276, in _event_loop
handler(ev)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 234, in master_down_handler
self.state_impl.master_down(ev)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 613, in master_down
self._master_down()
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 579, in _master_down
vrrp_router.send_advertisement()
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 219, in send_advertisement
packet_.serialize()
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py", line 74, in serialize
data = p.serialize(self.data, prev)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 394, in serialize
return self.serialize_static(self, prev)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 625, in serialize_static
*[conv(x) for x in vrrp_.ip_addresses])
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/addrconv.py", line 27, in text_to_bin
return self._addr(text, **self._addr_kwargs).packed
File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 314, in __init__
% (addr, self._module.version))
AddrFormatError: base address '.' is not IPv4
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Python bundles dictConfig since 2.7. Try the bundled version first
as the version included in Ryu will not work with python3.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix the leftover of previos types.*Type removal. Also, as python3
doesn't have long type, use six.integer_types instead.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If the path has a next hop value set, it should be used in the BGP
Update message first. This changes to logic to use the check for the
next hop in the order prefix/path->peer config->speaker config. This
will allow for sending the nexthop as part of the add_prefix message and
allow for overiding the nexthop of the peer if one is set.
Based-on: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Allows listening on a socket for OVSDB clients, reacting to their events
and modifying their database.
Co-Authored-By: Chris Hansen <chris.hansen.career@gmail.com>
Co-Authored-By: Ravi Kamachi <ravi.kamachi@rackspace.com>
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: Chris Hansen <chris.hansen.career@gmail.com>
Signed-off-by: Ravi Kamachi <ravi.kamachi@rackspace.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
While msgpack has default binary-unicode conversion, the feature is
somehow disabled in ryu. As the other parts of ryu requires binary_type
data where they directly appear on-wire, simply follow the policy.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
map() has been changed to return an iterator in python3. Iterators aren't
JSON serializable, and can be used only once for for loops.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is the partial patch to supporting python 3.
unicode was removed in python 3. So we use six.text_type instead of unicode.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch is generated by "2to3 -f dict" and irrevant parts were
hand-removed.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
oslo packages got away from namespaces while ago.
Update ryu to use the new namespace-less import path.
Bump oslo.config requirement version accordingly.
Reference:
https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We use syntaxes which can be used only in Python2 at many locations. But we should reduce the use of the syntaxes. This patch serves syntax level compatibility with Python3. However, for full compatibility is required still a lot of work because many API changes are made between 2 to 3.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Deferred formatting to the logging system:
---------------------------------------------
In general
logger.debug('xxx %s yyy %d zzz' % (a, b, c))
can be written as:
logger.debug('xxx %s yyy %d %zzz', a, b, c)
This is faster, as Python logging doesn't bother doing the format
operation (which is slow) if the log message won't be logged.
We measured that a significant amount of CPU time in the BGP service
was attributable to these formatting operations.
Removed unneeded calls to str() and repr()
------------------------------------------
since formatting operations %s and %r will make these calls when
(and if) the formatting is performed.
Signed-off-by: Jerry Cen <zhiweic@google.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BGPPathAttributeNextHop and BGPPathAttributeMpReachNLRI is already in
new_pathattr. so stop construct and append it to new_pathattr list.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
You can understand adj-RIB-in information through new api.
- received-routes : paths received and not withdrawn by given peer
- sent-routes : paths sent and not withdrawn to given peer
(sample log of show neighbor)
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['neighbor', 'received-routes', '192.168.101.101', 'all'], 'format': 'cli'}
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
Timestamp Network Labels Next Hop Metric LocPrf Path
2015/02/06 06:52:04 192.168.1.0/30 None 192.168.101.101 100 None [65010] i
2015/02/06 06:52:04 192.168.2.0/30 None 192.168.101.101 100 None [65010] i
2015/02/06 06:52:04 0.0.0.0/0 None 192.168.101.101 100 None [65010, 65001] i
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When a single peer is specified for BGPSpeaker the server value was not
being set upon return.
Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The field of "Path" has not displayed in properly as bellow.
It looks the raw data of Origin code has displayed instead.
bgpd> show neighbor received-routes 192.168.101.101 all
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
Timestamp Network Labels Next Hop Metric LocPrf Path
2015/02/05 07:39:05 192.168.1.0/30 None 192.168.101.101 100 None [65010] 2
2015/02/05 07:39:05 192.168.2.0/30 None 192.168.101.101 100 None [65010] 2
2015/02/05 07:39:05 0.0.0.0/0 None 192.168.101.101 100 None [65010, 65001] 2
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Current implementation of bmp client uses Peer._construct_update()
which modifies original BGPUpdate message for sending to peers.
This function is not appropriate to use for bmp client, because
bmp client must send a BGPUpdate message which contains unmodified path
attributes. Fix this by introducing BMPClient._construct_update().
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In case of selecting new best path, Ryu BGPSpeaker send withdraw messages.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>