diff --git a/extras/vom/vom/gbp_contract.cpp b/extras/vom/vom/gbp_contract.cpp
index 0ef50ad..c95c2e8 100644
--- a/extras/vom/vom/gbp_contract.cpp
+++ b/extras/vom/vom/gbp_contract.cpp
@@ -24,14 +24,14 @@
 
 gbp_contract::event_handler gbp_contract::m_evh;
 
-gbp_contract::gbp_contract(epg_id_t src_epg_id,
-                           epg_id_t dst_epg_id,
+gbp_contract::gbp_contract(sclass_t sclass,
+                           sclass_t dclass,
                            const ACL::l3_list& acl,
                            const gbp_rules_t& rules,
                            const ethertype_set_t& allowed_ethertypes)
   : m_hw(false)
-  , m_src_epg_id(src_epg_id)
-  , m_dst_epg_id(dst_epg_id)
+  , m_sclass(sclass)
+  , m_dclass(dclass)
   , m_acl(acl.singular())
   , m_gbp_rules(rules)
   , m_allowed_ethertypes(allowed_ethertypes)
@@ -40,8 +40,8 @@
 
 gbp_contract::gbp_contract(const gbp_contract& gbpc)
   : m_hw(gbpc.m_hw)
-  , m_src_epg_id(gbpc.m_src_epg_id)
-  , m_dst_epg_id(gbpc.m_dst_epg_id)
+  , m_sclass(gbpc.m_sclass)
+  , m_dclass(gbpc.m_dclass)
   , m_acl(gbpc.m_acl)
   , m_gbp_rules(gbpc.m_gbp_rules)
   , m_allowed_ethertypes(gbpc.m_allowed_ethertypes)
@@ -59,7 +59,7 @@
 const gbp_contract::key_t
 gbp_contract::key() const
 {
-  return (std::make_pair(m_src_epg_id, m_dst_epg_id));
+  return (std::make_pair(m_sclass, m_dclass));
 }
 
 bool
@@ -72,8 +72,7 @@
 gbp_contract::sweep()
 {
   if (m_hw) {
-    HW::enqueue(
-      new gbp_contract_cmds::delete_cmd(m_hw, m_src_epg_id, m_dst_epg_id));
+    HW::enqueue(new gbp_contract_cmds::delete_cmd(m_hw, m_sclass, m_dclass));
   }
   HW::write();
 }
@@ -82,9 +81,9 @@
 gbp_contract::replay()
 {
   if (m_hw) {
-    HW::enqueue(new gbp_contract_cmds::create_cmd(
-      m_hw, m_src_epg_id, m_dst_epg_id, m_acl->handle(), m_gbp_rules,
-      m_allowed_ethertypes));
+    HW::enqueue(new gbp_contract_cmds::create_cmd(m_hw, m_sclass, m_dclass,
+                                                  m_acl->handle(), m_gbp_rules,
+                                                  m_allowed_ethertypes));
   }
 }
 
@@ -92,7 +91,7 @@
 gbp_contract::to_string() const
 {
   std::ostringstream s;
-  s << "gbp-contract:[{" << m_src_epg_id << ", " << m_dst_epg_id << "}, "
+  s << "gbp-contract:[{" << m_sclass << ", " << m_dclass << "}, "
     << m_acl->to_string();
   if (m_gbp_rules.size()) {
     auto it = m_gbp_rules.cbegin();
@@ -116,9 +115,9 @@
    * create the table if it is not yet created
    */
   if (rc_t::OK != m_hw.rc()) {
-    HW::enqueue(new gbp_contract_cmds::create_cmd(
-      m_hw, m_src_epg_id, m_dst_epg_id, m_acl->handle(), m_gbp_rules,
-      m_allowed_ethertypes));
+    HW::enqueue(new gbp_contract_cmds::create_cmd(m_hw, m_sclass, m_dclass,
+                                                  m_acl->handle(), m_gbp_rules,
+                                                  m_allowed_ethertypes));
   }
 }
 
@@ -208,8 +207,8 @@
         allowed_ethertypes.insert(ethertype_t::from_numeric_val(et[i]));
       }
 
-      gbp_contract gbpc(payload.contract.src_epg, payload.contract.dst_epg,
-                        *acl, rules, allowed_ethertypes);
+      gbp_contract gbpc(payload.contract.sclass, payload.contract.dclass, *acl,
+                        rules, allowed_ethertypes);
       OM::commit(key, gbpc);
 
       VOM_LOG(log_level_t::DEBUG) << "read: " << gbpc.to_string();
diff --git a/extras/vom/vom/gbp_contract.hpp b/extras/vom/vom/gbp_contract.hpp
index 2f1c3c5..7775638 100644
--- a/extras/vom/vom/gbp_contract.hpp
+++ b/extras/vom/vom/gbp_contract.hpp
@@ -39,7 +39,7 @@
   /**
    * The key for a contract is the pari of EPG-IDs
    */
-  typedef std::pair<epg_id_t, epg_id_t> key_t;
+  typedef std::pair<sclass_t, sclass_t> key_t;
 
   /**
    * A set of allowed ethertypes
@@ -49,8 +49,8 @@
   /**
    * Construct a GBP contract
    */
-  gbp_contract(epg_id_t src_epg_id,
-               epg_id_t dst_epg_id,
+  gbp_contract(sclass_t sclass,
+               sclass_t dclass,
                const ACL::l3_list& acl,
                const gbp_rules_t& gpb_rules,
                const ethertype_set_t& allowed_ethertypes);
@@ -169,12 +169,12 @@
   /**
    * The source EPG ID
    */
-  epg_id_t m_src_epg_id;
+  sclass_t m_sclass;
 
   /**
    * The destination EPG ID
    */
-  epg_id_t m_dst_epg_id;
+  sclass_t m_dclass;
 
   /**
    * The ACL applied to traffic between the gourps
diff --git a/extras/vom/vom/gbp_contract_cmds.cpp b/extras/vom/vom/gbp_contract_cmds.cpp
index 5cdd885..9e8a177 100644
--- a/extras/vom/vom/gbp_contract_cmds.cpp
+++ b/extras/vom/vom/gbp_contract_cmds.cpp
@@ -20,14 +20,14 @@
 namespace gbp_contract_cmds {
 
 create_cmd::create_cmd(HW::item<bool>& item,
-                       epg_id_t src_epg_id,
-                       epg_id_t dst_epg_id,
+                       sclass_t sclass,
+                       sclass_t dclass,
                        const handle_t& acl,
                        const gbp_contract::gbp_rules_t& gbp_rules,
                        const gbp_contract::ethertype_set_t& allowed_ethertypes)
   : rpc_cmd(item)
-  , m_src_epg_id(src_epg_id)
-  , m_dst_epg_id(dst_epg_id)
+  , m_sclass(sclass)
+  , m_dclass(dclass)
   , m_acl(acl)
   , m_gbp_rules(gbp_rules)
   , m_allowed_ethertypes(allowed_ethertypes)
@@ -37,9 +37,8 @@
 bool
 create_cmd::operator==(const create_cmd& other) const
 {
-  return ((m_acl == other.m_acl) && (m_src_epg_id == other.m_src_epg_id) &&
-          (m_dst_epg_id == other.m_dst_epg_id) &&
-          (m_gbp_rules == other.m_gbp_rules) &&
+  return ((m_acl == other.m_acl) && (m_sclass == other.m_sclass) &&
+          (m_dclass == other.m_dclass) && (m_gbp_rules == other.m_gbp_rules) &&
           (m_allowed_ethertypes == other.m_allowed_ethertypes));
 }
 
@@ -54,8 +53,8 @@
   auto& payload = req.get_request().get_payload();
   payload.is_add = 1;
   payload.contract.acl_index = m_acl.value();
-  payload.contract.src_epg = m_src_epg_id;
-  payload.contract.dst_epg = m_dst_epg_id;
+  payload.contract.sclass = m_sclass;
+  payload.contract.dclass = m_dclass;
 
   uint32_t ii = 0;
   payload.contract.n_rules = n_rules;
@@ -112,8 +111,7 @@
 {
   std::ostringstream s;
   s << "gbp-contract-create: " << m_hw_item.to_string()
-    << " src-epg-id:" << m_src_epg_id << " dst-epg-id:" << m_dst_epg_id
-    << " acl:" << m_acl;
+    << " sclass:" << m_sclass << " dclass:" << m_dclass << " acl:" << m_acl;
   s << "[ethertype:";
   for (auto e : m_allowed_ethertypes)
     s << " " << e;
@@ -122,20 +120,17 @@
   return (s.str());
 }
 
-delete_cmd::delete_cmd(HW::item<bool>& item,
-                       epg_id_t src_epg_id,
-                       epg_id_t dst_epg_id)
+delete_cmd::delete_cmd(HW::item<bool>& item, sclass_t sclass, sclass_t dclass)
   : rpc_cmd(item)
-  , m_src_epg_id(src_epg_id)
-  , m_dst_epg_id(dst_epg_id)
+  , m_sclass(sclass)
+  , m_dclass(dclass)
 {
 }
 
 bool
 delete_cmd::operator==(const delete_cmd& other) const
 {
-  return ((m_src_epg_id == other.m_src_epg_id) &&
-          (m_dst_epg_id == other.m_dst_epg_id));
+  return ((m_sclass == other.m_sclass) && (m_dclass == other.m_dclass));
 }
 
 rc_t
@@ -146,8 +141,8 @@
   auto& payload = req.get_request().get_payload();
   payload.is_add = 0;
   payload.contract.acl_index = ~0;
-  payload.contract.src_epg = m_src_epg_id;
-  payload.contract.dst_epg = m_dst_epg_id;
+  payload.contract.sclass = m_sclass;
+  payload.contract.dclass = m_dclass;
 
   VAPI_CALL(req.execute());
 
@@ -159,7 +154,7 @@
 {
   std::ostringstream s;
   s << "gbp-contract-delete: " << m_hw_item.to_string()
-    << " src-epg-id:" << m_src_epg_id << " dst-epg-id:" << m_dst_epg_id;
+    << " src-epg-id:" << m_sclass << " dst-epg-id:" << m_dclass;
 
   return (s.str());
 }
diff --git a/extras/vom/vom/gbp_contract_cmds.hpp b/extras/vom/vom/gbp_contract_cmds.hpp
index 476a594..7108c53 100644
--- a/extras/vom/vom/gbp_contract_cmds.hpp
+++ b/extras/vom/vom/gbp_contract_cmds.hpp
@@ -34,8 +34,8 @@
    * Constructor
    */
   create_cmd(HW::item<bool>& item,
-             epg_id_t src_epg_id,
-             epg_id_t dst_epg_id,
+             sclass_t sclass,
+             sclass_t dclass,
              const handle_t& acl,
              const gbp_contract::gbp_rules_t& gbp_rules,
              const gbp_contract::ethertype_set_t& allowed_ethertypes);
@@ -56,8 +56,8 @@
   bool operator==(const create_cmd& i) const;
 
 private:
-  const epg_id_t m_src_epg_id;
-  const epg_id_t m_dst_epg_id;
+  const sclass_t m_sclass;
+  const sclass_t m_dclass;
   const handle_t m_acl;
   const gbp_contract::gbp_rules_t& m_gbp_rules;
   const gbp_contract::ethertype_set_t& m_allowed_ethertypes;
@@ -72,7 +72,7 @@
   /**
    * Constructor
    */
-  delete_cmd(HW::item<bool>& item, epg_id_t src_epg_id, epg_id_t dst_epg_id);
+  delete_cmd(HW::item<bool>& item, sclass_t sclass, sclass_t dclass);
 
   /**
    * Issue the command to VPP/HW
@@ -90,8 +90,8 @@
   bool operator==(const delete_cmd& i) const;
 
 private:
-  const epg_id_t m_src_epg_id;
-  const epg_id_t m_dst_epg_id;
+  const sclass_t m_sclass;
+  const sclass_t m_dclass;
 };
 
 /**
diff --git a/extras/vom/vom/gbp_endpoint.cpp b/extras/vom/vom/gbp_endpoint.cpp
index b39e9f9..20f966c 100644
--- a/extras/vom/vom/gbp_endpoint.cpp
+++ b/extras/vom/vom/gbp_endpoint.cpp
@@ -78,7 +78,7 @@
 {
   if (m_hdl) {
     HW::enqueue(new gbp_endpoint_cmds::create_cmd(m_hdl, m_itf->handle(), m_ips,
-                                                  m_mac, m_epg->id()));
+                                                  m_mac, m_epg->sclass()));
   }
 }
 
@@ -101,7 +101,7 @@
 {
   if (rc_t::OK != m_hdl.rc()) {
     HW::enqueue(new gbp_endpoint_cmds::create_cmd(m_hdl, m_itf->handle(), m_ips,
-                                                  m_mac, m_epg->id()));
+                                                  m_mac, m_epg->sclass()));
   }
 }
 
@@ -160,7 +160,7 @@
     std::shared_ptr<interface> itf =
       interface::find(payload.endpoint.sw_if_index);
     std::shared_ptr<gbp_endpoint_group> epg =
-      gbp_endpoint_group::find(payload.endpoint.epg_id);
+      gbp_endpoint_group::find(payload.endpoint.sclass);
     mac_address_t mac = from_api(payload.endpoint.mac);
 
     VOM_LOG(log_level_t::DEBUG) << "data: " << payload.endpoint.sw_if_index;
@@ -173,7 +173,7 @@
     } else {
       VOM_LOG(log_level_t::ERROR)
         << "no interface:" << payload.endpoint.sw_if_index
-        << "or epg:" << payload.endpoint.epg_id;
+        << "or sclass:" << payload.endpoint.sclass;
     }
   }
 }
diff --git a/extras/vom/vom/gbp_endpoint_cmds.cpp b/extras/vom/vom/gbp_endpoint_cmds.cpp
index 2732d1c..77c7548 100644
--- a/extras/vom/vom/gbp_endpoint_cmds.cpp
+++ b/extras/vom/vom/gbp_endpoint_cmds.cpp
@@ -25,12 +25,12 @@
                        const handle_t& itf,
                        const std::vector<boost::asio::ip::address>& ip_addrs,
                        const mac_address_t& mac,
-                       epg_id_t epg_id)
+                       sclass_t sclass)
   : rpc_cmd(item)
   , m_itf(itf)
   , m_ip_addrs(ip_addrs)
   , m_mac(mac)
-  , m_epg_id(epg_id)
+  , m_sclass(sclass)
 {
 }
 
@@ -38,7 +38,7 @@
 create_cmd::operator==(const create_cmd& other) const
 {
   return ((m_itf == other.m_itf) && (m_ip_addrs == other.m_ip_addrs) &&
-          (m_mac == other.m_mac) && (m_epg_id == other.m_epg_id));
+          (m_mac == other.m_mac) && (m_sclass == other.m_sclass));
 }
 
 rc_t
@@ -50,7 +50,7 @@
 
   auto& payload = req.get_request().get_payload();
   payload.endpoint.sw_if_index = m_itf.value();
-  payload.endpoint.epg_id = m_epg_id;
+  payload.endpoint.sclass = m_sclass;
   payload.endpoint.n_ips = m_ip_addrs.size();
 
   for (n = 0; n < payload.endpoint.n_ips; n++) {
@@ -93,7 +93,7 @@
     s << ip.to_string();
 
   s << "] mac:" << m_mac;
-  s << " epg-id:" << m_epg_id;
+  s << " slcass:" << m_sclass;
 
   return (s.str());
 }
diff --git a/extras/vom/vom/gbp_endpoint_cmds.hpp b/extras/vom/vom/gbp_endpoint_cmds.hpp
index e90fb66..2aa56f8 100644
--- a/extras/vom/vom/gbp_endpoint_cmds.hpp
+++ b/extras/vom/vom/gbp_endpoint_cmds.hpp
@@ -25,8 +25,8 @@
 namespace gbp_endpoint_cmds {
 
 /**
-* A command class that creates or updates the GBP endpoint
-*/
+ * A command class that creates or updates the GBP endpoint
+ */
 class create_cmd : public rpc_cmd<HW::item<handle_t>, vapi::Gbp_endpoint_add>
 {
 public:
@@ -37,7 +37,7 @@
              const handle_t& itf,
              const std::vector<boost::asio::ip::address>& ip_addrs,
              const mac_address_t& mac,
-             epg_id_t epg_id);
+             sclass_t sclass);
 
   /**
    * Issue the command to VPP/HW
@@ -60,7 +60,7 @@
   const handle_t m_itf;
   const std::vector<boost::asio::ip::address> m_ip_addrs;
   const mac_address_t m_mac;
-  const epg_id_t m_epg_id;
+  const sclass_t m_sclass;
 };
 
 /**
diff --git a/extras/vom/vom/gbp_endpoint_group.cpp b/extras/vom/vom/gbp_endpoint_group.cpp
index d549a06..abec585 100644
--- a/extras/vom/vom/gbp_endpoint_group.cpp
+++ b/extras/vom/vom/gbp_endpoint_group.cpp
@@ -45,40 +45,13 @@
   return std::to_string(remote_ep_timeout);
 }
 
-gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
+gbp_endpoint_group::gbp_endpoint_group(vnid_t vnid,
+                                       sclass_t sclass,
                                        const interface& itf,
                                        const gbp_route_domain& rd,
                                        const gbp_bridge_domain& bd)
   : m_hw(false)
-  , m_epg_id(epg_id)
-  , m_sclass(0xffff)
-  , m_itf(itf.singular())
-  , m_rd(rd.singular())
-  , m_bd(bd.singular())
-  , m_retention()
-{
-}
-
-gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
-                                       const gbp_route_domain& rd,
-                                       const gbp_bridge_domain& bd)
-  : m_hw(false)
-  , m_epg_id(epg_id)
-  , m_sclass(0xffff)
-  , m_itf()
-  , m_rd(rd.singular())
-  , m_bd(bd.singular())
-  , m_retention()
-{
-}
-
-gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
-                                       uint16_t sclass,
-                                       const interface& itf,
-                                       const gbp_route_domain& rd,
-                                       const gbp_bridge_domain& bd)
-  : m_hw(false)
-  , m_epg_id(epg_id)
+  , m_vnid(vnid)
   , m_sclass(sclass)
   , m_itf(itf.singular())
   , m_rd(rd.singular())
@@ -87,12 +60,25 @@
 {
 }
 
-gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
-                                       uint16_t sclass,
+gbp_endpoint_group::gbp_endpoint_group(vnid_t vnid,
+                                       sclass_t sclass,
                                        const gbp_route_domain& rd,
                                        const gbp_bridge_domain& bd)
   : m_hw(false)
-  , m_epg_id(epg_id)
+  , m_vnid(vnid)
+  , m_sclass(sclass)
+  , m_itf()
+  , m_rd(rd.singular())
+  , m_bd(bd.singular())
+  , m_retention()
+{
+}
+
+gbp_endpoint_group::gbp_endpoint_group(sclass_t sclass,
+                                       const gbp_route_domain& rd,
+                                       const gbp_bridge_domain& bd)
+  : m_hw(false)
+  , m_vnid(~0)
   , m_sclass(sclass)
   , m_itf()
   , m_rd(rd.singular())
@@ -103,7 +89,7 @@
 
 gbp_endpoint_group::gbp_endpoint_group(const gbp_endpoint_group& epg)
   : m_hw(epg.m_hw)
-  , m_epg_id(epg.m_epg_id)
+  , m_vnid(epg.m_vnid)
   , m_sclass(epg.m_sclass)
   , m_itf(epg.m_itf)
   , m_rd(epg.m_rd)
@@ -121,13 +107,13 @@
 const gbp_endpoint_group::key_t
 gbp_endpoint_group::key() const
 {
-  return (m_epg_id);
+  return (m_sclass);
 }
 
-epg_id_t
-gbp_endpoint_group::id() const
+vnid_t
+gbp_endpoint_group::vnid() const
 {
-  return (m_epg_id);
+  return (m_vnid);
 }
 
 void
@@ -136,10 +122,16 @@
   m_retention = retention;
 }
 
+sclass_t
+gbp_endpoint_group::sclass() const
+{
+  return (m_sclass);
+}
+
 bool
 gbp_endpoint_group::operator==(const gbp_endpoint_group& gg) const
 {
-  return (key() == gg.key() && (m_sclass == gg.m_sclass) &&
+  return (key() == gg.key() && (m_vnid == gg.m_vnid) &&
           (m_retention == gg.m_retention) && (m_itf == gg.m_itf) &&
           (m_rd == gg.m_rd) && (m_bd == gg.m_bd));
 }
@@ -148,7 +140,7 @@
 gbp_endpoint_group::sweep()
 {
   if (m_hw) {
-    HW::enqueue(new gbp_endpoint_group_cmds::delete_cmd(m_hw, m_epg_id));
+    HW::enqueue(new gbp_endpoint_group_cmds::delete_cmd(m_hw, m_vnid));
   }
   HW::write();
 }
@@ -158,7 +150,7 @@
 {
   if (m_hw) {
     HW::enqueue(new gbp_endpoint_group_cmds::create_cmd(
-      m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(), m_retention,
+      m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention,
       (m_itf ? m_itf->handle() : handle_t::INVALID)));
   }
 }
@@ -168,7 +160,7 @@
 {
   std::ostringstream s;
   s << "gbp-endpoint-group:["
-    << "epg:" << m_epg_id << ", sclass:" << m_sclass << ", "
+    << "vnid:" << m_vnid << ", sclass:" << m_sclass << ", "
     << "retention:[" << m_retention.to_string() << "], "
     << (m_itf ? m_itf->to_string() : "NULL") << ", " << m_bd->to_string()
     << ", " << m_rd->to_string() << "]";
@@ -181,7 +173,7 @@
 {
   if (rc_t::OK != m_hw.rc()) {
     HW::enqueue(new gbp_endpoint_group_cmds::create_cmd(
-      m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(), m_retention,
+      m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention,
       (m_itf ? m_itf->handle() : handle_t::INVALID)));
   }
 }
@@ -259,13 +251,13 @@
                                 << payload.epg.bd_id << "]";
 
     if (itf && bd && rd) {
-      gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *itf, *rd,
+      gbp_endpoint_group gbpe(payload.epg.vnid, payload.epg.sclass, *itf, *rd,
                               *bd);
       OM::commit(key, gbpe);
 
       VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string();
     } else if (bd && rd) {
-      gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *rd, *bd);
+      gbp_endpoint_group gbpe(payload.epg.sclass, *rd, *bd);
       OM::commit(key, gbpe);
 
       VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string();
diff --git a/extras/vom/vom/gbp_endpoint_group.hpp b/extras/vom/vom/gbp_endpoint_group.hpp
index d6af570..5c061a9 100644
--- a/extras/vom/vom/gbp_endpoint_group.hpp
+++ b/extras/vom/vom/gbp_endpoint_group.hpp
@@ -28,7 +28,8 @@
 /**
  * EPG IDs are 32 bit integers
  */
-typedef uint32_t epg_id_t;
+typedef uint32_t vnid_t;
+typedef uint16_t sclass_t;
 
 /**
  * A entry in the ARP termination table of a Bridge Domain
@@ -59,25 +60,21 @@
   /**
    * The key for a GBP endpoint group is its ID
    */
-  typedef epg_id_t key_t;
+  typedef sclass_t key_t;
 
   /**
    * Construct a GBP endpoint_group
    */
-  gbp_endpoint_group(epg_id_t epg_id,
+  gbp_endpoint_group(vnid_t vnid,
+                     sclass_t sclass,
                      const interface& itf,
                      const gbp_route_domain& rd,
                      const gbp_bridge_domain& bd);
-  gbp_endpoint_group(epg_id_t epg_id,
+  gbp_endpoint_group(vnid_t vnid,
+                     sclass_t sclass,
                      const gbp_route_domain& rd,
                      const gbp_bridge_domain& bd);
-  gbp_endpoint_group(epg_id_t epg_id,
-                     uint16_t sclass,
-                     const interface& itf,
-                     const gbp_route_domain& rd,
-                     const gbp_bridge_domain& bd);
-  gbp_endpoint_group(epg_id_t epg_id,
-                     uint16_t sclass,
+  gbp_endpoint_group(sclass_t sclass,
                      const gbp_route_domain& rd,
                      const gbp_bridge_domain& bd);
 
@@ -129,7 +126,8 @@
   /**
    * Get the ID of the EPG
    */
-  epg_id_t id() const;
+  vnid_t vnid() const;
+  sclass_t sclass() const;
 
   const std::shared_ptr<gbp_route_domain> get_route_domain() const;
   const std::shared_ptr<gbp_bridge_domain> get_bridge_domain() const;
@@ -206,7 +204,7 @@
   /**
    * The EPG ID
    */
-  epg_id_t m_epg_id;
+  vnid_t m_vnid;
 
   /**
    * The SClass on the wire
diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.cpp b/extras/vom/vom/gbp_endpoint_group_cmds.cpp
index a4f8660..c561860 100644
--- a/extras/vom/vom/gbp_endpoint_group_cmds.cpp
+++ b/extras/vom/vom/gbp_endpoint_group_cmds.cpp
@@ -19,14 +19,14 @@
 namespace gbp_endpoint_group_cmds {
 
 create_cmd::create_cmd(HW::item<bool>& item,
-                       epg_id_t epg_id,
+                       vnid_t vnid,
                        uint16_t sclass,
                        uint32_t bd_id,
                        route::table_id_t rd_id,
                        const gbp_endpoint_group::retention_t& retention,
                        const handle_t& itf)
   : rpc_cmd(item)
-  , m_epg_id(epg_id)
+  , m_vnid(vnid)
   , m_sclass(sclass)
   , m_bd_id(bd_id)
   , m_rd_id(rd_id)
@@ -39,7 +39,7 @@
 create_cmd::operator==(const create_cmd& other) const
 {
   return ((m_itf == other.m_itf) && (m_bd_id == other.m_bd_id) &&
-          (m_rd_id == other.m_rd_id) && (m_epg_id == other.m_epg_id) &&
+          (m_rd_id == other.m_rd_id) && (m_vnid == other.m_vnid) &&
           (m_retention == other.m_retention));
 }
 
@@ -50,7 +50,7 @@
 
   auto& payload = req.get_request().get_payload();
   payload.epg.uplink_sw_if_index = m_itf.value();
-  payload.epg.epg_id = m_epg_id;
+  payload.epg.vnid = m_vnid;
   payload.epg.sclass = m_sclass;
   payload.epg.bd_id = m_bd_id;
   payload.epg.rd_id = m_rd_id;
@@ -66,22 +66,22 @@
 {
   std::ostringstream s;
   s << "gbp-endpoint-group-create: " << m_hw_item.to_string()
-    << " epg-id:" << m_epg_id << " bd-id:" << m_bd_id << " rd-id:" << m_rd_id
+    << " vnid:" << m_vnid << " bd-id:" << m_bd_id << " rd-id:" << m_rd_id
     << " itf:" << m_itf;
 
   return (s.str());
 }
 
-delete_cmd::delete_cmd(HW::item<bool>& item, epg_id_t epg_id)
+delete_cmd::delete_cmd(HW::item<bool>& item, sclass_t sclass)
   : rpc_cmd(item)
-  , m_epg_id(epg_id)
+  , m_sclass(sclass)
 {
 }
 
 bool
 delete_cmd::operator==(const delete_cmd& other) const
 {
-  return (m_epg_id == other.m_epg_id);
+  return (m_sclass == other.m_sclass);
 }
 
 rc_t
@@ -90,7 +90,7 @@
   msg_t req(con.ctx(), std::ref(*this));
 
   auto& payload = req.get_request().get_payload();
-  payload.epg_id = m_epg_id;
+  payload.sclass = m_sclass;
 
   VAPI_CALL(req.execute());
 
@@ -102,7 +102,7 @@
 {
   std::ostringstream s;
   s << "gbp-endpoint-group-delete: " << m_hw_item.to_string()
-    << " epg:" << m_epg_id;
+    << " sclass:" << m_sclass;
 
   return (s.str());
 }
diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.hpp b/extras/vom/vom/gbp_endpoint_group_cmds.hpp
index b735b5c..fa89272 100644
--- a/extras/vom/vom/gbp_endpoint_group_cmds.hpp
+++ b/extras/vom/vom/gbp_endpoint_group_cmds.hpp
@@ -34,7 +34,7 @@
    * Constructor
    */
   create_cmd(HW::item<bool>& item,
-             epg_id_t epg_id,
+             vnid_t vnid,
              uint16_t sclass,
              uint32_t bd_id,
              route::table_id_t rd_id,
@@ -57,7 +57,7 @@
   bool operator==(const create_cmd& i) const;
 
 private:
-  const epg_id_t m_epg_id;
+  const vnid_t m_vnid;
   const uint16_t m_sclass;
   const uint32_t m_bd_id;
   const route::table_id_t m_rd_id;
@@ -74,7 +74,7 @@
   /**
    * Constructor
    */
-  delete_cmd(HW::item<bool>& item, epg_id_t epg_id);
+  delete_cmd(HW::item<bool>& item, sclass_t sclass);
 
   /**
    * Issue the command to VPP/HW
@@ -92,7 +92,7 @@
   bool operator==(const delete_cmd& i) const;
 
 private:
-  const epg_id_t m_epg_id;
+  const sclass_t m_sclass;
 };
 
 /**
diff --git a/extras/vom/vom/gbp_recirc.cpp b/extras/vom/vom/gbp_recirc.cpp
index 250e304..19cb2da 100644
--- a/extras/vom/vom/gbp_recirc.cpp
+++ b/extras/vom/vom/gbp_recirc.cpp
@@ -88,7 +88,7 @@
 {
   if (m_hw) {
     HW::enqueue(new gbp_recirc_cmds::create_cmd(
-      m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->id()));
+      m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->sclass()));
   }
 }
 
@@ -107,7 +107,7 @@
 {
   if (rc_t::OK != m_hw.rc()) {
     HW::enqueue(new gbp_recirc_cmds::create_cmd(
-      m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->id()));
+      m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->sclass()));
   }
 }
 
@@ -162,10 +162,10 @@
     std::shared_ptr<interface> itf =
       interface::find(payload.recirc.sw_if_index);
     std::shared_ptr<gbp_endpoint_group> epg =
-      gbp_endpoint_group::find(payload.recirc.epg_id);
+      gbp_endpoint_group::find(payload.recirc.sclass);
 
     VOM_LOG(log_level_t::DEBUG) << "data: [" << payload.recirc.sw_if_index
-                                << ", " << payload.recirc.epg_id << "]";
+                                << ", " << payload.recirc.sclass << "]";
 
     if (itf && epg) {
       gbp_recirc recirc(
diff --git a/extras/vom/vom/gbp_recirc_cmds.cpp b/extras/vom/vom/gbp_recirc_cmds.cpp
index b14697c..90b931c 100644
--- a/extras/vom/vom/gbp_recirc_cmds.cpp
+++ b/extras/vom/vom/gbp_recirc_cmds.cpp
@@ -21,11 +21,11 @@
 create_cmd::create_cmd(HW::item<bool>& item,
                        const handle_t& itf,
                        bool is_ext,
-                       epg_id_t epg_id)
+                       sclass_t sclass)
   : rpc_cmd(item)
   , m_itf(itf)
   , m_is_ext(is_ext)
-  , m_epg_id(epg_id)
+  , m_sclass(sclass)
 {
 }
 
@@ -33,7 +33,7 @@
 create_cmd::operator==(const create_cmd& other) const
 {
   return ((m_itf == other.m_itf) && (m_is_ext == other.m_is_ext) &&
-          (m_epg_id == other.m_epg_id));
+          (m_sclass == other.m_sclass));
 }
 
 rc_t
@@ -44,7 +44,7 @@
   auto& payload = req.get_request().get_payload();
   payload.is_add = 1;
   payload.recirc.sw_if_index = m_itf.value();
-  payload.recirc.epg_id = m_epg_id;
+  payload.recirc.sclass = m_sclass;
   payload.recirc.is_ext = m_is_ext;
 
   VAPI_CALL(req.execute());
@@ -57,7 +57,7 @@
 {
   std::ostringstream s;
   s << "gbp-recirc-create: " << m_hw_item.to_string() << " itf:" << m_itf
-    << " ext:" << m_is_ext << " epg-id:" << m_epg_id;
+    << " ext:" << m_is_ext << " sclass:" << m_sclass;
 
   return (s.str());
 }
@@ -82,7 +82,7 @@
   auto& payload = req.get_request().get_payload();
   payload.is_add = 0;
   payload.recirc.sw_if_index = m_itf.value();
-  payload.recirc.epg_id = ~0;
+  payload.recirc.sclass = ~0;
 
   VAPI_CALL(req.execute());
 
diff --git a/extras/vom/vom/gbp_recirc_cmds.hpp b/extras/vom/vom/gbp_recirc_cmds.hpp
index 3c25d44..9d95bf1 100644
--- a/extras/vom/vom/gbp_recirc_cmds.hpp
+++ b/extras/vom/vom/gbp_recirc_cmds.hpp
@@ -36,7 +36,7 @@
   create_cmd(HW::item<bool>& item,
              const handle_t& itf,
              bool is_ext,
-             epg_id_t epg_id);
+             sclass_t sclass);
 
   /**
    * Issue the command to VPP/HW
@@ -56,7 +56,7 @@
 private:
   const handle_t m_itf;
   bool m_is_ext;
-  const epg_id_t m_epg_id;
+  const sclass_t m_sclass;
 };
 
 /**
diff --git a/extras/vom/vom/gbp_subnet.cpp b/extras/vom/vom/gbp_subnet.cpp
index a6bb550..304da3e 100644
--- a/extras/vom/vom/gbp_subnet.cpp
+++ b/extras/vom/vom/gbp_subnet.cpp
@@ -120,7 +120,7 @@
     HW::enqueue(new gbp_subnet_cmds::create_cmd(
       m_hw, m_rd->id(), m_prefix, m_type,
       (m_recirc ? m_recirc->handle() : handle_t::INVALID),
-      (m_epg ? m_epg->id() : ~0)));
+      (m_epg ? m_epg->sclass() : ~0)));
   }
 }
 
@@ -147,7 +147,7 @@
     HW::enqueue(new gbp_subnet_cmds::create_cmd(
       m_hw, m_rd->id(), m_prefix, m_type,
       (m_recirc ? m_recirc->handle() : handle_t::INVALID),
-      (m_epg ? m_epg->id() : ~0)));
+      (m_epg ? m_epg->sclass() : ~0)));
   } else {
     if (m_type != r.m_type) {
       m_epg = r.m_epg;
@@ -157,7 +157,7 @@
       HW::enqueue(new gbp_subnet_cmds::create_cmd(
         m_hw, m_rd->id(), m_prefix, m_type,
         (m_recirc ? m_recirc->handle() : handle_t::INVALID),
-        (m_epg ? m_epg->id() : ~0)));
+        (m_epg ? m_epg->sclass() : ~0)));
     }
   }
 }
@@ -230,7 +230,7 @@
         }
         case GBP_API_SUBNET_L3_OUT: {
           std::shared_ptr<gbp_endpoint_group> epg =
-            gbp_endpoint_group::find(payload.subnet.epg_id);
+            gbp_endpoint_group::find(payload.subnet.sclass);
 
           gbp_subnet gs(*rd, pfx, *epg);
           OM::commit(key, gs);
@@ -241,7 +241,7 @@
           std::shared_ptr<interface> itf =
             interface::find(payload.subnet.sw_if_index);
           std::shared_ptr<gbp_endpoint_group> epg =
-            gbp_endpoint_group::find(payload.subnet.epg_id);
+            gbp_endpoint_group::find(payload.subnet.sclass);
 
           if (itf && epg) {
             std::shared_ptr<gbp_recirc> recirc = gbp_recirc::find(itf->key());
diff --git a/extras/vom/vom/gbp_subnet_cmds.cpp b/extras/vom/vom/gbp_subnet_cmds.cpp
index 3dcd652..cf2801c 100644
--- a/extras/vom/vom/gbp_subnet_cmds.cpp
+++ b/extras/vom/vom/gbp_subnet_cmds.cpp
@@ -24,13 +24,13 @@
                        const route::prefix_t& prefix,
                        const gbp_subnet::type_t& type,
                        const handle_t& itf,
-                       epg_id_t epg_id)
+                       sclass_t sclass)
   : rpc_cmd(item)
   , m_rd(rd)
   , m_prefix(prefix)
   , m_type(type)
   , m_itf(itf)
-  , m_epg_id(epg_id)
+  , m_sclass(sclass)
 {
 }
 
@@ -39,7 +39,7 @@
 {
   return ((m_itf == other.m_itf) && (m_rd == other.m_rd) &&
           (m_prefix == other.m_prefix) && (m_type == other.m_type) &&
-          (m_itf == other.m_itf) && (m_epg_id == other.m_epg_id));
+          (m_itf == other.m_itf) && (m_sclass == other.m_sclass));
 }
 
 static vapi_enum_gbp_subnet_type
@@ -65,7 +65,7 @@
   payload.subnet.type = gbp_subnet_type_to_api(m_type);
   payload.subnet.rd_id = m_rd;
   payload.subnet.sw_if_index = m_itf.value();
-  payload.subnet.epg_id = m_epg_id;
+  payload.subnet.sclass = m_sclass;
   payload.subnet.prefix = to_api(m_prefix);
 
   VAPI_CALL(req.execute());
@@ -79,7 +79,7 @@
   std::ostringstream s;
   s << "gbp-subnet-create: " << m_hw_item.to_string() << "type:" << m_type
     << ", " << m_rd << ":" << m_prefix.to_string() << " itf:" << m_itf
-    << " epg-id:" << m_epg_id;
+    << " sclass:" << m_sclass;
 
   return (s.str());
 }
diff --git a/extras/vom/vom/gbp_subnet_cmds.hpp b/extras/vom/vom/gbp_subnet_cmds.hpp
index da2a4c5..b78699e 100644
--- a/extras/vom/vom/gbp_subnet_cmds.hpp
+++ b/extras/vom/vom/gbp_subnet_cmds.hpp
@@ -25,8 +25,8 @@
 namespace gbp_subnet_cmds {
 
 /**
-* A command class that creates or updates the GBP subnet
-*/
+ * A command class that creates or updates the GBP subnet
+ */
 class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_subnet_add_del>
 {
 public:
@@ -38,7 +38,7 @@
              const route::prefix_t& prefix,
              const gbp_subnet::type_t& type,
              const handle_t& itf,
-             epg_id_t epg_id);
+             sclass_t sclass);
 
   /**
    * Issue the command to VPP/HW
@@ -60,7 +60,7 @@
   const route::prefix_t m_prefix;
   const gbp_subnet::type_t& m_type;
   const handle_t m_itf;
-  const epg_id_t m_epg_id;
+  const sclass_t m_sclass;
 };
 
 /**
diff --git a/src/plugins/gbp/CMakeLists.txt b/src/plugins/gbp/CMakeLists.txt
index 02c4c17..6789a9c 100644
--- a/src/plugins/gbp/CMakeLists.txt
+++ b/src/plugins/gbp/CMakeLists.txt
@@ -33,8 +33,6 @@
   gbp_recirc.c
   gbp_route_domain.c
   gbp_scanner.c
-  gbp_sclass.c
-  gbp_sclass_node.c
   gbp_subnet.c
   gbp_vxlan.c
   gbp_vxlan_node.c
@@ -47,7 +45,6 @@
   gbp_policy_dpo.c
   gbp_policy_node.c
   gbp_vxlan_node.c
-  gbp_sclass_node.c
 
   API_FILES
   gbp.api
diff --git a/src/plugins/gbp/gbp.api b/src/plugins/gbp/gbp.api
index 8343e22..342c98b 100644
--- a/src/plugins/gbp/gbp.api
+++ b/src/plugins/gbp/gbp.api
@@ -114,7 +114,7 @@
 typedef gbp_endpoint
 {
   u32 sw_if_index;
-  u16 epg_id;
+  u16 sclass;
   vl_api_gbp_endpoint_flags_t flags;
   vl_api_mac_address_t mac;
   vl_api_gbp_endpoint_tun_t tun;
@@ -164,7 +164,7 @@
 
 typeonly define gbp_endpoint_group
 {
-  u16 epg_id;
+  u32 vnid;
   u16 sclass;
   u32 bd_id;
   u32 rd_id;
@@ -182,7 +182,7 @@
 {
   u32 client_index;
   u32 context;
-  u16 epg_id;
+  u16 sclass;
 };
 
 define gbp_endpoint_group_dump
@@ -200,7 +200,7 @@
 typeonly define gbp_recirc
 {
   u32 sw_if_index;
-  u16 epg_id;
+  u16 sclass;
   u8  is_ext;
 };
 
@@ -236,7 +236,7 @@
 {
   u32 rd_id;
   u32 sw_if_index;
-  u16 epg_id;
+  u16 sclass;
   vl_api_gbp_subnet_type_t type;
   vl_api_prefix_t prefix;
 };
@@ -298,8 +298,8 @@
 
 typedef gbp_contract
 {
-  u16 src_epg;
-  u16 dst_epg;
+  u16 sclass;
+  u16 dclass;
   u32 acl_index;
   u8  n_rules;
   vl_api_gbp_rule_t rules[n_rules];
diff --git a/src/plugins/gbp/gbp_api.c b/src/plugins/gbp/gbp_api.c
index ffdae28..3f35555 100644
--- a/src/plugins/gbp/gbp_api.c
+++ b/src/plugins/gbp/gbp_api.c
@@ -165,7 +165,7 @@
       rv = gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_CP,
 					 sw_if_index, ips, &mac,
 					 INDEX_INVALID, INDEX_INVALID,
-					 ntohs (mp->endpoint.epg_id),
+					 ntohs (mp->endpoint.sclass),
 					 gef, &tun_src, &tun_dst, &handle);
     }
   else
@@ -173,7 +173,7 @@
       rv = gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_CP,
 					 sw_if_index, ips, &mac,
 					 INDEX_INVALID, INDEX_INVALID,
-					 ntohs (mp->endpoint.epg_id),
+					 ntohs (mp->endpoint.sclass),
 					 gef, NULL, NULL, &handle);
     }
   vec_free (ips);
@@ -241,7 +241,7 @@
     {
       mp->endpoint.sw_if_index = ntohl (gef->gef_itf);
     }
-  mp->endpoint.epg_id = ntohs (ge->ge_fwd.gef_epg_id);
+  mp->endpoint.sclass = ntohs (ge->ge_fwd.gef_sclass);
   mp->endpoint.n_ips = n_ips;
   mp->endpoint.flags = gbp_endpoint_flags_encode (gef->gef_flags);
   mp->handle = htonl (gei);
@@ -293,7 +293,7 @@
 
   gbp_retention_decode (&mp->epg.retention, &retention);
 
-  rv = gbp_endpoint_group_add_and_lock (ntohs (mp->epg.epg_id),
+  rv = gbp_endpoint_group_add_and_lock (ntohl (mp->epg.vnid),
 					ntohs (mp->epg.sclass),
 					ntohl (mp->epg.bd_id),
 					ntohl (mp->epg.rd_id),
@@ -310,7 +310,7 @@
   vl_api_gbp_endpoint_group_del_reply_t *rmp;
   int rv = 0;
 
-  rv = gbp_endpoint_group_delete (ntohs (mp->epg_id));
+  rv = gbp_endpoint_group_delete (ntohs (mp->sclass));
 
   REPLY_MACRO (VL_API_GBP_ENDPOINT_GROUP_DEL_REPLY + GBP_MSG_BASE);
 }
@@ -425,7 +425,7 @@
     rv = gbp_subnet_add (ntohl (mp->subnet.rd_id),
 			 &pfx, type,
 			 ntohl (mp->subnet.sw_if_index),
-			 ntohs (mp->subnet.epg_id));
+			 ntohs (mp->subnet.sclass));
   else
     rv = gbp_subnet_del (ntohl (mp->subnet.rd_id), &pfx);
 
@@ -463,7 +463,7 @@
 gbp_subnet_send_details (u32 rd_id,
 			 const fib_prefix_t * pfx,
 			 gbp_subnet_type_t type,
-			 u32 sw_if_index, epg_id_t epg, void *args)
+			 u32 sw_if_index, sclass_t sclass, void *args)
 {
   vl_api_gbp_subnet_details_t *mp;
   gbp_walk_ctx_t *ctx;
@@ -479,7 +479,7 @@
 
   mp->subnet.type = gub_subnet_type_to_api (type);
   mp->subnet.sw_if_index = ntohl (sw_if_index);
-  mp->subnet.epg_id = ntohs (epg);
+  mp->subnet.sclass = ntohs (sclass);
   mp->subnet.rd_id = ntohl (rd_id);
   ip_prefix_encode (pfx, &mp->subnet.prefix);
 
@@ -521,7 +521,7 @@
   mp->context = ctx->context;
 
   mp->epg.uplink_sw_if_index = ntohl (gg->gg_uplink_sw_if_index);
-  mp->epg.epg_id = ntohs (gg->gg_id);
+  mp->epg.vnid = ntohl (gg->gg_vnid);
   mp->epg.sclass = ntohs (gg->gg_sclass);
   mp->epg.bd_id = ntohl (gbp_endpoint_group_get_bd_id (gg));
   mp->epg.rd_id = ntohl (gbp_route_domain_get_rd_id (gg->gg_rd));
@@ -647,7 +647,7 @@
 
   if (mp->is_add)
     rv = gbp_recirc_add (sw_if_index,
-			 ntohs (mp->recirc.epg_id), mp->recirc.is_ext);
+			 ntohs (mp->recirc.sclass), mp->recirc.is_ext);
   else
     rv = gbp_recirc_delete (sw_if_index);
 
@@ -671,7 +671,7 @@
   mp->_vl_msg_id = ntohs (VL_API_GBP_RECIRC_DETAILS + GBP_MSG_BASE);
   mp->context = ctx->context;
 
-  mp->recirc.epg_id = ntohs (gr->gr_epg);
+  mp->recirc.sclass = ntohs (gr->gr_sclass);
   mp->recirc.sw_if_index = ntohl (gr->gr_sw_if_index);
   mp->recirc.is_ext = gr->gr_is_ext;
 
@@ -959,14 +959,14 @@
 	  allowed_ethertypes[ii] = et[ii];
 	}
 
-      rv = gbp_contract_update (ntohs (mp->contract.src_epg),
-				ntohs (mp->contract.dst_epg),
+      rv = gbp_contract_update (ntohs (mp->contract.sclass),
+				ntohs (mp->contract.dclass),
 				ntohl (mp->contract.acl_index),
 				rules, allowed_ethertypes);
     }
   else
-    rv = gbp_contract_delete (ntohs (mp->contract.src_epg),
-			      ntohs (mp->contract.dst_epg));
+    rv = gbp_contract_delete (ntohs (mp->contract.sclass),
+			      ntohs (mp->contract.dclass));
 
 out:
   REPLY_MACRO (VL_API_GBP_CONTRACT_ADD_DEL_REPLY + GBP_MSG_BASE);
@@ -987,9 +987,9 @@
   mp->_vl_msg_id = ntohs (VL_API_GBP_CONTRACT_DETAILS + GBP_MSG_BASE);
   mp->context = ctx->context;
 
-  mp->contract.src_epg = ntohs (gbpc->gc_key.gck_src);
-  mp->contract.dst_epg = ntohs (gbpc->gc_key.gck_dst);
-  // mp->contract.acl_index = ntohl (gbpc->gc_value.gc_acl_index);
+  mp->contract.sclass = ntohs (gbpc->gc_key.gck_src);
+  mp->contract.dclass = ntohs (gbpc->gc_key.gck_dst);
+  mp->contract.acl_index = ntohl (gbpc->gc_acl_index);
 
   vl_api_send_msg (ctx->reg, (u8 *) mp);
 
diff --git a/src/plugins/gbp/gbp_bridge_domain.c b/src/plugins/gbp/gbp_bridge_domain.c
index 24bfb25..02ed97d 100644
--- a/src/plugins/gbp/gbp_bridge_domain.c
+++ b/src/plugins/gbp/gbp_bridge_domain.c
@@ -15,7 +15,6 @@
 
 #include <plugins/gbp/gbp_bridge_domain.h>
 #include <plugins/gbp/gbp_endpoint.h>
-#include <plugins/gbp/gbp_sclass.h>
 #include <plugins/gbp/gbp_learn.h>
 
 #include <vnet/dpo/dvr_dpo.h>
@@ -211,14 +210,12 @@
 	  set_int_l2_mode (vlib_get_main (), vnet_get_main (),
 			   MODE_L2_BRIDGE, gb->gb_uu_fwd_sw_if_index,
 			   bd_index, L2_BD_PORT_TYPE_UU_FWD, 0, 0);
-	  gbp_sclass_enable_l2 (gb->gb_uu_fwd_sw_if_index);
 	}
       if (~0 != gb->gb_bm_flood_sw_if_index)
 	{
 	  set_int_l2_mode (vlib_get_main (), vnet_get_main (),
 			   MODE_L2_BRIDGE, gb->gb_bm_flood_sw_if_index,
 			   bd_index, L2_BD_PORT_TYPE_NORMAL, 0, 0);
-	  gbp_sclass_enable_l2 (gb->gb_bm_flood_sw_if_index);
 	  gbp_learn_enable (gb->gb_bm_flood_sw_if_index, GBP_LEARN_MODE_L2);
 	}
 
@@ -269,14 +266,12 @@
 	  set_int_l2_mode (vlib_get_main (), vnet_get_main (),
 			   MODE_L3, gb->gb_uu_fwd_sw_if_index,
 			   gb->gb_bd_index, L2_BD_PORT_TYPE_UU_FWD, 0, 0);
-	  gbp_sclass_disable_l2 (gb->gb_uu_fwd_sw_if_index);
 	}
       if (~0 != gb->gb_bm_flood_sw_if_index)
 	{
 	  set_int_l2_mode (vlib_get_main (), vnet_get_main (),
 			   MODE_L3, gb->gb_bm_flood_sw_if_index,
 			   gb->gb_bd_index, L2_BD_PORT_TYPE_NORMAL, 0, 0);
-	  gbp_sclass_disable_l2 (gb->gb_bm_flood_sw_if_index);
 	  gbp_learn_enable (gb->gb_bm_flood_sw_if_index, GBP_LEARN_MODE_L2);
 	}
 
diff --git a/src/plugins/gbp/gbp_classify_node.c b/src/plugins/gbp/gbp_classify_node.c
index 43fea76..1b2cb0a 100644
--- a/src/plugins/gbp/gbp_classify_node.c
+++ b/src/plugins/gbp/gbp_classify_node.c
@@ -33,7 +33,7 @@
 typedef struct gbp_classify_trace_t_
 {
   /* per-pkt trace data */
-  epg_id_t src_epg;
+  sclass_t sclass;
 } gbp_classify_trace_t;
 
 /*
@@ -61,9 +61,10 @@
 
       while (n_left_from > 0 && n_left_to_next > 0)
 	{
-	  u32 next0, bi0, src_epg, sw_if_index0;
+	  u32 next0, bi0, sw_if_index0;
 	  const gbp_endpoint_t *ge0;
 	  vlib_buffer_t *b0;
+	  sclass_t sclass0;
 
 	  bi0 = from[0];
 	  to_next[0] = bi0;
@@ -79,7 +80,7 @@
 
 	  if (GBP_SRC_CLASSIFY_NULL == type)
 	    {
-	      src_epg = EPG_INVALID;
+	      sclass0 = SCLASS_INVALID;
 	      next0 =
 		vnet_l2_feature_next (b0, gscm->l2_input_feat_next[type],
 				      L2INPUT_FEAT_GBP_NULL_CLASSIFY);
@@ -139,18 +140,18 @@
 		}
 
 	      if (PREDICT_TRUE (NULL != ge0))
-		src_epg = ge0->ge_fwd.gef_epg_id;
+		sclass0 = ge0->ge_fwd.gef_sclass;
 	      else
-		src_epg = EPG_INVALID;
+		sclass0 = SCLASS_INVALID;
 	    }
 
-	  vnet_buffer2 (b0)->gbp.src_epg = src_epg;
+	  vnet_buffer2 (b0)->gbp.sclass = sclass0;
 
 	  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
 	    {
 	      gbp_classify_trace_t *t =
 		vlib_add_trace (vm, node, b0, sizeof (*t));
-	      t->src_epg = src_epg;
+	      t->sclass = sclass0;
 	    }
 
 	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
@@ -205,7 +206,7 @@
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   gbp_classify_trace_t *t = va_arg (*args, gbp_classify_trace_t *);
 
-  s = format (s, "src-epg:%d", t->src_epg);
+  s = format (s, "sclass:%d", t->sclass);
 
   return s;
 }
@@ -342,7 +343,7 @@
 	  ip4_header_t *ip4_0;
 	  ip6_header_t *ip6_0;
 	  vlib_buffer_t *b0;
-	  epg_id_t src_epg0;
+	  sclass_t sclass0;
 
 	  bi0 = from[0];
 	  to_next[0] = bi0;
@@ -383,7 +384,7 @@
 		  break;
 		default:
 		  /* not IP so no LPM classify possible */
-		  src_epg0 = EPG_INVALID;
+		  sclass0 = SCLASS_INVALID;
 		  goto trace;
 		}
 	    }
@@ -418,7 +419,7 @@
 	  else
 	    {
 	      /* not IP so no LPM classify possible */
-	      src_epg0 = EPG_INVALID;
+	      sclass0 = SCLASS_INVALID;
 	      goto trace;
 	    }
 	  lb0 = load_balance_get (lbi0);
@@ -427,23 +428,23 @@
 	  if (gbp_policy_dpo_type == dpo0->dpoi_type)
 	    {
 	      gpd0 = gbp_policy_dpo_get (dpo0->dpoi_index);
-	      src_epg0 = gpd0->gpd_epg;
+	      sclass0 = gpd0->gpd_sclass;
 	    }
 	  else
 	    {
 	      /* could not classify => drop */
-	      src_epg0 = EPG_INVALID;
+	      sclass0 = SCLASS_INVALID;
 	      next0 = GPB_LPM_CLASSIFY_DROP;
 	    }
 
 	trace:
-	  vnet_buffer2 (b0)->gbp.src_epg = src_epg0;
+	  vnet_buffer2 (b0)->gbp.sclass = sclass0;
 
 	  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
 	    {
 	      gbp_classify_trace_t *t =
 		vlib_add_trace (vm, node, b0, sizeof (*t));
-	      t->src_epg = src_epg0;
+	      t->sclass = sclass0;
 	    }
 
 	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
diff --git a/src/plugins/gbp/gbp_contract.c b/src/plugins/gbp/gbp_contract.c
index f7b8b64..805e9b2 100644
--- a/src/plugins/gbp/gbp_contract.c
+++ b/src/plugins/gbp/gbp_contract.c
@@ -377,7 +377,7 @@
 				     gbd->gb_uu_fwd_sw_if_index,
 				     ips,
 				     &gnh->gnh_mac,
-				     gnh->gnh_bd, gnh->gnh_rd, EPG_INVALID,
+				     gnh->gnh_bd, gnh->gnh_rd, SCLASS_INVALID,
 				     GBP_ENDPOINT_FLAG_NONE, NULL, NULL,
 				     &gnh->gnh_ge);
 
@@ -433,8 +433,8 @@
 }
 
 int
-gbp_contract_update (epg_id_t src_epg,
-		     epg_id_t dst_epg,
+gbp_contract_update (sclass_t sclass,
+		     sclass_t dclass,
 		     u32 acl_index, index_t * rules, u16 * allowed_ethertypes)
 {
   gbp_main_t *gm = &gbp_main;
@@ -444,8 +444,8 @@
   uword *p;
 
   gbp_contract_key_t key = {
-    .gck_src = src_epg,
-    .gck_dst = dst_epg,
+    .gck_src = sclass,
+    .gck_dst = dclass,
   };
 
   if (~0 == gm->gbp_acl_user_id)
@@ -483,7 +483,7 @@
   gc->gc_acl_index = acl_index;
   gc->gc_lc_index =
     gm->acl_plugin.get_lookup_context_index (gm->gbp_acl_user_id,
-					     src_epg, dst_epg);
+					     sclass, dclass);
 
   vec_add1 (acl_vec, gc->gc_acl_index);
   gm->acl_plugin.set_acl_vec_for_context (gc->gc_lc_index, acl_vec);
@@ -493,11 +493,11 @@
 }
 
 int
-gbp_contract_delete (epg_id_t src_epg, epg_id_t dst_epg)
+gbp_contract_delete (sclass_t sclass, sclass_t dclass)
 {
   gbp_contract_key_t key = {
-    .gck_src = src_epg,
-    .gck_dst = dst_epg,
+    .gck_src = sclass,
+    .gck_dst = dclass,
   };
   gbp_contract_t *gc;
   uword *p;
@@ -538,7 +538,7 @@
 gbp_contract_cli (vlib_main_t * vm,
 		  unformat_input_t * input, vlib_cli_command_t * cmd)
 {
-  epg_id_t src_epg_id = EPG_INVALID, dst_epg_id = EPG_INVALID;
+  sclass_t sclass = SCLASS_INVALID, dclass = SCLASS_INVALID;
   u32 acl_index = ~0;
   u8 add = 1;
 
@@ -548,9 +548,9 @@
 	add = 1;
       else if (unformat (input, "del"))
 	add = 0;
-      else if (unformat (input, "src-epg %d", &src_epg_id))
+      else if (unformat (input, "src-epg %d", &sclass))
 	;
-      else if (unformat (input, "dst-epg %d", &dst_epg_id))
+      else if (unformat (input, "dst-epg %d", &dclass))
 	;
       else if (unformat (input, "acl-index %d", &acl_index))
 	;
@@ -558,18 +558,18 @@
 	break;
     }
 
-  if (EPG_INVALID == src_epg_id)
+  if (SCLASS_INVALID == sclass)
     return clib_error_return (0, "Source EPG-ID must be specified");
-  if (EPG_INVALID == dst_epg_id)
+  if (SCLASS_INVALID == dclass)
     return clib_error_return (0, "Destination EPG-ID must be specified");
 
   if (add)
     {
-      gbp_contract_update (src_epg_id, dst_epg_id, acl_index, NULL, NULL);
+      gbp_contract_update (sclass, dclass, acl_index, NULL, NULL);
     }
   else
     {
-      gbp_contract_delete (src_epg_id, dst_epg_id);
+      gbp_contract_delete (sclass, dclass);
     }
 
   return (NULL);
diff --git a/src/plugins/gbp/gbp_contract.h b/src/plugins/gbp/gbp_contract.h
index 876c10f..dff1b44 100644
--- a/src/plugins/gbp/gbp_contract.h
+++ b/src/plugins/gbp/gbp_contract.h
@@ -30,8 +30,8 @@
       /**
        * source and destination EPGs for which the ACL applies
        */
-      epg_id_t gck_src;
-      epg_id_t gck_dst;
+      sclass_t gck_src;
+      sclass_t gck_dst;
     };
     u32 as_u32;
   };
@@ -138,11 +138,11 @@
   uword *gc_hash;
 } gbp_contract_db_t;
 
-extern int gbp_contract_update (epg_id_t src_epg,
-				epg_id_t dst_epg,
+extern int gbp_contract_update (sclass_t sclass,
+				sclass_t dclass,
 				u32 acl_index,
 				index_t * rules, u16 * allowed_ethertypes);
-extern int gbp_contract_delete (epg_id_t src_epg, epg_id_t dst_epg);
+extern int gbp_contract_delete (sclass_t sclass, sclass_t dclass);
 
 extern index_t gbp_rule_alloc (gbp_rule_action_t action,
 			       gbp_hash_mode_t hash_mode, index_t * nhs);
diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c
index 4bd726f..36e0050 100644
--- a/src/plugins/gbp/gbp_endpoint.c
+++ b/src/plugins/gbp/gbp_endpoint.c
@@ -636,7 +636,7 @@
   if (INDEX_INVALID != gel->gel_epg)
     {
       gg = gbp_endpoint_group_get (gel->gel_epg);
-      gef->gef_epg_id = gg->gg_id;
+      gef->gef_sclass = gg->gg_sclass;
     }
   else
     {
@@ -757,7 +757,7 @@
 	     * is applied
 	     */
 	    gbp_policy_dpo_add_or_lock (fib_proto_to_dpo (pfx->fp_proto),
-					gg->gg_id, ~0, &policy_dpo);
+					gg->gg_sclass, ~0, &policy_dpo);
 
 	    fib_table_entry_special_dpo_add (fib_index, pfx,
 					     FIB_SOURCE_PLUGIN_HI,
@@ -818,7 +818,8 @@
 			      u32 sw_if_index,
 			      const ip46_address_t * ips,
 			      const mac_address_t * mac,
-			      index_t gbdi, index_t grdi, epg_id_t epg_id,
+			      index_t gbdi, index_t grdi,
+			      sclass_t sclass,
 			      gbp_endpoint_flags_t flags,
 			      const ip46_address_t * tun_src,
 			      const ip46_address_t * tun_dst, u32 * handle)
@@ -842,9 +843,9 @@
    * we need to determine the bridge-domain, either from the EPG or
    * the BD passed
    */
-  if (EPG_INVALID != epg_id)
+  if (SCLASS_INVALID != sclass)
     {
-      ggi = gbp_endpoint_group_find (epg_id);
+      ggi = gbp_endpoint_group_find (sclass);
 
       if (INDEX_INVALID == ggi)
 	return (VNET_API_ERROR_NO_SUCH_ENTRY);
@@ -1074,7 +1075,7 @@
   ip46_address_t ip = ip46_address_initializer, *ips = NULL;
   mac_address_t mac = ZERO_MAC_ADDRESS;
   vnet_main_t *vnm = vnet_get_main ();
-  u32 epg_id = EPG_INVALID;
+  u32 sclass = SCLASS_INVALID;
   u32 handle = INDEX_INVALID;
   u32 sw_if_index = ~0;
   u8 add = 1;
@@ -1091,7 +1092,7 @@
 	add = 1;
       else if (unformat (input, "del"))
 	add = 0;
-      else if (unformat (input, "epg %d", &epg_id))
+      else if (unformat (input, "sclass %d", &sclass))
 	;
       else if (unformat (input, "handle %d", &handle))
 	;
@@ -1109,14 +1110,14 @@
     {
       if (~0 == sw_if_index)
 	return clib_error_return (0, "interface must be specified");
-      if (EPG_INVALID == epg_id)
-	return clib_error_return (0, "EPG-ID must be specified");
+      if (SCLASS_INVALID == sclass)
+	return clib_error_return (0, "SCLASS must be specified");
 
       rv =
 	gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_CP,
 				      sw_if_index, ips, &mac,
 				      INDEX_INVALID, INDEX_INVALID,
-				      epg_id,
+				      sclass,
 				      GBP_ENDPOINT_FLAG_NONE,
 				      NULL, NULL, &handle);
 
diff --git a/src/plugins/gbp/gbp_endpoint.h b/src/plugins/gbp/gbp_endpoint.h
index e399ff4..aba1f9d 100644
--- a/src/plugins/gbp/gbp_endpoint.h
+++ b/src/plugins/gbp/gbp_endpoint.h
@@ -164,9 +164,9 @@
   index_t *gef_adjs;
 
   /**
-   * Endpoint Group's ID. cached for fast DP access.
+   * Endpoint Group's sclass. cached for fast DP access.
    */
-  epg_id_t gef_epg_id;
+  sclass_t gef_sclass;
 
   gbp_endpoint_flags_t gef_flags;
 } gbp_endpoint_fwd_t;
@@ -222,7 +222,7 @@
 					 const ip46_address_t * ip,
 					 const mac_address_t * mac,
 					 index_t gbd, index_t grd,
-					 epg_id_t epg_id,
+					 sclass_t sclass,
 					 gbp_endpoint_flags_t flags,
 					 const ip46_address_t * tun_src,
 					 const ip46_address_t * tun_dst,
diff --git a/src/plugins/gbp/gbp_endpoint_group.c b/src/plugins/gbp/gbp_endpoint_group.c
index 821adef..d6e42e8 100644
--- a/src/plugins/gbp/gbp_endpoint_group.c
+++ b/src/plugins/gbp/gbp_endpoint_group.c
@@ -60,11 +60,11 @@
 }
 
 index_t
-gbp_endpoint_group_find (epg_id_t epg_id)
+gbp_endpoint_group_find (sclass_t sclass)
 {
   uword *p;
 
-  p = hash_get (gbp_endpoint_group_db.gg_hash, epg_id);
+  p = hash_get (gbp_endpoint_group_db.gg_hash_sclass, sclass);
 
   if (NULL != p)
     return p[0];
@@ -73,7 +73,7 @@
 }
 
 int
-gbp_endpoint_group_add_and_lock (epg_id_t epg_id,
+gbp_endpoint_group_add_and_lock (vnid_t vnid,
 				 u16 sclass,
 				 u32 bd_id,
 				 u32 rd_id,
@@ -83,7 +83,7 @@
   gbp_endpoint_group_t *gg;
   index_t ggi;
 
-  ggi = gbp_endpoint_group_find (epg_id);
+  ggi = gbp_endpoint_group_find (sclass);
 
   if (INDEX_INVALID == ggi)
     {
@@ -108,7 +108,7 @@
 
       pool_get_zero (gbp_endpoint_group_pool, gg);
 
-      gg->gg_id = epg_id;
+      gg->gg_vnid = vnid;
       gg->gg_rd = grdi;
       gg->gg_gbd = gbi;
       gg->gg_bd_index = gb->gb_bd_index;
@@ -119,7 +119,7 @@
       gg->gg_retention = *retention;
 
       if (SCLASS_INVALID != gg->gg_sclass)
-	hash_set (gbp_epg_sclass_db, gg->gg_sclass, gg->gg_id);
+	hash_set (gbp_epg_sclass_db, gg->gg_sclass, gg->gg_vnid);
 
       /*
        * an egress DVR dpo for internal subnets to use when sending
@@ -145,9 +145,8 @@
 				      L2INPUT_FEAT_GBP_NULL_CLASSIFY, 1);
 	}
 
-      hash_set (gbp_endpoint_group_db.gg_hash,
-		gg->gg_id, gg - gbp_endpoint_group_pool);
-
+      hash_set (gbp_endpoint_group_db.gg_hash_sclass,
+		gg->gg_sclass, gg - gbp_endpoint_group_pool);
     }
   else
     {
@@ -196,18 +195,18 @@
 
       if (SCLASS_INVALID != gg->gg_sclass)
 	hash_unset (gbp_epg_sclass_db, gg->gg_sclass);
-      hash_unset (gbp_endpoint_group_db.gg_hash, gg->gg_id);
+      hash_unset (gbp_endpoint_group_db.gg_hash_sclass, gg->gg_sclass);
 
       pool_put (gbp_endpoint_group_pool, gg);
     }
 }
 
 int
-gbp_endpoint_group_delete (epg_id_t epg_id)
+gbp_endpoint_group_delete (sclass_t sclass)
 {
   index_t ggi;
 
-  ggi = gbp_endpoint_group_find (epg_id);
+  ggi = gbp_endpoint_group_find (sclass);
 
   if (INDEX_INVALID != ggi)
     {
@@ -261,7 +260,7 @@
 			unformat_input_t * input, vlib_cli_command_t * cmd)
 {
   gbp_endpoint_retention_t retention = { 0 };
-  epg_id_t epg_id = EPG_INVALID, sclass;
+  vnid_t vnid = VNID_INVALID, sclass;
   vnet_main_t *vnm = vnet_get_main ();
   u32 uplink_sw_if_index = ~0;
   u32 bd_id = ~0;
@@ -277,7 +276,7 @@
 	add = 1;
       else if (unformat (input, "del"))
 	add = 0;
-      else if (unformat (input, "epg %d", &epg_id))
+      else if (unformat (input, "epg %d", &vnid))
 	;
       else if (unformat (input, "sclass %d", &sclass))
 	;
@@ -289,7 +288,7 @@
 	break;
     }
 
-  if (EPG_INVALID == epg_id)
+  if (VNID_INVALID == vnid)
     return clib_error_return (0, "EPG-ID must be specified");
 
   if (add)
@@ -301,11 +300,11 @@
       if (~0 == rd_id)
 	return clib_error_return (0, "route-domain must be specified");
 
-      gbp_endpoint_group_add_and_lock (epg_id, sclass, bd_id, rd_id,
+      gbp_endpoint_group_add_and_lock (vnid, sclass, bd_id, rd_id,
 				       uplink_sw_if_index, &retention);
     }
   else
-    gbp_endpoint_group_delete (epg_id);
+    gbp_endpoint_group_delete (vnid);
 
   return (NULL);
 }
@@ -343,7 +342,7 @@
   if (NULL != gg)
     s = format (s, "[%d] %d, sclass:%d bd:[%d,%d] rd:[%d] uplink:%U retnetion:%U locks:%d",
                 gg - gbp_endpoint_group_pool,
-                gg->gg_id,
+                gg->gg_vnid,
                 gg->gg_sclass,
                 gbp_endpoint_group_get_bd_id(gg), gg->gg_bd_index,
                 gg->gg_rd,
diff --git a/src/plugins/gbp/gbp_endpoint_group.h b/src/plugins/gbp/gbp_endpoint_group.h
index 08e3a5c..e0d54ea 100644
--- a/src/plugins/gbp/gbp_endpoint_group.h
+++ b/src/plugins/gbp/gbp_endpoint_group.h
@@ -37,7 +37,7 @@
   /**
    * ID
    */
-  epg_id_t gg_id;
+  vnid_t gg_vnid;
 
   /**
    * Sclass. Could be unset => ~0
@@ -86,18 +86,18 @@
  */
 typedef struct gbp_endpoint_group_db_t_
 {
-  uword *gg_hash;
+  uword *gg_hash_sclass;
 } gbp_endpoint_group_db_t;
 
-extern int gbp_endpoint_group_add_and_lock (epg_id_t epg_id,
+extern int gbp_endpoint_group_add_and_lock (vnid_t vnid,
 					    u16 sclass,
 					    u32 bd_id,
 					    u32 rd_id,
 					    u32 uplink_sw_if_index,
 					    const gbp_endpoint_retention_t *
 					    retention);
-extern index_t gbp_endpoint_group_find (epg_id_t epg_id);
-extern int gbp_endpoint_group_delete (epg_id_t epg_id);
+extern index_t gbp_endpoint_group_find (sclass_t sclass);
+extern int gbp_endpoint_group_delete (sclass_t sclass);
 extern void gbp_endpoint_group_unlock (index_t index);
 extern void gbp_endpoint_group_lock (index_t index);
 extern u32 gbp_endpoint_group_get_bd_id (const gbp_endpoint_group_t *);
@@ -120,24 +120,12 @@
 extern gbp_endpoint_group_t *gbp_endpoint_group_pool;
 extern uword *gbp_epg_sclass_db;
 
-always_inline gbp_endpoint_group_t *
-gbp_epg_get (epg_id_t epg)
-{
-  uword *p;
-
-  p = hash_get (gbp_endpoint_group_db.gg_hash, epg);
-
-  if (NULL != p)
-    return (pool_elt_at_index (gbp_endpoint_group_pool, p[0]));
-  return (NULL);
-}
-
 always_inline u32
-gbp_epg_itf_lookup (epg_id_t epg)
+gbp_epg_itf_lookup_sclass (sclass_t sclass)
 {
   uword *p;
 
-  p = hash_get (gbp_endpoint_group_db.gg_hash, epg);
+  p = hash_get (gbp_endpoint_group_db.gg_hash_sclass, sclass);
 
   if (NULL != p)
     {
@@ -149,26 +137,12 @@
   return (~0);
 }
 
-always_inline epg_id_t
-gbp_epg_sclass_2_id (u16 sclass)
-{
-  uword *p;
-
-  p = hash_get (gbp_epg_sclass_db, sclass);
-
-  if (NULL != p)
-    {
-      return (p[0]);
-    }
-  return (EPG_INVALID);
-}
-
 always_inline const dpo_id_t *
-gbp_epg_dpo_lookup (epg_id_t epg, fib_protocol_t fproto)
+gbp_epg_dpo_lookup (sclass_t sclass, fib_protocol_t fproto)
 {
   uword *p;
 
-  p = hash_get (gbp_endpoint_group_db.gg_hash, epg);
+  p = hash_get (gbp_endpoint_group_db.gg_hash_sclass, sclass);
 
   if (NULL != p)
     {
diff --git a/src/plugins/gbp/gbp_fwd.c b/src/plugins/gbp/gbp_fwd.c
index dd39398..4ecc477 100644
--- a/src/plugins/gbp/gbp_fwd.c
+++ b/src/plugins/gbp/gbp_fwd.c
@@ -27,7 +27,7 @@
   u32 l2_input_feat_next[32];
 } gbp_fwd_main_t;
 
-static gbp_fwd_main_t gbp_fwd_main;
+gbp_fwd_main_t gbp_fwd_main;
 
 static clib_error_t *
 gbp_fwd_init (vlib_main_t * vm)
diff --git a/src/plugins/gbp/gbp_fwd_dpo.c b/src/plugins/gbp/gbp_fwd_dpo.c
index c0b19a9..b1023f5 100644
--- a/src/plugins/gbp/gbp_fwd_dpo.c
+++ b/src/plugins/gbp/gbp_fwd_dpo.c
@@ -170,7 +170,7 @@
 
 typedef struct gbp_fwd_dpo_trace_t_
 {
-  u32 src_epg;
+  u32 sclass;
   u32 dpo_index;
 } gbp_fwd_dpo_trace_t;
 
@@ -203,7 +203,7 @@
 	{
 	  const dpo_id_t *next_dpo0;
 	  vlib_buffer_t *b0;
-	  epg_id_t src_epg0;
+	  sclass_t sclass0;
 	  u32 bi0, next0;
 
 	  bi0 = from[0];
@@ -215,8 +215,8 @@
 
 	  b0 = vlib_get_buffer (vm, bi0);
 
-	  src_epg0 = vnet_buffer2 (b0)->gbp.src_epg;
-	  next_dpo0 = gbp_epg_dpo_lookup (src_epg0, fproto);
+	  sclass0 = vnet_buffer2 (b0)->gbp.sclass;
+	  next_dpo0 = gbp_epg_dpo_lookup (sclass0, fproto);
 
 	  if (PREDICT_TRUE (NULL != next_dpo0))
 	    {
@@ -233,7 +233,7 @@
 	      gbp_fwd_dpo_trace_t *tr;
 
 	      tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
-	      tr->src_epg = src_epg0;
+	      tr->sclass = sclass0;
 	      tr->dpo_index = (NULL != next_dpo0 ?
 			       next_dpo0->dpoi_index : ~0);
 	    }
@@ -253,7 +253,7 @@
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   gbp_fwd_dpo_trace_t *t = va_arg (*args, gbp_fwd_dpo_trace_t *);
 
-  s = format (s, " epg:%d dpo:%d", t->src_epg, t->dpo_index);
+  s = format (s, " sclass:%d dpo:%d", t->sclass, t->dpo_index);
 
   return s;
 }
diff --git a/src/plugins/gbp/gbp_fwd_node.c b/src/plugins/gbp/gbp_fwd_node.c
index eff4aeb..6ea56fd 100644
--- a/src/plugins/gbp/gbp_fwd_node.c
+++ b/src/plugins/gbp/gbp_fwd_node.c
@@ -48,7 +48,7 @@
 typedef struct gbp_fwd_trace_t_
 {
   /* per-pkt trace data */
-  epg_id_t src_epg;
+  sclass_t sclass;
   u32 sw_if_index;
 } gbp_fwd_trace_t;
 
@@ -70,9 +70,10 @@
 
       while (n_left_from > 0 && n_left_to_next > 0)
 	{
-	  u32 bi0, sw_if_index0, src_epg;
+	  u32 bi0, sw_if_index0;
 	  gbp_fwd_next_t next0;
 	  vlib_buffer_t *b0;
+	  sclass_t sclass0;
 
 	  next0 = GBP_FWD_NEXT_DROP;
 	  bi0 = from[0];
@@ -87,9 +88,9 @@
 	  /*
 	   * lookup the uplink based on src EPG
 	   */
-	  src_epg = vnet_buffer2 (b0)->gbp.src_epg;
+	  sclass0 = vnet_buffer2 (b0)->gbp.sclass;
 
-	  sw_if_index0 = gbp_epg_itf_lookup (src_epg);
+	  sw_if_index0 = gbp_epg_itf_lookup_sclass (sclass0);
 
 	  if (~0 != sw_if_index0)
 	    {
@@ -105,7 +106,7 @@
 	  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
 	    {
 	      gbp_fwd_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
-	      t->src_epg = src_epg;
+	      t->sclass = sclass0;
 	      t->sw_if_index = sw_if_index0;
 	    }
 
@@ -129,7 +130,7 @@
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   gbp_fwd_trace_t *t = va_arg (*args, gbp_fwd_trace_t *);
 
-  s = format (s, "src-epg:%d", t->src_epg);
+  s = format (s, "sclass:%d", t->sclass);
 
   return s;
 }
diff --git a/src/plugins/gbp/gbp_learn_node.c b/src/plugins/gbp/gbp_learn_node.c
index 461d209..8c623e8 100644
--- a/src/plugins/gbp/gbp_learn_node.c
+++ b/src/plugins/gbp/gbp_learn_node.c
@@ -58,7 +58,7 @@
   mac_address_t mac;
   u32 sw_if_index;
   u32 bd_index;
-  epg_id_t epg;
+  sclass_t sclass;
   ip46_address_t outer_src;
   ip46_address_t outer_dst;
 } gbp_learn_l2_t;
@@ -71,7 +71,7 @@
 
   GBP_LEARN_DBG ("L2 EP: %U %U, %d",
 		 format_mac_address_t, &gl2->mac,
-		 format_ip46_address, &gl2->ip, IP46_TYPE_ANY, gl2->epg);
+		 format_ip46_address, &gl2->ip, IP46_TYPE_ANY, gl2->sclass);
 
   if (!ip46_address_is_zero (&gl2->ip))
     vec_add1 (ips, gl2->ip);
@@ -83,7 +83,7 @@
   gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_DP,
 				gl2->sw_if_index, ips,
 				&gl2->mac, INDEX_INVALID,
-				INDEX_INVALID, gl2->epg,
+				INDEX_INVALID, gl2->sclass,
 				(GBP_ENDPOINT_FLAG_LEARNT |
 				 GBP_ENDPOINT_FLAG_REMOTE),
 				&gl2->outer_dst, &gl2->outer_src, NULL);
@@ -92,14 +92,14 @@
 
 static void
 gbp_learn_l2_ip4_dp (const u8 * mac, const ip4_address_t * ip,
-		     u32 bd_index, u32 sw_if_index, epg_id_t epg,
+		     u32 bd_index, u32 sw_if_index, sclass_t sclass,
 		     const ip4_address_t * outer_src,
 		     const ip4_address_t * outer_dst)
 {
   gbp_learn_l2_t gl2 = {
     .sw_if_index = sw_if_index,
     .bd_index = bd_index,
-    .epg = epg,
+    .sclass = sclass,
     .ip.ip4 = *ip,
     .outer_src.ip4 = *outer_src,
     .outer_dst.ip4 = *outer_dst,
@@ -111,14 +111,14 @@
 
 static void
 gbp_learn_l2_ip6_dp (const u8 * mac, const ip6_address_t * ip,
-		     u32 bd_index, u32 sw_if_index, epg_id_t epg,
+		     u32 bd_index, u32 sw_if_index, sclass_t sclass,
 		     const ip4_address_t * outer_src,
 		     const ip4_address_t * outer_dst)
 {
   gbp_learn_l2_t gl2 = {
     .sw_if_index = sw_if_index,
     .bd_index = bd_index,
-    .epg = epg,
+    .sclass = sclass,
     .ip.ip6 = *ip,
     .outer_src.ip4 = *outer_src,
     .outer_dst.ip4 = *outer_dst,
@@ -130,14 +130,14 @@
 
 static void
 gbp_learn_l2_dp (const u8 * mac, u32 bd_index, u32 sw_if_index,
-		 epg_id_t epg,
+		 sclass_t sclass,
 		 const ip4_address_t * outer_src,
 		 const ip4_address_t * outer_dst)
 {
   gbp_learn_l2_t gl2 = {
     .sw_if_index = sw_if_index,
     .bd_index = bd_index,
-    .epg = epg,
+    .sclass = sclass,
     .outer_src.ip4 = *outer_src,
     .outer_dst.ip4 = *outer_dst,
   };
@@ -156,7 +156,7 @@
   u32 sw_if_index;
   u32 new;
   u32 throttled;
-  u32 epg;
+  u32 sclass;
   u32 d_bit;
   gbp_bridge_domain_flags_t gb_flags;
 } gbp_learn_l2_trace_t;
@@ -205,12 +205,13 @@
       while (n_left_from > 0 && n_left_to_next > 0)
 	{
 	  ip4_address_t outer_src, outer_dst;
-	  u32 bi0, sw_if_index0, t0, epg0;
 	  const ethernet_header_t *eh0;
+	  u32 bi0, sw_if_index0, t0;
 	  gbp_bridge_domain_t *gb0;
 	  gbp_learn_next_t next0;
 	  gbp_endpoint_t *ge0;
 	  vlib_buffer_t *b0;
+	  sclass_t sclass0;
 
 	  next0 = GBP_LEARN_NEXT_DROP;
 	  bi0 = from[0];
@@ -224,7 +225,7 @@
 	  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
 
 	  eh0 = vlib_buffer_get_current (b0);
-	  epg0 = vnet_buffer2 (b0)->gbp.src_epg;
+	  sclass0 = vnet_buffer2 (b0)->gbp.sclass;
 
 	  next0 = vnet_l2_feature_next (b0, glm->gl_l2_input_feat_next,
 					L2INPUT_FEAT_GBP_LEARN);
@@ -273,7 +274,7 @@
 			gbp_learn_l2_ip4_dp (eh0->src_address,
 					     &ip0->src_address,
 					     vnet_buffer (b0)->l2.bd_index,
-					     sw_if_index0, epg0,
+					     sw_if_index0, sclass0,
 					     &outer_src, &outer_dst);
 
 			break;
@@ -287,7 +288,7 @@
 			gbp_learn_l2_ip6_dp (eh0->src_address,
 					     &ip0->src_address,
 					     vnet_buffer (b0)->l2.bd_index,
-					     sw_if_index0, epg0,
+					     sw_if_index0, sclass0,
 					     &outer_src, &outer_dst);
 
 			break;
@@ -301,14 +302,14 @@
 			gbp_learn_l2_ip4_dp (eh0->src_address,
 					     &arp0->ip4_over_ethernet[0].ip4,
 					     vnet_buffer (b0)->l2.bd_index,
-					     sw_if_index0, epg0,
+					     sw_if_index0, sclass0,
 					     &outer_src, &outer_dst);
 			break;
 		      }
 		    default:
 		      gbp_learn_l2_dp (eh0->src_address,
 				       vnet_buffer (b0)->l2.bd_index,
-				       sw_if_index0, epg0,
+				       sw_if_index0, sclass0,
 				       &outer_src, &outer_dst);
 		      break;
 		    }
@@ -332,7 +333,7 @@
 	      t->new = (NULL == ge0);
 	      t->throttled = t0;
 	      t->sw_if_index = sw_if_index0;
-	      t->epg = epg0;
+	      t->sclass = sclass0;
 	      t->gb_flags = gb0->gb_flags;
 	      t->d_bit = ! !(vnet_buffer2 (b0)->gbp.flags &
 			     VXLAN_GBP_GPFLAGS_D);
@@ -358,10 +359,10 @@
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   gbp_learn_l2_trace_t *t = va_arg (*args, gbp_learn_l2_trace_t *);
 
-  s = format (s, "new:%d throttled:%d d-bit:%d mac:%U itf:%d epg:%d"
+  s = format (s, "new:%d throttled:%d d-bit:%d mac:%U itf:%d sclass:%d"
 	      " gb-flags:%U",
 	      t->new, t->throttled, t->d_bit,
-	      format_mac_address_t, &t->mac, t->sw_if_index, t->epg,
+	      format_mac_address_t, &t->mac, t->sw_if_index, t->sclass,
 	      format_gbp_bridge_domain_flags, t->gb_flags);
 
   return s;
@@ -390,7 +391,7 @@
   ip46_address_t ip;
   u32 fib_index;
   u32 sw_if_index;
-  epg_id_t epg;
+  sclass_t sclass;
   ip46_address_t outer_src;
   ip46_address_t outer_dst;
 } gbp_learn_l3_t;
@@ -401,13 +402,13 @@
   ip46_address_t *ips = NULL;
 
   GBP_LEARN_DBG ("L3 EP: %U, %d", format_ip46_address, &gl3->ip,
-		 IP46_TYPE_ANY, gl3->epg);
+		 IP46_TYPE_ANY, gl3->sclass);
 
   vec_add1 (ips, gl3->ip);
 
   gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_DP,
 				gl3->sw_if_index, ips, NULL,
-				INDEX_INVALID, INDEX_INVALID, gl3->epg,
+				INDEX_INVALID, INDEX_INVALID, gl3->sclass,
 				(GBP_ENDPOINT_FLAG_REMOTE |
 				 GBP_ENDPOINT_FLAG_LEARNT),
 				&gl3->outer_dst, &gl3->outer_src, NULL);
@@ -416,7 +417,7 @@
 
 static void
 gbp_learn_ip4_dp (const ip4_address_t * ip,
-		  u32 fib_index, u32 sw_if_index, epg_id_t epg,
+		  u32 fib_index, u32 sw_if_index, sclass_t sclass,
 		  const ip4_address_t * outer_src,
 		  const ip4_address_t * outer_dst)
 {
@@ -427,7 +428,7 @@
     },
     .sw_if_index = sw_if_index,
     .fib_index = fib_index,
-    .epg = epg,
+    .sclass = sclass,
     .outer_src.ip4 = *outer_src,
     .outer_dst.ip4 = *outer_dst,
   };
@@ -438,7 +439,7 @@
 
 static void
 gbp_learn_ip6_dp (const ip6_address_t * ip,
-		  u32 fib_index, u32 sw_if_index, epg_id_t epg,
+		  u32 fib_index, u32 sw_if_index, sclass_t sclass,
 		  const ip4_address_t * outer_src,
 		  const ip4_address_t * outer_dst)
 {
@@ -449,7 +450,7 @@
     },
     .sw_if_index = sw_if_index,
     .fib_index = fib_index,
-    .epg = epg,
+    .sclass = sclass,
     .outer_src.ip4 = *outer_src,
     .outer_dst.ip4 = *outer_dst,
   };
@@ -468,7 +469,7 @@
   u32 sw_if_index;
   u32 new;
   u32 throttled;
-  u32 epg;
+  u32 sclass;
 } gbp_learn_l3_trace_t;
 
 static uword
@@ -497,14 +498,15 @@
 
       while (n_left_from > 0 && n_left_to_next > 0)
 	{
-	  u32 bi0, sw_if_index0, t0, epg0, fib_index0;
 	  CLIB_UNUSED (const ip4_header_t *) ip4_0;
 	  CLIB_UNUSED (const ip6_header_t *) ip6_0;
+	  u32 bi0, sw_if_index0, t0, fib_index0;
 	  ip4_address_t outer_src, outer_dst;
 	  ethernet_header_t *eth0;
 	  gbp_learn_next_t next0;
 	  gbp_endpoint_t *ge0;
 	  vlib_buffer_t *b0;
+	  sclass_t sclass0;
 
 	  next0 = GBP_LEARN_NEXT_DROP;
 	  bi0 = from[0];
@@ -516,7 +518,7 @@
 
 	  b0 = vlib_get_buffer (vm, bi0);
 	  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
-	  epg0 = vnet_buffer2 (b0)->gbp.src_epg;
+	  sclass0 = vnet_buffer2 (b0)->gbp.sclass;
 	  ip6_0 = NULL;
 	  ip4_0 = NULL;
 
@@ -551,7 +553,7 @@
 		  if (!t0)
 		    {
 		      gbp_learn_ip6_dp (&ip6_0->src_address,
-					fib_index0, sw_if_index0, epg0,
+					fib_index0, sw_if_index0, sclass0,
 					&outer_src, &outer_dst);
 		    }
 		}
@@ -582,7 +584,7 @@
 		  if (!t0)
 		    {
 		      gbp_learn_ip4_dp (&ip4_0->src_address,
-					fib_index0, sw_if_index0, epg0,
+					fib_index0, sw_if_index0, sclass0,
 					&outer_src, &outer_dst);
 		    }
 		}
@@ -610,7 +612,7 @@
 	      t->new = (NULL == ge0);
 	      t->throttled = t0;
 	      t->sw_if_index = sw_if_index0;
-	      t->epg = epg0;
+	      t->sclass = sclass0;
 	    }
 
 	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
