diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPoint.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPoint.java
new file mode 100644
index 0000000..6370ddc
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPoint.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * 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.
+ */
+
+package org.onosproject.sdxl2;
+
+import com.google.common.base.MoreObjects;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.*;
+
+/**
+ * Sdx-l2 connection point expressed as composition of a:
+ * ConnectPoint; Set of Vlanid; Customer edge MAC address (optional).
+ */
+public class SdxL2ConnectionPoint {
+
+    private String name;
+    private final ConnectPoint cPoint;
+    private final List<VlanId> vlanIds;
+    private final MacAddress ceMac;
+
+    /**
+     * Creates a new SDXL2 connection point.
+     *
+     * @param name connection point name
+     * @param cPoint connection point
+     * @param vlans the customer edge vlans
+     * @param ceMac the customer edge router mac address
+     */
+    public SdxL2ConnectionPoint(String name, ConnectPoint cPoint, List<VlanId> vlans, MacAddress ceMac) {
+        this.name = name;
+        this.cPoint = cPoint;
+        this.vlanIds = vlans;
+        this.ceMac = ceMac;
+    }
+
+    /**
+     * Return the name of SDXL2 connection point.
+     *
+     * @return a string representing the name of connection point
+     */
+    public String name() {
+        return name;
+    }
+
+    /**
+     * Returns the connection point.
+     *
+     * @return connection point object
+     */
+    public ConnectPoint connectPoint() {
+        return cPoint;
+    }
+
+    /**
+     * Returns the set of vlans that are used by the customer edge.
+     *
+     * @return a set of vlan ids
+     */
+    public List<VlanId> vlanIds() {
+        return vlanIds;
+    }
+
+    /**
+     * Returns the customer edge mac address.
+     *
+     * @return a mac address object
+     */
+    public MacAddress macAddress() {
+        return ceMac;
+    }
+
+    /**
+     * Parse a device connect point from a string, set of vlans from a string
+     * and mac from a string.
+     * The connect point should be in the format "deviceUri/portNumber".
+     * The vlans should be in the format "vlan1,vlan2,vlan3"
+     * The mac address should be in hex
+     *
+     * @param name name of the SDXL2 cp
+     * @param connectPoint connection point to parse
+     * @param vlans vlanIds to parse
+     * @param mac mac address to parse
+     * @return a ConnectPoint based on the information in the string.
+     *
+     */
+    public static SdxL2ConnectionPoint
+    sdxl2ConnectionPoint(String name, String connectPoint, String vlans, String mac) {
+        checkNotNull(connectPoint);
+        checkNotNull(vlans);
+        checkState(!(name.contains(",") ||
+                name.contains("-") ||
+                name.contains("vlanid=") ||
+                name.contains("ConnectPoint{") ||
+                name.contains("elementId=") ||
+                name.contains("portNumber=") ||
+                name.contains("{") ||
+                name.contains("}") ||
+                name.contains("|")), "Names cannot contain some special characters");
+        checkNotNull(mac);
+        ConnectPoint connectionPoint = ConnectPoint.deviceConnectPoint(connectPoint);
+        String[] splitted = vlans.split(",");
+        checkArgument(splitted.length != 0, "At least '-1' or '1' as value");
+        List<VlanId> vlanslist = new ArrayList<>();
+        for (String vlan : splitted) {
+            if (!vlanslist.contains(VlanId.vlanId(Short.parseShort(vlan))) &&
+                    Short.parseShort(vlan) != -1 &&
+                    Short.parseShort(vlan) != 1) {
+                vlanslist.add(VlanId.vlanId(Short.parseShort(vlan)));
+            }
+        }
+        MacAddress macAddress = MacAddress.valueOf(mac);
+        return new SdxL2ConnectionPoint(name, connectionPoint, vlanslist, macAddress);
+    }
+
+    /**
+     * Parse a device connect point from a string and set of vlans from a string.
+     * The connect point should be in the format "deviceUri/portNumber".
+     * The vlans should be in the format "vlan1,vlan2,vlan3"
+     *
+     * @param name name of the SDXL2 cp
+     * @param connectPoint connection point to parse
+     * @param vlans vlanIds to parse
+     * @return a ConnectPoint based on the information in the string.
+     *
+     */
+    public static SdxL2ConnectionPoint sdxl2ConnectionPoint(String name, String connectPoint, String vlans) {
+        checkNotNull(connectPoint);
+        checkNotNull(vlans);
+        checkState(!(name.contains(",") ||
+                name.contains("-") ||
+                name.contains("vlanid=") ||
+                name.contains("ConnectPoint{") ||
+                name.contains("elementId=") ||
+                name.contains("portNumber=") ||
+                name.contains("{") ||
+                name.contains("}") ||
+                name.contains("|")), "Names cannot contain some special characters");
+        ConnectPoint connectionPoint = ConnectPoint.deviceConnectPoint(connectPoint);
+        String[] splitted = vlans.split(",");
+        checkArgument(splitted.length != 0, "At least '-1' or '1' as value");
+        List<VlanId> vlanslist = new ArrayList<>();
+        for (String vlan : splitted) {
+            if (!vlanslist.contains(VlanId.vlanId(Short.parseShort(vlan))) &&
+                    Short.parseShort(vlan) != -1 &&
+                    Short.parseShort(vlan) != 1) {
+                vlanslist.add(VlanId.vlanId(Short.parseShort(vlan)));
+            }
+        }
+        MacAddress macAddress = MacAddress.ZERO;
+        return new SdxL2ConnectionPoint(name, connectionPoint, vlanslist, macAddress);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(name, cPoint, vlanIds, ceMac);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof SdxL2ConnectionPoint) {
+            final SdxL2ConnectionPoint other = (SdxL2ConnectionPoint) obj;
+            return  Objects.equals(this.name, other.name) &&
+                    Objects.equals(this.cPoint, other.cPoint) &&
+                    Objects.equals(this.vlanIds, other.vlanIds) &&
+                    Objects.equals(this.ceMac, other.ceMac);
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("name", name)
+                .add("connectionPoint", cPoint)
+                .add("vlanIds", vlanIds)
+                .add("ceMac", ceMac)
+                .toString();
+    }
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPointSerializer.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPointSerializer.java
new file mode 100644
index 0000000..adbc246
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/SdxL2ConnectionPointSerializer.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * 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.
+ */
+
+package org.onosproject.sdxl2;
+
+import com.esotericsoftware.kryo.Kryo;
+import com.esotericsoftware.kryo.Serializer;
+import com.esotericsoftware.kryo.io.Input;
+import com.esotericsoftware.kryo.io.Output;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+
+import java.util.List;
+
+/**
+ * Kryo serializer for SdxL2ConnectionPoint.
+ */
+public class SdxL2ConnectionPointSerializer extends Serializer<SdxL2ConnectionPoint> {
+
+    /**
+     * Serialize the object using kryo.
+     *
+     * @param kryo the serializer
+     * @param output the output
+     * @param object the object to serialize
+     */
+    public void write(Kryo kryo, Output output, SdxL2ConnectionPoint object) {
+        kryo.writeClassAndObject(output, object.name());
+        kryo.writeClassAndObject(output, object.connectPoint());
+        kryo.writeClassAndObject(output, object.macAddress());
+        kryo.writeClassAndObject(output, object.vlanIds());
+    }
+
+    /**
+     * Create an object from one serialized using kryo.
+     *
+     * @param kryo the serializer
+     * @param input the inpunt
+     * @param type the object to create
+     * @return the object
+     */
+    public SdxL2ConnectionPoint read(Kryo kryo, Input input, Class<SdxL2ConnectionPoint> type) {
+        String name = (String) kryo.readClassAndObject(input);
+        ConnectPoint cp = (ConnectPoint) kryo.readClassAndObject(input);
+        MacAddress mac = (MacAddress) kryo.readClassAndObject(input);
+        List<VlanId> vlans = (List<VlanId>) kryo.readClassAndObject(input);
+        return new SdxL2ConnectionPoint(name, cp, vlans, mac);
+    }
+}
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/package-info.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/package-info.java
new file mode 100644
index 0000000..0e134d7
--- /dev/null
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * 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.
+ */
+
+/**
+ * Application providing the basic functionality of a L2-SDX.
+ */
+package org.onosproject.sdxl2;
