diff --git a/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java b/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
index d620fed..8676e46 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
@@ -15,7 +15,6 @@
  */
 package org.onosproject.net.host;
 
-import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.HostId;
 
 /**
@@ -30,37 +29,4 @@
      */
     void removeHost(HostId hostId);
 
-    /**
-     * Binds IP and MAC addresses to the given connection point.
-     * <p>
-     * The addresses are added to the set of addresses already bound to the
-     * connection point.
-     *
-     * @param addresses address object containing addresses to add and the port
-     * to add them to
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void bindAddressesToPort(PortAddresses addresses);
-
-    /**
-     * Removes the addresses contained in the given PortAddresses object from
-     * the set of addresses bound to the port.
-     *
-     * @param portAddresses set of addresses to remove and port to remove them
-     * from
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void unbindAddressesFromPort(PortAddresses portAddresses);
-
-    /**
-     * Removes all address information for the given connection point.
-     *
-     * @param connectPoint the connection point to remove address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void clearAddresses(ConnectPoint connectPoint);
-
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostService.java b/core/api/src/main/java/org/onosproject/net/host/HostService.java
index be114f0..3901215 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostService.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostService.java
@@ -123,24 +123,4 @@
      */
     void requestMac(IpAddress ip);
 
-    /**
-     * Returns the addresses information for all connection points.
-     *
-     * @return the set of address bindings for all connection points
-     * @deprecated in Drake release: use InterfaceService instead
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindings();
-
-    /**
-     * Retrieves the addresses that have been bound to the given connection
-     * point.
-     *
-     * @param connectPoint the connection point to retrieve address bindings for
-     * @return addresses bound to the port
-     * @deprecated in Drake release: use InterfaceService instead
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
-
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostStore.java b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
index ca11a94..35a2a8b 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostStore.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
@@ -115,53 +115,4 @@
      */
     Set<Host> getConnectedHosts(DeviceId deviceId);
 
-    /**
-     * Updates the address information for a given port. The given address
-     * information is added to any previously held information for the port.
-     *
-     * @param addresses the port and address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void updateAddressBindings(PortAddresses addresses);
-
-    /**
-     * Removes the given addresses from the set of address information held for
-     * a port.
-     *
-     * @param addresses the port and address information
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void removeAddressBindings(PortAddresses addresses);
-
-    /**
-     * Removes any previously stored address information for a given connection
-     * point.
-     *
-     * @param connectPoint the connection point
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    void clearAddressBindings(ConnectPoint connectPoint);
-
-    /**
-     * Returns the address bindings stored for all connection points.
-     *
-     * @return the set of address bindings
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindings();
-
-    /**
-     * Returns the address bindings for a particular connection point.
-     *
-     * @param connectPoint the connection point to return address information
-     *                     for
-     * @return address information for the connection point
-     * @deprecated in Drake release: address info now stored in InterfaceService
-     */
-    @Deprecated
-    Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
 }
diff --git a/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java b/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java
deleted file mode 100644
index 74f22ae..0000000
--- a/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2014-2015 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.net.host;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.ConnectPoint;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Represents address information bound to a port.
- */
-public final class PortAddresses {
-
-    private final ConnectPoint connectPoint;
-    private final Set<InterfaceIpAddress> ipAddresses;
-    private final MacAddress macAddress;
-    private final VlanId vlan;
-
-    /**
-     * Constructs a PortAddresses object for the given connection point, with a
-     * set of IP addresses and a MAC address. Both address parameters are
-     * optional and can be set to null.
-     *
-     * @param connectPoint the connection point these addresses are for
-     * @param ipAddresses a set of interface IP addresses
-     * @param mac a MAC address
-     * @param vlan a VLAN ID
-     */
-    public PortAddresses(ConnectPoint connectPoint,
-            Set<InterfaceIpAddress> ipAddresses, MacAddress mac, VlanId vlan) {
-        this.connectPoint = connectPoint;
-        this.ipAddresses = (ipAddresses == null) ?
-            Collections.<InterfaceIpAddress>emptySet()
-            : new HashSet<>(ipAddresses);
-        this.macAddress = mac;
-        this.vlan = vlan;
-    }
-
-    /**
-     * Returns the connection point this address information is bound to.
-     *
-     * @return the connection point
-     */
-    public ConnectPoint connectPoint() {
-        return connectPoint;
-    }
-
-    /**
-     * Returns the set of interface IP addresses.
-     *
-     * @return the interface IP addresses
-     */
-    public Set<InterfaceIpAddress> ipAddresses() {
-        return ipAddresses;
-    }
-
-    /**
-     * Returns the MAC address.
-     *
-     * @return the MAC address
-     */
-    public MacAddress mac() {
-        return macAddress;
-    }
-
-    /**
-     * Returns the VLAN ID.
-     *
-     * @return the VLAN ID
-     */
-    public VlanId vlan() {
-        return vlan;
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (this == other) {
-            return true;
-        }
-
-        if (!(other instanceof PortAddresses)) {
-            return false;
-        }
-
-        PortAddresses otherPa = (PortAddresses) other;
-
-        return Objects.equals(this.connectPoint, otherPa.connectPoint)
-                && Objects.equals(this.ipAddresses, otherPa.ipAddresses)
-                && Objects.equals(this.macAddress, otherPa.macAddress)
-                && Objects.equals(this.vlan, otherPa.vlan);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(connectPoint, ipAddresses, macAddress, vlan);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-            .add("connect-point", connectPoint)
-            .add("ip-addresses", ipAddresses)
-            .add("mac-address", macAddress)
-            .add("vlan", vlan)
-            .toString();
-    }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
index 226dad0..0fad54a 100644
--- a/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/host/HostServiceAdapter.java
@@ -15,15 +15,15 @@
  */
 package org.onosproject.net.host;
 
-import java.util.Set;
-
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.Host;
 import org.onosproject.net.HostId;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
+
+import java.util.Set;
 
 /**
  * Test adapter for host service.
@@ -89,14 +89,4 @@
     public void removeListener(HostListener listener) {
     }
 
-    @Override
-    public Set<PortAddresses> getAddressBindings() {
-        return null;
-    }
-
-    @Override
-    public Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint) {
-        return null;
-    }
-
 }
diff --git a/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java b/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java
deleted file mode 100644
index 7c10cd1..0000000
--- a/core/api/src/test/java/org/onosproject/net/host/PortAddressesTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2015 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.net.host;
-
-import java.util.Set;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.NetTestTools;
-
-import static org.hamcrest.Matchers.is;
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.testing.EqualsTester;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-/**
- * Unit tests for port addresses class.
- */
-public class PortAddressesTest {
-
-    PortAddresses addresses1;
-    PortAddresses sameAsAddresses1;
-    PortAddresses addresses2;
-    PortAddresses addresses3;
-
-    private static final ConnectPoint CONNECT_POINT1 =
-            NetTestTools.connectPoint("cp1", 1);
-    private static final IpAddress IP_ADDRESS1 = IpAddress.valueOf("1.2.3.4");
-    private static final IpPrefix SUBNET_ADDRESS1 =
-            IpPrefix.valueOf("1.2.0.0/16");
-    private static final InterfaceIpAddress INTERFACE_ADDRESS_1 =
-            new InterfaceIpAddress(IP_ADDRESS1, SUBNET_ADDRESS1);
-
-    private static final ConnectPoint CONNECT_POINT2 =
-            NetTestTools.connectPoint("cp2", 1);
-    private static final IpAddress IP_ADDRESS2 = IpAddress.valueOf("1.2.3.5");
-    private static final IpPrefix SUBNET_ADDRESS2 =
-            IpPrefix.valueOf("1.3.0.0/16");
-    private static final InterfaceIpAddress INTERFACE_ADDRESS_2 =
-            new InterfaceIpAddress(IP_ADDRESS2, SUBNET_ADDRESS2);
-
-    Set<InterfaceIpAddress> ipAddresses;
-
-
-    /**
-     * Initializes local data used by all test cases.
-     */
-    @Before
-    public void setUpAddresses() {
-        ipAddresses = ImmutableSet.of(INTERFACE_ADDRESS_1,
-                INTERFACE_ADDRESS_2);
-        addresses1 = new PortAddresses(CONNECT_POINT1, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        sameAsAddresses1 = new PortAddresses(CONNECT_POINT1, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        addresses2 = new PortAddresses(CONNECT_POINT2, ipAddresses,
-                MacAddress.BROADCAST, VlanId.NONE);
-        addresses3 = new PortAddresses(CONNECT_POINT2, ipAddresses,
-                MacAddress.ZERO, VlanId.NONE);
-    }
-
-    /**
-     * Checks that the PortAddresses class is immutable.
-     */
-    @Test
-    public void testImmutability() {
-        assertThatClassIsImmutable(PortAddresses.class);
-    }
-
-    /**
-     * Checks the operation of the equals(), hash() and toString()
-     * methods.
-     */
-    @Test
-    public void testEquals() {
-        new EqualsTester()
-                .addEqualityGroup(addresses1, sameAsAddresses1)
-                .addEqualityGroup(addresses2)
-                .addEqualityGroup(addresses3)
-                .testEquals();
-    }
-
-    /**
-     * Tests that object are created correctly.
-     */
-    @Test
-    public void testConstruction() {
-        assertThat(addresses1.mac(), is(MacAddress.BROADCAST));
-        assertThat(addresses1.connectPoint(), is(CONNECT_POINT1));
-        assertThat(addresses1.ipAddresses(), is(ipAddresses));
-        assertThat(addresses1.vlan(), is(VlanId.NONE));
-    }
-}