@@ -632,10 +634,10 @@
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   gbp_learn_l3_trace_t *t = va_arg (*args, gbp_learn_l3_trace_t *);
 
-  s = format (s, "new:%d throttled:%d ip:%U itf:%d epg:%d",
+  s = format (s, "new:%d throttled:%d ip:%U itf:%d sclass:%d",
 	      t->new, t->throttled,
 	      format_ip46_address, &t->ip, IP46_TYPE_ANY, t->sw_if_index,
-	      t->epg);
+	      t->sclass);
 
   return s;
 }
diff --git a/src/plugins/gbp/gbp_policy_dpo.c b/src/plugins/gbp/gbp_policy_dpo.c
index ce628e5..c52dcc4 100644
--- a/src/plugins/gbp/gbp_policy_dpo.c
+++ b/src/plugins/gbp/gbp_policy_dpo.c
@@ -92,7 +92,7 @@
 
 void
 gbp_policy_dpo_add_or_lock (dpo_proto_t dproto,
-			    epg_id_t epg, u32 sw_if_index, dpo_id_t * dpo)
+			    sclass_t sclass, u32 sw_if_index, dpo_id_t * dpo)
 {
   gbp_policy_dpo_t *gpd;
   dpo_id_t parent = DPO_INVALID;
@@ -101,7 +101,7 @@
 
   gpd->gpd_proto = dproto;
   gpd->gpd_sw_if_index = sw_if_index;
-  gpd->gpd_epg = epg;
+  gpd->gpd_sclass = sclass;
 
   if (~0 != sw_if_index)
     {
@@ -127,9 +127,9 @@
   gbp_policy_dpo_t *gpd = gbp_policy_dpo_get (index);
   vnet_main_t *vnm = vnet_get_main ();
 
-  s = format (s, "gbp-policy-dpo: %U, epg:%d out:%U",
+  s = format (s, "gbp-policy-dpo: %U, sclass:%d out:%U",
 	      format_dpo_proto, gpd->gpd_proto,
-	      gpd->gpd_epg,
+	      (int) gpd->gpd_sclass,
 	      format_vnet_sw_if_index_name, vnm, gpd->gpd_sw_if_index);
   s = format (s, "\n%U", format_white_space, indent + 2);
   s = format (s, "%U", format_dpo_id, &gpd->gpd_dpo, indent + 4);
@@ -150,7 +150,7 @@
   gpd = gbp_policy_dpo_get (original->dpoi_index);
 
   gpd_clone->gpd_proto = gpd->gpd_proto;
-  gpd_clone->gpd_epg = gpd->gpd_epg;
+  gpd_clone->gpd_sclass = gpd->gpd_sclass;
   gpd_clone->gpd_sw_if_index = gpd->gpd_sw_if_index;
 
   dpo_stack (gbp_policy_dpo_type,
@@ -290,10 +290,10 @@
 	      goto trace;
 	    }
 
-	  key0.gck_src = vnet_buffer2 (b0)->gbp.src_epg;
-	  key0.gck_dst = gpd0->gpd_epg;
+	  key0.gck_src = vnet_buffer2 (b0)->gbp.sclass;
+	  key0.gck_dst = gpd0->gpd_sclass;
 
-	  if (EPG_INVALID != key0.gck_src)
+	  if (SCLASS_INVALID != key0.gck_src)
 	    {
 	      if (PREDICT_FALSE (key0.gck_src == key0.gck_dst))
 		{
diff --git a/src/plugins/gbp/gbp_policy_dpo.h b/src/plugins/gbp/gbp_policy_dpo.h
index 097205b..3a4264d 100644
--- a/src/plugins/gbp/gbp_policy_dpo.h
+++ b/src/plugins/gbp/gbp_policy_dpo.h
@@ -33,9 +33,9 @@
   dpo_proto_t gpd_proto;
 
   /**
-   * EPG
+   * SClass
    */
-  epg_id_t gpd_epg;
+  sclass_t gpd_sclass;
 
   /**
    * output sw_if_index
@@ -54,7 +54,7 @@
 } gbp_policy_dpo_t;
 
 extern void gbp_policy_dpo_add_or_lock (dpo_proto_t dproto,
-					epg_id_t epg,
+					sclass_t sclass,
 					u32 sw_if_index, dpo_id_t * dpo);
 
 extern dpo_type_t gbp_policy_dpo_get_type (void);
diff --git a/src/plugins/gbp/gbp_policy_node.c b/src/plugins/gbp/gbp_policy_node.c
index aaf362d..ff21e7d 100644
--- a/src/plugins/gbp/gbp_policy_node.c
+++ b/src/plugins/gbp/gbp_policy_node.c
@@ -49,7 +49,7 @@
 typedef struct gbp_policy_trace_t_
 {
   /* per-pkt trace data */
-  u32 src_epg;
+  u32 sclass;
   u32 dst_epg;
   u32 acl_index;
   u32 allowed;
@@ -175,14 +175,14 @@
 					 vnet_buffer (b0)->l2.bd_index);
 
 	  if (NULL != ge0)
-	    key0.gck_dst = ge0->ge_fwd.gef_epg_id;
+	    key0.gck_dst = ge0->ge_fwd.gef_sclass;
 	  else
 	    /* If you cannot determine the destination EP then drop */
 	    goto trace;
 
-	  key0.gck_src = vnet_buffer2 (b0)->gbp.src_epg;
+	  key0.gck_src = vnet_buffer2 (b0)->gbp.sclass;
 
-	  if (EPG_INVALID != key0.gck_src)
+	  if (SCLASS_INVALID != key0.gck_src)
 	    {
 	      if (PREDICT_FALSE (key0.gck_src == key0.gck_dst))
 		{
@@ -305,7 +305,7 @@
 	    {
 	      gbp_policy_trace_t *t =
 		vlib_add_trace (vm, node, b0, sizeof (*t));
-	      t->src_epg = key0.gck_src;
+	      t->sclass = key0.gck_src;
 	      t->dst_epg = key0.gck_dst;
 	      t->acl_index = (gc0 ? gc0->gc_acl_index : ~0),
 		t->allowed = (next0 != GBP_POLICY_NEXT_DENY);
@@ -346,8 +346,8 @@
   gbp_policy_trace_t *t = va_arg (*args, gbp_policy_trace_t *);
 
   s =
-    format (s, "src:%d, dst:%d, acl:%d allowed:%d",
-	    t->src_epg, t->dst_epg, t->acl_index, t->allowed);
+    format (s, "sclass:%d, dst:%d, acl:%d allowed:%d",
+	    t->sclass, t->dst_epg, t->acl_index, t->allowed);
 
   return s;
 }
diff --git a/src/plugins/gbp/gbp_recirc.c b/src/plugins/gbp/gbp_recirc.c
index cee6381..87d0d05 100644
--- a/src/plugins/gbp/gbp_recirc.c
+++ b/src/plugins/gbp/gbp_recirc.c
@@ -53,13 +53,13 @@
   gbp_recirc_t *gr = va_arg (*args, gbp_recirc_t *);
   vnet_main_t *vnm = vnet_get_main ();
 
-  return format (s, "  %U, epg:%d, ext:%d",
+  return format (s, "  %U, sclass:%d, ext:%d",
 		 format_vnet_sw_if_index_name, vnm,
-		 gr->gr_sw_if_index, gr->gr_epg, gr->gr_is_ext);
+		 gr->gr_sw_if_index, gr->gr_sclass, gr->gr_is_ext);
 }
 
 int
-gbp_recirc_add (u32 sw_if_index, epg_id_t epg_id, u8 is_ext)
+gbp_recirc_add (u32 sw_if_index, sclass_t sclass, u8 is_ext)
 {
   gbp_recirc_t *gr;
   index_t gri;
@@ -74,7 +74,7 @@
       fib_protocol_t fproto;
       index_t ggi;
 
-      ggi = gbp_endpoint_group_find (epg_id);
+      ggi = gbp_endpoint_group_find (sclass);
 
       if (INDEX_INVALID == ggi)
 	return (VNET_API_ERROR_NO_SUCH_ENTRY);
@@ -83,7 +83,7 @@
       pool_get_zero (gbp_recirc_pool, gr);
       gri = gr - gbp_recirc_pool;
 
-      gr->gr_epg = epg_id;
+      gr->gr_sclass = sclass;
       gr->gr_is_ext = is_ext;
       gr->gr_sw_if_index = sw_if_index;
 
@@ -135,7 +135,7 @@
 	  gbp_endpoint_update_and_lock (GBP_ENDPOINT_SRC_CP,
 					gr->gr_sw_if_index,
 					NULL, &mac, INDEX_INVALID,
-					INDEX_INVALID, gr->gr_epg,
+					INDEX_INVALID, gr->gr_sclass,
 					GBP_ENDPOINT_FLAG_NONE,
 					NULL, NULL, &gr->gr_ep);
 	  vnet_feature_enable_disable ("ip4-unicast",
diff --git a/src/plugins/gbp/gbp_recirc.h b/src/plugins/gbp/gbp_recirc.h
index 86b857d..3af77b4 100644
--- a/src/plugins/gbp/gbp_recirc.h
+++ b/src/plugins/gbp/gbp_recirc.h
@@ -30,7 +30,7 @@
   /**
    * EPG ID that packets will classify to when they arrive on this recirc
    */
-  epg_id_t gr_epg;
+  sclass_t gr_sclass;
 
   /**
    * The index of the EPG
@@ -59,7 +59,7 @@
   index_t gr_ep;
 } gbp_recirc_t;
 
-extern int gbp_recirc_add (u32 sw_if_index, epg_id_t epg_id, u8 is_ext);
+extern int gbp_recirc_add (u32 sw_if_index, sclass_t sclass, u8 is_ext);
 extern int gbp_recirc_delete (u32 sw_if_index);
 
 typedef walk_rc_t (*gbp_recirc_cb_t) (gbp_recirc_t * gbpe, void *ctx);
diff --git a/src/plugins/gbp/gbp_route_domain.c b/src/plugins/gbp/gbp_route_domain.c
index 6a3f4fa..67b6915 100644
--- a/src/plugins/gbp/gbp_route_domain.c
+++ b/src/plugins/gbp/gbp_route_domain.c
@@ -15,7 +15,6 @@
 
 #include <plugins/gbp/gbp_route_domain.h>
 #include <plugins/gbp/gbp_endpoint.h>
-#include <plugins/gbp/gbp_sclass.h>
 
 #include <vnet/dpo/dvr_dpo.h>
 #include <vnet/fib/fib_table.h>
@@ -183,8 +182,6 @@
 					     &ADJ_BCAST_ADDR,
 					     grd->grd_uu_sw_if_index[fproto],
 					     rewrite);
-
-	    gbp_sclass_enable_ip (grd->grd_uu_sw_if_index[fproto]);
 	  }
 	else
 	  {
@@ -226,8 +223,6 @@
 			  fproto, FIB_SOURCE_PLUGIN_HI);
 	if (INDEX_INVALID != grd->grd_adj[fproto])
 	  adj_unlock (grd->grd_adj[fproto]);
-	if (~0 != grd->grd_uu_sw_if_index[fproto])
-	  gbp_sclass_disable_ip (grd->grd_uu_sw_if_index[fproto]);
       }
 
       gbp_route_domain_db_remove (grd);
diff --git a/src/plugins/gbp/gbp_sclass.c b/src/plugins/gbp/gbp_sclass.c
deleted file mode 100644
index 481ee88..0000000
--- a/src/plugins/gbp/gbp_sclass.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2018 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <plugins/gbp/gbp_sclass.h>
-#include <vnet/l2/l2_input.h>
-#include <vnet/l2/l2_output.h>
-
-gbp_sclass_main_t gbp_sclass_main;
-
-void
-gbp_sclass_enable_l2 (u32 sw_if_index)
-{
-  l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_GBP_SCLASS_2_ID, 1);
-  l2output_intf_bitmap_enable (sw_if_index, L2OUTPUT_FEAT_GBP_ID_2_SCLASS, 1);
-}
-
-void
-gbp_sclass_disable_l2 (u32 sw_if_index)
-{
-  l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_GBP_SCLASS_2_ID, 0);
-  l2output_intf_bitmap_enable (sw_if_index, L2OUTPUT_FEAT_GBP_ID_2_SCLASS, 0);
-}
-
-void
-gbp_sclass_enable_ip (u32 sw_if_index)
-{
-  vnet_feature_enable_disable ("ip4-unicast",
-			       "ip4-gbp-sclass-2-id", sw_if_index, 1, 0, 0);
-  vnet_feature_enable_disable ("ip6-unicast",
-			       "ip6-gbp-sclass-2-id", sw_if_index, 1, 0, 0);
-  vnet_feature_enable_disable ("ip4-output",
-			       "ip4-gbp-id-2-sclass", sw_if_index, 1, 0, 0);
-  vnet_feature_enable_disable ("ip6-output",
-			       "ip6-gbp-id-2-sclass", sw_if_index, 1, 0, 0);
-}
-
-void
-gbp_sclass_disable_ip (u32 sw_if_index)
-{
-  vnet_feature_enable_disable ("ip4-unicast",
-			       "ip4-gbp-sclass-2-id", sw_if_index, 0, 0, 0);
-  vnet_feature_enable_disable ("ip6-unicast",
-			       "ip6-gbp-sclass-2-id", sw_if_index, 0, 0, 0);
-  vnet_feature_enable_disable ("ip4-output",
-			       "ip4-gbp-id-2-sclass", sw_if_index, 0, 0, 0);
-  vnet_feature_enable_disable ("ip6-output",
-			       "ip6-gbp-id-2-sclass", sw_if_index, 0, 0, 0);
-}
-
-static clib_error_t *
-gbp_sclass_init (vlib_main_t * vm)
-{
-  gbp_sclass_main_t *glm = &gbp_sclass_main;
-  vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "l2-gbp-sclass-2-id");
-
-  /* Initialize the feature next-node indices */
-  feat_bitmap_init_next_nodes (vm,
-			       node->index,
-			       L2INPUT_N_FEAT,
-			       l2input_get_feat_names (),
-			       glm->gel_l2_input_feat_next);
-
-  node = vlib_get_node_by_name (vm, (u8 *) "l2-gbp-id-2-sclass");
-  feat_bitmap_init_next_nodes (vm,
-			       node->index,
-			       L2OUTPUT_N_FEAT,
-			       l2output_get_feat_names (),
-			       glm->gel_l2_output_feat_next);
-
-  return (NULL);
-}
-
-VLIB_INIT_FUNCTION (gbp_sclass_init);
-
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/plugins/gbp/gbp_sclass.h b/src/plugins/gbp/gbp_sclass.h
deleted file mode 100644
index 75e35c3..0000000
--- a/src/plugins/gbp/gbp_sclass.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2018 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GBP_SCLASS_H__
-#define __GBP_SCLASS_H__
-
-#include <plugins/gbp/gbp.h>
-
-/**
- * Grouping of global data for the GBP source EPG classification feature
- */
-typedef struct gbp_sclass_main_t_
-{
-  /**
-   * Next nodes for L2 output features
-   */
-  u32 gel_l2_input_feat_next[32];
-  u32 gel_l2_output_feat_next[32];
-} gbp_sclass_main_t;
-
-extern gbp_sclass_main_t gbp_sclass_main;
-
-extern void gbp_sclass_enable_l2 (u32 sw_if_index);
-extern void gbp_sclass_disable_l2 (u32 sw_if_index);
-extern void gbp_sclass_enable_ip (u32 sw_if_index);
-extern void gbp_sclass_disable_ip (u32 sw_if_index);
-
-#endif
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/plugins/gbp/gbp_sclass_node.c b/src/plugins/gbp/gbp_sclass_node.c
deleted file mode 100644
index 35b2384..0000000
--- a/src/plugins/gbp/gbp_sclass_node.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 2018 Cisco and/or its affiliates.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <plugins/gbp/gbp_sclass.h>
-#include <vnet/l2/l2_input.h>
-#include <vnet/l2/l2_output.h>
-
-#define foreach_gbp_sclass                      \
-  _(DROP,    "drop")
-
-typedef enum
-{
-#define _(sym,str) GBP_SCLASS_NEXT_##sym,
-  foreach_gbp_sclass
-#undef _
-    GBP_SCLASS_N_NEXT,
-} gbp_sclass_next_t;
-
-typedef struct gbp_sclass_trace_t_
-{
-  /* per-pkt trace data */
-  u32 epg;
-  u32 sclass;
-} gbp_sclass_trace_t;
-
-static_always_inline uword
-gbp_sclass_inline (vlib_main_t * vm,
-		   vlib_node_runtime_t * node,
-		   vlib_frame_t * frame, int is_id_2_sclass, int is_l2)
-{
-  u32 n_left_from, *from, *to_next, next_index;
-  gbp_sclass_main_t *glm;
-
-  glm = &gbp_sclass_main;
-  next_index = 0;
-  n_left_from = frame->n_vectors;
-  from = vlib_frame_vector_args (frame);
-
-  while (n_left_from > 0)
-    {
-      u32 n_left_to_next;
-
-      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
-
-      while (n_left_from > 0 && n_left_to_next > 0)
-	{
-	  gbp_sclass_next_t next0;
-	  vlib_buffer_t *b0;
-	  epg_id_t epg0;
-	  u16 sclass0;
-	  u32 bi0;
-
-	  next0 = GBP_SCLASS_NEXT_DROP;
-	  bi0 = from[0];
-	  to_next[0] = bi0;
-	  from += 1;
-	  to_next += 1;
-	  n_left_from -= 1;
-	  n_left_to_next -= 1;
-
-	  b0 = vlib_get_buffer (vm, bi0);
-
-	  if (is_id_2_sclass)
-	    {
-	      // output direction - convert from the SRC-EPD to the sclass
-	      gbp_endpoint_group_t *gg;
-
-	      epg0 = vnet_buffer2 (b0)->gbp.src_epg;
-	      gg = gbp_epg_get (epg0);
-
-	      if (NULL != gg)
-		{
-		  sclass0 = vnet_buffer2 (b0)->gbp.sclass = gg->gg_sclass;
-		  if (is_l2)
-		    next0 =
-		      vnet_l2_feature_next (b0, glm->gel_l2_output_feat_next,
-					    L2OUTPUT_FEAT_GBP_ID_2_SCLASS);
-		  else
-		    vnet_feature_next (&next0, b0);
-		}
-	      else
-		sclass0 = 0;
-	    }
-	  else
-	    {
-	      /* input direction - convert from the sclass to the SRC-EGD */
-	      sclass0 = vnet_buffer2 (b0)->gbp.sclass;
-	      vnet_buffer2 (b0)->gbp.src_epg =
-		gbp_epg_sclass_2_id (vnet_buffer2 (b0)->gbp.sclass);
-	      epg0 = vnet_buffer2 (b0)->gbp.src_epg;
-
-	      if (EPG_INVALID != epg0)
-		{
-		  if (is_l2)
-		    next0 =
-		      vnet_l2_feature_next (b0, glm->gel_l2_input_feat_next,
-					    L2INPUT_FEAT_GBP_SCLASS_2_ID);
-		  else
-		    vnet_feature_next (&next0, b0);
-		}
-	    }
-
-	  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
-	    {
-	      gbp_sclass_trace_t *t =
-		vlib_add_trace (vm, node, b0, sizeof (*t));
-	      t->epg = epg0;
-	      t->sclass = sclass0;
-	    }
-
-	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
-					   to_next, n_left_to_next,
-					   bi0, next0);
-	}
-
-      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
-    }
-
-  return frame->n_vectors;
-}
-
-VLIB_NODE_FN (l2_gbp_id_2_sclass_node) (vlib_main_t * vm,
-					vlib_node_runtime_t * node,
-					vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 1, 1));
-}
-
-VLIB_NODE_FN (l2_gbp_sclass_2_id_node) (vlib_main_t * vm,
-					vlib_node_runtime_t * node,
-					vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 0, 1));
-}
-
-VLIB_NODE_FN (ip4_gbp_id_2_sclass_node) (vlib_main_t * vm,
-					 vlib_node_runtime_t * node,
-					 vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 1, 0));
-}
-
-VLIB_NODE_FN (ip4_gbp_sclass_2_id_node) (vlib_main_t * vm,
-					 vlib_node_runtime_t * node,
-					 vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 0, 0));
-}
-
-VLIB_NODE_FN (ip6_gbp_id_2_sclass_node) (vlib_main_t * vm,
-					 vlib_node_runtime_t * node,
-					 vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 1, 0));
-}
-
-VLIB_NODE_FN (ip6_gbp_sclass_2_id_node) (vlib_main_t * vm,
-					 vlib_node_runtime_t * node,
-					 vlib_frame_t * frame)
-{
-  return (gbp_sclass_inline (vm, node, frame, 0, 0));
-}
-
-/* packet trace format function */
-static u8 *
-format_gbp_sclass_trace (u8 * s, va_list * args)
-{
-  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
-  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
-  gbp_sclass_trace_t *t = va_arg (*args, gbp_sclass_trace_t *);
-
-  s = format (s, "epg:%d sclass:%d", t->epg, t->sclass);
-
-  return s;
-}
-
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (l2_gbp_id_2_sclass_node) = {
-  .name = "l2-gbp-id-2-sclass",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-VLIB_REGISTER_NODE (l2_gbp_sclass_2_id_node) = {
-  .name = "l2-gbp-sclass-2-id",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-
-VLIB_REGISTER_NODE (ip4_gbp_id_2_sclass_node) = {
-  .name = "ip4-gbp-id-2-sclass",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-VLIB_REGISTER_NODE (ip4_gbp_sclass_2_id_node) = {
-  .name = "ip4-gbp-sclass-2-id",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-
-VLIB_REGISTER_NODE (ip6_gbp_id_2_sclass_node) = {
-  .name = "ip6-gbp-id-2-sclass",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-VLIB_REGISTER_NODE (ip6_gbp_sclass_2_id_node) = {
-  .name = "ip6-gbp-sclass-2-id",
-  .vector_size = sizeof (u32),
-  .format_trace = format_gbp_sclass_trace,
-  .type = VLIB_NODE_TYPE_INTERNAL,
-
-  .n_next_nodes = GBP_SCLASS_N_NEXT,
-
-  .next_nodes = {
-    [GBP_SCLASS_NEXT_DROP] = "error-drop",
-  },
-};
-
-
-VNET_FEATURE_INIT (ip4_gbp_sclass_2_id_feat, static) =
-{
-  .arc_name = "ip4-unicast",
-  .node_name = "ip4-gbp-sclass-2-id",
-  .runs_before = VNET_FEATURES ("gbp-learn-ip4"),
-};
-VNET_FEATURE_INIT (ip6_gbp_sclass_2_id_feat, static) =
-{
-  .arc_name = "ip6-unicast",
-  .node_name = "ip6-gbp-sclass-2-id",
-  .runs_before = VNET_FEATURES ("gbp-learn-ip6"),
-};
-VNET_FEATURE_INIT (ip4_gbp_id_2_sclass_feat, static) =
-{
-  .arc_name = "ip4-output",
-  .node_name = "ip4-gbp-id-2-sclass",
-};
-VNET_FEATURE_INIT (ip6_gbp_id_2_sclass_feat, static) =
-{
-  .arc_name = "ip6-output",
-  .node_name = "ip6-gbp-id-2-sclass",
-};
-/* *INDENT-ON* */
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
diff --git a/src/plugins/gbp/gbp_subnet.c b/src/plugins/gbp/gbp_subnet.c
index 0c8d3ae..5e56c82 100644
--- a/src/plugins/gbp/gbp_subnet.c
+++ b/src/plugins/gbp/gbp_subnet.c
@@ -43,12 +43,12 @@
   {
     struct
     {
-      epg_id_t gs_epg;
+      sclass_t gs_sclass;
       u32 gs_sw_if_index;
     } gs_stitched_external;
     struct
     {
-      epg_id_t gs_epg;
+      sclass_t gs_sclass;
     } gs_l3_out;
   };
 
@@ -155,15 +155,15 @@
 }
 
 static int
-gbp_subnet_external_add (gbp_subnet_t * gs, u32 sw_if_index, epg_id_t epg)
+gbp_subnet_external_add (gbp_subnet_t * gs, u32 sw_if_index, sclass_t sclass)
 {
   dpo_id_t gpd = DPO_INVALID;
 
-  gs->gs_stitched_external.gs_epg = epg;
+  gs->gs_stitched_external.gs_sclass = sclass;
   gs->gs_stitched_external.gs_sw_if_index = sw_if_index;
 
   gbp_policy_dpo_add_or_lock (fib_proto_to_dpo (gs->gs_key->gsk_pfx.fp_proto),
-			      gs->gs_stitched_external.gs_epg,
+			      gs->gs_stitched_external.gs_sclass,
 			      gs->gs_stitched_external.gs_sw_if_index, &gpd);
 
   gs->gs_fei = fib_table_entry_special_dpo_update (gs->gs_key->gsk_fib_index,
@@ -179,14 +179,14 @@
 }
 
 static int
-gbp_subnet_l3_out_add (gbp_subnet_t * gs, u32 sw_if_index, epg_id_t epg)
+gbp_subnet_l3_out_add (gbp_subnet_t * gs, u32 sw_if_index, sclass_t sclass)
 {
   dpo_id_t gpd = DPO_INVALID;
 
-  gs->gs_l3_out.gs_epg = epg;
+  gs->gs_l3_out.gs_sclass = sclass;
 
   gbp_policy_dpo_add_or_lock (fib_proto_to_dpo (gs->gs_key->gsk_pfx.fp_proto),
-			      gs->gs_l3_out.gs_epg, ~0, &gpd);
+			      gs->gs_l3_out.gs_sclass, ~0, &gpd);
 
   gs->gs_fei = fib_table_entry_special_dpo_add (gs->gs_key->gsk_fib_index,
 						&gs->gs_key->gsk_pfx,
@@ -238,7 +238,7 @@
 int
 gbp_subnet_add (u32 rd_id,
 		const fib_prefix_t * pfx,
-		gbp_subnet_type_t type, u32 sw_if_index, epg_id_t epg)
+		gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass)
 {
   gbp_route_domain_t *grd;
   index_t grdi, gsi;
@@ -273,13 +273,13 @@
       rv = gbp_subnet_internal_add (gs);
       break;
     case GBP_SUBNET_STITCHED_EXTERNAL:
-      rv = gbp_subnet_external_add (gs, sw_if_index, epg);
+      rv = gbp_subnet_external_add (gs, sw_if_index, sclass);
       break;
     case GBP_SUBNET_TRANSPORT:
       rv = gbp_subnet_transport_add (gs);
       break;
     case GBP_SUBNET_L3_OUT:
-      rv = gbp_subnet_l3_out_add (gs, sw_if_index, epg);
+      rv = gbp_subnet_l3_out_add (gs, sw_if_index, sclass);
       break;
     }
 
@@ -292,9 +292,9 @@
   gbp_route_domain_t *grd;
   gbp_subnet_t *gs;
   u32 sw_if_index;
-  epg_id_t epg;
+  sclass_t sclass;
 
-  epg = EPG_INVALID;
+  sclass = SCLASS_INVALID;
   sw_if_index = ~0;
 
   /* *INDENT-OFF* */
@@ -310,15 +310,15 @@
         break;
       case GBP_SUBNET_STITCHED_EXTERNAL:
         sw_if_index = gs->gs_stitched_external.gs_sw_if_index;
-        epg = gs->gs_stitched_external.gs_epg;
+        sclass = gs->gs_stitched_external.gs_sclass;
         break;
       case GBP_SUBNET_L3_OUT:
-        epg = gs->gs_l3_out.gs_epg;
+        sclass = gs->gs_l3_out.gs_sclass;
         break;
       }
 
     if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx,
-                         gs->gs_type, sw_if_index, epg, ctx))
+                         gs->gs_type, sw_if_index, sclass, ctx))
       break;
   }));
   /* *INDENT-ON* */
@@ -373,12 +373,12 @@
     case GBP_SUBNET_TRANSPORT:
       break;
     case GBP_SUBNET_STITCHED_EXTERNAL:
-      s = format (s, " {epg:%d %U}", gs->gs_stitched_external.gs_epg,
+      s = format (s, " {sclass:%d %U}", gs->gs_stitched_external.gs_sclass,
 		  format_vnet_sw_if_index_name,
 		  vnet_get_main (), gs->gs_stitched_external.gs_sw_if_index);
       break;
     case GBP_SUBNET_L3_OUT:
-      s = format (s, " {epg:%d}", gs->gs_l3_out.gs_epg);
+      s = format (s, " {sclass:%d}", gs->gs_l3_out.gs_sclass);
       break;
     }
 
diff --git a/src/plugins/gbp/gbp_subnet.h b/src/plugins/gbp/gbp_subnet.h
index 5fbd4b2..b792a1b 100644
--- a/src/plugins/gbp/gbp_subnet.h
+++ b/src/plugins/gbp/gbp_subnet.h
@@ -29,7 +29,7 @@
 extern int gbp_subnet_add (u32 rd_id,
 			   const fib_prefix_t * pfx,
 			   gbp_subnet_type_t type,
-			   u32 sw_if_index, epg_id_t epg);
+			   u32 sw_if_index, sclass_t sclass);
 
 extern int gbp_subnet_del (u32 rd_id, const fib_prefix_t * pfx);
 
