diff --git a/threadnetwork/aidl/default/socket_interface.cpp b/threadnetwork/aidl/default/socket_interface.cpp
index 3a8b1cf..e42f03d 100644
--- a/threadnetwork/aidl/default/socket_interface.cpp
+++ b/threadnetwork/aidl/default/socket_interface.cpp
@@ -22,6 +22,17 @@
 
 #include "socket_interface.hpp"
 
+#include <errno.h>
+#include <openthread/logging.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "common/code_utils.hpp"
+#include "openthread/openthread-system.h"
+
 namespace aidl {
 namespace android {
 namespace hardware {
@@ -37,6 +48,83 @@
     mInterfaceMetrics.mRcpInterfaceType = kSpinelInterfaceTypeVendor;
 }
 
+otError SocketInterface::Init(ReceiveFrameCallback aCallback, void* aCallbackContext,
+                              RxFrameBuffer& aFrameBuffer) {
+    otError error = OT_ERROR_NONE;
+
+    VerifyOrExit(mSockFd == -1, error = OT_ERROR_ALREADY);
+
+    mSockFd = OpenFile(mRadioUrl);
+    VerifyOrExit(mSockFd != -1, error = OT_ERROR_FAILED);
+
+    mReceiveFrameCallback = aCallback;
+    mReceiveFrameContext = aCallbackContext;
+    mReceiveFrameBuffer = &aFrameBuffer;
+
+exit:
+    return error;
+}
+
+SocketInterface::~SocketInterface(void) {
+    Deinit();
+}
+
+void SocketInterface::Deinit(void) {
+    CloseFile();
+
+    mReceiveFrameCallback = nullptr;
+    mReceiveFrameContext = nullptr;
+    mReceiveFrameBuffer = nullptr;
+}
+
+void SocketInterface::UpdateFdSet(void* aMainloopContext) {
+    otSysMainloopContext* context = reinterpret_cast<otSysMainloopContext*>(aMainloopContext);
+
+    assert(context != nullptr);
+
+    FD_SET(mSockFd, &context->mReadFdSet);
+
+    if (context->mMaxFd < mSockFd) {
+        context->mMaxFd = mSockFd;
+    }
+}
+
+int SocketInterface::OpenFile(const ot::Url::Url& aRadioUrl) {
+    int fd = -1;
+    sockaddr_un serverAddress;
+
+    VerifyOrExit(sizeof(serverAddress.sun_path) > strlen(aRadioUrl.GetPath()),
+                 otLogCritPlat("Invalid file path length"));
+    strncpy(serverAddress.sun_path, aRadioUrl.GetPath(), sizeof(serverAddress.sun_path));
+    serverAddress.sun_family = AF_UNIX;
+
+    fd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
+    VerifyOrExit(fd != -1, otLogCritPlat("open(): errno=%s", strerror(errno)));
+
+    if (connect(fd, reinterpret_cast<struct sockaddr*>(&serverAddress), sizeof(serverAddress)) ==
+        -1) {
+        otLogCritPlat("connect(): errno=%s", strerror(errno));
+        close(fd);
+        fd = -1;
+    }
+
+exit:
+    return fd;
+}
+
+void SocketInterface::CloseFile(void) {
+    VerifyOrExit(mSockFd != -1);
+
+    VerifyOrExit(0 == close(mSockFd), otLogCritPlat("close(): errno=%s", strerror(errno)));
+    VerifyOrExit(wait(nullptr) != -1 || errno == ECHILD,
+                 otLogCritPlat("wait(): errno=%s", strerror(errno)));
+
+    mSockFd = -1;
+
+exit:
+    return;
+}
+
 }  // namespace threadnetwork
 }  // namespace hardware
 }  // namespace android
diff --git a/threadnetwork/aidl/default/socket_interface.hpp b/threadnetwork/aidl/default/socket_interface.hpp
index 2d1b614..5c679cd 100644
--- a/threadnetwork/aidl/default/socket_interface.hpp
+++ b/threadnetwork/aidl/default/socket_interface.hpp
@@ -49,6 +49,57 @@
     ~SocketInterface();
 
     /**
+     * Initializes the interface to the Radio Co-processor (RCP)
+     *
+     * @note This method should be called before reading and sending Spinel
+     * frames to the interface.
+     *
+     * @param[in] aCallback         Callback on frame received
+     * @param[in] aCallbackContext  Callback context
+     * @param[in] aFrameBuffer      A reference to a `RxFrameBuffer` object.
+     *
+     * @retval OT_ERROR_NONE       The interface is initialized successfully
+     * @retval OT_ERROR_ALREADY    The interface is already initialized.
+     * @retval OT_ERROR_FAILED     Failed to initialize the interface.
+     *
+     */
+    otError Init(ReceiveFrameCallback aCallback, void* aCallbackContext,
+                 RxFrameBuffer& aFrameBuffer);
+
+    /**
+     * Deinitializes the interface to the RCP.
+     *
+     */
+    void Deinit(void);
+
+    /**
+     * Updates the file descriptor sets with file descriptors used by the radio
+     * driver.
+     *
+     * @param[in,out]   aMainloopContext  A pointer to the mainloop context
+     * containing fd_sets.
+     *
+     */
+    void UpdateFdSet(void* aMainloopContext);
+
+    /**
+     * Returns the bus speed between the host and the radio.
+     *
+     * @return   Bus speed in bits/second.
+     *
+     */
+    uint32_t GetBusSpeed(void) const { return 1000000; }
+
+    /**
+     * Hardware resets the RCP.
+     *
+     * @retval OT_ERROR_NONE            Successfully reset the RCP.
+     * @retval OT_ERROR_NOT_IMPLEMENT   The hardware reset is not implemented.
+     *
+     */
+    otError HardwareReset(void) { return OT_ERROR_NOT_IMPLEMENTED; }
+
+    /**
      * Returns the RCP interface metrics.
      *
      * @return The RCP interface metrics.
@@ -71,6 +122,24 @@
     }
 
   private:
+    /**
+     * Opens file specified by aRadioUrl.
+     *
+     * @param[in] aRadioUrl  A reference to object containing path to file and
+     * data for configuring the connection with tty type file.
+     *
+     * @retval The file descriptor of newly opened file.
+     * @retval -1 Fail to open file.
+     *
+     */
+    int OpenFile(const ot::Url::Url& aRadioUrl);
+
+    /**
+     * Closes file associated with the file descriptor.
+     *
+     */
+    void CloseFile(void);
+
     ReceiveFrameCallback mReceiveFrameCallback;
     void* mReceiveFrameContext;
     RxFrameBuffer* mReceiveFrameBuffer;
