Hi ,

I am working on a project to implement BGP in SDN using ryu controller, we
have implemented 3 ryu contollers . Below code has been added as BGP app on
all 3 Ryus, right now bgp is working between the controllers  but we are
trying to edit simple switch.py to be able to send packets to other domains
using BGP app,  I have some questions in this Regard :

How Can I call the RIB in and RIB out ? is it possible to call them in
another app ?
 can I run two apps which are dependent at the same time ? is it possible
to merge the codes and create one app ?

import eventlet
# BGPSpeaker needs sockets patched
eventlet.monkey_patch()
# initialize a log handler
# this is not strictly necessary but useful if you get messages like:
# No handlers could be found for logger "ryu.lib.hub"
import logging
import sys
log = logging.getLogger()
log.addHandler(logging.StreamHandler(sys.stderr))
from ryu.services.protocols.bgp.bgpspeaker import BGPSpeaker
def dump_remote_best_path_change(event):
    print "the best path changed:", event.remote_as, event.prefix,\
            event.nexthop, event.is_withdraw
def detect_peer_down(remote_ip, remote_as):
    print "Peer down:", remote_ip, remote_as
if __name__ == "__main__":
    speaker = BGPSpeaker(as_number=64512, router_id="10.0.0.2",
                    best_path_change_handler=dump_remote_best_path_change,
                    peer_down_handler=detect_peer_down,ssh_console=True)
    speaker.neighbor_add("192.168.220.138", 64512)
# uncomment the below line if the speaker needs to talk with a bmp server.
# speaker.bmp_server_add(’192.168.177.2’, 11019)
    count = 1
    while True:
        eventlet.sleep(30)
        prefix = "10.30." + str(count) + ".0/24"
        print "add a new prefix", prefix
        speaker.prefix_add(prefix)
        count += 1
        if count == 10:
            break



Regards
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to