Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-8113

Cannot get bgp evpn route from switch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.13.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Description

      1. If the bgp evpn route ip info contains 0.0.0.0, the ip address in macIpAdvNlri will be null. The code in `org/onosproject/provider/bgp/route/impl/BgpRouteProvider.java`  will throw exception.  

      //org/onosproject/provider/bgp/route/impl/BgpRouteProvider.java
      if ((!exportRt.isEmpty()) && (!evpnReachNlri.isEmpty())) {
          for (BgpEvpnNlri nlri : evpnReachNlri) {
              if (nlri.getRouteType() == BgpEvpnRouteType
                      .MAC_IP_ADVERTISEMENT) {
                  BgpEvpnRouteType2Nlri macIpAdvNlri
                          = (BgpEvpnRouteType2Nlri) nlri
                          .getNlri();
                  MacAddress macAddress = macIpAdvNlri.getMacAddress();
                  Ip4Address ipAddress = Ip4Address
                          .valueOf(macIpAdvNlri.getIpAddress());//Here throw Exception.
                  RouteDistinguisher rd = macIpAdvNlri
                          .getRouteDistinguisher();
      

       

      The route data will cause the exception. 

      • > [2][0][48][5254-0039-6e54][0][0.0.0.0]/104

       

          2.  Bgp evpn update message may contain multi route data, and if the one route type is not BGP_EVPN_MAC_IP_ADVERTISEMENT, the method will throw BgpParseException. Then the other BGP_EVPN_MAC_IP_ADVERTISEMENT route cannot be read.

         

      //org/onosproject/bgp/controller/impl/BgpMessageDecoder.java
      try {
          while (buffer.readableBytes() > 0) {
              buffer.markReaderIndex();
              BgpHeader bgpHeader = new BgpHeader();
              BgpMessage message = reader.readFrom(buffer, bgpHeader); //throw exception
              msgList.add(message);
          }
          ctx.setAttachment(null);
          return msgList;
      } catch (Exception e) {
          log.debug("Bgp protocol message decode error");
          buffer.resetReaderIndex();
          buffer.discardReadBytes();
          ctx.setAttachment(msgList);
      }
      
      

       

      The data will cause execpiton 

      • > [3][0][32][2.2.2.2]/80     

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lswang wang long sheng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: