June 2017
Intermediate to advanced
446 pages
10h 10m
English
The first BGP speaker code in Chapter11_5.py is very similar to the BGP speaker example on the Ryu readthedocs documentation, http://ryu.readthedocs.io/en/latest/library_bgp_speaker.html#example, with a few exceptions, as we will see. Since we are launching the application directly from Python, we need to import the Ryu event queue in the form of eventlet as well as the BGP speaker library:
import eventlet...from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
We will define two callback functions for the BGP speaker for BGP neighbor detection and best-path change:
def dump_remote_best_path_change(event): print 'the best path changed:', event.remote_as, event.prefix, event.nexthop, event.is_withdraw ...
Read now
Unlock full access