Hi, Ishida-san

Thanks for your patches.
But, I’ve found new issue regarding this patch.
BMP client sets duplicate “BGPPathAttributeMpReachNLR” field in 
BMPRouteMonitoring messages as bellow.

— ryu_bmp.log ---
2015 Jan 22 13:14:19 | 192.168.183.220 | 
BMPRouteMonitoring(bgp_update=BGPUpdate(len=120,nlri=[],path_attributes=[BGPPathAttributeExtendedCommunities(communities=[BGPTwoOctetAsSpecificExtendedCommunity(as_number=65010,local_administrator=101,subtype=2,type=0)],flags=192,length=8,type=16),
 BGPPathAttributeOrigin(flags=64,length=1,type=1,value=2), 
BGPPathAttributeAsPath(flags=64,length=0,type=2,value=[]), 
BGPPathAttributeLocalPref(flags=64,length=4,type=5,value=100), 
BGPPathAttributeMpReachNLRI(afi=1,flags=128,length=33,next_hop='192.168.106.102',next_hop_len=4,nlri=[LabelledVPNIPAddrPrefix(addr=([100],
 BGPTwoOctetAsRD(admin=65010,assigned=101,type=0), 
'192.168.100.1'),length=120)],safi=128,type=14), 
BGPPathAttributeMpReachNLRI(afi=1,flags=128,length=33,next_hop='192.168.106.102',next_hop_len=4,nlri=[LabelledVPNIPAddrPrefix(addr=([100],
 BGPTwoOctetAsRD(admin=65010,assigned=101,type=0), 
'192.168.100.1'),length=120)],safi=128,type=14)],total_path_attribute_len=97,type=2,withdrawn_routes=[],withdrawn_routes_len=0),is_post_policy=True,len=168,peer_address='192.168.106.102',peer_as=65011,peer_bgp_id='10.0.1.3',peer_distinguisher=0,peer_type=1,timestamp=1421900059.0,type=0,version=3)


Thanks.


> 2015/01/21 14:03、ISHIDA Wataru <[email protected]> のメール:
> 
> 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 <[email protected]>
> ---
> ryu/services/protocols/bgp/bmp.py | 43 +++++++++++++++++++++++++++++++++++----
> 1 file changed, 39 insertions(+), 4 deletions(-)
> 
> diff --git a/ryu/services/protocols/bgp/bmp.py 
> b/ryu/services/protocols/bgp/bmp.py
> index 4fbbecb..78175ee 100644
> --- a/ryu/services/protocols/bgp/bmp.py
> +++ b/ryu/services/protocols/bgp/bmp.py
> @@ -22,6 +22,11 @@ import socket
> import logging
> from calendar import timegm
> from ryu.services.protocols.bgp.signals.emit import BgpSignalBus
> +from ryu.services.protocols.bgp.info_base.ipv4 import Ipv4Path
> +from ryu.lib.packet.bgp import BGPUpdate
> +from ryu.lib.packet.bgp import BGPPathAttributeNextHop
> +from ryu.lib.packet.bgp import BGPPathAttributeMpReachNLRI
> +from ryu.lib.packet.bgp import BGPPathAttributeMpUnreachNLRI
> 
> LOG = logging.getLogger('bgpspeaker.bmp')
> 
> @@ -159,7 +164,37 @@ class BMPClient(Activity):
>                                            peer_bgp_id=peer_bgp_id,
>                                            timestamp=0)
> 
> -    def _construct_route_monitoring(self, peer, path):
> +    def _construct_update(self, path):
> +        # Get copy of path's path attributes.
> +        new_pathattr = [attr for attr in path.pathattr_map.itervalues()]
> +
> +        if path.is_withdraw:
> +            if isinstance(path, Ipv4Path):
> +                return BGPUpdate(withdrawn_routes=[path.nlri],
> +                                 path_attributes=new_pathattr)
> +            else:
> +                mpunreach_attr = BGPPathAttributeMpUnreachNLRI(
> +                    path.route_family.afi, path.route_family.safi, 
> [path.nlri]
> +                )
> +                new_pathattr.append(mpunreach_attr)
> +        else:
> +            if isinstance(path, Ipv4Path):
> +                nexthop_attr = BGPPathAttributeNextHop(path.nexthop)
> +                new_pathattr.append(nexthop_attr)
> +                return BGPUpdate(nlri=[path.nlri],
> +                                 path_attributes=new_pathattr)
> +            else:
> +                mpnlri_attr = BGPPathAttributeMpReachNLRI(
> +                    path.route_family.afi,
> +                    path.route_family.safi,
> +                    path.nexthop,
> +                    [path.nlri]
> +                )
> +                new_pathattr.append(mpnlri_attr)
> +
> +        return BGPUpdate(path_attributes=new_pathattr)
> +
> +    def _construct_route_monitoring(self, peer, route):
>         if peer.is_mpbgp_cap_valid(bgp.RF_IPv4_VPN) or \
>                 peer.is_mpbgp_cap_valid(bgp.RF_IPv6_VPN):
>             peer_type = bmp.BMP_PEER_TYPE_L3VPN
> @@ -171,9 +206,9 @@ class BMPClient(Activity):
>         peer_bgp_id = peer.protocol.recv_open_msg.bgp_identifier
>         peer_address, _ = peer.protocol._remotename
> 
> -        bgp_update = peer._construct_update(path)
> -        is_post_policy = not path.filtered
> -        timestamp = timegm(path.timestamp)
> +        bgp_update = self._construct_update(route.path)
> +        is_post_policy = not route.filtered
> +        timestamp = timegm(route.timestamp)
> 
>         msg = bmp.BMPRouteMonitoring(bgp_update=bgp_update,
>                                      peer_type=peer_type,
> -- 
> 1.9.1
> 
> 
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to