diff --git a/Dockerfile b/Dockerfile
index 97b715a..3d95450 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,10 @@
-# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 the original author or authors.
 #
 # 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
+#      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,
@@ -14,36 +14,49 @@
 
 # bbsim dockerfile
 
-# builder parent
-FROM golang:1.10-stretch as builder
+ARG TAG=latest
+ARG REGISTRY=
+ARG REPOSITORY=
 
-# install prereqs
-ENV PROTOC_VERSION 3.6.1
-ENV PROTOC_SHA256SUM 6003de742ea3fcf703cfec1cd4a3380fd143081a2eb0e559065563496af27807
+#builder parent
+FROM ubuntu:16.04
 
-RUN apt-get update \
- && apt-get install unzip \
- && curl -L -o /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip \
- && echo "$PROTOC_SHA256SUM  /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c - \
- && unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /tmp/protoc3 \
- && mv /tmp/protoc3/bin/* /usr/local/bin/ \
- && mv /tmp/protoc3/include/* /usr/local/include/ \
- && go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
- && go get -v github.com/golang/protobuf/protoc-gen-go
+MAINTAINER Voltha Community <info@opennetworking.org>
 
-# copy and build
-WORKDIR /go/src/gerrit.opencord.org/voltha-bbsim
-COPY . /go/src/gerrit.opencord.org/voltha-bbsim
+# Install required packages
+RUN apt-get update && apt-get install -y wget git make libpcap-dev gcc unzip
+ARG version="1.9.3."
+RUN wget https://storage.googleapis.com/golang/go${version}linux-amd64.tar.gz -P /tmp \
+    && tar -C /usr/local -xzf /tmp/go${version}linux-amd64.tar.gz \
+    && rm /tmp/go${version}linux-amd64.tar.gz
 
+# Set PATH
+ENV GOPATH $HOME/go
+ENV PATH /usr/local/go/bin:/go/bin:$PATH
+
+# Copy source code
+RUN mkdir -p $GOPATH/src/gerrit.opencord.org/voltha-bbsim
+COPY . $GOPATH/src/gerrit.opencord.org/voltha-bbsim
+
+# Install golang protobuf and pcap support
+RUN wget https://github.com/google/protobuf/releases/download/v3.6.0/protoc-3.6.0-linux-x86_64.zip -P /tmp/ \
+&& unzip /tmp/protoc-3.6.0-linux-x86_64.zip -d /tmp/ \
+&& mv /tmp/bin/* /usr/local/bin/ \
+&& mv /tmp/include/* /usr/local/include/ \
+&& go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
+&& go get -u github.com/golang/protobuf/protoc-gen-go \
+&& go get -u github.com/google/gopacket/pcap \
+&& go get -u golang.org/x/net/context \
+&& go get -u google.golang.org/grpc
+
+# ... Install utilities & config
+RUN apt-get update && apt-get install -y wpasupplicant isc-dhcp-server
+COPY ./config/wpa_supplicant.conf /etc/wpa_supplicant/
+COPY ./config/isc-dhcp-server /etc/default/
+COPY ./config/dhcpd.conf /etc/dhcp/
+RUN mv /usr/sbin/dhcpd /usr/local/bin/ \
+&& mv /sbin/dhclient /usr/local/bin/
+
+WORKDIR $GOPATH/src/gerrit.opencord.org/voltha-bbsim
 RUN make bbsim
 
-# runtime parent
-FROM alpine:3.8
-
-# required for binaries to run
-RUN apk add --update libc6-compat
-
-WORKDIR /app
-COPY --from=builder /go/src/gerrit.opencord.org/voltha-bbsim/bbsim /app/bbsim
-
-CMD [ '/app/bbsim' ]
diff --git a/Makefile b/Makefile
index 0ec079c..56bbcb2 100644
--- a/Makefile
+++ b/Makefile
@@ -17,25 +17,25 @@
 
 .PHONY: dep test clean docker
 
-bbsim: $(BBSIM_DEPS) openolt/openolt.pb.go dep
+bbsim: protos/openolt.pb.go dep
 	go build -i -v -o $@
 
-dep: openolt/openolt.pb.go
+dep: protos/openolt.pb.go
 	@go get -v -d ./...
 
-openolt/openolt.pb.go: openolt.proto
+protos/openolt.pb.go: openolt.proto
 	@protoc -I . \
 	-I${GOPATH}/src \
 	-I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-	--go_out=plugins=grpc:openolt \
-	$<
+	--go_out=plugins=grpc:protos/ \
+	openolt.proto
 
 test:
 	@go test -v ./...
 	@go test -v ./... -cover
 
 clean:
-	@rm bbsim openolt/openolt.pb.go
+	@rm bbsim protos/openolt.pb.go
 
 docker:
 	@docker build -t voltha/voltha-bbsim:${DOCKERTAG} .
diff --git a/README b/README
deleted file mode 100644
index 0b186af..0000000
--- a/README
+++ /dev/null
@@ -1,85 +0,0 @@
-# 1. Overview
-
-The BBSim (Broadband Simulator) is for emulating the control message response sent from OLTs and ONUs which are connected to VOLTHA Adapter.
-It is implemetend as a software process which runs outside VOLTHA, and acts as if it was multiple OLTs and ONUs.
-This enables the scalability test of VOLTHA without actual hardware OLTs / ONUs.
-The difference from the existing PONsim is to focus on emulating control messages, not data-path traffic which PONsim targets.
-
-It currently supports the following VOLTHA mode:
-(Reference to https://github.com/opencord/voltha/blob/master/BUILD.md)
-* Run in stand-alone mode
-* Run with the "voltha ensamble"
-
-**Please note: Kubernetes mode is NOT supported by the current version.**
-
-==============
-VOLTHA
-OpenOLT Adapter
-==============
-|||
-|||  gRPC connections
-|||
-==============
-BBSim
-==============
-
-# 2. PON Simulator Usage
-
-```
-Usage of ./bbsim:
-  -H
-    	IP and Port number which BBSim listens (default 172.17.0.1:50060)
-  -N
-        Number of OLTs
-  -i
-    	Number of PON interfaces provided per OLT
-  -n
-    	Number of ONUs per PON interface
-```
-
-# 3. Requirements
-
-# Golang Installation
-
-If you plan on running the simulator locally, i.e. not in a container, you will need to first 
-install setup Golang on your system.  Install using existing packages for your operating system 
-or issue the following commands (Linux).
-
-```
-cd /tmp
-wget https://storage.googleapis.com/golang/go1.9.3.linux-amd64.tar.gz
-tar -C /usr/local -xzf /tmp/go1.9.3.linux-amd64.tar.gz
-rm -f /tmp/go1.9.3.linux-amd64.tar.gz
-mkdir ~/go
-```
-
-Edit your profile (e.g. .bashrc) and add the following configuration
-
-```
-export GOROOT=/usr/local/go
-export GOPATH=~/go
-export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
-```
-
-# 4. Run BBSim and VOLTHA-CLI commands
-
-```
-# in VOLTHA docker
-cd /cord/incubator/voltha/voltha/bbsim
-./bbsim -H 172.17.0.1:50060 -N 1 -i 1 -n 16
-
-# After this, execute the following commands from VOLTHA-CLI
-(voltha) health
-{
-    "state": "HEALTHY"
-}
-(voltha) preprovision_olt -t openolt -H 172.17.0.1:50060
-success (device id = <deviceid>)
-(voltha) enable
-enabling <deviceid>
-waiting for device to be enabled...
-success (device id = <deviceid>)
-(voltha) devices
-## You can see the list of devices (OLT/ONUs) ##
-```
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..516c61f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,65 @@
+# 1. Overview
+
+The BBSim (Broadband Simulator) is for emulating the control message response sent from OLT and ONUs which are connected to VOLTHA Adapter.
+It is implemetend as a software process which runs outside VOLTHA, and acts as if it was a OLT connected to multiple ONUs.
+This enables the scalability test of VOLTHA without actual hardware OLT / ONUs.
+The difference from the existing PONsim is to focus on emulating control messages, not data-path traffic which PONsim targets.
+
+The BBSim container contains wpa_supplicants and dhcp clients for supporting AAA client (wpa_supplicant) emulation & DHCP client emulation.
+
+==============
+VOLTHA
+OpenOLT Adapter
+==============
+ |
+ |  gRPC connections
+ |
+==============
+BBSim container
+==============
+
+# 2. Build, Run BBSim and VOLTHA-CLI commands
+```
+# Build and Run Docker container
+git clone https://github.com/opencord/voltha-bbsim
+cd voltha-bbsim
+make docker
+docker run -it --rm --privileged=true --expose=50060 --network=compose_default voltha/voltha-bbsim /go/src/gerrit.opencord.org/voltha-bbsim/bbsim -n 16
+
+# After this, execute the following commands from VOLTHA-CLI
+(voltha) health
+{
+    "state": "HEALTHY"
+}
+(voltha) preprovision_olt -t openolt -H <BBSim Docker container IP>
+success (device id = <deviceid>)
+(voltha) enable
+enabling <deviceid>
+waiting for device to be enabled...
+success (device id = <deviceid>)
+(voltha) devices
+## You can see the list of devices (OLT/ONUs) ##
+```
+
+# 3. How to use BBSim
+
+```
+# Note: 2018/10/8 The current version only supports AAA emulations.
+Usage of ./bbsim:
+  -H string
+    	IP address:port (default ":50060")
+  -a int
+    	Wait time (sec) for activation WPA supplicants (default 30)
+  -d int
+    	Wait time (sec) for activation DHCP clients (default 10)
+  -i int
+    	Number of PON-IF ports (default 1)
+  -id int
+    	OLT-ID (default: 0)
+  -m string
+    	Emulation mode (default, aaa, both (aaa & dhcp)) (default "default")
+  -n int
+    	Number of ONUs per PON-IF port (default 1)
+  -s string
+    	DHCP Server IP Address (default "182.21.0.1")
+```
diff --git a/bbsim.go b/bbsim.go
index 28ab99f..27373f8 100755
--- a/bbsim.go
+++ b/bbsim.go
@@ -17,266 +17,20 @@
 package main
 
 import (
-	"log"
-	"net"
-	"gerrit.opencord.org/voltha-bbsim/openolt"
-	"google.golang.org/grpc"
-	"fmt"
+	"gerrit.opencord.org/voltha-bbsim/protos"
+	"gerrit.opencord.org/voltha-bbsim/core"
 	"flag"
-	"reflect"
-	"strings"
+	"fmt"
+	"log"
+	"os"
+	"os/signal"
 	"strconv"
+	"strings"
 	"sync"
+	"time"
 )
 
-type server struct{
-	olt olt
-	onus map[uint32]map[uint32]*onu
-}
-
-
-type oltState int
-type onuState int
-
-const(
-	PRE_ENABLE oltState = iota
-	OLT_UP
-	PONIF_UP
-	ONU_DISCOVERED
-)
-
-const(
-	ONU_PRE_ACTIVATED onuState = iota
-	ONU_ACTIVATED
-)
-
-type olt struct {
-	ID			         uint32
-	NumPonIntf           uint32
-	NumNniIntf           uint32
-	Mac                  string
-	SerialNumber         string
-	Manufacture          string
-	Name                 string
-	internalState        oltState
-	OperState            string
-	Intfs                []intf
-	HeartbeatSignature   uint32
-}
-
-type intf struct{
-	Type                string
-	IntfID              uint32
-	OperState           string
-}
-
-type onu struct{
-	internalState       onuState
-	IntfID              uint32
-	OperState           string
-	SerialNumber        *openolt.SerialNumber
-}
-
-func createOlt(oltid uint32, npon uint32, nnni uint32) olt{
-	olt := olt {}
-	olt.ID              = oltid
-	olt.NumPonIntf      = npon
-	olt.NumNniIntf      = nnni
-	olt.Name          = "BBSIM OLT"
-	olt.internalState = PRE_ENABLE
-	olt.OperState     = "up"
-	olt.Intfs = make([]intf, olt.NumPonIntf + olt.NumNniIntf)
-	olt.HeartbeatSignature = oltid
-	for i := uint32(0); i < olt.NumNniIntf; i ++ {
-		olt.Intfs[i].IntfID = i
-		olt.Intfs[i].OperState = "up"
-		olt.Intfs[i].Type      = "nni"
-	}
-	for i := uint32(olt.NumNniIntf); i <  olt.NumPonIntf + olt.NumNniIntf; i ++ {
-		olt.Intfs[i].IntfID = i
-		olt.Intfs[i].OperState = "up"
-		olt.Intfs[i].Type      = "pon"
-	}
-	return olt
-}
-
-func createSN(oltid uint32, intfid uint32, onuid uint32) string{
-	sn := fmt.Sprintf("%X%X%02X", oltid, intfid, onuid)
-	return sn
-}
-
-func createOnus(oltid uint32, intfid uint32, nonus uint32, nnni uint32) map[uint32] *onu {
-	onus := make(map[uint32] *onu ,nonus)
-	for onuid := uint32(1 + (intfid - nnni) * nonus); onuid <= (intfid - nnni + 1) * nonus; onuid ++ {
-		onu := onu{}
-		onu.internalState = ONU_PRE_ACTIVATED
-		onu.IntfID        = intfid
-		onu.OperState     = "up"
-		onu.SerialNumber  = new(openolt.SerialNumber)
-		onu.SerialNumber.VendorId = []byte("BRCM")
-		onu.SerialNumber.VendorSpecific = []byte(createSN(oltid, intfid, uint32(onuid))) //FIX
-		onus[onuid] = &onu
-	}
-	return onus
-}
-
-func validateONU(targetonu openolt.Onu, regonus map[uint32]map[uint32] *onu) bool{
-	for _, onus := range regonus{
-		for _, onu := range onus{
-			if validateSN(*targetonu.SerialNumber, *onu.SerialNumber){
-				return true
-			}
-		}
-	}
-	return false
-}
-
-func validateSN(sn1 openolt.SerialNumber, sn2 openolt.SerialNumber) bool{
-	return reflect.DeepEqual(sn1.VendorId, sn2.VendorId) && reflect.DeepEqual(sn1.VendorSpecific, sn2.VendorSpecific)
-}
-
-func isAllONUActive(regonus map[uint32]map[uint32] *onu ) bool{
-	for _, onus := range regonus{
-		for _, onu := range onus{
-			if onu.internalState != ONU_ACTIVATED{
-				return false
-			}
-		}
-	}
-	return true
-}
-
-func updateOnusOpStatus(ponif uint32, onus map[uint32] *onu, opstatus string){
-	for i, onu := range onus{
-		onu.OperState = "up"
-		log.Printf("(PONIF:%d) ONU [%d] discovered.\n", ponif, i)
-	}
-}
-
-func activateOLT(s *server, stream openolt.Openolt_EnableIndicationServer) error{
-	// Activate OLT
-	olt  := &s.olt
-	onus := s.onus
-	if err := sendOltInd(stream, olt); err != nil {
-		return err
-	}
-	olt.OperState = "up"
-	olt.internalState = OLT_UP
-	log.Printf("OLT %s sent OltInd.\n", olt.Name)
-
-
-	// OLT sends Interface Indication to Adapter
-	if err := sendIntfInd(stream, olt); err != nil {
-		return err
-	}
-	log.Printf("OLT %s sent IntfInd.\n", olt.Name)
-
-	// OLT sends Operation Indication to Adapter after activating each interface
-	//time.Sleep(IF_UP_TIME * time.Second)
-	olt.internalState = PONIF_UP
-	if err := sendOperInd(stream, olt); err != nil {
-		return err
-	}
-	log.Printf("OLT %s sent OperInd.\n", olt.Name)
-
-	// OLT sends ONU Discover Indication to Adapter after ONU discovery
-	for intfid := uint32(olt.NumNniIntf); intfid < olt.NumNniIntf + olt.NumPonIntf; intfid ++ {
-		updateOnusOpStatus(intfid, onus[intfid], "up")
-	}
-
-	for intfid := uint32(olt.NumNniIntf); intfid < olt.NumNniIntf + olt.NumPonIntf; intfid ++ {
-		sendOnuDiscInd(stream, onus[intfid])
-		log.Printf("OLT id:%d sent ONUDiscInd.\n", olt.ID)
-	}
-
-	for{
-		//log.Printf("stop %v\n", s.onus)
-		if isAllONUActive(s.onus){
-			//log.Printf("break! %v\n", s.onus)
-			break
-		}
-	}
-	for intfid := uint32(olt.NumNniIntf); intfid < olt.NumNniIntf + olt.NumPonIntf; intfid ++ {
-		sendOnuInd(stream, onus[intfid])
-		log.Printf("OLT id:%d sent ONUInd.\n", olt.ID)
-	}
-	return nil
-}
-
-func sendOltInd(stream openolt.Openolt_EnableIndicationServer, olt *olt) error{
-	data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: "up"}}
-	if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-		log.Printf("Failed to send OLT indication: %v\n", err)
-		return err
-	}
-	return nil
-}
-
-func sendIntfInd(stream openolt.Openolt_EnableIndicationServer, olt *olt) error{
-	for i := uint32(0); i < olt.NumPonIntf + olt.NumNniIntf; i ++ {
-		intf := olt.Intfs[i]
-		data := &openolt.Indication_IntfInd{&openolt.IntfIndication{IntfId: intf.IntfID, OperState: intf.OperState}}
-		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			log.Printf("Failed to send Intf [id: %d] indication : %v\n", i, err)
-			return err
-		}
-		log.Printf("SendIntfInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
-	}
-	return nil
-}
-
-func sendOperInd(stream openolt.Openolt_EnableIndicationServer, olt *olt) error{
-	for i := uint32(0); i < olt.NumPonIntf + olt.NumNniIntf; i ++ {
-		intf := olt.Intfs[i]
-		data := &openolt.Indication_IntfOperInd{&openolt.IntfOperIndication{Type: intf.Type, IntfId: intf.IntfID, OperState: intf.OperState}}
-		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			log.Printf("Failed to send IntfOper [id: %d] indication : %v\n", i, err)
-			return err
-		}
-		log.Printf("SendOperInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
-	}
-	return nil
-}
-
-func sendOnuDiscInd(stream openolt.Openolt_EnableIndicationServer, onus map[uint32] *onu) error{
-	for i, onu := range onus {
-		data := &openolt.Indication_OnuDiscInd{&openolt.OnuDiscIndication{IntfId: onu.IntfID, SerialNumber:onu.SerialNumber}}
-		log.Printf("sendONUDiscInd Onuid: %d\n", i)
-		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			log.Printf("Failed to send ONUDiscInd [id: %d]: %v\n", i, err)
-			return err
-		}
-	}
-	return nil
-}
-
-func sendOnuInd(stream openolt.Openolt_EnableIndicationServer, onus map[uint32] *onu) error{
-	for i, onu := range onus {
-		data := &openolt.Indication_OnuInd{&openolt.OnuIndication{IntfId: onu.IntfID, OnuId: uint32(i), OperState: "up", AdminState: "up", SerialNumber:onu.SerialNumber}}
-		log.Printf("sendONUInd Onuid: %d\n", i)
-		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
-			log.Printf("Failed to send ONUInd [id: %d]: %v\n", i, err)
-			return err
-		}
-	}
-	return nil
-}
-
-func newServer(oltid uint32, npon uint32, nonus uint32) *server{
-	s := new(server)
-	s.olt  = createOlt(oltid, npon, 1)
-	nnni := s.olt.NumNniIntf
-	log.Printf("OLT ID: %d was retrieved.\n", s.olt.ID)
-
-	s.onus = make(map[uint32]map[uint32] *onu)
-	for intfid := nnni; intfid < npon + nnni; intfid ++ {
-		s.onus[intfid] = createOnus(oltid, intfid, nonus, nnni)
-	}
-	//log.Printf("s.onus: %v\n", s.onus)
-	return s
-}
-
-func printBanner(){
+func printBanner() {
 	log.Println("     ________    _______   ________                 ")
 	log.Println("    / ____   | / ____   | / ______/  __            ")
 	log.Println("   / /____/ / / /____/ / / /_____   /_/            ")
@@ -285,38 +39,63 @@
 	log.Println("/________/ /________/ /________/ /_/ /_/ /_/ /_/  ")
 }
 
-func getOptions()(string, uint32, uint32, uint32, uint32){
-	addressport := flag.String("H","127.0.0.1:50060","IP address:port")
-	nolts    := flag.Int("N", 1, "Number of OLTs")
-	nports   := flag.Int("i", 1, "Number of PON-IF ports")
-	nonus    := flag.Int("n", 1, "Number of ONUs per PON-IF port")
+func getOptions() (uint32, string, uint32, uint32, uint32, int, int, string, core.Mode) {
+	addressport := flag.String("H", ":50060", "IP address:port")
+	oltid := flag.Int("id", 0, "OLT-ID")
+	nintfs := flag.Int("i", 1, "Number of PON-IF ports")
+	nonus := flag.Int("n", 1, "Number of ONUs per PON-IF port")
+	modeopt := flag.String("m", "default", "Emulation mode (default, aaa, both (aaa & dhcp))")
+	aaawait := flag.Int("a", 30, "Wait time (sec) for activation WPA supplicants")
+	dhcpwait := flag.Int("d", 10, "Wait time (sec) for activation DHCP clients")
+	dhcpservip := flag.String("s", "182.21.0.1", "DHCP Server IP Address")
+	mode := core.DEFAULT
 	flag.Parse()
-	fmt.Printf("%v\n", *addressport)
-	//fmt.Println("nports:", *nports, "nonus:", *nonus)
-	address  := strings.Split(*addressport, ":")[0]
-	port,_ := strconv.Atoi(strings.Split(*addressport, ":")[1])
-	return address, uint32(port), uint32(*nolts), uint32(*nports), uint32(*nonus)
+	if *modeopt == "aaa" {
+		mode = core.AAA
+	} else if *modeopt == "both" {
+		mode = core.BOTH
+	}
+	address := strings.Split(*addressport, ":")[0]
+	tmp, _ := strconv.Atoi(strings.Split(*addressport, ":")[1])
+	port := uint32(tmp)
+	return uint32(*oltid), address, port, uint32(*nintfs), uint32(*nonus), *aaawait, *dhcpwait, *dhcpservip, mode
 }
 
-
 func main() {
+	// CLI Shows up
 	printBanner()
-	ipaddress, baseport, nolts, npon, nonus := getOptions()
-	log.Printf("ip:%s, baseport:%d, nolts:%d, npon:%d, nonus:%d\n", ipaddress, baseport, nolts, npon, nonus)
-	servers := make([] *server, nolts)
-	grpcservers := make([] *grpc.Server, nolts)
-	lis         := make([] net.Listener, nolts)
+	oltid, ip, port, npon, nonus, aaawait, dhcpwait, dhcpservip, mode := getOptions()
+	log.Printf("ip:%s, baseport:%d, npon:%d, nonus:%d, mode:%d\n", ip, port, npon, nonus, mode)
+
+	// Set up gRPC Server
 	var wg sync.WaitGroup
-	wg.Add(int(nolts))
-	for oltid := uint32(0); oltid < nolts; oltid ++ {
-		portnum := baseport + oltid
-		addressport := ipaddress + ":" + strconv.Itoa(int(portnum))
-		log.Printf("Listening %s ...", addressport)
-		lis[oltid], _ = net.Listen("tcp", addressport)
-		servers[oltid] = newServer(oltid, npon, nonus)
-		grpcservers[oltid] = grpc.NewServer()
-		openolt.RegisterOpenoltServer(grpcservers[oltid], servers[oltid])
-		go grpcservers[oltid].Serve(lis[oltid])
+
+	addressport := ip + ":" + strconv.Itoa(int(port))
+	endchan := make(chan int, 1)
+	listener, gserver, err := core.CreateGrpcServer(oltid, npon, nonus, addressport)
+	server := core.CreateServer(oltid, npon, nonus, aaawait, dhcpwait, dhcpservip, gserver, mode, endchan)
+	if err != nil {
+		log.Println(err)
 	}
+	openolt.RegisterOpenoltServer(gserver, server)
+
+	wg.Add(1)
+	go func() {
+		defer wg.Done()
+		gserver.Serve(listener)
+	}()
+
+	c := make(chan os.Signal, 1)
+	signal.Notify(c, os.Interrupt)
+	go func() {
+		for sig := range c {
+			fmt.Println("SIGINT", sig)
+			close(c)
+			close(server.Endchan)
+			gserver.Stop()
+		}
+	}()
 	wg.Wait()
+	time.Sleep(5 * time.Second)
+	log.Println("Reach to the end line")
 }
diff --git a/config/dhcpd.conf b/config/dhcpd.conf
new file mode 100644
index 0000000..9f36163
--- /dev/null
+++ b/config/dhcpd.conf
@@ -0,0 +1,125 @@
+#
+# Sample configuration file for ISC dhcpd for Debian
+#
+# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
+# configuration file instead of this file.
+#
+#
+
+# The ddns-updates-style parameter controls whether or not the server will
+# attempt to do a DNS update when a lease is confirmed. We default to the
+# behavior of the version 2 packages ('none', since DHCP v2 didn't
+# have support for DDNS.)
+ddns-update-style none;
+
+# option definitions common to all supported networks...
+option domain-name "example.org";
+option domain-name-servers ns1.example.org, ns2.example.org;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+#authoritative;
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
+# No service will be given on this subnet, but declaring it helps the
+# DHCP server to understand the network topology.
+
+#subnet 10.152.187.0 netmask 255.255.255.0 {
+#}
+
+# This is a very basic subnet declaration.
+subnet 182.21.0.0 netmask 255.255.0.0 {
+  range 182.21.0.1 182.21.0.32;
+  option routers 182.21.0.254;
+}
+
+#subnet 182.22.0.0 netmask 255.255.0.0 {
+#  range 182.22.0.1 182.22.0.240;
+#  option routers 182.22.0.254;
+#}
+
+#subnet 172.20.0.0 netmask 255.255.0.0 {
+#  range 172.20.0.1 172.20.0.240;
+#  option routers 172.20.0.254;
+#}
+
+#subnet 10.254.239.0 netmask 255.255.255.224 {
+#  range 10.254.239.10 10.254.239.20;
+#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
+#}
+
+# This declaration allows BOOTP clients to get dynamic addresses,
+# which we don't really recommend.
+
+#subnet 10.254.239.32 netmask 255.255.255.224 {
+#  range dynamic-bootp 10.254.239.40 10.254.239.60;
+#  option broadcast-address 10.254.239.31;
+#  option routers rtr-239-32-1.example.org;
+#}
+
+# A slightly different configuration for an internal subnet.
+#subnet 10.5.5.0 netmask 255.255.255.224 {
+#  range 10.5.5.26 10.5.5.30;
+#  option domain-name-servers ns1.internal.example.org;
+#  option domain-name "internal.example.org";
+#  option subnet-mask 255.255.255.224;
+#  option routers 10.5.5.1;
+#  option broadcast-address 10.5.5.31;
+#  default-lease-time 600;
+#  max-lease-time 7200;
+#}
+
+# Hosts which require special configuration options can be listed in
+# host statements.   If no address is specified, the address will be
+# allocated dynamically (if possible), but the host-specific information
+# will still come from the host declaration.
+
+#host passacaglia {
+#  hardware ethernet 0:0:c0:5d:bd:95;
+#  filename "vmunix.passacaglia";
+#  server-name "toccata.fugue.com";
+#}
+
+# Fixed IP addresses can also be specified for hosts.   These addresses
+# should not also be listed as being available for dynamic assignment.
+# Hosts for which fixed IP addresses have been specified can boot using
+# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
+# be booted with DHCP, unless there is an address range on the subnet
+# to which a BOOTP client is connected which has the dynamic-bootp flag
+# set.
+#host fantasia {
+#  hardware ethernet 08:00:07:26:c0:a5;
+#  fixed-address fantasia.fugue.com;
+#}
+
+# You can declare a class of clients and then do address allocation
+# based on that.   The example below shows a case where all clients
+# in a certain class get addresses on the 10.17.224/24 subnet, and all
+# other clients get addresses on the 10.0.29/24 subnet.
+
+#class "foo" {
+#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
+#}
+
+#shared-network 224-29 {
+#  subnet 10.17.224.0 netmask 255.255.255.0 {
+#    option routers rtr-224.example.org;
+#  }
+#  subnet 10.0.29.0 netmask 255.255.255.0 {
+#    option routers rtr-29.example.org;
+#  }
+#  pool {
+#    allow members of "foo";
+#    range 10.17.224.10 10.17.224.250;
+#  }
+#  pool {
+#    deny members of "foo";
+#    range 10.0.29.10 10.0.29.230;
+#  }
+#}
\ No newline at end of file
diff --git a/config/isc-dhcp-server b/config/isc-dhcp-server
new file mode 100644
index 0000000..440f7b3
--- /dev/null
+++ b/config/isc-dhcp-server
@@ -0,0 +1,22 @@
+# Defaults for isc-dhcp-server initscript
+# sourced by /etc/init.d/isc-dhcp-server
+# installed at /etc/default/isc-dhcp-server by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
+#DHCPD_CONF=/etc/dhcp/dhcpd.conf
+
+# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
+#DHCPD_PID=/var/run/dhcpd.pid
+
+# Additional options to start dhcpd with.
+#	Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
+#OPTIONS=""
+
+# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
+#	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
+INTERFACES="sim_nu0"
+
diff --git a/config/wpa_supplicant.conf b/config/wpa_supplicant.conf
new file mode 100644
index 0000000..1f0a99c
--- /dev/null
+++ b/config/wpa_supplicant.conf
@@ -0,0 +1,15 @@
+ctrl_interface=/var/run/wpa_supplicant
+eapol_version=1
+ap_scan=0
+fast_reauth=1
+network={
+        key_mgmt=WPA-EAP
+        eap=MD5
+        identity="user"
+        password="password"
+        ca_cert="/etc/cert/cacert.pem"
+        client_cert="/etc/cert/client.pem"
+        private_key="/etc/cert/client.key"
+        private_key_passwd="whatever"
+        eapol_flags=3
+}
diff --git a/core/core_server.go b/core/core_server.go
new file mode 100644
index 0000000..39f4ca7
--- /dev/null
+++ b/core/core_server.go
@@ -0,0 +1,460 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 core
+
+import (
+	"gerrit.opencord.org/voltha-bbsim/device"
+	"gerrit.opencord.org/voltha-bbsim/protos"
+	"gerrit.opencord.org/voltha-bbsim/setup"
+	"errors"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"github.com/google/gopacket/pcap"
+	"google.golang.org/grpc"
+	"log"
+	"strconv"
+	"sync"
+	"time"
+)
+
+type Mode int
+
+const MAX_ONUS_PER_PON = 64 // This value should be the same with the value in AdapterPlatrorm class
+
+const (
+	DEFAULT Mode = iota
+	AAA
+	BOTH
+)
+
+type Server struct {
+	Olt          *device.Olt
+	Onumap       map[uint32][]*device.Onu
+	Ioinfos      []*Ioinfo
+	Endchan      chan int
+	Mode         Mode
+	AAAWait      int
+	DhcpWait     int
+	DhcpServerIP string
+	gRPCserver   *grpc.Server
+}
+
+type Packet struct {
+	Info *Ioinfo
+	Pkt  gopacket.Packet
+}
+
+func CreateServer(oltid uint32, npon uint32, nonus uint32, aaawait int, dhcpwait int, ip string, g *grpc.Server, mode Mode, e chan int) *Server {
+	s := new(Server)
+	s.Olt = device.CreateOlt(oltid, npon, 1)
+	nnni := s.Olt.NumNniIntf
+	log.Printf("OLT ID: %d was retrieved.\n", s.Olt.ID)
+	s.Onumap = make(map[uint32][]*device.Onu)
+	s.AAAWait = aaawait
+	s.DhcpWait = dhcpwait
+	s.DhcpServerIP = ip
+	s.gRPCserver = g
+	s.Mode = mode
+	s.Endchan = e
+	for intfid := nnni; intfid < npon+nnni; intfid++ {
+		s.Onumap[intfid] = device.CreateOnus(oltid, intfid, nonus, nnni)
+	}
+	return s
+}
+
+func (s *Server) activateOLT(stream openolt.Openolt_EnableIndicationServer) error {
+	// Activate OLT
+	olt := s.Olt
+	oltid := olt.ID
+	vethenv := []string{}
+	wg := &sync.WaitGroup{}
+
+	if err := sendOltInd(stream, olt); err != nil {
+		return err
+	}
+	olt.OperState = "up"
+	olt.InternalState = device.OLT_UP
+	log.Printf("OLT %s sent OltInd.\n", olt.Name)
+
+	// OLT sends Interface Indication to Adapter
+	if err := sendIntfInd(stream, olt); err != nil {
+		log.Printf("[ERROR] Fail to sendIntfInd: %v\n", err)
+		return err
+	}
+	log.Printf("OLT %s sent IntfInd.\n", olt.Name)
+
+	// OLT sends Operation Indication to Adapter after activating each interface
+	//time.Sleep(IF_UP_TIME * time.Second)
+	olt.InternalState = device.PONIF_UP
+	if err := sendOperInd(stream, olt); err != nil {
+		log.Printf("[ERROR] Fail to sendOperInd: %v\n", err)
+		return err
+	}
+	log.Printf("OLT %s sent OperInd.\n", olt.Name)
+
+	// OLT sends ONU Discover Indication to Adapter after ONU discovery
+	for intfid, _ := range s.Onumap {
+		device.UpdateOnusOpStatus(intfid, s.Onumap[intfid], "up")
+	}
+
+	for intfid, _ := range s.Onumap {
+		sendOnuDiscInd(stream, s.Onumap[intfid])
+		log.Printf("OLT id:%d sent ONUDiscInd.\n", olt.ID)
+	}
+
+	// OLT Sends OnuInd after waiting all of those ONUs up
+	for {
+		if s.IsAllONUActive() {
+			break
+		}
+	}
+	for intfid, _ := range s.Onumap {
+		sendOnuInd(stream, s.Onumap[intfid])
+		log.Printf("OLT id:%d sent ONUInd.\n", olt.ID)
+	}
+
+	if s.Mode == DEFAULT {
+		//EnableIndication's stream should be kept even after activateOLT() is finished.
+		//Otherwise, OpenOLT adapter sends EnableIndication again.
+		<-s.Endchan
+		log.Println("core server thread receives close !")
+	} else if s.Mode == AAA || s.Mode == BOTH {
+		var err error
+		s.Ioinfos = []*Ioinfo{}
+		for intfid, _ := range s.Onumap {
+			for i := 0; i < len(s.Onumap[intfid]); i++ {
+				var handler *pcap.Handle
+				onuid := s.Onumap[intfid][i].OnuID
+				uniup, unidw := makeUniName(oltid, intfid, onuid)
+				if handler, vethenv, err = setupVethHandler(uniup, unidw, vethenv); err != nil {
+					return err
+				}
+				iinfo := Ioinfo{name: uniup, iotype: "uni", ioloc: "inside", intfid: intfid, onuid: onuid, handler: handler}
+				s.Ioinfos = append(s.Ioinfos, &iinfo)
+				oinfo := Ioinfo{name: unidw, iotype: "uni", ioloc: "outside", intfid: intfid, onuid: onuid, handler: nil}
+				s.Ioinfos = append(s.Ioinfos, &oinfo)
+			}
+		}
+		var handler *pcap.Handle
+		nniup, nnidw := makeNniName(oltid)
+		if handler, vethenv, err = setupVethHandler(nniup, nnidw, vethenv); err != nil {
+			return err
+		}
+		iinfo := Ioinfo{name: nnidw, iotype: "nni", ioloc: "inside", intfid: 1, handler: handler}
+		s.Ioinfos = append(s.Ioinfos, &iinfo)
+		oinfo := Ioinfo{name: nnidw, iotype: "nni", ioloc: "outside", intfid: 1, handler: nil}
+		s.Ioinfos = append(s.Ioinfos, &oinfo)
+
+		errchan := make(chan error)
+		go func() {
+			<-errchan
+			close(s.Endchan)
+		}()
+
+		wg.Add(1)
+		go func() {
+			defer func() {
+				log.Println("runPacketInDaemon Done")
+				wg.Done()
+			}()
+			err := s.runPacketInDaemon(stream)
+			if err != nil {
+				errchan <- err
+				return
+			}
+		}()
+
+		wg.Add(1)
+		go func() {
+			defer func() {
+				log.Println("exeAAATest Done")
+				wg.Done()
+			}()
+			infos, err := s.getUniIoinfos("outside")
+			if err != nil {
+				errchan <- err
+				return
+			}
+			univeths := []string{}
+			for _, info := range infos {
+				univeths = append(univeths, info.name)
+			}
+			err = s.exeAAATest(univeths)
+			if err != nil {
+				errchan <- err
+				return
+			}
+		}()
+		wg.Wait()
+		tearDown(vethenv) // Grace teardown
+		log.Println("Grace shutdown down")
+	}
+	return nil
+}
+
+func (s *Server) runPacketInDaemon(stream openolt.Openolt_EnableIndicationServer) error {
+	log.Println("runPacketInDaemon Start")
+	unichannel := make(chan Packet, 2048)
+	flag := false
+
+	for intfid, _ := range s.Onumap {
+		for _, onu := range s.Onumap[intfid] { //TODO: should be updated for multiple-Interface
+			onuid := onu.OnuID
+			ioinfo, err := s.identifyUniIoinfo("inside", intfid, onuid)
+			if err != nil {
+				log.Printf("[ERROR] Fail to identifyUniIoinfo (onuid: %d): %v\n", onuid, err)
+				return err
+			}
+			uhandler := ioinfo.handler
+			defer uhandler.Close()
+			go RecvWorker(ioinfo, uhandler, unichannel)
+		}
+	}
+
+	ioinfo, err := s.identifyNniIoinfo("inside")
+	if err != nil {
+		return err
+	}
+	nhandler := ioinfo.handler
+	defer nhandler.Close()
+	nnichannel := make(chan Packet, 32)
+	go RecvWorker(ioinfo, nhandler, nnichannel)
+
+	data := &openolt.Indication_PktInd{}
+	for {
+		select {
+		case unipkt := <-unichannel:
+			log.Println("Received packet in grpc Server from UNI.")
+			if unipkt.Info == nil || unipkt.Info.iotype != "uni" {
+				log.Println("[WARNING] This packet does not come from UNI !")
+				continue
+			}
+			intfid := unipkt.Info.intfid
+			onuid := unipkt.Info.onuid
+			gemid, _ := getGemPortID(intfid, onuid)
+			pkt := unipkt.Pkt
+			layerEth := pkt.Layer(layers.LayerTypeEthernet)
+			le, _ := layerEth.(*layers.Ethernet)
+			ethtype := le.EthernetType
+			if ethtype == 0x888e {
+				log.Printf("Received upstream packet is EAPOL.")
+				log.Println(unipkt.Pkt.Dump())
+				log.Println(pkt.Dump())
+			} else if layerDHCP := pkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
+				log.Printf("Received upstream packet is DHCP.")
+				log.Println(unipkt.Pkt.Dump())
+				log.Println(pkt.Dump())
+			} else {
+				continue
+			}
+			log.Printf("sendPktInd intfid:%d (onuid: %d) gemid:%d\n", intfid, onuid, gemid)
+			data = &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{IntfType: "pon", IntfId: intfid, GemportId: gemid, Pkt: pkt.Data()}}
+			if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+				log.Printf("[ERROR] Failed to send PktInd indication. %v\n", err)
+				return err
+			}
+		case nnipkt := <-nnichannel:
+			if nnipkt.Info == nil || nnipkt.Info.iotype != "nni" {
+				log.Println("[WARNING] This packet does not come from NNI !")
+				continue
+			}
+			log.Println("Received packet in grpc Server from NNI.")
+			intfid := nnipkt.Info.intfid
+			pkt := nnipkt.Pkt
+			log.Printf("sendPktInd intfid:%d\n", intfid)
+			data = &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{IntfType: "nni", IntfId: intfid, Pkt: pkt.Data()}}
+			if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+				log.Printf("[ERROR] Failed to send PktInd indication. %v\n", err)
+				return err
+			}
+		case <-s.Endchan:
+			if flag == false {
+				log.Println("PacketInDaemon thread receives close !")
+				close(unichannel)
+				log.Println("Closed unichannel !")
+				close(nnichannel)
+				log.Println("Closed nnichannel !")
+				flag = true
+				return nil
+			}
+		}
+	}
+	return nil
+}
+
+func (s *Server) exeAAATest(vethenv []string) error {
+	log.Println("exeAAATest Start")
+	for i := 0; i < s.AAAWait; i++ {
+		select {
+		case <-s.Endchan:
+			log.Println("exeAAATest thread receives close !")
+			return nil
+		default:
+			log.Println("exeAAATest is now sleeping....")
+			time.Sleep(time.Second)
+		}
+	}
+	err := setup.ActivateWPASups(vethenv)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (s *Server) onuPacketOut(intfid uint32, onuid uint32, rawpkt gopacket.Packet) error {
+	layerEth := rawpkt.Layer(layers.LayerTypeEthernet)
+	if layerEth != nil {
+		pkt, _ := layerEth.(*layers.Ethernet)
+		ethtype := pkt.EthernetType
+		if ethtype == 0x888e {
+			log.Printf("Received downstream packet is EAPOL.")
+			log.Println(rawpkt.Dump())
+		} else if layerDHCP := rawpkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
+			log.Printf("Received downstream packet is DHCP.")
+			log.Println(rawpkt.Dump())
+			rawpkt, _, _ = PopVLAN(rawpkt)
+			rawpkt, _, _ = PopVLAN(rawpkt)
+		} else {
+			return nil
+		}
+		ioinfo, err := s.identifyUniIoinfo("inside", intfid, onuid)
+		if err != nil {
+			return err
+		}
+		handle := ioinfo.handler
+		SendUni(handle, rawpkt)
+		return nil
+	}
+	log.Printf("[WARNING] Received packet is not supported")
+	return nil
+}
+
+func (s *Server) uplinkPacketOut(rawpkt gopacket.Packet) error {
+	log.Println("")
+	poppkt, _, err := PopVLAN(rawpkt)
+	poppkt, _, err = PopVLAN(poppkt)
+	if err != nil {
+		log.Println(err)
+		return err
+	}
+	ioinfo, err := s.identifyNniIoinfo("inside")
+	if err != nil {
+		return err
+	}
+	handle := ioinfo.handler
+	SendNni(handle, poppkt)
+	return nil
+}
+
+func (s *Server) IsAllONUActive() bool {
+	for _, onus := range s.Onumap {
+		for _, onu := range onus {
+			if onu.InternalState != device.ONU_ACTIVATED {
+				return false
+			}
+		}
+	}
+	return true
+}
+
+func getVID(onuid uint32) (uint16, error) {
+	return uint16(onuid), nil
+}
+
+func getGemPortID(intfid uint32, onuid uint32) (uint32, error) {
+	idx := uint32(0)
+	return 1024 + (((MAX_ONUS_PER_PON*intfid + onuid - 1) * 7) + idx), nil
+	//return uint32(1032 + 8 * (vid - 1)), nil
+}
+
+func (s *Server) getOnuBySN(sn *openolt.SerialNumber) (*device.Onu, error) {
+	for _, onus := range s.Onumap {
+		for _, onu := range onus {
+			if device.ValidateSN(*sn, *onu.SerialNumber) {
+				return onu, nil
+			}
+		}
+	}
+	err := errors.New("No mathced SN is found !")
+	log.Println(err)
+	return nil, err
+}
+
+func (s *Server) getOnuByID(onuid uint32) (*device.Onu, error) {
+	for _, onus := range s.Onumap {
+		for _, onu := range onus {
+			if onu.OnuID == onuid {
+				return onu, nil
+			}
+		}
+	}
+	err := errors.New("No matched OnuID is found !")
+	log.Println(err)
+	return nil, err
+}
+
+func makeUniName(oltid uint32, intfid uint32, onuid uint32) (upif string, dwif string) {
+	upif = setup.UNI_VETH_UP_PFX + strconv.Itoa(int(oltid)) + "_" + strconv.Itoa(int(intfid)) + "_" + strconv.Itoa(int(onuid))
+	dwif = setup.UNI_VETH_DW_PFX + strconv.Itoa(int(oltid)) + "_" + strconv.Itoa(int(intfid)) + "_" + strconv.Itoa(int(onuid))
+	return
+}
+
+func makeNniName(oltid uint32) (upif string, dwif string) {
+	upif = setup.NNI_VETH_UP_PFX + strconv.Itoa(int(oltid))
+	dwif = setup.NNI_VETH_DW_PFX + strconv.Itoa(int(oltid))
+	return
+}
+
+func tearDown(vethenv []string) error {
+	log.Println("tearDown()")
+	setup.KillAllWPASups()
+	setup.KillAllDHCPClients()
+	setup.TearVethDown(vethenv)
+	return nil
+}
+
+func setupVethHandler(inveth string, outveth string, vethenv []string) (*pcap.Handle, []string, error) {
+	log.Printf("setupVethHandler: %s and %s\n", inveth, outveth)
+	err1 := setup.CreateVethPairs(inveth, outveth)
+	vethenv = append(vethenv, inveth)
+	if err1 != nil {
+		setup.RemoveVeths(vethenv)
+		return nil, vethenv, err1
+	}
+	handler, err2 := getVethHandler(inveth)
+	if err2 != nil {
+		setup.RemoveVeths(vethenv)
+		return nil, vethenv, err2
+	}
+	return handler, vethenv, nil
+}
+
+func getVethHandler(vethname string) (*pcap.Handle, error) {
+	var (
+		device       string = vethname
+		snapshot_len int32  = 1518
+		promiscuous  bool   = false
+		err          error
+		timeout      time.Duration = pcap.BlockForever
+	)
+	handle, err := pcap.OpenLive(device, snapshot_len, promiscuous, timeout)
+	if err != nil {
+		return nil, err
+	}
+	log.Printf("Server handle created for %s\n", vethname)
+	return handle, nil
+}
diff --git a/core/grpc_service.go b/core/grpc_service.go
new file mode 100644
index 0000000..a5bc3e5
--- /dev/null
+++ b/core/grpc_service.go
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 core
+
+import (
+	"gerrit.opencord.org/voltha-bbsim/device"
+	"gerrit.opencord.org/voltha-bbsim/protos"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"golang.org/x/net/context"
+	"google.golang.org/grpc"
+	"log"
+	"net"
+)
+
+// gRPC Service
+func (s *Server) DisableOlt(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
+	log.Printf("OLT receives DisableOLT()\n")
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) ReenableOlt(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
+	log.Printf("OLT receives Reenable()\n")
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) CollectStatistics(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
+	log.Printf("OLT receives CollectStatistics()\n")
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) GetDeviceInfo(c context.Context, empty *openolt.Empty) (*openolt.DeviceInfo, error) {
+	log.Printf("OLT receives GetDeviceInfo()\n")
+	return new(openolt.DeviceInfo), nil
+}
+
+func (s *Server) ActivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
+	log.Printf("OLT receives ActivateONU()\n")
+	result := device.ValidateONU(*onu, s.Onumap)
+
+	if result == true {
+		matched, error := s.getOnuBySN(onu.SerialNumber)
+		if error != nil {
+			log.Fatalf("%s\n", error)
+		}
+		onuid := onu.OnuId
+		matched.OnuID = onuid
+		matched.InternalState = device.ONU_ACTIVATED
+		log.Printf("ONU IntfID: %d OnuID: %d activated succesufully.\n", onu.IntfId, onu.OnuId)
+	}
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) DeactivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
+	log.Printf("OLT receives DeactivateONU()\n")
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) DeleteOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
+	log.Printf("OLT receives DeleteONU()\n")
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) OmciMsgOut(c context.Context, msg *openolt.OmciMsg) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives OmciMsgOut to IF %v (ONU-ID: %v) pkt:%x.\n", s.Olt.ID, msg.IntfId, msg.OnuId, msg.Pkt)
+	//s.olt.Queue = append(s.olt.Queue, *msg)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) OnuPacketOut(c context.Context, packet *openolt.OnuPacket) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives OnuPacketOut () to IF-ID:%d ONU-ID %d.\n", s.Olt.ID, packet.IntfId, packet.OnuId)
+	onuid := packet.OnuId
+	intfid := packet.IntfId
+	rawpkt := gopacket.NewPacket(packet.Pkt, layers.LayerTypeEthernet, gopacket.Default)
+	if err := s.onuPacketOut(intfid, onuid, rawpkt); err != nil {
+		return new(openolt.Empty), err
+	}
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) UplinkPacketOut(c context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives UplinkPacketOut().\n", s.Olt.ID)
+	rawpkt := gopacket.NewPacket(packet.Pkt, layers.LayerTypeEthernet, gopacket.Default)
+	if err := s.uplinkPacketOut(rawpkt); err != nil {
+		return new(openolt.Empty), err
+	}
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) FlowAdd(c context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives FlowAdd().\n", s.Olt.ID)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) FlowRemove(c context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives FlowRemove().\n", s.Olt.ID)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) HeartbeatCheck(c context.Context, empty *openolt.Empty) (*openolt.Heartbeat, error) {
+	log.Printf("OLT %d receives HeartbeatCheck().\n", s.Olt.ID)
+	signature := new(openolt.Heartbeat)
+	signature.HeartbeatSignature = s.Olt.HeartbeatSignature
+	return signature, nil
+}
+
+func (s *Server) EnablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives EnablePonIf().\n", s.Olt.ID)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) DisablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives DisablePonIf().\n", s.Olt.ID)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) Reboot(c context.Context, empty *openolt.Empty) (*openolt.Empty, error) {
+	log.Printf("OLT %d receives Reboot ().\n", s.Olt.ID)
+	return new(openolt.Empty), nil
+}
+
+func (s *Server) EnableIndication(empty *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
+	defer func() {
+		s.gRPCserver.Stop()
+	}()
+	log.Printf("OLT receives EnableInd.\n")
+	if err := s.activateOLT(stream); err != nil {
+		log.Printf("Failed to activate OLT: %v\n", err)
+		return err
+	}
+	log.Println("Core server down.")
+	return nil
+}
+
+func CreateGrpcServer(oltid uint32, npon uint32, nonus uint32, addrport string) (l net.Listener, g *grpc.Server, e error) {
+	log.Printf("Listening %s ...", addrport)
+	g = grpc.NewServer()
+	l, e = net.Listen("tcp", addrport)
+	return
+}
diff --git a/core/io_info.go b/core/io_info.go
new file mode 100644
index 0000000..4252509
--- /dev/null
+++ b/core/io_info.go
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 core
+
+import (
+	"errors"
+	"github.com/google/gopacket/pcap"
+	"log"
+)
+
+type Ioinfo struct {
+	name    string
+	iotype  string //nni or uni
+	ioloc   string //inside or outsode
+	intfid  uint32
+	onuid   uint32
+	handler *pcap.Handle
+}
+
+func (s *Server) identifyUniIoinfo(ioloc string, intfid uint32, onuid uint32) (*Ioinfo, error) {
+	for _, ioinfo := range s.Ioinfos {
+		if ioinfo.iotype == "uni" && ioinfo.intfid == intfid && ioinfo.onuid == onuid && ioinfo.ioloc == ioloc {
+			return ioinfo, nil
+		}
+	}
+	err := errors.New("No matched Ioinfo is found !")
+	log.Println(err)
+	return nil, err
+}
+
+func (s *Server) identifyNniIoinfo(ioloc string) (*Ioinfo, error) {
+	for _, ioinfo := range s.Ioinfos {
+		if ioinfo.iotype == "nni" && ioinfo.ioloc == ioloc {
+			return ioinfo, nil
+		}
+	}
+	err := errors.New("No matched Ioinfo is found !")
+	log.Println(err)
+	return nil, err
+}
+
+func (s *Server) getUniIoinfos(ioloc string) ([]*Ioinfo, error) {
+	ioinfos := []*Ioinfo{}
+	for _, ioinfo := range s.Ioinfos {
+		if ioinfo.iotype == "uni" && ioinfo.ioloc == ioloc {
+			ioinfos = append(ioinfos, ioinfo)
+		}
+	}
+	if len(ioinfos) == 0 {
+		err := errors.New("No matched Ioinfo is found !")
+		log.Println(err)
+		return nil, err
+	}
+	return ioinfos, nil
+}
diff --git a/core/io_worker.go b/core/io_worker.go
new file mode 100644
index 0000000..a535869
--- /dev/null
+++ b/core/io_worker.go
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 core
+
+import (
+	"errors"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"github.com/google/gopacket/pcap"
+	"log"
+	"net"
+)
+
+func RecvWorker(io *Ioinfo, handler *pcap.Handle, r chan Packet) {
+	log.Printf("recvWorker runs. handler: %v", *handler)
+	packetSource := gopacket.NewPacketSource(handler, handler.LinkType())
+	for packet := range packetSource.Packets() {
+		log.Printf("recv packet from IF: %v \n", *handler)
+		//log.Println(packet.Dump())
+		pkt := Packet{}
+		pkt.Info = io
+		pkt.Pkt = packet
+		r <- pkt
+	}
+}
+
+func SendUni(handle *pcap.Handle, packet gopacket.Packet) {
+	handle.WritePacketData(packet.Data())
+	log.Printf("send packet to UNI-IF: %v \n", *handle)
+	//log.Println(packet.Dump())
+}
+
+func SendNni(handle *pcap.Handle, packet gopacket.Packet) {
+	handle.WritePacketData(packet.Data())
+	log.Printf("send packet to NNI-IF: %v \n", *handle)
+	//log.Println(packet.Dump())
+}
+
+func PopVLAN(pkt gopacket.Packet) (gopacket.Packet, uint16, error) {
+	if layer := getDot1QLayer(pkt); layer != nil {
+		if eth := getEthernetLayer(pkt); eth != nil {
+			ethernetLayer := &layers.Ethernet{
+				SrcMAC:       eth.SrcMAC,
+				DstMAC:       eth.DstMAC,
+				EthernetType: layer.Type,
+			}
+			buffer := gopacket.NewSerializeBuffer()
+			gopacket.SerializeLayers(buffer, gopacket.SerializeOptions{},
+				ethernetLayer,
+				gopacket.Payload(layer.Payload),
+			)
+			retpkt := gopacket.NewPacket(
+				buffer.Bytes(),
+				layers.LayerTypeEthernet,
+				gopacket.Default,
+			)
+			vid := uint16(4095 & layer.VLANIdentifier)
+			log.Printf("Pop the 802.1Q header (VID: %d)", vid)
+			return retpkt, vid, nil
+		}
+	}
+	//return pkt, 1, nil
+	return nil, 0, errors.New("failed to pop vlan")
+}
+
+func PushVLAN(pkt gopacket.Packet, vid uint16) (gopacket.Packet, error) {
+	if eth := getEthernetLayer(pkt); eth != nil {
+		ethernetLayer := &layers.Ethernet{
+			SrcMAC:       eth.SrcMAC,
+			DstMAC:       eth.DstMAC,
+			EthernetType: 0x8100,
+		}
+		dot1qLayer := &layers.Dot1Q{
+			Type:           eth.EthernetType,
+			VLANIdentifier: uint16(vid),
+		}
+
+		buffer := gopacket.NewSerializeBuffer()
+		gopacket.SerializeLayers(
+			buffer,
+			gopacket.SerializeOptions{
+				FixLengths: false,
+			},
+			ethernetLayer,
+			dot1qLayer,
+			gopacket.Payload(eth.Payload),
+		)
+		ret := gopacket.NewPacket(
+			buffer.Bytes(),
+			layers.LayerTypeEthernet,
+			gopacket.Default,
+		)
+		log.Printf("Push the 802.1Q header (VID: %d)", vid)
+		return ret, nil
+	}
+	return nil, errors.New("failed to push vlan")
+}
+
+func getEthernetLayer(pkt gopacket.Packet) *layers.Ethernet {
+	eth := &layers.Ethernet{}
+	if ethLayer := pkt.Layer(layers.LayerTypeEthernet); ethLayer != nil {
+		eth, _ = ethLayer.(*layers.Ethernet)
+	}
+	return eth
+}
+func getDot1QLayer(pkt gopacket.Packet) (dot1q *layers.Dot1Q) {
+	if dot1qLayer := pkt.Layer(layers.LayerTypeDot1Q); dot1qLayer != nil {
+		dot1q = dot1qLayer.(*layers.Dot1Q)
+	}
+	return dot1q
+}
+
+func getMacAddress(ifName string) net.HardwareAddr {
+	var err error
+	var netIf *net.Interface
+	var hwAddr net.HardwareAddr
+	if netIf, err = net.InterfaceByName(ifName); err == nil {
+		hwAddr = netIf.HardwareAddr
+	}
+	return hwAddr
+}
diff --git a/core/openolt_service.go b/core/openolt_service.go
new file mode 100644
index 0000000..3f0c311
--- /dev/null
+++ b/core/openolt_service.go
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 core
+
+import (
+	"gerrit.opencord.org/voltha-bbsim/protos"
+	"gerrit.opencord.org/voltha-bbsim/device"
+	"log"
+)
+
+func sendOltInd(stream openolt.Openolt_EnableIndicationServer, olt *device.Olt) error {
+	data := &openolt.Indication_OltInd{OltInd: &openolt.OltIndication{OperState: "up"}}
+	if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+		log.Printf("Failed to send OLT indication: %v\n", err)
+		return err
+	}
+	return nil
+}
+
+func sendIntfInd(stream openolt.Openolt_EnableIndicationServer, olt *device.Olt) error {
+	for i := uint32(0); i < olt.NumPonIntf+olt.NumNniIntf; i++ {
+		intf := olt.Intfs[i]
+		data := &openolt.Indication_IntfInd{&openolt.IntfIndication{IntfId: intf.IntfID, OperState: intf.OperState}}
+		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+			log.Printf("Failed to send Intf [id: %d] indication : %v\n", i, err)
+			return err
+		}
+		log.Printf("SendIntfInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
+	}
+	return nil
+}
+
+func sendOperInd(stream openolt.Openolt_EnableIndicationServer, olt *device.Olt) error {
+	for i := uint32(0); i < olt.NumPonIntf+olt.NumNniIntf; i++ {
+		intf := olt.Intfs[i]
+		data := &openolt.Indication_IntfOperInd{&openolt.IntfOperIndication{Type: intf.Type, IntfId: intf.IntfID, OperState: intf.OperState}}
+		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+			log.Printf("Failed to send IntfOper [id: %d] indication : %v\n", i, err)
+			return err
+		}
+		log.Printf("SendOperInd olt:%d intf:%d (%s)\n", olt.ID, intf.IntfID, intf.Type)
+	}
+	return nil
+}
+
+func sendOnuDiscInd(stream openolt.Openolt_EnableIndicationServer, onus []*device.Onu) error {
+	for i, onu := range onus {
+		data := &openolt.Indication_OnuDiscInd{&openolt.OnuDiscIndication{IntfId: onu.IntfID, SerialNumber: onu.SerialNumber}}
+		log.Printf("sendONUDiscInd Onuid: %d\n", i)
+		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+			log.Printf("Failed to send ONUDiscInd [id: %d]: %v\n", i, err)
+			return err
+		}
+	}
+	return nil
+}
+
+func sendOnuInd(stream openolt.Openolt_EnableIndicationServer, onus []*device.Onu) error {
+	for i, onu := range onus {
+		data := &openolt.Indication_OnuInd{&openolt.OnuIndication{IntfId: onu.IntfID, OnuId: onu.OnuID, OperState: "up", AdminState: "up", SerialNumber: onu.SerialNumber}}
+		log.Printf("sendONUInd Onuid: %d\n", i)
+		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+			log.Printf("Failed to send ONUInd [id: %d]: %v\n", i, err)
+			return err
+		}
+	}
+	return nil
+}
diff --git a/device/device_olt.go b/device/device_olt.go
new file mode 100644
index 0000000..a01dda1
--- /dev/null
+++ b/device/device_olt.go
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 device
+
+type oltState int
+
+type Olt struct {
+	ID                 uint32
+	NumPonIntf         uint32
+	NumNniIntf         uint32
+	Mac                string
+	SerialNumber       string
+	Manufacture        string
+	Name               string
+	InternalState      oltState
+	OperState          string
+	Intfs              []intf
+	HeartbeatSignature uint32
+}
+
+type intf struct {
+	Type      string
+	IntfID    uint32
+	OperState string
+}
+
+const (
+	PRE_ENABLE oltState = iota
+	OLT_UP
+	PONIF_UP
+	ONU_DISCOVERED
+)
+
+func CreateOlt(oltid uint32, npon uint32, nnni uint32) *Olt {
+	olt := Olt{}
+	olt.ID = oltid
+	olt.NumPonIntf = npon
+	olt.NumNniIntf = nnni
+	olt.Name = "BBSIM OLT"
+	olt.InternalState = PRE_ENABLE
+	olt.OperState = "up"
+	olt.Intfs = make([]intf, olt.NumPonIntf+olt.NumNniIntf)
+	olt.HeartbeatSignature = oltid
+	for i := uint32(0); i < olt.NumNniIntf; i++ {
+		olt.Intfs[i].IntfID = i
+		olt.Intfs[i].OperState = "up"
+		olt.Intfs[i].Type = "nni"
+	}
+	for i := uint32(olt.NumNniIntf); i < olt.NumPonIntf+olt.NumNniIntf; i++ {
+		olt.Intfs[i].IntfID = i
+		olt.Intfs[i].OperState = "up"
+		olt.Intfs[i].Type = "pon"
+	}
+	return &olt
+}
diff --git a/device/device_onu.go b/device/device_onu.go
new file mode 100644
index 0000000..6d3df40
--- /dev/null
+++ b/device/device_onu.go
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 device
+
+import (
+	"fmt"
+	"log"
+	"gerrit.opencord.org/voltha-bbsim/protos"
+	"reflect"
+)
+
+type onuState int
+
+const (
+	ONU_PRE_ACTIVATED onuState = iota
+	ONU_ACTIVATED
+)
+
+type Onu struct {
+	InternalState onuState
+	IntfID        uint32
+	OperState     string
+	SerialNumber  *openolt.SerialNumber
+	OnuID         uint32
+}
+
+func createSN(oltid uint32, intfid uint32, onuid uint32) string {
+	sn := fmt.Sprintf("%X%X%02X", oltid, intfid, onuid)
+	return sn
+}
+
+func CreateOnus(oltid uint32, intfid uint32, nonus uint32, nnni uint32) []*Onu {
+	onus := []*Onu{}
+	for i := 0; i < int(nonus); i++ {
+		onu := Onu{}
+		onu.InternalState = ONU_PRE_ACTIVATED
+		onu.IntfID = intfid
+		onu.OperState = "up"
+		onu.SerialNumber = new(openolt.SerialNumber)
+		onu.SerialNumber.VendorId = []byte("NONE")
+		onu.SerialNumber.VendorSpecific = []byte(createSN(oltid, intfid, uint32(i))) //FIX
+		onus = append(onus, &onu)
+	}
+	return onus
+}
+
+func ValidateONU(targetonu openolt.Onu, regonus map[uint32][]*Onu) bool {
+	for _, onus := range regonus {
+		for _, onu := range onus {
+			if ValidateSN(*targetonu.SerialNumber, *onu.SerialNumber) {
+				return true
+			}
+		}
+	}
+	return false
+}
+
+func ValidateSN(sn1 openolt.SerialNumber, sn2 openolt.SerialNumber) bool {
+	return reflect.DeepEqual(sn1.VendorId, sn2.VendorId) && reflect.DeepEqual(sn1.VendorSpecific, sn2.VendorSpecific)
+}
+
+func UpdateOnusOpStatus(ponif uint32, onus []*Onu, opstatus string) {
+	for i, onu := range onus {
+		onu.OperState = "up"
+		log.Printf("(PONIF:%d) ONU [%d] discovered.\n", ponif, i)
+	}
+}
diff --git a/grpc_service.go b/grpc_service.go
deleted file mode 100644
index 33993f6..0000000
--- a/grpc_service.go
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2018-present Open Networking Foundation
-
- * 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 main
-
-import (
-	"log"
-  "gerrit.opencord.org/voltha-bbsim/openolt"
-	"golang.org/x/net/context"
-	"time"
-)
-
-// gRPC Service
-func (s *server) DisableOlt(c context.Context, empty *openolt.Empty) (*openolt.Empty, error){
-	log.Printf("OLT receives DisableOLT()\n")
-	return new(openolt.Empty), nil
-}
-
-func (s *server) ReenableOlt(c context.Context, empty *openolt.Empty)(*openolt.Empty, error){
-	log.Printf("OLT receives Reenable()\n")
-	return new(openolt.Empty), nil
-}
-
-func (s *server) ActivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error){
-	log.Printf("OLT receives ActivateONU()\n")
-	result := validateONU(*onu, s.onus)
-	if result == true {
-		log.Printf("ONU %d activated succesufully.\n", onu.OnuId)
-		s.onus[onu.IntfId][onu.OnuId].internalState = ONU_ACTIVATED
-		//log.Printf("ActivateOnu(): %v", s.onus)
-	}
-	return new(openolt.Empty), nil
-}
-
-func (s *server) DeactivateOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error){
-	log.Printf("OLT receives DeactivateONU()\n")
-	return new(openolt.Empty), nil
-}
-
-func (s *server) DeleteOnu(c context.Context, onu *openolt.Onu) (*openolt.Empty, error){
-	log.Printf("OLT receives DeleteONU()\n")
-	return new(openolt.Empty), nil
-}
-
-func (s *server)OmciMsgOut(c context.Context, msg *openolt.OmciMsg)(*openolt.Empty, error){
-	//log.Printf("OLT %d receives OmciMsgOut to IF %v (ONU-ID: %v): %v.\n", s.olt.ID, msg.IntfId, msg.OnuId, msg.Pkt)
-	log.Printf("OLT %d receives OmciMsgOut to IF %v (ONU-ID: %v).\n", s.olt.ID, msg.IntfId, msg.OnuId)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) OnuPacketOut(c context.Context, packet *openolt.OnuPacket)(*openolt.Empty, error){
-	log.Printf("OLT %d receives OnuPacketOut ().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) UplinkPacketOut(c context.Context, packet *openolt.UplinkPacket)(*openolt.Empty, error){
-	log.Printf("OLT %d receives UplinkPacketOut().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) FlowAdd(c context.Context, flow *openolt.Flow)(*openolt.Empty, error){
-	log.Printf("OLT %d receives FlowAdd().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) HeartbeatCheck(c context.Context, empty *openolt.Empty) (*openolt.Heartbeat, error){
-	log.Printf("OLT %d receives HeartbeatCheck().\n", s.olt.ID)
-	signature := new(openolt.Heartbeat)
-	signature.HeartbeatSignature = s.olt.HeartbeatSignature
-	return signature, nil
-}
-
-func (s *server) EnablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error){
-	log.Printf("OLT %d receives EnablePonIf().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) DisablePonIf(c context.Context, intf *openolt.Interface) (*openolt.Empty, error){
-	log.Printf("OLT %d receives DisablePonIf().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) Reboot(c context.Context, empty *openolt.Empty,) (*openolt.Empty, error){
-	log.Printf("OLT %d receives Reboot ().\n", s.olt.ID)
-	return new(openolt.Empty), nil
-}
-
-func (s *server) EnableIndication(empty *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
-	log.Printf("OLT receives EnableInd.\n")
-	if err := activateOLT(s, stream); err != nil {
-		log.Printf("Failed to activate OLT: %v\n", err)
-		return err
-	}
-	// Infinite loop TODO: This should be a queue processing.
-	for {
-		time.Sleep(1 * time.Second)
-	}
-	return nil
-}
diff --git a/openolt.proto b/openolt.proto
index c4d4fd0..ed69539 100644
--- a/openolt.proto
+++ b/openolt.proto
@@ -81,6 +81,13 @@
         };
     }
 
+    rpc FlowRemove(Flow) returns (Empty) {
+        option (google.api.http) = {
+          post: "/v1/FlowRemove"
+          body: "*"
+        };
+    }
+
     rpc HeartbeatCheck(Empty) returns (Heartbeat) {
         option (google.api.http) = {
           post: "/v1/HeartbeatCheck"
@@ -102,6 +109,13 @@
         };
     }
 
+    rpc GetDeviceInfo(Empty) returns (DeviceInfo) {
+        option (google.api.http) = {
+            post: "/v1/GetDeviceInfo"
+            body: "*"
+        };
+    }
+
     rpc Reboot(Empty) returns (Empty) {
          option (google.api.http) = {
             post: "/v1/Reboot"
@@ -109,6 +123,13 @@
         };
     }
 
+    rpc CollectStatistics(Empty) returns (Empty) {
+        option (google.api.http) = {
+            post: "/v1/CollectStatistics"
+            body: "*"
+        };
+    }
+
     rpc EnableIndication(Empty) returns (stream Indication) {}
 }
 
@@ -178,6 +199,7 @@
 }
 
 message PacketIndication {
+    string intf_type = 5;		// nni, pon, unknown
     fixed32 intf_id = 1;
     fixed32 gemport_id = 2;
     fixed32 flow_id = 3;
@@ -197,6 +219,7 @@
     fixed32 onu_id = 2;
     SerialNumber serial_number = 3;
     fixed32 pir = 4;   // peak information rate assigned to onu
+    fixed32 alloc_id = 5;
 }
 
 message OmciMsg {
@@ -216,6 +239,21 @@
     bytes pkt = 2;
 }
 
+message DeviceInfo {
+    string vendor = 1;
+    string model = 2;
+    string hardware_version = 3;
+    string firmware_version = 4;
+    string technology = 5;
+    fixed32 onu_id_start = 6;
+    fixed32 onu_id_end = 7;
+    fixed32 alloc_id_start = 8;
+    fixed32 alloc_id_end = 9;
+    fixed32 gemport_id_start = 10;
+    fixed32 gemport_id_end = 11;
+    fixed32 pon_ports = 12;
+}
+
 message Classifier {
     fixed32 o_tpid = 1;
     fixed32 o_vid = 2;
@@ -251,15 +289,16 @@
 }
 
 message Flow {
-    fixed32 access_intf_id = 1;
-    fixed32 onu_id = 2;
+    sfixed32 access_intf_id = 1;
+    sfixed32 onu_id = 2;
     fixed32 flow_id = 3;
     string flow_type = 4;	// upstream, downstream, broadcast, multicast
-    fixed32 network_intf_id = 5;
-    fixed32 gemport_id = 6;
+    sfixed32 alloc_id = 10;
+    sfixed32 network_intf_id = 5;
+    sfixed32 gemport_id = 6;
     Classifier classifier = 7;
     Action action = 8;
-    fixed32 priority = 9;
+    sfixed32 priority = 9;
 }
 
 message SerialNumber {
@@ -367,4 +406,4 @@
 }
 
 
-message Empty {}
+message Empty {}
\ No newline at end of file
diff --git a/openolt/.gitignore b/openolt/.gitignore
deleted file mode 100644
index 8b13789..0000000
--- a/openolt/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/protos/.gitignore b/protos/.gitignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/protos/.gitignore
diff --git a/setup/setup_env.go b/setup/setup_env.go
new file mode 100644
index 0000000..a4210f5
--- /dev/null
+++ b/setup/setup_env.go
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+
+ * 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 setup
+
+import (
+	"log"
+	"os/exec"
+)
+
+const (
+	UNI_VETH_UP_PFX = "sim_uu"
+	UNI_VETH_DW_PFX = "sim_ud"
+	NNI_VETH_UP_PFX = "sim_nu"
+	NNI_VETH_DW_PFX = "sim_nd"
+)
+
+func ActivateWPASups(vethnames []string) error {
+	for _, vethname := range vethnames {
+		if err := activateWPASupplicant(vethname); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func KillAllWPASups() error {
+	err := exec.Command("pkill", "wpa_supplicant").Run()
+	if err != nil {
+		log.Printf("[ERROR] Fail to pkill wpa_supplicant: %v\n", err)
+		return err
+	}
+	return nil
+}
+
+func KillAllDHCPClients() error {
+	err := exec.Command("pkill", "dhclient").Run()
+	if err != nil {
+		log.Printf("[ERROR] Fail to pkill dhclient: %v\n", err)
+		return err
+	}
+	return nil
+}
+
+func TearVethDown(veths []string) {
+	for _, veth := range veths {
+		RemoveVeth(veth)
+	}
+}
+
+func CreateVethPairs(name1 string, name2 string) (err error) {
+	err = exec.Command("ip", "link", "add", name1, "type", "veth", "peer", "name", name2).Run()
+	if err != nil {
+		log.Printf("[ERROR] Fail to createVeth() for %s and %s veth creation error: %s\n", name1, name2, err.Error())
+		return
+	}
+	log.Printf("%s & %s was created.", name1, name2)
+	err = exec.Command("ip", "link", "set", name1, "up").Run()
+	if err != nil {
+		log.Println("[ERROR] Fail to createVeth() veth1 up", err)
+		return
+	}
+	err = exec.Command("ip", "link", "set", name2, "up").Run()
+	if err != nil {
+		log.Println("[ERROR] Fail to createVeth() veth2 up", err)
+		return
+	}
+	log.Printf("%s & %s was up.", name1, name2)
+	return
+}
+
+func RemoveVeth(name string) {
+	err := exec.Command("ip", "link", "del", name).Run()
+	if err != nil {
+		log.Println("[ERROR] Fail to removeVeth()", err)
+	}
+	log.Printf("%s was removed.", name)
+}
+
+func RemoveVeths(names []string) {
+	log.Printf("RemoveVeths() :%s\n", names)
+	for _, name := range names {
+		RemoveVeth(name)
+	}
+}
+
+func activateWPASupplicant(vethname string) (err error) {
+	cmd := "/sbin/wpa_supplicant"
+	conf := "/etc/wpa_supplicant/wpa_supplicant.conf"
+	err = exec.Command(cmd, "-D", "wired", "-i", vethname, "-c", conf).Start()
+	if err != nil {
+		log.Printf("[ERROR] Fail to activateWPASupplicant() for :%s %v\n", vethname, err)
+		return
+	}
+	log.Printf("activateWPASupplicant() for :%s\n", vethname)
+	return
+}
\ No newline at end of file