@@ -37,7 +37,7 @@
 				      const fib_prefix_t * pfx,
 				      gbp_subnet_type_t type,
 				      u32 sw_if_index,
-				      epg_id_t epg, void *ctx);
+				      sclass_t sclass, void *ctx);
 
 extern void gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx);
 
diff --git a/src/plugins/gbp/gbp_types.h b/src/plugins/gbp/gbp_types.h
index 0faa74b..5bd9735 100644
--- a/src/plugins/gbp/gbp_types.h
+++ b/src/plugins/gbp/gbp_types.h
@@ -18,8 +18,10 @@
 
 #include <vnet/vnet.h>
 
-typedef u16 epg_id_t;
-#define EPG_INVALID ((u16)~0)
+typedef u32 vnid_t;
+#define VNID_INVALID ((u16)~0)
+
+typedef u16 sclass_t;
 #define SCLASS_INVALID ((u16)~0)
 
 #endif
diff --git a/src/plugins/gbp/gbp_vxlan.c b/src/plugins/gbp/gbp_vxlan.c
index c0e88fd..286345e 100644
--- a/src/plugins/gbp/gbp_vxlan.c
+++ b/src/plugins/gbp/gbp_vxlan.c
@@ -18,7 +18,6 @@
 #include <plugins/gbp/gbp_learn.h>
 #include <plugins/gbp/gbp_bridge_domain.h>
 #include <plugins/gbp/gbp_route_domain.h>
-#include <plugins/gbp/gbp_sclass.h>
 
 #include <vnet/vxlan-gbp/vxlan_gbp.h>
 #include <vlibmemory/api.h>
@@ -169,9 +168,8 @@
 	  vxr->vxr_itf = gbp_itf_add_and_lock (vxr->vxr_sw_if_index,
 					       gt->gt_bd_index);
 
-	  ofeat = (L2OUTPUT_FEAT_GBP_POLICY_MAC |
-		   L2OUTPUT_FEAT_GBP_ID_2_SCLASS);
-	  ifeat = L2INPUT_FEAT_GBP_SCLASS_2_ID;
+	  ofeat = L2OUTPUT_FEAT_GBP_POLICY_MAC;
+	  ifeat = L2INPUT_FEAT_NONE;
 
 	  if (!(gbd->gb_flags & GBP_BD_FLAG_DO_NOT_LEARN))
 	    ifeat |= L2INPUT_FEAT_GBP_LEARN;
@@ -193,7 +191,6 @@
 			   grd->grd_table_id[fproto], 1);
 
 	  gbp_learn_enable (vxr->vxr_sw_if_index, GBP_LEARN_MODE_L3);
-	  gbp_sclass_enable_ip (vxr->vxr_sw_if_index);
 	}
     }
 
@@ -283,7 +280,6 @@
 
       FOR_EACH_FIB_IP_PROTOCOL (fproto)
 	ip_table_bind (fproto, vxr->vxr_sw_if_index, 0, 0);
-      gbp_sclass_disable_ip (vxr->vxr_sw_if_index);
       gbp_learn_disable (vxr->vxr_sw_if_index, GBP_LEARN_MODE_L3);
     }
 
@@ -541,7 +537,6 @@
 	  gt->gt_itf = gbp_itf_add_and_lock (gt->gt_sw_if_index,
 					     gt->gt_bd_index);
 	  gbp_learn_enable (gt->gt_sw_if_index, GBP_LEARN_MODE_L2);
-	  gbp_sclass_enable_l2 (gt->gt_sw_if_index);
 	}
       else
 	{
@@ -554,7 +549,6 @@
 	  grd->grd_vni_sw_if_index = gt->gt_sw_if_index;
 
 	  gbp_learn_enable (gt->gt_sw_if_index, GBP_LEARN_MODE_L3);
-	  gbp_sclass_enable_ip (gt->gt_sw_if_index);
 
 	  ip4_sw_interface_enable_disable (gt->gt_sw_if_index, 1);
 	  ip6_sw_interface_enable_disable (gt->gt_sw_if_index, 1);
@@ -620,7 +614,6 @@
       if (GBP_VXLAN_TUN_L2 == gt->gt_layer)
 	{
 	  gbp_learn_disable (gt->gt_sw_if_index, GBP_LEARN_MODE_L2);
-	  gbp_sclass_disable_l2 (gt->gt_sw_if_index);
 	  gbp_itf_unlock (gt->gt_itf);
 	  gbp_bridge_domain_unlock (gt->gt_gbd);
 	}
@@ -635,7 +628,6 @@
 	  ip6_sw_interface_enable_disable (gt->gt_sw_if_index, 0);
 
 	  gbp_learn_disable (gt->gt_sw_if_index, GBP_LEARN_MODE_L3);
-	  gbp_sclass_disable_ip (gt->gt_sw_if_index);
 	  gbp_route_domain_unlock (gt->gt_grd);
 	}
 
diff --git a/src/plugins/gbp/gbp_vxlan_node.c b/src/plugins/gbp/gbp_vxlan_node.c
index c49f74a..413a9f4 100644
--- a/src/plugins/gbp/gbp_vxlan_node.c
+++ b/src/plugins/gbp/gbp_vxlan_node.c
@@ -17,7 +17,6 @@
 #include <plugins/gbp/gbp_learn.h>
 #include <plugins/gbp/gbp_bridge_domain.h>
 #include <plugins/gbp/gbp_route_domain.h>
