Hi Iwase,
Thanks for the response. Changing the source code may not be the best
option as there are disadvantages involved.
What about using the *"EventBestPathChanged(best_path_change_handler)*"
event handler?. Do you think we can catch the BGP Update messages using
this event?.
Regards
Hadem
On Tue, Nov 28, 2017 at 5:09 AM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:
> Hi Hadem,
>
> Please let me know what "process" exactly means.
> You mean receiving all BGP UPDATE messages in your application, right?
>
> Currently, Ryu BGP service does not provide the APIs to pass the received
> BGP Update messages to
> other applications, so you need to manually open socket, parse the
> received buffer and handle the
> BGP states manually.
>
> Example:
> import socket
> from ryu.lib.packet import bgp
> ...(snip)...
>
> sock = socket.socket()
> ...(snip)... # bind, connect, accept, ...
>
> buf = self.socket.recv(required_len)
>
> msg, _, rest = bgp.BGPMessage.parser(buf)
> # Do handling
>
>
> FYI, Ryu BGP service receives the BGP message here, if you don't mind the
> changing Ryu source,
> you might be able to add some "hooks" for your application.
> (I don't think it better way though...)
>
>
> Thanks,
> Iwase
>
>
> On 2017年11月27日 18:15, Pynbiang Hadem wrote:
>
>> Hi Iwase,
>>
>> Actually, i want to process the BGP Update messages in my application.
>> Pls suggest how this can be done.
>>
>> Thanks
>> Hadem
>>
>> On Mon, Nov 27, 2017 at 12:54 PM, Iwase Yusuke <iwase.yusu...@gmail.com
>> <mailto:iwase.yusu...@gmail.com>> wrote:
>>
>> Hi Hadem,
>>
>> You don't need to handle (receive, extract attributes and so on) the
>> BGP UPDATE messages directly.
>> Ryu BGP service does handle the BGP messages, then notify the updates
>> of the best path or connect/
>> disconnect of neighbors as the "events".
>> For example, Ryu will call the given "best_path_change_handler" if
>> you uses the APIs of BGPSpeaker,
>>
>> http://ryu.readthedocs.io/en/latest/library_bgp_speaker_ref.
>> html#ryu.services.protocols.bgp.bgpspeaker.BGPSpeaker
>> <http://ryu.readthedocs.io/en/latest/library_bgp_speaker_ref
>> .html#ryu.services.protocols.bgp.bgpspeaker.BGPSpeaker>
>> and application.py will generate the event instance if your
>> application observes them.
>>
>> https://github.com/osrg/ryu/blob/ed2c6eca2227c9efb3c7e51cdd6
>> db6bf578ec609/ryu/services/protocols/bgp/application.py#L141-L171
>> <https://github.com/osrg/ryu/blob/ed2c6eca2227c9efb3c7e51cdd
>> 6db6bf578ec609/ryu/services/protocols/bgp/application.py#L141-L171>
>>
>> Thanks,
>> Iwase
>>
>>
>> On 2017年11月24日 21:32, Pynbiang Hadem wrote:
>>
>> Hi,
>>
>> I have two Autonomous Systems AS1 and AS2. I am able to send BGP
>> update message from AS1 to
>> AS2 and vice versa. I want to process the BGP update messages in
>> my RYU application. I'm a
>> little confused how to achieve that.
>>
>> Pls help.
>>
>> Thanks
>> Hadem
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> _______________________________________________
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.source
>> forge.net>
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> <https://lists.sourceforge.net/lists/listinfo/ryu-devel>
>>
>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>>
>> _______________________________________________
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel