Add support for Service Path mapping records processing 61/31561/1
authorFlorin Coras <fcoras@cisco.com>
Fri, 18 Dec 2015 00:45:27 +0000 (01:45 +0100)
committerFlorin Coras <fcoras@cisco.com>
Fri, 18 Dec 2015 00:45:27 +0000 (01:45 +0100)
The patch introduces two important changes for mapping records with
Service Path EIDs. First, it ensures that ServicePath EIDs are
normalized (i.e., Service Index is set to 0) before being used as keys
in mappings caches. Second, when doing lookups, for records with ELP
locator records, the Service Index in the requested EID is used to
select one, next hop, locator that is returned in the map-reply, instead
of the whole ELP.

Change-Id: Id487f3603f89beb5a878d5256709112ef004b4f6
Signed-off-by: Florin Coras <fcoras@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingSystem.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/FlatMapCache.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/MultiTableMapCache.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/mapcache/SimpleMapCache.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/util/LispAddressUtil.java
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/util/MaskUtil.java

index 6827751e14a1a26f07b98ba789a8c7b1fbe35663..ca605bfe67aa60429cc7b9c0ef0c9d97b9219559 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.lispflowmapping.implementation;
 
+import java.util.ArrayList;
 import java.util.EnumMap;
 import java.util.List;
 
@@ -20,7 +21,19 @@ import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMapCache;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMappingSystem;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
+import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ExplicitLocatorPath;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.Mapping;
@@ -100,6 +113,46 @@ public class MappingSystem implements IMappingSystem {
         tableMap.get(origin).updateMappingRegistration(key);
     }
 
+    private MappingRecord updateServicePathMappingRecord(MappingRecord mapping, Eid eid) {
+        // keep properties of original record
+        MappingRecordBuilder recordBuilder = new MappingRecordBuilder(mapping);
+        recordBuilder.setLocatorRecord(new ArrayList<LocatorRecord>());
+
+        // there should only be one locator record
+        if (mapping.getLocatorRecord().size() != 1) {
+            LOG.warn("MappingRecord associated to ServicePath EID has more than one locator!");
+            return mapping;
+        }
+
+        LocatorRecord locatorRecord = mapping.getLocatorRecord().get(0);
+        long serviceIndex = ((ServicePath) eid.getAddress()).getServicePath().getServiceIndex();
+        int index = 255 - (int) serviceIndex;
+        Rloc rloc = locatorRecord.getRloc();
+        if (rloc.getAddress() instanceof Ipv4 || rloc.getAddress() instanceof Ipv6) {
+            if (index != 0) {
+                LOG.warn("Service Index should be 255 for simple IP RLOCs!");
+            }
+            return mapping;
+        } else if (rloc.getAddress() instanceof ExplicitLocatorPath) {
+            ExplicitLocatorPath elp = (ExplicitLocatorPath) rloc.getAddress();
+            List<Hop> hops = elp.getExplicitLocatorPath().getHop();
+
+            if (index < 0 || index > hops.size())  {
+                LOG.warn("Service Index out of bounds!");
+                return mapping;
+            }
+
+            SimpleAddress nextHop = hops.get(index).getAddress();
+            LocatorRecordBuilder lrb = new LocatorRecordBuilder(locatorRecord);
+            lrb.setRloc(LispAddressUtil.toRloc(nextHop));
+            recordBuilder.getLocatorRecord().add(lrb.build());
+            return recordBuilder.build();
+        } else {
+            LOG.warn("Nothing to do with ServicePath mapping record");
+            return mapping;
+        }
+    }
+
     @Override
     public Object getMapping(Eid src, Eid dst) {
         // NOTE: what follows is just a simple implementation of a lookup logic, it SHOULD be subject to future
@@ -113,6 +166,9 @@ public class MappingSystem implements IMappingSystem {
             return smc.getMapping(src, dst);
         }
 
+        if (dst.getAddress() instanceof ServicePath) {
+            return updateServicePathMappingRecord((MappingRecord)mapping, dst);
+        }
         return mapping;
     }
 
index 560373a88bf77ae1f48b76354a7e245c03c326bc..0da27846eafdab2bb84cf7755ff30fe56f10fc95 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.lispflowmapping.interfaces.dao.IRowVisitor;
 import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
 import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
 import org.opendaylight.lispflowmapping.interfaces.mapcache.IMapCache;