-#include <plugins/gbp/gbp_sclass.h>
 
 #include <vnet/vxlan-gbp/vxlan_gbp.h>
 #include <vlibmemory/api.h>
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 7afd16b..c9b99c9 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -391,11 +391,7 @@
   {
     u8 __unused;
     u8 flags;
-    union
-    {
-      u16 src_epg;
-      u16 sclass;
-    };
+    u16 sclass;
   } gbp;
 
   /**
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index 5b20866..2cc10f9 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -578,8 +578,8 @@
   s = format (s, "loop_counter: %d", o->loop_counter);
   vec_add1 (s, '\n');
 
-  s = format (s, "gbp.flags: %x, gbp.src_epg: %d",
-	      (u32) (o->gbp.flags), (u32) (o->gbp.src_epg));
+  s = format (s, "gbp.flags: %x, gbp.sclass: %d",
+	      (u32) (o->gbp.flags), (u32) (o->gbp.sclass));
   vec_add1 (s, '\n');
 
   s = format (s, "pg_replay_timestamp: %llu", (u32) (o->pg_replay_timestamp));
diff --git a/src/vnet/l2/l2_input.h b/src/vnet/l2/l2_input.h
index 12e7e54..93da127 100644
--- a/src/vnet/l2/l2_input.h
+++ b/src/vnet/l2/l2_input.h
@@ -114,7 +114,6 @@
  _(GBP_NULL_CLASSIFY, "gbp-null-classify")      \
  _(GBP_SRC_CLASSIFY,  "gbp-src-classify")       \
  _(GBP_LPM_CLASSIFY,  "l2-gbp-lpm-classify")    \
- _(GBP_SCLASS_2_ID, "l2-gbp-sclass-2-id")         \
  _(VTR,           "l2-input-vtr")               \
  _(L2_IP_QOS_RECORD, "l2-ip-qos-record")        \
  _(VPATH,         "vpath-input-l2")             \
diff --git a/src/vnet/l2/l2_output.h b/src/vnet/l2/l2_output.h
index fdb6167..74d2829 100644
--- a/src/vnet/l2/l2_output.h
+++ b/src/vnet/l2/l2_output.h
@@ -81,7 +81,6 @@
 #define foreach_l2output_feat \
  _(OUTPUT,            "interface-output")           \
  _(SPAN,              "span-l2-output")             \
- _(GBP_ID_2_SCLASS,   "l2-gbp-id-2-sclass")          \
  _(GBP_POLICY_PORT,   "gbp-policy-port")            \
  _(GBP_POLICY_MAC,    "gbp-policy-mac")             \
  _(CFM,               "feature-bitmap-drop")        \
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 1b23cff..4304303 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -124,7 +124,7 @@
             self.itf.sw_if_index,
             [self.ip4.encode(), self.ip6.encode()],
             self.vmac.packed,
-            self.epg.epg,
+            self.epg.sclass,
             self.flags,
             self.tun_src.encode(),
             self.tun_dst.encode())
@@ -141,7 +141,7 @@
         return "gbp-endpoint:[%d==%d:%s:%d]" % (self.handle,
                                                 self.itf.sw_if_index,
                                                 self.ip4.address,
-                                                self.epg.epg)
+                                                self.epg.sclass)
 
     def query_vpp_config(self):
         return find_gbp_endpoint(self._test,
@@ -164,7 +164,7 @@
         self._test.vapi.gbp_recirc_add_del(
             1,
             self.recirc.sw_if_index,
-            self.epg.epg,
+            self.epg.sclass,
             self.is_ext)
         self._test.registry.register(self, self._test.logger)
 
@@ -172,7 +172,7 @@
         self._test.vapi.gbp_recirc_add_del(
             0,
             self.recirc.sw_if_index,
-            self.epg.epg,
+            self.epg.sclass,
             self.is_ext)
 
     def __str__(self):
@@ -249,7 +249,7 @@
             self.prefix.encode(),
             self.type,
             sw_if_index=self.sw_if_index if self.sw_if_index else 0xffffffff,
-            epg_id=self.epg if self.epg else 0xffff)
+            sclass=self.epg.sclass if self.epg else 0xffff)
         self._test.registry.register(self, self._test.logger)
 
     def remove_vpp_config(self):
@@ -288,7 +288,7 @@
     GBP Endpoint Group
     """
 
-    def __init__(self, test, epg, sclass, rd, bd, uplink,
+    def __init__(self, test, vnid, sclass, rd, bd, uplink,
                  bvi, bvi_ip4, bvi_ip6=None,
                  retention=VppGbpEndpointRetention()):
         self._test = test
@@ -296,7 +296,7 @@
         self.bvi = bvi
         self.bvi_ip4 = VppIpAddress(bvi_ip4)
         self.bvi_ip6 = VppIpAddress(bvi_ip6)
-        self.epg = epg
+        self.vnid = vnid
         self.bd = bd
         self.rd = rd
         self.sclass = sclass
@@ -306,7 +306,7 @@
 
     def add_vpp_config(self):
         self._test.vapi.gbp_endpoint_group_add(
-            self.epg,
+            self.vnid,
             self.sclass,
             self.bd.bd.bd_id,
             self.rd.rd_id,
@@ -315,18 +315,18 @@
         self._test.registry.register(self, self._test.logger)
 
     def remove_vpp_config(self):
-        self._test.vapi.gbp_endpoint_group_del(self.epg)
+        self._test.vapi.gbp_endpoint_group_del(self.sclass)
 
     def __str__(self):
         return self.object_id()
 
     def object_id(self):
-        return "gbp-endpoint-group:[%d]" % (self.epg)
+        return "gbp-endpoint-group:[%d]" % (self.vnid)
 
     def query_vpp_config(self):
         epgs = self._test.vapi.gbp_endpoint_group_dump()
         for epg in epgs:
-            if epg.epg.epg_id == self.epg:
+            if epg.epg.vnid == self.vnid:
                 return True
         return False
 
@@ -468,8 +468,8 @@
             rules.append(r.encode())
         self._test.vapi.gbp_contract_add_del(
             1,
-            self.src_epg,
-            self.dst_epg,
+            self.src_epg.sclass,
+            self.dst_epg.sclass,
             self.acl_index,
             rules,
             self.allowed_ethertypes)
@@ -478,8 +478,8 @@
     def remove_vpp_config(self):
         self._test.vapi.gbp_contract_add_del(
             0,
-            self.src_epg,
-            self.dst_epg,
+            self.src_epg.sclass,
+            self.dst_epg.sclass,
             self.acl_index,
             [], [])
 
@@ -487,15 +487,15 @@
         return self.object_id()
 
     def object_id(self):
-        return "gbp-contract:[%d:%s:%d]" % (self.src_epg,
-                                            self.dst_epg,
+        return "gbp-contract:[%d:%s:%d]" % (self.src_epg.sclass,
+                                            self.dst_epg.sclass,
                                             self.acl_index)
 
     def query_vpp_config(self):
         cs = self._test.vapi.gbp_contract_dump()
         for c in cs:
-            if c.contract.src_epg == self.src_epg \
-               and c.contract.dst_epg == self.dst_epg:
+            if c.contract.sclass == self.src_epg.sclass \
+               and c.contract.dclass == self.dst_epg.sclass:
                 return True
         return False
 
@@ -748,36 +748,26 @@
         # 3 EPGs, 2 of which share a BD.
         # 2 NAT EPGs, one for floating-IP subnets, the other for internet
         #
-        epgs = [VppGbpEndpointGroup(self, 220, 0, rd0, gbd1, self.pg4,
-                                    self.loop0,
-                                    "10.0.0.128",
-                                    "2001:10::128"),
-                VppGbpEndpointGroup(self, 221, 0, rd0, gbd1, self.pg5,
-                                    self.loop0,
-                                    "10.0.1.128",
-                                    "2001:10:1::128"),
-                VppGbpEndpointGroup(self, 222, 0, rd0, gbd2, self.pg6,
-                                    self.loop1,
-                                    "10.0.2.128",
-                                    "2001:10:2::128"),
-                VppGbpEndpointGroup(self, 333, 0, rd20, gbd20, self.pg7,
-                                    self.loop2,
-                                    "11.0.0.128",
-                                    "3001::128"),
-                VppGbpEndpointGroup(self, 444, 0, rd20, gbd20, self.pg8,
-                                    self.loop2,
-                                    "11.0.0.129",
-                                    "3001::129")]
-        recircs = [VppGbpRecirc(self, epgs[0],
-                                self.loop3),
-                   VppGbpRecirc(self, epgs[1],
-                                self.loop4),
-                   VppGbpRecirc(self, epgs[2],
-                                self.loop5),
-                   VppGbpRecirc(self, epgs[3],
-                                self.loop6, is_ext=True),
-                   VppGbpRecirc(self, epgs[4],
-                                self.loop7, is_ext=True)]
+        epgs = [VppGbpEndpointGroup(self, 220, 1220, rd0, gbd1,
+                                    self.pg4, self.loop0,
+                                    "10.0.0.128", "2001:10::128"),
+                VppGbpEndpointGroup(self, 221, 1221, rd0, gbd1,
+                                    self.pg5, self.loop0,
+                                    "10.0.1.128", "2001:10:1::128"),
+                VppGbpEndpointGroup(self, 222, 1222, rd0, gbd2,
+                                    self.pg6, self.loop1,
+                                    "10.0.2.128", "2001:10:2::128"),
+                VppGbpEndpointGroup(self, 333, 1333, rd20, gbd20,
+                                    self.pg7, self.loop2,
+                                    "11.0.0.128", "3001::128"),
+                VppGbpEndpointGroup(self, 444, 1444, rd20, gbd20,
+                                    self.pg8, self.loop2,
+                                    "11.0.0.129", "3001::129")]
+        recircs = [VppGbpRecirc(self, epgs[0], self.loop3),
+                   VppGbpRecirc(self, epgs[1], self.loop4),
+                   VppGbpRecirc(self, epgs[2], self.loop5),
+                   VppGbpRecirc(self, epgs[3], self.loop6, is_ext=True),
+                   VppGbpRecirc(self, epgs[4], self.loop7, is_ext=True)]
 
         epg_nat = epgs[3]
         recirc_nat = recircs[3]
@@ -1154,7 +1144,7 @@
         rule2 = acl.create_rule(is_ipv6=1, permit_deny=1, proto=17)
         acl_index = acl.add_vpp_config([rule, rule2])
         c1 = VppGbpContract(
-            self, 220, 221, acl_index,
+            self, epgs[0], epgs[1], acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -1174,7 +1164,7 @@
         # contract for the return direction
         #
         c2 = VppGbpContract(
-            self, 221, 220, acl_index,
+            self, epgs[1], epgs[0], acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -1211,7 +1201,7 @@
         # A uni-directional contract from EPG 220 -> 222 'L3 routed'
         #
         c3 = VppGbpContract(
-            self, 220, 222, acl_index,
+            self, epgs[0], epgs[2], acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -1253,33 +1243,33 @@
             self, rd0, "0.0.0.0", 0,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=recirc_nat.recirc.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         se2 = VppGbpSubnet(
             self, rd0, "11.0.0.0", 8,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=recirc_nat.recirc.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         se16 = VppGbpSubnet(
             self, rd0, "::", 0,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=recirc_nat.recirc.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         # in the NAT RD an external subnet via the NAT EPG's uplink
         se3 = VppGbpSubnet(
             self, rd20, "0.0.0.0", 0,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=epg_nat.uplink.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         se36 = VppGbpSubnet(
             self, rd20, "::", 0,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=epg_nat.uplink.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         se4 = VppGbpSubnet(
             self, rd20, "11.0.0.0", 8,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_STITCHED_EXTERNAL,
             sw_if_index=epg_nat.uplink.sw_if_index,
-            epg=epg_nat.epg)
+            epg=epg_nat)
         se1.add_vpp_config()
         se2.add_vpp_config()
         se16.add_vpp_config()
@@ -1316,7 +1306,7 @@
 
         acl_index2 = acl2.add_vpp_config([rule, rule2])
         c4 = VppGbpContract(
-            self, 220, 333, acl_index2,
+            self, epgs[0], epgs[3], acl_index2,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -1357,7 +1347,7 @@
                                         pkt_inter_epg_220_from_global * 65)
 
         c5 = VppGbpContract(
-            self, 333, 220, acl_index2,
+            self, epgs[3], epgs[0], acl_index2,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -1860,7 +1850,7 @@
         rule2 = acl.create_rule(is_ipv6=1, permit_deny=1, proto=17)
         acl_index = acl.add_vpp_config([rule, rule2])
         c1 = VppGbpContract(
-            self, 220, 330, acl_index,
+            self, epg_220, epg_330, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -2755,7 +2745,7 @@
         # test the src-ip hash mode
         #
         c1 = VppGbpContract(
-            self, 220, 222, acl_index,
+            self, epg_220, epg_222, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_SRC_IP,
@@ -2774,7 +2764,7 @@
         c1.add_vpp_config()
 
         c2 = VppGbpContract(
-            self, 222, 220, acl_index,
+            self, epg_222, epg_220, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_SRC_IP,
@@ -2887,7 +2877,7 @@
         # test the symmetric hash mode
         #
         c1 = VppGbpContract(
-            self, 220, 222, acl_index,
+            self, epg_220, epg_222, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_SYMMETRIC,
@@ -2906,7 +2896,7 @@
         c1.add_vpp_config()
 
         c2 = VppGbpContract(
-            self, 222, 220, acl_index,
+            self, epg_222, epg_220, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_SYMMETRIC,
@@ -2971,7 +2961,7 @@
                Raw('\xa5' * 100))]
 
         c3 = VppGbpContract(
-            self, 220, 221, acl_index,
+            self, epg_220, epg_221, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_SYMMETRIC,
@@ -3007,7 +2997,7 @@
         vx_tun_l3.add_vpp_config()
 
         c4 = VppGbpContract(
-            self, 221, 220, acl_index,
+            self, epg_221, epg_220, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_PERMIT,
                 []),
@@ -3085,7 +3075,7 @@
         # test the dst-ip hash mode
         #
         c5 = VppGbpContract(
-            self, 220, 221, acl_index,
+            self, epg_220, epg_221, acl_index,
             [VppGbpContractRule(
                 VppEnum.vl_api_gbp_rule_action_t.GBP_API_RULE_REDIRECT,
                 VppEnum.vl_api_gbp_hash_mode_t.GBP_API_HASH_MODE_DST_IP,
@@ -3195,7 +3185,7 @@
         l3o_1 = VppGbpSubnet(
             self, rd1, "10.0.0.0", 24,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_L3_OUT,
-            epg=220)
+            epg=epg_220)
         l3o_1.add_vpp_config()
 
         #
@@ -3301,7 +3291,7 @@
         l3o_220 = VppGbpSubnet(
             self, rd1, "10.220.0.0", 24,
             VppEnum.vl_api_gbp_subnet_type_t.GBP_API_SUBNET_L3_OUT,
-            epg=220)
+            epg=epg_220)
         l3o_220.add_vpp_config()
 
         p = (Ether(src=self.pg7.remote_mac,
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 9955518..5975b57 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -3553,7 +3553,7 @@
                          'enable_ip6': 1 if enable_ip6 else 0,
                          })
 
-    def gbp_endpoint_add(self, sw_if_index, ips, mac, epg, flags,
+    def gbp_endpoint_add(self, sw_if_index, ips, mac, sclass, flags,
                          tun_src, tun_dst):
         """ GBP endpoint Add """
         return self.api(self.papi.gbp_endpoint_add,
@@ -3562,7 +3562,7 @@
                             'ips': ips,
                             'n_ips': len(ips),
                             'mac': mac,
-                            'epg_id': epg,
+                            'sclass': sclass,
                             'flags': flags,
                             'tun': {
                                 'src': tun_src,
@@ -3579,7 +3579,7 @@
         return self.api(self.papi.gbp_endpoint_dump,
                         {'_no_type_conversion': True})
 
-    def gbp_endpoint_group_add(self, epg, sclass, bd,
+    def gbp_endpoint_group_add(self, vnid, sclass, bd,
                                rd, uplink_sw_if_index,
                                retention):
         """ GBP endpoint group Add """
@@ -3589,15 +3589,15 @@
                              'uplink_sw_if_index': uplink_sw_if_index,
                              'bd_id': bd,
                              'rd_id': rd,
-                             'epg_id': epg,
+                             'vnid': vnid,
                              'sclass': sclass,
                              'retention': retention
                          }})
 
-    def gbp_endpoint_group_del(self, epg):
+    def gbp_endpoint_group_del(self, sclass):
         """ GBP endpoint group Del """
         return self.api(self.papi.gbp_endpoint_group_del,
-                        {'epg_id': epg})
+                        {'sclass': sclass})
 
     def gbp_endpoint_group_dump(self):
         """ GBP endpoint group Dump """
@@ -3652,14 +3652,14 @@
         """ GBP Route Domain Dump """
         return self.api(self.papi.gbp_route_domain_dump, {})
 
-    def gbp_recirc_add_del(self, is_add, sw_if_index, epg, is_ext):
+    def gbp_recirc_add_del(self, is_add, sw_if_index, sclass, is_ext):
         """ GBP recirc Add/Del """
         return self.api(self.papi.gbp_recirc_add_del,
                         {'is_add': is_add,
                          'recirc': {
                              'is_ext': is_ext,
                              'sw_if_index': sw_if_index,
-                             'epg_id': epg}})
+                             'sclass': sclass}})
 
     def gbp_recirc_dump(self):
         """ GBP recirc Dump """
@@ -3681,14 +3681,14 @@
     def gbp_subnet_add_del(self, is_add, rd_id,
                            prefix, type,
                            sw_if_index=0xffffffff,
-                           epg_id=0xffff):
+                           sclass=0xffff):
         """ GBP Subnet Add/Del """
         return self.api(self.papi.gbp_subnet_add_del,
                         {'is_add': is_add,
                          'subnet': {
                              'type': type,
                              'sw_if_index': sw_if_index,
-                             'epg_id': epg_id,
+                             'sclass': sclass,
                              'prefix': prefix,
                              'rd_id': rd_id}})
 
@@ -3697,15 +3697,15 @@
         return self.api(self.papi.gbp_subnet_dump,
                         {'_no_type_conversion': True})
 
-    def gbp_contract_add_del(self, is_add, src_epg, dst_epg, acl_index,
+    def gbp_contract_add_del(self, is_add, sclass, dclass, acl_index,
                              rules, allowed_ethertypes):
         """ GBP contract Add/Del """
         return self.api(self.papi.gbp_contract_add_del,
                         {'is_add': is_add,
                          'contract': {
                              'acl_index': acl_index,
-                             'src_epg': src_epg,
-                             'dst_epg': dst_epg,
+                             'sclass': sclass,
+                             'dclass': dclass,
                              'n_rules': len(rules),
                              'rules': rules,
                              'n_ether_types': len(allowed_ethertypes),
