Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exabgp-4.x support #12

Open
acoul opened this issue Oct 5, 2017 · 3 comments
Open

exabgp-4.x support #12

acoul opened this issue Oct 5, 2017 · 3 comments

Comments

@acoul
Copy link

acoul commented Oct 5, 2017

greetings,

I managed to migrate the exabgp.conf to the new format following this guideline and exabgp successfully connects to quagga. I can see the BGP messages in the log_exabgp but it looks like none of them is been passed to the mysql database as all the gixl tables are empty.

Is gixlg compatible with the exabgp-4.x brunch?

regards

@tomicke
Copy link

tomicke commented Oct 5, 2017

Hello!

From what i have gathered when trying to get gixlg to work with exabgp version 3.5 nad onwards is that the gixlg collector code needs to be updated supporting the changed exabgp announcements.

You created a documentation issue with this link https://fakrul.files.wordpress.com/2014/11/log_collector.png. If you look at the image for exabgp announcements and compare it to the following you can see the differences

For example, it is not neighbor ip like in exabgp version 3.4, it is neighbor address.
EXABGP: {
"exabgp": "3.5.0",
"time": 1483028688.01,
"host" : "exabgp01",
"pid" : 1340,
"ppid" : 1,
"counter": 15,
"type": "update",
"neighbor": {
"address": {
"local": "172.16.1.5",
"peer": "172.16.1.11"
},
"asn": {
"local": "65129",
"peer": "65129"
},
"direction": "receive",
"message": {
"update": {
"attribute": {
"origin": "incomplete",
"med": 0,
"local-preference": 100
},
"announce": {
"ipv4 unicast": {
"172.16.1.11": [
{ "nlri": "1.1.1.1/32" },
{ "nlri": "10.10.12.0/24" },
{ "nlri": "10.10.13.0/24" },
{ "nlri": "100.10.10.0/24" },
{ "nlri": "101.10.10.0/24" },
{ "nlri": "172.16.1.0/24" },
{ "nlri": "221.221.20.0/24" } ]
}
}
}
}
}
}

Think there was some other structural changes but cant really remember. Started to update the collector code but since my python skills are very low i got stuck :(

@acoul
Copy link
Author

acoul commented Oct 5, 2017

@tomicke thanks for the follow-up. I was able to get it going in my case with the following config:

# exabgp 4.0 config
template {
    neighbor SupperQuagga {
        family {
          ipv4 unicast;
        }
        api speaking { # tried both speaking and listening, not sure the vantage point
#        api listening { # tried both speaking and listening, not sure the vantage point
                processes [ received-routes ];
                receive {
                        parsed;
                        update;
                }
                send {
                        parsed;
                        update;
                }
        }
    }
}
process received-routes {
        run /opt/gixlg/exabgp/collector.py exabgp;
#               receive-routes;
#               neighbor-changes;
#                peer-updates;
#                parse-routes;
                encoder json;
}
neighbor 10.2.146.10 {
        inherit SupperQuagga;
        router-id 10.2.19.10;
        local-address 10.2.19.10;
        local-as 636;
        peer-as 22128;
        hold-time 90;
        description "SupperQuagga";
}

I also made the following changes in the exabgp/collector.py:

--- a/exabgp/collector.py
+++ b/exabgp/collector.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 """
 Created by Daniel Piekacz on 2012-01-14.
 Last update on 2015-02-27.
@@ -20,11 +20,11 @@ config = {}
 
 # MySQL database details - host, database, user, password, socket, timeout.
 config["mysql_enable"] = True
-config["mysql_host"] = ""
+config["mysql_host"] = "localhost"
 config["mysql_db"] = "gixlg"
 config["mysql_user"] = "gixlg"
 config["mysql_pass"] = "gixlg"
-config["mysql_sock"] = "/tmp/mysqld.sock"
+config["mysql_sock"] = "/var/run/mysqld/mysqld.sock"
 config["mysql_timeout"] = 0
 # True/False - Check if MySQL connection is still live. That significantly can
 # reduce overall performance.
@@ -38,7 +38,7 @@ config["collector_threads"] = 1
 config["collector_queue"] = 10000
 
 # True/False - Enable prefix cache.
-config["prefix_cache"] = False
+config["prefix_cache"] = True
 
 # True/False - Enable a delay of updating stats in members table. That
 # significantly reduces number of mysql queries and can reduce time required
@@ -48,7 +48,7 @@ config["stats_delayed"] = True
 config["stats_refresh"] = 2
 
 # True/False - Enable updating of iptoasn table.
-config["ip2asn"] = False
+config["ip2asn"] = True
 
 # Logging and debugging.
 config["log_file"] = "/opt/gixlg/exabgp/log_collector"

I was looking though for a way to talk and parse the mysql results through a web API but I think there is no such implementation in gixlg yet. I found though about exaprefixdb. & prefixdb that may be a viable alternative for me.

@cherdt
Copy link

cherdt commented Jul 12, 2018

It looks like the route announcements are also very different in recent versions of ExaBGP:

ExaBGP 3.4.0:

"announce": {
  "ipv4 unicast": {
    "103.12.177.217": {
      "205.71.224.0/20": {}
    }
  }
}

ExaBGP 4.0.3:

"announce": {
  "ipv4 mpls-vpn": {
    "192.168.212.225": [
      {
        "nlri": "10.26.5.224/28",
        "label": [
          [
            24325
          ]
        ],
        "rd": "217:1031"
      }
    }
  }

The 3.4.0 example is from exabgp & gixlg -Looking Glass, the 4.0.3 example is from an ExaBGP instance I am running. I don't have any ipv4 unicast announcement examples, but I assume they would also be different than the 3.4.0 example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants