Hey,

On Wed, 25 Jun 2014 11:49:42 +0200
Jaume Devesa <[email protected]> wrote:

>> > 1. neighbor_add(*address*, *remote_as*, *enable_ipv4=True*,
>> > *enable_vpnv4=False*, *enable_vpnv6=False*) does not allow to set
>> next-hop
>> > value, it uses the machine's ip by default. It would be good to specify
>> as
>> > an optional parameter. In our spec, the agent does not route packets,
>> just
>> > changes routes. The router would have another IP address and even be
>> > deployed in another machine
>>
>> Make sense. Once I finish v6 support, I'll add the feature.

Implemented. IPv6 advertisement is also implemented. I've just sent
patches. Probably, I'll merge them tomorrow.

>> > 2. AFAIK, some BGP peers are configured with tcp-md5 password.
>> > *neighbor_add* should have a password optional parameter as well.
>>
>> Yeah. btw, you actually need md5 authentication feature?
>>
> 
> ​I'm afraid so. If you want to connect to an ISP's BGP service, you need it.

I've implemented pro-active session side:

https://github.com/fujita/ryu/commit/b01f92e30524c3f90f6de790aa0af678e6f8c26a

About pre-active session side, seems like that listen socket is needed
to be set with a password instead of a socket created by accept(). I
had quick look at Quagga, seems that it does. So it means that a
listen socket can handle only one password, that is, all our peers
must use the same password and try to connect to us. Is this what you
expect?


>> > 3. I seems that according to your API, all the routes are advertised to
>> all
>> > the neighbors. If you want distinction, you need to create another
>> > speaker... and you can not because port 179 is already binded. I would be
>> > great if there was a way to differentiate routes per peer.
>>
>> Yeah, I plan to add 'filtering' feature like other bgps
>> implementations to do such.
>>
>> > 4. Mode pedantic: maybe if there is a speaker.shutdown(), in terms of
>> > coherency it should be a speaker.start()...
>>
>> Yeah, I didn't add start() just because implementing start() needs
>> some refactoring.
>>
>> > 5.* rib_get* method is exactly what I need! I don't want to modify the
>> > routing table of the machine where the agent runs, but discover the
>> routes
>> > after the exchange.
>>
>> I see. Let us know if you want any changes.
>>
>> > 6. I would say that when the remote peer connection is lost, the prefixes
>> > learned from aren't deleted in the rib table... Should they?
>>
>> You mean that the prefixes are not deleted?
> 
> 
> ​Yes, the data ​related to the prefixes are deleted, but the prefixes still
> there.

Let me make sure that we are on the same page.

The attached simple code (just calling vrfs_get() periodically) gives
me:

fujitatomonari-no-MacBook-Air:~ fujita$ sudo PYTHONPATH=.:$PYTHONPATH
python ~/bgp.py  
Password:
[]

# vrfs_get() return an empty before a session establishes.

Connection to peer: fd41:28b7:be11::201:2ff:fe03:406 established
the best path changed: 64513 fc00::/32 :: False
[{"paths": [{"origin": "i", "aspath": [64513], "prefix": "fc00::/32",
"bpr": "Only Path", "localpref": "", "metric": 0, "nexthop": "::",
"best": true}], "prefix": "fc00::/32"}]

# vrfs_get() return routes after the session establishes.

[{"paths": [{"origin": "i", "aspath": [64513], "prefix": "fc00::/32",
"bpr": "Only Path", "localpref": "", "metric": 0, "nexthop": "::",
"best": true}], "prefix": "fc00::/32"}]

# here, I stopped Quagga used as a peer.

Received notification message, hence closing connection
BGPNotification(data='',error_code=6,error_subcode=3,len=21,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',type=3)
Connection to peer fd41:28b7:be11::201:2ff:fe03:406 lost, reason:
Connection to peer lost: [Errno 9] Bad file descriptor. Resetting
retry connect loop: False
the best path changed: 64513 fc00::/32 :: False
[]

# vrfs_get() return an empty again after the peer is lost.

Please let me know the details of your problem with the code.

Thanks!
import eventlet

eventlet.monkey_patch()

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

if __name__ == "__main__":
    speaker = BGPSpeaker(as_number=64512, router_id='10.0.0.1',
                         best_path_change_handler=dump_remote_best_path_change)
    
    speaker.neighbor_add('fd41:28b7:be11:0:201:2ff:fe03:0406', 64513)

    while True:
        print speaker.rib_get(family='ipv6')
        eventlet.sleep(5)
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to