+import org.opendaylight.lispflowmapping.lisp.util.MaskUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.authkey.container.MappingAuthkey;
 
@@ -34,7 +35,8 @@ public class FlatMapCache implements IMapCache {
     }
 
     @Override
-    public void addMapping(Eid key, Object data, boolean shouldOverwrite) {
+    public void addMapping(Eid eid, Object data, boolean shouldOverwrite) {
+        Eid key = MaskUtil.normalize(eid);
         dao.put(key, new MappingEntry<>(SubKeys.REGDATE, new Date(System.currentTimeMillis())));
         dao.put(key, new MappingEntry<>(SubKeys.RECORD, data));
     }
@@ -44,21 +46,25 @@ public class FlatMapCache implements IMapCache {
         if (dstKey == null) {
             return null;
         }
-        return dao.getSpecific(dstKey, SubKeys.RECORD);
+        Eid key = MaskUtil.normalize(dstKey);
+        return dao.getSpecific(key, SubKeys.RECORD);
     }
 
     @Override
-    public void removeMapping(Eid key, boolean overwrite) {
+    public void removeMapping(Eid eid, boolean overwrite) {
+        Eid key = MaskUtil.normalize(eid);
         dao.removeSpecific(key, SubKeys.RECORD);
     }
 
     @Override
-    public void addAuthenticationKey(Eid key, MappingAuthkey authKey) {
+    public void addAuthenticationKey(Eid eid, MappingAuthkey authKey) {
+        Eid key = MaskUtil.normalize(eid);
         dao.put(key, new MappingEntry<>(SubKeys.AUTH_KEY, authKey));
     }
 
     @Override
-    public MappingAuthkey getAuthenticationKey(Eid key) {
+    public MappingAuthkey getAuthenticationKey(Eid eid) {
+        Eid key = MaskUtil.normalize(eid);
         Object data = dao.getSpecific(key, SubKeys.AUTH_KEY);
         if (data instanceof MappingAuthkey) {
             return (MappingAuthkey) data;
@@ -68,29 +74,34 @@ public class FlatMapCache implements IMapCache {
     }
 
     @Override
-    public void removeAuthenticationKey(Eid key) {
+    public void removeAuthenticationKey(Eid eid) {
+        Eid key = MaskUtil.normalize(eid);
         dao.removeSpecific(key, SubKeys.AUTH_KEY);
     }
 
     @Override
-    public void updateMappingRegistration(Eid key) {
+    public void updateMappingRegistration(Eid eid) {
+        Eid key = MaskUtil.normalize(eid);
         if (dao.get(key) != null) {
             dao.put(key, new MappingEntry<>(SubKeys.REGDATE, new Date(System.currentTimeMillis())));
         }
     }
 
     @Override
-    public void addData(Eid key, String subKey, Object data) {
+    public void addData(Eid eid, String subKey, Object data) {
+        Eid key = MaskUtil.normalize(eid);
         dao.put(key, new MappingEntry<>(subKey, data));
     }
 
     @Override
-    public Object getData(Eid key, String subKey) {
+    public Object getData(Eid eid, String subKey) {
+        Eid key = MaskUtil.normalize(eid);
         return dao.getSpecific(key, subKey);
     }
 
     @Override
-    public void removeData(Eid key, String subKey) {
+    public void removeData(Eid eid, String subKey) {
+        Eid key = MaskUtil.normalize(eid);
         dao.removeSpecific(key, subKey);
     }
 
index 4f1b0caff47ce1a9ddf5c65bc9632350fe642121..bf790daff6446aa8826b6375e22e206a883487ea 100644 (file)
@@ -82,8 +82,8 @@ public class MultiTableMapCache implements IMapCache {
     // Method returns the DAO entry (hash) corresponding to either the longest prefix match of eid, if eid is maskable,
     // or the exact match otherwise. eid must be a 'simple' address
     private Map<String, ?> getDaoEntryBest(Eid eid, ILispDAO dao) {
+        Eid key;
         if (MaskUtil.isMaskable(eid.getAddress())) {
-            Eid key;
             short mask = MaskUtil.getMaskForAddress(eid.getAddress());
             while (mask > 0) {
                 key = MaskUtil.normalize(eid, mask);
@@ -95,9 +95,10 @@ public class MultiTableMapCache implements IMapCache {
             }
             return null;
         } else {
-            Map<String, ?> entry = dao.get(eid);
+            key = MaskUtil.normalize(eid);
+            Map<String, ?> entry = dao.get(key);
             if (entry != null) {
-                return dao.get(eid);
+                return dao.get(key);
             } else {
                 return null;
             }
@@ -231,7 +232,8 @@ public class MultiTableMapCache implements IMapCache {
             }
             return null;
         } else {
-            Object password = table.getSpecific(eid, SubKeys.AUTH_KEY);
+            Eid key = MaskUtil.normalize(eid);
+            Object password = table.getSpecific(key, SubKeys.AUTH_KEY);
             if (password != null && password instanceof MappingAuthkey) {
                 return (MappingAuthkey) password;
             } else {
@@ -341,7 +343,6 @@ public class MultiTableMapCache implements IMapCache {
         Eid key = MaskUtil.normalize(eid);
         ILispDAO table = getOrInstantiateVniTable(key);
 
-
         if (key.getAddress() instanceof SourceDestKey) {
             ILispDAO srcDstDao = getOrInstantiateSDInnerDao(key, table);
             srcDstDao.put(SourceDestKeyHelper.getSrc(key), new MappingEntry<Object>(subKey, data));
@@ -351,7 +352,8 @@ public class MultiTableMapCache implements IMapCache {
     }
 
     @Override
-    public Object getData(Eid key, String subKey) {
+    public Object getData(Eid eid, String subKey) {
+        Eid key = MaskUtil.normalize(eid);
         ILispDAO table = getVniTable(key);
         if (table == null) {
             return null;
index 93caa47619bc4b5e72cd18468f8de15a3c6d7e5c..67d94feeb205382eb592c5497e641175306545e6 100644 (file)
@@ -93,20 +93,21 @@ public class SimpleMapCache implements IMapCache {
 
     // Method returns the DAO entry (hash) corresponding to either the longest prefix match of eid, if eid is maskable,
     // or the exact match otherwise. eid must be a 'simple' address
-    private  Map<String, ?> getDaoEntryBest(Eid key, ILispDAO dao) {
-        if (MaskUtil.isMaskable(key.getAddress())) {
-            Eid lookupKey;
-            short mask = MaskUtil.getMaskForAddress(key.getAddress());
+    private  Map<String, Object> getDaoEntryBest(Eid eid, ILispDAO dao) {
+        Eid key;
+        if (MaskUtil.isMaskable(eid.getAddress())) {
+            short mask = MaskUtil.getMaskForAddress(eid.getAddress());
             while (mask > 0) {
-                lookupKey = MaskUtil.normalize(key, mask);
+                key = MaskUtil.normalize(eid, mask);
                 mask--;
-                Map<String, ?> entry = dao.get(lookupKey);
+                Map<String, Object> entry = dao.get(key);
                 if (entry != null) {
                     return entry;
                 }
             }
             return null;
         } else {
+            key = MaskUtil.normalize(eid);
             return dao.get(key);
         }
     }
@@ -215,7 +216,8 @@ public class SimpleMapCache implements IMapCache {
         if (MaskUtil.isMaskable(eid.getAddress())) {
             return getAuthKeyLpm(eid, table);
         } else {
-            Object password = table.getSpecific(eid, SubKeys.AUTH_KEY);
+            Eid key = MaskUtil.normalize(eid);
+            Object password = table.getSpecific(key, SubKeys.AUTH_KEY);
             if (password != null && password instanceof MappingAuthkey) {
                 return (MappingAuthkey) password;
             } else {
@@ -274,39 +276,41 @@ public class SimpleMapCache implements IMapCache {
     }
 
     @Override
-    public void updateMappingRegistration(Eid key) {
-        ILispDAO table = getVniTable(key);
+    public void updateMappingRegistration(Eid eid) {
+        ILispDAO table = getVniTable(eid);
         if (table == null) {
             return;
         }
-        Map<String, ?> daoEntry = getDaoEntryBest(key, table);
+        Map<String, Object> daoEntry = getDaoEntryBest(eid, table);
         if (daoEntry != null) {
-            table.put(key, new MappingEntry<>(SubKeys.REGDATE, new Date(System.currentTimeMillis())));
+            daoEntry.put(SubKeys.REGDATE, new Date(System.currentTimeMillis()));
         }
     }
 
     @Override
-    public void addData(Eid key, String subKey, Object data) {
-        Eid normKey = MaskUtil.normalize(key);
-        ILispDAO table = getOrInstantiateVniTable(normKey);
-        table.put(normKey, new MappingEntry<>(subKey, data));
+    public void addData(Eid eid, String subKey, Object data) {
+        Eid key = MaskUtil.normalize(eid);
+        ILispDAO table = getOrInstantiateVniTable(key);
+        table.put(key, new MappingEntry<>(subKey, data));
     }
 
     @Override
-    public Object getData(Eid key, String subKey) {
-        ILispDAO table = getOrInstantiateVniTable(key);
+    public Object getData(Eid eid, String subKey) {
+        ILispDAO table = getOrInstantiateVniTable(eid);
         if (table == null) {
             return null;
         }
+        Eid key = MaskUtil.normalize(eid);
         return table.getSpecific(key, subKey);
     }
 
     @Override
-    public void removeData(Eid key, String subKey) {
-        ILispDAO table = getOrInstantiateVniTable(key);
+    public void removeData(Eid eid, String subKey) {
+        ILispDAO table = getOrInstantiateVniTable(eid);
         if (table == null) {
             return;
         }
+        Eid key = MaskUtil.normalize(eid);
         table.removeSpecific(key, subKey);
     }
 }
index 94be33022082b13c2685b48f4073eeec3b16154f..252549b9aea6f4efc0d8b4cebf7409a425ee3236 100644 (file)
@@ -35,6 +35,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.MacAfi;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.NoAddressAfi;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathIdType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.ServicePathLcaf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SourceDestKeyLcaf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address;
@@ -47,6 +49,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.MacBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.NoAddressBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePathBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.locatorrecords.LocatorRecord;
@@ -54,6 +57,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.lo
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.key.value.address.KeyValueAddressBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePath;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.source.dest.key.SourceDestKeyBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
@@ -186,6 +190,14 @@ public final class LispAddressUtil {
         }
     }
 
+    public static Address addressFromServicePath(ServicePath address) {
+        if (address == null) {
+            return null;
+        } else {
+            return (Address) new ServicePathBuilder().setServicePath(address).build();
+        }
+    }
+
     public static Address addressFromDistinguishedName(DistinguishedNameType address) {
         if (address == null) {
             return null;
@@ -358,6 +370,16 @@ public final class LispAddressUtil {
         return builder.build();
     }
 
+    public static Eid asServicePathEid(long vni, long servicePathId, short serviceIndex) {
+        EidBuilder eb = new EidBuilder();
+        eb.setAddressType(ServicePathLcaf.class);
+        eb.setVirtualNetworkId(new InstanceIdType(vni));
+        org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder spb = new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder();
+        spb.setServicePathId(new ServicePathIdType(servicePathId));
+        spb.setServiceIndex(serviceIndex);
+        return eb.setAddress(addressFromServicePath(spb.build())).build();
+    }
+
     public static Eid toEid(MacAddress mac, InstanceIdType vni) {
         EidBuilder builder = new EidBuilder();
         builder.setAddressType(MacAfi.class);
index b1abf48cd429733feb0b01c9ae3317fd20621bef..fd5532e19e24e818cda8339dfef8f4eb98eff79c 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.slf4j.Logger;
@@ -89,6 +90,10 @@ public final class MaskUtil {
             } else if (address instanceof InstanceId) {
                 // TODO - not absolutely necessary, but should be implemented
                 return eid;
+            } else if (address instanceof ServicePath) {
+                // Build new Service Path eid with service index set to 0
+                long spi = ((ServicePath) address).getServicePath().getServicePathId().getValue();
+                return LispAddressUtil.asServicePathEid(0, spi, (short)0);
             }
         } catch (UnknownHostException e) {
             LOG.trace("Failed to normalize eid {}: {}", eid, ExceptionUtils.getStackTrace(e));