diff --git a/Makefile.am b/Makefile.am
index 4e96444..d1a1bd8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,11 +43,12 @@
 	sol/console_buffer.hpp \
 	sd_event_loop.hpp \
 	sol/sol_context.hpp \
-	sol/sol_manager.hpp
+	sol/sol_manager.hpp \
+	sd_event_loop.cpp
 
 netipmid_CPPFLAGS = -DNET_IPMID_LIB_PATH=\"/usr/lib/net-ipmid/\"
-netipmid_LDFLAGS = $(SYSTEMD_LIBS) $(CRYPTO_LIBS) $(libmapper_LIBS) $(LIBADD_DLOPEN) -export-dynamic
-netipmid_CXXFLAGS = $(SYSTEMD_CFLAGS) $(libmapper_CFLAGS)
+netipmid_LDFLAGS = $(SYSTEMD_LIBS) $(CRYPTO_LIBS) $(libmapper_LIBS) $(PHOSPHOR_LOGGING_LIBS) $(LIBADD_DLOPEN) -export-dynamic
+netipmid_CXXFLAGS = $(SYSTEMD_CFLAGS) $(libmapper_CFLAGS) $(PHOSPHOR_LOGGING_CFLAGS)
 
 SUBDIRS = test
 
diff --git a/configure.ac b/configure.ac
index 715bf56..3b7a75b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,7 @@
 # Checks for libraries.
 PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
 PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g], ,[AC_MSG_ERROR([can't find openssl libcrypto])])
+PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
 AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])])
 
 # Checks for header files.
diff --git a/sd_event_loop.cpp b/sd_event_loop.cpp
new file mode 100644
index 0000000..a99cf56
--- /dev/null
+++ b/sd_event_loop.cpp
@@ -0,0 +1,133 @@
+#include <sys/ioctl.h>
+#include <systemd/sd-daemon.h>
+#include <phosphor-logging/log.hpp>
+#include "main.hpp"
+#include "message_handler.hpp"
+#include "sd_event_loop.hpp"
+
+namespace eventloop
+{
+using namespace phosphor::logging;
+
+static int udp623Handler(sd_event_source* es, int fd, uint32_t revents,
+                         void* userdata)
+{
+    std::shared_ptr<udpsocket::Channel> channelPtr;
+    struct timeval timeout;
+    timeout.tv_sec = SELECT_CALL_TIMEOUT;
+    timeout.tv_usec = 0;
+
+    try
+    {
+        channelPtr.reset(new udpsocket::Channel(fd, timeout));
+
+        // Initialize the Message Handler with the socket channel
+        message::Handler msgHandler(channelPtr);
+
+
+        std::unique_ptr<message::Message> inMessage;
+
+        // Read the incoming IPMI packet
+        inMessage = msgHandler.receive();
+        if (inMessage == nullptr)
+        {
+            return 0;
+        }
+
+        // Execute the Command
+        auto outMessage = msgHandler.executeCommand(*(inMessage.get()));
+        if (outMessage == nullptr)
+        {
+            return 0;
+        }
+
+        // Send the response IPMI Message
+        msgHandler.send(*(outMessage.get()));
+    }
+    catch (std::exception& e)
+    {
+        log<level::ERR>("Executing the IPMI message failed");
+        log<level::ERR>(e.what());
+    }
+
+    return 0;
+}
+
+int EventLoop::startEventLoop()
+{
+    int fd = -1;
+    int r = 0;
+    sigset_t ss;
+    sd_event_source* source = nullptr;
+
+    r = sd_event_default(&event);
+    if (r < 0)
+    {
+        goto finish;
+    }
+
+    if (sigemptyset(&ss) < 0 || sigaddset(&ss, SIGTERM) < 0 ||
+        sigaddset(&ss, SIGINT) < 0)
+    {
+        r = -errno;
+        goto finish;
+    }
+
+    /* Block SIGTERM first, so that the event loop can handle it */
+    if (sigprocmask(SIG_BLOCK, &ss, nullptr) < 0)
+    {
+        r = -errno;
+        goto finish;
+    }
+
+    /* Let's make use of the default handler and "floating" reference features
+     * of sd_event_add_signal() */
+    r = sd_event_add_signal(event, nullptr, SIGTERM, nullptr, nullptr);
+    if (r < 0)
+    {
+        goto finish;
+    }
+
+    r = sd_event_add_signal(event, nullptr, SIGINT, nullptr, nullptr);
+    if (r < 0)
+    {
+        goto finish;
+    }
+
+    if (sd_listen_fds(0) != 1)
+    {
+        log<level::ERR>("No or too many file descriptors received");
+        goto finish;
+    }
+
+    fd = SD_LISTEN_FDS_START;
+
+    r = sd_event_add_io(event, &source, fd, EPOLLIN, udp623Handler, nullptr);
+    if (r < 0)
+    {
+        goto finish;
+    }
+
+    udpIPMI.reset(source);
+    source = nullptr;
+
+    r = sd_event_loop(event);
+
+finish:
+    event = sd_event_unref(event);
+
+    if (fd >= 0)
+    {
+        (void) close(fd);
+    }
+
+    if (r < 0)
+    {
+        log<level::ERR>("Event Loop Failure:",
+                entry("FAILURE=%s", strerror(-r)));
+    }
+
+    return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+}
+
+} // namespace eventloop
