diff --git a/internal/bbsim/bbsim.go b/internal/bbsim/bbsim.go
index 943c021..7c47e91 100644
--- a/internal/bbsim/bbsim.go
+++ b/internal/bbsim/bbsim.go
@@ -31,11 +31,13 @@
 
 func getOpts() *CliOptions {
 
-	olt_id 		:= flag.Int("olt_id", 0, "Number of OLT devices to be emulated (default is 1)")
-	nni 		:= flag.Int("nni", 1, "Number of NNI ports per OLT device to be emulated (default is 1)")
-	pon 		:= flag.Int("pon", 1, "Number of PON ports per OLT device to be emulated (default is 1)")
-	onu 		:= flag.Int("onu", 1, "Number of ONU devices per PON port to be emulated (default is 1)")
-	profileCpu 	:= flag.String("cpuprofile", "", "write cpu profile to file")
+	olt_id := flag.Int("olt_id", 0, "Number of OLT devices to be emulated (default is 1)")
+	nni := flag.Int("nni", 1, "Number of NNI ports per OLT device to be emulated (default is 1)")
+	pon := flag.Int("pon", 1, "Number of PON ports per OLT device to be emulated (default is 1)")
+	onu := flag.Int("onu", 1, "Number of ONU devices per PON port to be emulated (default is 1)")
+	s_tag := flag.Int("s_tag", 900, "S-Tag value (default is 900)")
+	c_tag_init := flag.Int("c_tag", 900, "C-Tag starting value (default is 900), each ONU will get a sequentail one (targeting 1024 ONUs per BBSim instance the range is bug enough)")
+	profileCpu := flag.String("cpuprofile", "", "write cpu profile to file")
 
 	flag.Parse()
 
@@ -45,14 +47,16 @@
 	o.NumNniPerOlt = int(*nni)
 	o.NumPonPerOlt = int(*pon)
 	o.NumOnuPerPon = int(*onu)
+	o.STag = int(*s_tag)
+	o.CTagInit = int(*c_tag_init)
 	o.profileCpu = profileCpu
 
 	return o
 }
 
-func startApiServer(channel chan bool, group *sync.WaitGroup)  {
+func startApiServer(channel chan bool, group *sync.WaitGroup) {
 	// TODO make configurable
-	address :=  "0.0.0.0:50070"
+	address := "0.0.0.0:50070"
 	log.Debugf("APIServer Listening on: %v", address)
 	lis, err := net.Listen("tcp", address)
 	if err != nil {
@@ -69,7 +73,7 @@
 	go grpcServer.Serve(lis)
 
 	for {
-		_, ok := <- channel
+		_, ok := <-channel
 		if !ok {
 			// if the olt channel is closed, stop the gRPC server
 			log.Warnf("Stopping API gRPC server")
@@ -105,7 +109,7 @@
 	}
 
 	log.WithFields(log.Fields{
-		"OltID": options.OltID,
+		"OltID":        options.OltID,
 		"NumNniPerOlt": options.NumNniPerOlt,
 		"NumPonPerOlt": options.NumPonPerOlt,
 		"NumOnuPerPon": options.NumOnuPerPon,
@@ -118,8 +122,7 @@
 	wg := sync.WaitGroup{}
 	wg.Add(2)
 
-
-	go devices.CreateOLT(options.OltID, options.NumNniPerOlt, options.NumPonPerOlt, options.NumOnuPerPon, &oltDoneChannel, &apiDoneChannel, &wg)
+	go devices.CreateOLT(options.OltID, options.NumNniPerOlt, options.NumPonPerOlt, options.NumOnuPerPon, options.STag, options.CTagInit, &oltDoneChannel, &apiDoneChannel, &wg)
 	log.Debugf("Created OLT with id: %d", options.OltID)
 	go startApiServer(apiDoneChannel, &wg)
 	log.Debugf("Started APIService")
@@ -133,4 +136,4 @@
 			pprof.StopCPUProfile()
 		}
 	}()
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/devices/helpers.go b/internal/bbsim/devices/helpers.go
index 920b1d4..5a56825 100644
--- a/internal/bbsim/devices/helpers.go
+++ b/internal/bbsim/devices/helpers.go
@@ -16,7 +16,11 @@
 
 package devices
 
-import "github.com/looplab/fsm"
+import (
+	"github.com/looplab/fsm"
+	"github.com/opencord/voltha-protos/go/openolt"
+	"strconv"
+)
 
 var newFSM = fsm.NewFSM
 
@@ -34,3 +38,11 @@
 		},
 	)
 }
+
+func onuSnToString(sn *openolt.SerialNumber) string {
+	s := string(sn.VendorId)
+	for _, i := range sn.VendorSpecific {
+		s = s + strconv.FormatInt(int64(i/16), 16) + strconv.FormatInt(int64(i%16), 16)
+	}
+	return s
+}
diff --git a/internal/bbsim/devices/nni.go b/internal/bbsim/devices/nni.go
new file mode 100644
index 0000000..814c825
--- /dev/null
+++ b/internal/bbsim/devices/nni.go
@@ -0,0 +1,191 @@
+/*
+ * 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 devices
+
+import (
+	"bytes"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/pcap"
+	"github.com/looplab/fsm"
+	"github.com/opencord/bbsim/internal/bbsim/packetHandlers"
+	"github.com/opencord/bbsim/internal/bbsim/types"
+	log "github.com/sirupsen/logrus"
+	"os/exec"
+)
+
+var (
+	nniLogger    = log.WithFields(log.Fields{"module": "NNI"})
+	nniVeth      = "nni"
+	upstreamVeth = "upstream"
+	dhcpServerIp = "182.21.0.128"
+)
+
+func CreateNNI(olt *OltDevice) (NniPort, error) {
+	nniPort := NniPort{
+		ID: uint32(0),
+		OperState: getOperStateFSM(func(e *fsm.Event) {
+			oltLogger.Debugf("Changing NNI OperState from %s to %s", e.Src, e.Dst)
+		}),
+		Type: "nni",
+	}
+	createNNIPair(olt)
+	return nniPort, nil
+}
+
+// sendNniPacket will send a packet out of the NNI interface.
+// We will send upstream only DHCP packets and drop anything else
+func sendNniPacket(packet gopacket.Packet) error {
+	if isDhcp := packetHandlers.IsDhcpPacket(packet); !isDhcp {
+		nniLogger.WithFields(log.Fields{
+			"packet": packet,
+		}).Trace("Dropping NNI packet as it's not DHCP")
+	}
+
+	packet, err := packetHandlers.PopDoubleTag(packet)
+	if err != nil {
+		nniLogger.WithFields(log.Fields{
+			"packet": packet,
+		}).Errorf("Can't remove double tags from packet: %v", err)
+		return err
+	}
+
+	handle, err := getVethHandler(nniVeth)
+	if err != nil {
+		return err
+	}
+
+	err = handle.WritePacketData(packet.Data())
+	if err != nil {
+		nniLogger.WithFields(log.Fields{
+			"packet": packet,
+		}).Errorf("Failed to send packet out of the NNI: %s", err)
+		return err
+	}
+
+	nniLogger.Infof("Sent packet out of NNI")
+	return nil
+}
+
+// createNNIBridge will create a veth bridge to fake the connection between the NNI port
+// and something upstream, in this case a DHCP server.
+// It is also responsible to start the DHCP server itself
+func createNNIPair(olt *OltDevice) error {
+
+	if err := exec.Command("ip", "link", "add", nniVeth, "type", "veth", "peer", "name", upstreamVeth).Run(); err != nil {
+		nniLogger.Errorf("Couldn't create veth pair between %s and %s", nniVeth, upstreamVeth)
+		return err
+	}
+
+	if err := setVethUp(nniVeth); err != nil {
+		return err
+	}
+
+	if err := setVethUp(upstreamVeth); err != nil {
+		return err
+	}
+
+	if err := startDHCPServer(); err != nil {
+		return err
+	}
+
+	ch, err := listenOnVeth(nniVeth)
+	if err != nil {
+		return err
+	}
+	olt.nniPktInChannel = ch
+	return nil
+}
+
+// setVethUp is responsible to activate a virtual interface
+func setVethUp(vethName string) error {
+	if err := exec.Command("ip", "link", "set", vethName, "up").Run(); err != nil {
+		nniLogger.Errorf("Couldn't change interface %s state to up: %v", vethName, err)
+		return err
+	}
+	return nil
+}
+
+func startDHCPServer() error {
+	if err := exec.Command("ip", "addr", "add", dhcpServerIp, "dev", upstreamVeth).Run(); err != nil {
+		nniLogger.Errorf("Couldn't assing ip %s to interface %s: %v", dhcpServerIp, upstreamVeth, err)
+		return err
+	}
+
+	if err := setVethUp(upstreamVeth); err != nil {
+		return err
+	}
+
+	dhcp := "/usr/local/bin/dhcpd"
+	conf := "/etc/dhcp/dhcpd.conf" // copied in the container from configs/dhcpd.conf
+	logfile := "/tmp/dhcplog"
+	var stderr bytes.Buffer
+	cmd := exec.Command(dhcp, "-cf", conf, upstreamVeth, "-tf", logfile)
+	cmd.Stderr = &stderr
+	err := cmd.Run()
+	if err != nil {
+		nniLogger.Errorf("Fail to start DHCP Server: %s, %s", err, stderr.String())
+		return err
+	}
+	nniLogger.Info("Successfully activated DHCP Server")
+	return nil
+}
+
+func getVethHandler(vethName string) (*pcap.Handle, error) {
+	var (
+		device            = vethName
+		snapshotLen int32 = 1518
+		promiscuous       = false
+		timeout           = pcap.BlockForever
+	)
+	handle, err := pcap.OpenLive(device, snapshotLen, promiscuous, timeout)
+	if err != nil {
+		nniLogger.Errorf("Can't retrieve handler for interface %s", vethName)
+		return nil, err
+	}
+	return handle, nil
+}
+
+func listenOnVeth(vethName string) (chan *types.PacketMsg, error) {
+
+	handle, err := getVethHandler(vethName)
+	if err != nil {
+		return nil, err
+	}
+
+	channel := make(chan *types.PacketMsg, 32)
+
+	go func() {
+		packetSource := gopacket.NewPacketSource(handle, handle.LinkType())
+		for packet := range packetSource.Packets() {
+
+			if !packetHandlers.IsIncomingPacket(packet) {
+				nniLogger.Tracef("Ignoring packet as it's going out")
+				continue
+			}
+
+			nniLogger.WithFields(log.Fields{
+				"packet": packet.Dump(),
+			}).Tracef("Received packet on NNI Port")
+			pkt := types.PacketMsg{
+				Pkt: packet,
+			}
+			channel <- &pkt
+		}
+	}()
+
+	return channel, nil
+}
diff --git a/internal/bbsim/devices/olt.go b/internal/bbsim/devices/olt.go
index 6ce09a1..c75f2d1 100644
--- a/internal/bbsim/devices/olt.go
+++ b/internal/bbsim/devices/olt.go
@@ -20,10 +20,10 @@
 	"context"
 	"errors"
 	"fmt"
-	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	"github.com/google/gopacket"
 	"github.com/google/gopacket/layers"
 	"github.com/looplab/fsm"
+	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	"github.com/opencord/voltha-protos/go/openolt"
 	"github.com/opencord/voltha-protos/go/tech_profile"
 	log "github.com/sirupsen/logrus"
@@ -43,32 +43,33 @@
 
 var olt = OltDevice{}
 
-func GetOLT() OltDevice  {
+func GetOLT() OltDevice {
 	return olt
 }
 
-func CreateOLT(seq int, nni int, pon int, onuPerPon int, oltDoneChannel *chan bool, apiDoneChannel *chan bool, group *sync.WaitGroup) OltDevice {
+func CreateOLT(seq int, nni int, pon int, onuPerPon int, sTag int, cTagInit int, oltDoneChannel *chan bool, apiDoneChannel *chan bool, group *sync.WaitGroup) OltDevice {
 	oltLogger.WithFields(log.Fields{
-		"ID": seq,
-		"NumNni":nni,
-		"NumPon":pon,
-		"NumOnuPerPon":onuPerPon,
+		"ID":           seq,
+		"NumNni":       nni,
+		"NumPon":       pon,
+		"NumOnuPerPon": onuPerPon,
 	}).Debug("CreateOLT")
 
 	olt = OltDevice{
-		ID: seq,
+		ID:           seq,
 		SerialNumber: fmt.Sprintf("BBSIM_OLT_%d", seq),
 		OperState: getOperStateFSM(func(e *fsm.Event) {
 			oltLogger.Debugf("Changing OLT OperState from %s to %s", e.Src, e.Dst)
 		}),
-		NumNni:nni,
-		NumPon:pon,
-		NumOnuPerPon:onuPerPon,
-		Pons: []PonPort{},
-		Nnis: []NniPort{},
-		channel: make(chan Message),
-		oltDoneChannel: oltDoneChannel,
-		apiDoneChannel: apiDoneChannel,
+		NumNni:          nni,
+		NumPon:          pon,
+		NumOnuPerPon:    onuPerPon,
+		Pons:            []PonPort{},
+		Nnis:            []NniPort{},
+		channel:         make(chan Message),
+		oltDoneChannel:  oltDoneChannel,
+		apiDoneChannel:  apiDoneChannel,
+		nniPktInChannel: make(chan *bbsim.PacketMsg, 1024), // packets coming in from the NNI and going to VOLTHA
 	}
 
 	// OLT State machine
@@ -87,22 +88,21 @@
 	)
 
 	// create NNI Port
-	nniPort := NniPort{
-		ID: uint32(0),
-		OperState: getOperStateFSM(func(e *fsm.Event) {
-			oltLogger.Debugf("Changing NNI OperState from %s to %s", e.Src, e.Dst)
-		}),
-		Type: "nni",
+	nniPort, err := CreateNNI(&olt)
+
+	if err != nil {
+		oltLogger.Fatalf("Couldn't create NNI Port: %v", err)
 	}
+
 	olt.Nnis = append(olt.Nnis, nniPort)
 
 	// create PON ports
-	//onuId := 1
+	availableCTag := cTagInit
 	for i := 0; i < pon; i++ {
 		p := PonPort{
 			NumOnu: olt.NumOnuPerPon,
-			ID: uint32(i),
-			Type: "pon",
+			ID:     uint32(i),
+			Type:   "pon",
 		}
 		p.OperState = getOperStateFSM(func(e *fsm.Event) {
 			oltLogger.WithFields(log.Fields{
@@ -113,9 +113,9 @@
 		// create ONU devices
 		for j := 0; j < onuPerPon; j++ {
 			//o := CreateONU(olt, p, uint32(onuId))
-			o := CreateONU(olt, p, uint32(j + 1))
+			o := CreateONU(olt, p, uint32(j+1), sTag, availableCTag)
 			p.Onus = append(p.Onus, o)
-			//onuId = onuId + 1
+			availableCTag = availableCTag + 1
 		}
 
 		olt.Pons = append(olt.Pons, p)
@@ -129,7 +129,7 @@
 
 func newOltServer(o OltDevice) error {
 	// TODO make configurable
-	address :=  "0.0.0.0:50060"
+	address := "0.0.0.0:50060"
 	lis, err := net.Listen("tcp", address)
 	if err != nil {
 		oltLogger.Fatalf("OLT failed to listen: %v", err)
@@ -144,7 +144,7 @@
 	oltLogger.Debugf("OLT Listening on: %v", address)
 
 	for {
-		_, ok := <- *o.oltDoneChannel
+		_, ok := <-*o.oltDoneChannel
 		if !ok {
 			// if the olt channel is closed, stop the gRPC server
 			log.Warnf("Stopping OLT gRPC server")
@@ -161,15 +161,16 @@
 
 // Device Methods
 
-func (o OltDevice) Enable (stream openolt.Openolt_EnableIndicationServer) error {
+func (o OltDevice) Enable(stream openolt.Openolt_EnableIndicationServer) error {
 
 	oltLogger.Debug("Enable OLT called")
 
 	wg := sync.WaitGroup{}
-	wg.Add(1)
+	wg.Add(2)
 
 	// create a channel for all the OLT events
 	go o.processOltMessages(stream)
+	go o.processNniPacketIns(stream)
 
 	// enable the OLT
 	olt_msg := Message{
@@ -207,9 +208,9 @@
 			go onu.processOnuMessages(stream)
 			go onu.processOmciMessages(stream)
 			msg := Message{
-				Type:      OnuDiscIndication,
+				Type: OnuDiscIndication,
 				Data: OnuDiscIndicationMessage{
-					Onu:     onu,
+					Onu:       onu,
 					OperState: UP,
 				},
 			}
@@ -257,8 +258,8 @@
 	nni.OperState.Event("enable")
 	// NOTE Operstate may need to be an integer
 	operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
-		Type: nni.Type,
-		IntfId: nni.ID,
+		Type:      nni.Type,
+		IntfId:    nni.ID,
 		OperState: nni.OperState.Current(),
 	}}
 
@@ -267,8 +268,8 @@
 	}
 
 	oltLogger.WithFields(log.Fields{
-		"Type": nni.Type,
-		"IntfId": nni.ID,
+		"Type":      nni.Type,
+		"IntfId":    nni.ID,
 		"OperState": nni.OperState.Current(),
 	}).Debug("Sent Indication_IntfOperInd for NNI")
 }
@@ -277,7 +278,7 @@
 	pon, _ := o.getPonById(msg.PonPortID)
 	pon.OperState.Event("enable")
 	discoverData := &openolt.Indication_IntfInd{IntfInd: &openolt.IntfIndication{
-		IntfId: pon.ID,
+		IntfId:    pon.ID,
 		OperState: pon.OperState.Current(),
 	}}
 
@@ -286,13 +287,13 @@
 	}
 
 	oltLogger.WithFields(log.Fields{
-		"IntfId": pon.ID,
+		"IntfId":    pon.ID,
 		"OperState": pon.OperState.Current(),
 	}).Debug("Sent Indication_IntfInd")
 
 	operData := &openolt.Indication_IntfOperInd{IntfOperInd: &openolt.IntfOperIndication{
-		Type: pon.Type,
-		IntfId: pon.ID,
+		Type:      pon.Type,
+		IntfId:    pon.ID,
 		OperState: pon.OperState.Current(),
 	}}
 
@@ -301,8 +302,8 @@
 	}
 
 	oltLogger.WithFields(log.Fields{
-		"Type": pon.Type,
-		"IntfId": pon.ID,
+		"Type":      pon.Type,
+		"IntfId":    pon.ID,
 		"OperState": pon.OperState.Current(),
 	}).Debug("Sent Indication_IntfOperInd for PON")
 }
@@ -311,9 +312,8 @@
 	oltLogger.Debug("Started OLT Indication Channel")
 	for message := range o.channel {
 
-
 		oltLogger.WithFields(log.Fields{
-			"oltId": o.ID,
+			"oltId":       o.ID,
 			"messageType": message.Type,
 		}).Trace("Received message")
 
@@ -341,11 +341,32 @@
 	}
 }
 
+func (o OltDevice) processNniPacketIns(stream openolt.Openolt_EnableIndicationServer) {
+	oltLogger.WithFields(log.Fields{
+		"nniChannel": o.nniPktInChannel,
+	}).Debug("Started NNI Channel")
+	nniId := o.Nnis[0].ID // FIXME we are assuming we have only one NNI
+	for message := range o.nniPktInChannel {
+		oltLogger.Debug("Received packets on NNI Channel")
+		data := &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{
+			IntfType: "nni",
+			IntfId:   nniId,
+			Pkt:      message.Pkt.Data()}}
+		if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+			oltLogger.WithFields(log.Fields{
+				"IntfType": data.PktInd.IntfType,
+				"IntfId":   nniId,
+				"Pkt":      message.Pkt.Data(),
+			}).Errorf("Fail to send PktInd indication: %v", err)
+		}
+	}
+}
+
 // GRPC Endpoints
 
-func (o OltDevice) ActivateOnu(context context.Context, onu *openolt.Onu) (*openolt.Empty, error)  {
+func (o OltDevice) ActivateOnu(context context.Context, onu *openolt.Onu) (*openolt.Empty, error) {
 	oltLogger.WithFields(log.Fields{
-		"onuSerialNumber": onu.SerialNumber,
+		"OnuSn": onuSnToString(onu.SerialNumber),
 	}).Info("Received ActivateOnu call from VOLTHA")
 
 	pon, _ := o.getPonById(onu.IntfId)
@@ -353,28 +374,28 @@
 
 	// NOTE we need to immediately activate the ONU or the OMCI state machine won't start
 	msg := Message{
-		Type:      OnuIndication,
-		Data:      OnuIndicationMessage{
+		Type: OnuIndication,
+		Data: OnuIndicationMessage{
 			OnuSN:     onu.SerialNumber,
 			PonPortID: onu.IntfId,
 			OperState: UP,
 		},
 	}
 	_onu.channel <- msg
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) DeactivateOnu(context.Context, *openolt.Onu) (*openolt.Empty, error)  {
+func (o OltDevice) DeactivateOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
 	oltLogger.Error("DeactivateOnu not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) DeleteOnu(context.Context, *openolt.Onu) (*openolt.Empty, error)  {
+func (o OltDevice) DeleteOnu(context.Context, *openolt.Onu) (*openolt.Empty, error) {
 	oltLogger.Error("DeleteOnu not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) DisableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error)  {
+func (o OltDevice) DisableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
 	// NOTE when we disable the OLT should we disable NNI, PONs and ONUs altogether?
 	olt_msg := Message{
 		Type: OltIndication,
@@ -383,37 +404,37 @@
 		},
 	}
 	o.channel <- olt_msg
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) DisablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error)  {
+func (o OltDevice) DisablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
 	oltLogger.Error("DisablePonIf not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) EnableIndication(_ *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error  {
+func (o OltDevice) EnableIndication(_ *openolt.Empty, stream openolt.Openolt_EnableIndicationServer) error {
 	oltLogger.WithField("oltId", o.ID).Info("OLT receives EnableIndication call from VOLTHA")
 	o.Enable(stream)
 	return nil
 }
 
-func (o OltDevice) EnablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error)  {
+func (o OltDevice) EnablePonIf(context.Context, *openolt.Interface) (*openolt.Empty, error) {
 	oltLogger.Error("EnablePonIf not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) FlowAdd(ctx context.Context, flow *openolt.Flow) (*openolt.Empty, error)  {
+func (o OltDevice) FlowAdd(ctx context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
 	oltLogger.WithFields(log.Fields{
-		"IntfId": flow.AccessIntfId,
-		"OnuId": flow.OnuId,
-		"EthType": fmt.Sprintf("%x", flow.Classifier.EthType),
+		"IntfId":    flow.AccessIntfId,
+		"OnuId":     flow.OnuId,
+		"EthType":   fmt.Sprintf("%x", flow.Classifier.EthType),
 		"InnerVlan": flow.Classifier.IVid,
 		"OuterVlan": flow.Classifier.OVid,
-		"FlowType": flow.FlowType,
-		"FlowId": flow.FlowId,
-		"UniID": flow.UniId,
-		"PortNo": flow.PortNo,
-	}).Infof("OLT receives Flow")
+		"FlowType":  flow.FlowType,
+		"FlowId":    flow.FlowId,
+		"UniID":     flow.UniId,
+		"PortNo":    flow.PortNo,
+	}).Tracef("OLT receives Flow")
 	// TODO optionally store flows somewhere
 
 	if flow.AccessIntfId == -1 {
@@ -425,34 +446,34 @@
 		onu, _ := pon.getOnuById(uint32(flow.OnuId))
 
 		msg := Message{
-			Type:      FlowUpdate,
-			Data:      OnuFlowUpdateMessage{
-				PonPortID:  pon.ID,
-				OnuID: 	onu.ID,
-				Flow: 	flow,
+			Type: FlowUpdate,
+			Data: OnuFlowUpdateMessage{
+				PonPortID: pon.ID,
+				OnuID:     onu.ID,
+				Flow:      flow,
 			},
 		}
 		onu.channel <- msg
 	}
 
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) FlowRemove(context.Context, *openolt.Flow) (*openolt.Empty, error)  {
-	oltLogger.Info("received FlowRemove")
+func (o OltDevice) FlowRemove(context.Context, *openolt.Flow) (*openolt.Empty, error) {
+	oltLogger.Tracef("received FlowRemove")
 	// TODO store flows somewhere
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) HeartbeatCheck(context.Context, *openolt.Empty) (*openolt.Heartbeat, error)  {
+func (o OltDevice) HeartbeatCheck(context.Context, *openolt.Empty) (*openolt.Heartbeat, error) {
 	oltLogger.Error("HeartbeatCheck not implemented")
-	return new(openolt.Heartbeat) , nil
+	return new(openolt.Heartbeat), nil
 }
 
-func (o OltDevice) GetDeviceInfo(context.Context, *openolt.Empty) (*openolt.DeviceInfo, error)  {
+func (o OltDevice) GetDeviceInfo(context.Context, *openolt.Empty) (*openolt.DeviceInfo, error) {
 
 	oltLogger.WithFields(log.Fields{
-		"oltId": o.ID,
+		"oltId":    o.ID,
 		"PonPorts": o.NumPon,
 	}).Info("OLT receives GetDeviceInfo call from VOLTHA")
 	devinfo := new(openolt.DeviceInfo)
@@ -475,67 +496,76 @@
 	return devinfo, nil
 }
 
-func (o OltDevice) OmciMsgOut(ctx context.Context, omci_msg *openolt.OmciMsg) (*openolt.Empty, error)  {
+func (o OltDevice) OmciMsgOut(ctx context.Context, omci_msg *openolt.OmciMsg) (*openolt.Empty, error) {
 	pon, _ := o.getPonById(omci_msg.IntfId)
 	onu, _ := pon.getOnuById(omci_msg.OnuId)
 	msg := Message{
-		Type:      OMCI,
-		Data:      OmciMessage{
-			OnuSN:  onu.SerialNumber,
-			OnuID: 	onu.ID,
-			omciMsg: 	omci_msg,
+		Type: OMCI,
+		Data: OmciMessage{
+			OnuSN:   onu.SerialNumber,
+			OnuID:   onu.ID,
+			omciMsg: omci_msg,
 		},
 	}
 	onu.channel <- msg
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) OnuPacketOut(ctx context.Context, onuPkt *openolt.OnuPacket) (*openolt.Empty, error)  {
+func (o OltDevice) OnuPacketOut(ctx context.Context, onuPkt *openolt.OnuPacket) (*openolt.Empty, error) {
 	pon, _ := o.getPonById(onuPkt.IntfId)
 	onu, _ := pon.getOnuById(onuPkt.OnuId)
 
 	rawpkt := gopacket.NewPacket(onuPkt.Pkt, layers.LayerTypeEthernet, gopacket.Default)
 
-	// NOTE is this the best way to the to the ethertype?
 	etherType := rawpkt.Layer(layers.LayerTypeEthernet).(*layers.Ethernet).EthernetType
 
 	if etherType == layers.EthernetTypeEAPOL {
 		eapolPkt := bbsim.ByteMsg{IntfId: onuPkt.IntfId, OnuId: onuPkt.OnuId, Bytes: rawpkt.Data()}
 		onu.eapolPktOutCh <- &eapolPkt
+	} else if layerDHCP := rawpkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
+		// TODO use IsDhcpPacket
+		// TODO we need to untag the packets
+		// NOTE here we receive packets going from the DHCP Server to the ONU
+		// for now we expect them to be double-tagged, but ideally the should be single tagged
+		dhcpPkt := bbsim.ByteMsg{IntfId: onuPkt.IntfId, OnuId: onuPkt.OnuId, Bytes: rawpkt.Data()}
+		onu.dhcpPktOutCh <- &dhcpPkt
 	}
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error)  {
+func (o OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error) {
 	oltLogger.Info("Shutting Down")
 	close(*o.oltDoneChannel)
 	close(*o.apiDoneChannel)
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
 func (o OltDevice) ReenableOlt(context.Context, *openolt.Empty) (*openolt.Empty, error) {
 	oltLogger.Error("ReenableOlt not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
 func (o OltDevice) UplinkPacketOut(context context.Context, packet *openolt.UplinkPacket) (*openolt.Empty, error) {
-	oltLogger.Warn("UplinkPacketOut not implemented")
-	return new(openolt.Empty) , nil
+	pkt := gopacket.NewPacket(packet.Pkt, layers.LayerTypeEthernet, gopacket.Default)
+
+	sendNniPacket(pkt)
+	// NOTE should we return an error if sendNniPakcet fails?
+	return new(openolt.Empty), nil
 }
 
-func (o OltDevice) CollectStatistics(context.Context, *openolt.Empty) (*openolt.Empty, error)  {
+func (o OltDevice) CollectStatistics(context.Context, *openolt.Empty) (*openolt.Empty, error) {
 	oltLogger.Error("CollectStatistics not implemented")
-	return new(openolt.Empty) , nil
+	return new(openolt.Empty), nil
 }
 
 func (o OltDevice) GetOnuInfo(context context.Context, packet *openolt.Onu) (*openolt.OnuIndication, error) {
 	oltLogger.Error("GetOnuInfo not implemented")
-	return new(openolt.OnuIndication) , nil
+	return new(openolt.OnuIndication), nil
 }
 
 func (o OltDevice) GetPonIf(context context.Context, packet *openolt.Interface) (*openolt.IntfIndication, error) {
 	oltLogger.Error("GetPonIf not implemented")
-	return new(openolt.IntfIndication) , nil
+	return new(openolt.IntfIndication), nil
 }
 
 func (s OltDevice) CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*openolt.Empty, error) {
@@ -556,4 +586,4 @@
 func (s OltDevice) RemoveTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*openolt.Empty, error) {
 	oltLogger.Info("received RemoveTrafficSchedulers")
 	return new(openolt.Empty), nil
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/devices/onu.go b/internal/bbsim/devices/onu.go
index fac7ce1..77e912c 100644
--- a/internal/bbsim/devices/onu.go
+++ b/internal/bbsim/devices/onu.go
@@ -18,129 +18,130 @@
 
 import (
 	"fmt"
-	"github.com/opencord/bbsim/internal/bbsim/responders/eapol"
 	"github.com/google/gopacket/layers"
 	"github.com/looplab/fsm"
+	"github.com/opencord/bbsim/internal/bbsim/responders/dhcp"
+	"github.com/opencord/bbsim/internal/bbsim/responders/eapol"
+	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	omci "github.com/opencord/omci-sim"
 	"github.com/opencord/voltha-protos/go/openolt"
 	log "github.com/sirupsen/logrus"
-	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
+	"net"
 )
 
 var onuLogger = log.WithFields(log.Fields{
 	"module": "ONU",
 })
 
-func CreateONU(olt OltDevice, pon PonPort, id uint32) Onu {
-		o := Onu{
-			ID: id,
-			PonPortID: pon.ID,
-			PonPort: pon,
-			// NOTE can we combine everything in a single channel?
-			channel: make(chan Message),
-			eapolPktOutCh: make(chan *bbsim.ByteMsg, 1024),
-		}
-		o.SerialNumber = o.NewSN(olt.ID, pon.ID, o.ID)
+func CreateONU(olt OltDevice, pon PonPort, id uint32, sTag int, cTag int) Onu {
 
-		// NOTE this state machine is used to track the operational
-		// state as requested by VOLTHA
-		o.OperState = getOperStateFSM(func(e *fsm.Event) {
-			onuLogger.WithFields(log.Fields{
-				"ID": o.ID,
-			}).Debugf("Changing ONU OperState from %s to %s", e.Src, e.Dst)
-		})
+	o := Onu{
+		ID:        id,
+		PonPortID: pon.ID,
+		PonPort:   pon,
+		STag:      sTag,
+		CTag:      cTag,
+		HwAddress: net.HardwareAddr{0x2e, 0x60, 0x70, 0x13, byte(pon.ID), byte(id)},
+		// NOTE can we combine everything in a single channel?
+		channel:       make(chan Message, 2048),
+		eapolPktOutCh: make(chan *bbsim.ByteMsg, 1024),
+		dhcpPktOutCh:  make(chan *bbsim.ByteMsg, 1024),
+	}
+	o.SerialNumber = o.NewSN(olt.ID, pon.ID, o.ID)
 
-		// NOTE this state machine is used to activate the OMCI, EAPOL and DHCP clients
-		o.InternalState = fsm.NewFSM(
-			"created",
-			fsm.Events{
-				{Name: "discover", Src: []string{"created"}, Dst: "discovered"},
-				{Name: "enable", Src: []string{"discovered"}, Dst: "enabled"},
-				{Name: "receive_eapol_flow", Src: []string{"enabled", "gem_port_added"}, Dst: "eapol_flow_received"},
-				{Name: "add_gem_port", Src: []string{"enabled", "eapol_flow_received"}, Dst: "gem_port_added"},
-				{Name: "start_auth", Src: []string{"eapol_flow_received", "gem_port_added"}, Dst: "auth_started"},
-				{Name: "eap_start_sent", Src: []string{"auth_started"}, Dst: "eap_start_sent"},
-				{Name: "eap_resonse_identity_sent", Src: []string{"eap_start_sent"}, Dst: "eap_resonse_identity_sent"},
-				{Name: "eap_resonse_challenge_sent", Src: []string{"eap_resonse_identity_sent"}, Dst: "eap_resonse_challenge_sent"},
-				{Name: "eap_resonse_success_received", Src: []string{"eap_resonse_challenge_sent"}, Dst: "eap_resonse_success_received"},
-				{Name: "auth_failed", Src: []string{"auth_started", "eap_start_sent", "eap_resonse_identity_sent", "eap_resonse_challenge_sent"}, Dst: "auth_failed"},
+	// NOTE this state machine is used to track the operational
+	// state as requested by VOLTHA
+	o.OperState = getOperStateFSM(func(e *fsm.Event) {
+		onuLogger.WithFields(log.Fields{
+			"ID": o.ID,
+		}).Debugf("Changing ONU OperState from %s to %s", e.Src, e.Dst)
+	})
+
+	// NOTE this state machine is used to activate the OMCI, EAPOL and DHCP clients
+	o.InternalState = fsm.NewFSM(
+		"created",
+		fsm.Events{
+			// DEVICE Activation
+			{Name: "discover", Src: []string{"created"}, Dst: "discovered"},
+			{Name: "enable", Src: []string{"discovered"}, Dst: "enabled"},
+			{Name: "receive_eapol_flow", Src: []string{"enabled", "gem_port_added"}, Dst: "eapol_flow_received"},
+			{Name: "add_gem_port", Src: []string{"enabled", "eapol_flow_received"}, Dst: "gem_port_added"},
+			// EAPOL
+			{Name: "start_auth", Src: []string{"eapol_flow_received", "gem_port_added"}, Dst: "auth_started"},
+			{Name: "eap_start_sent", Src: []string{"auth_started"}, Dst: "eap_start_sent"},
+			{Name: "eap_response_identity_sent", Src: []string{"eap_start_sent"}, Dst: "eap_response_identity_sent"},
+			{Name: "eap_response_challenge_sent", Src: []string{"eap_response_identity_sent"}, Dst: "eap_response_challenge_sent"},
+			{Name: "eap_response_success_received", Src: []string{"eap_response_challenge_sent"}, Dst: "eap_response_success_received"},
+			{Name: "auth_failed", Src: []string{"auth_started", "eap_start_sent", "eap_response_identity_sent", "eap_response_challenge_sent"}, Dst: "auth_failed"},
+			// DHCP
+			{Name: "start_dhcp", Src: []string{"eap_response_success_received"}, Dst: "dhcp_started"},
+			{Name: "dhcp_discovery_sent", Src: []string{"dhcp_started"}, Dst: "dhcp_discovery_sent"},
+			{Name: "dhcp_request_sent", Src: []string{"dhcp_discovery_sent"}, Dst: "dhcp_request_sent"},
+			{Name: "dhcp_ack_received", Src: []string{"dhcp_request_sent"}, Dst: "dhcp_ack_received"},
+			{Name: "dhcp_failed", Src: []string{"dhcp_started", "dhcp_discovery_sent", "dhcp_request_sent"}, Dst: "dhcp_failed"},
+		},
+		fsm.Callbacks{
+			"enter_state": func(e *fsm.Event) {
+				o.logStateChange(e.Src, e.Dst)
 			},
-			fsm.Callbacks{
-				"enter_state": func(e *fsm.Event) {
-					o.logStateChange(e.Src, e.Dst)
-				},
-				"enter_eapol_flow_received": func(e *fsm.Event) {
-					o.logStateChange(e.Src, e.Dst)
-					if e.Src == "enter_gem_port_added" {
-						if err := o.InternalState.Event("start_auth"); err != nil {
-							log.Infof("Transitioning to StartAuth")
-							onuLogger.WithFields(log.Fields{
-								"OnuId":  o.ID,
-								"IntfId": o.PonPortID,
-								"OnuSn":  o.SerialNumber,
-							}).Errorf("Error while transitioning ONU State")
-						}
-					}
-				},
-				"enter_gem_port_added": func(e *fsm.Event) {
-					o.logStateChange(e.Src, e.Dst)
-					if e.Src == "eapol_flow_received" {
-						log.Infof("Transitioning to StartAuth")
-						if err := o.InternalState.Event("start_auth"); err != nil {
-							onuLogger.WithFields(log.Fields{
-								"OnuId": o.ID,
-								"IntfId": o.PonPortID,
-								"OnuSn": o.SerialNumber,
-							}).Errorf("Error while transitioning ONU State")
-						}
-					}
-				},
-				"enter_auth_started": func(e *fsm.Event) {
-					o.logStateChange(e.Src, e.Dst)
-					msg := Message{
-						Type:      StartEAPOL,
-						Data: EapStartMessage{
-							PonPortID: o.PonPortID,
-							OnuID: o.ID,
-						},
-					}
-					go func(msg Message){
-						// you can only send a value on an unbuffered channel without blocking
-						o.channel <- msg
-					}(msg)
-
-				},
-				"enter_eap_resonse_success_received": func(e *fsm.Event) {
-					o.logStateChange(e.Src, e.Dst)
-					onuLogger.WithFields(log.Fields{
-						"OnuId": o.ID,
-						"IntfId": o.PonPortID,
-						"OnuSn": o.SerialNumber,
-					}).Warnf("TODO start DHCP request")
-				},
+			"enter_auth_started": func(e *fsm.Event) {
+				o.logStateChange(e.Src, e.Dst)
+				msg := Message{
+					Type: StartEAPOL,
+					Data: PacketMessage{
+						PonPortID: o.PonPortID,
+						OnuID:     o.ID,
+					},
+				}
+				o.channel <- msg
 			},
-		)
-		return o
+			"enter_auth_failed": func(e *fsm.Event) {
+				onuLogger.WithFields(log.Fields{
+					"OnuId":  o.ID,
+					"IntfId": o.PonPortID,
+					"OnuSn":  o.Sn(),
+				}).Errorf("ONU failed to authenticate!")
+			},
+			"enter_dhcp_started": func(e *fsm.Event) {
+				msg := Message{
+					Type: StartDHCP,
+					Data: PacketMessage{
+						PonPortID: o.PonPortID,
+						OnuID:     o.ID,
+					},
+				}
+				o.channel <- msg
+			},
+			"enter_dhcp_failed": func(e *fsm.Event) {
+				onuLogger.WithFields(log.Fields{
+					"OnuId":  o.ID,
+					"IntfId": o.PonPortID,
+					"OnuSn":  o.Sn(),
+				}).Errorf("ONU failed to DHCP!")
+			},
+		},
+	)
+	return o
 }
 
 func (o Onu) logStateChange(src string, dst string) {
 	onuLogger.WithFields(log.Fields{
-		"OnuId": o.ID,
+		"OnuId":  o.ID,
 		"IntfId": o.PonPortID,
-		"OnuSn": o.SerialNumber,
+		"OnuSn":  o.Sn(),
 	}).Debugf("Changing ONU InternalState from %s to %s", src, dst)
 }
 
-func (o Onu) processOnuMessages(stream openolt.Openolt_EnableIndicationServer)  {
+func (o Onu) processOnuMessages(stream openolt.Openolt_EnableIndicationServer) {
 	onuLogger.WithFields(log.Fields{
 		"onuID": o.ID,
-		"onuSN": o.SerialNumber,
+		"onuSN": o.Sn(),
 	}).Debug("Started ONU Indication Channel")
 
 	for message := range o.channel {
 		onuLogger.WithFields(log.Fields{
-			"onuID": o.ID,
-			"onuSN": o.SerialNumber,
+			"onuID":       o.ID,
+			"onuSN":       o.SerialNumber,
 			"messageType": message.Type,
 		}).Tracef("Received message on ONU Channel")
 
@@ -161,7 +162,29 @@
 			log.Infof("Receive StartEAPOL message on ONU channel")
 			go func() {
 				// TODO kill this thread
-				eapol.CreateWPASupplicant(o.ID, o.PonPortID, o.SerialNumber, o.InternalState, stream, o.eapolPktOutCh)
+				eapol.CreateWPASupplicant(
+					o.ID,
+					o.PonPortID,
+					o.Sn(),
+					o.InternalState,
+					stream,
+					o.eapolPktOutCh,
+				)
+			}()
+		case StartDHCP:
+			log.Infof("Receive StartDHCP message on ONU channel")
+			go func() {
+				// TODO kill this thread
+				dhcp.CreateDHCPClient(
+					o.ID,
+					o.PonPortID,
+					o.Sn(),
+					o.HwAddress,
+					o.CTag,
+					o.InternalState,
+					stream,
+					o.dhcpPktOutCh,
+				)
 			}()
 		default:
 			onuLogger.Warnf("Received unknown message data %v for type %v in OLT channel", message.Data, message.Type)
@@ -169,19 +192,19 @@
 	}
 }
 
-func (o Onu) processOmciMessages(stream openolt.Openolt_EnableIndicationServer)  {
+func (o Onu) processOmciMessages(stream openolt.Openolt_EnableIndicationServer) {
 	ch := omci.GetChannel()
 
 	onuLogger.WithFields(log.Fields{
 		"onuID": o.ID,
-		"onuSN": o.SerialNumber,
+		"onuSN": o.Sn(),
 	}).Debug("Started OMCI Indication Channel")
 
 	for message := range ch {
 		switch message.Type {
 		case omci.GemPortAdded:
 			log.WithFields(log.Fields{
-				"OnuId": message.Data.OnuId,
+				"OnuId":  message.Data.OnuId,
 				"IntfId": message.Data.IntfId,
 			}).Infof("GemPort Added")
 
@@ -191,7 +214,7 @@
 				if err := o.InternalState.Event("add_gem_port"); err != nil {
 					log.Errorf("Can't go to gem_port_added: %v", err)
 				}
-			} else if  o.InternalState.Is("eapol_flow_received"){
+			} else if o.InternalState.Is("eapol_flow_received") {
 				if err := o.InternalState.Event("start_auth"); err != nil {
 					log.Errorf("Can't go to auth_started: %v", err)
 				}
@@ -213,7 +236,7 @@
 
 func (o Onu) sendOnuDiscIndication(msg OnuDiscIndicationMessage, stream openolt.Openolt_EnableIndicationServer) {
 	discoverData := &openolt.Indication_OnuDiscInd{OnuDiscInd: &openolt.OnuDiscIndication{
-		IntfId: msg.Onu.PonPortID,
+		IntfId:       msg.Onu.PonPortID,
 		SerialNumber: msg.Onu.SerialNumber,
 	}}
 	if err := stream.Send(&openolt.Indication{Data: discoverData}); err != nil {
@@ -222,8 +245,8 @@
 	o.InternalState.Event("discover")
 	onuLogger.WithFields(log.Fields{
 		"IntfId": msg.Onu.PonPortID,
-		"SerialNumber": msg.Onu.SerialNumber,
-		"OnuId": o.ID,
+		"OnuSn":  msg.Onu.Sn(),
+		"OnuId":  o.ID,
 	}).Debug("Sent Indication_OnuDiscInd")
 }
 
@@ -235,10 +258,10 @@
 	o.OperState.Event("enable")
 
 	indData := &openolt.Indication_OnuInd{OnuInd: &openolt.OnuIndication{
-		IntfId: o.PonPortID,
-		OnuId: o.ID,
-		OperState: o.OperState.Current(),
-		AdminState: o.OperState.Current(),
+		IntfId:       o.PonPortID,
+		OnuId:        o.ID,
+		OperState:    o.OperState.Current(),
+		AdminState:   o.OperState.Current(),
 		SerialNumber: o.SerialNumber,
 	}}
 	if err := stream.Send(&openolt.Indication{Data: indData}); err != nil {
@@ -246,20 +269,20 @@
 	}
 	o.InternalState.Event("enable")
 	onuLogger.WithFields(log.Fields{
-		"IntfId": o.PonPortID,
-		"OnuId": o.ID,
-		"OperState": msg.OperState.String(),
+		"IntfId":     o.PonPortID,
+		"OnuId":      o.ID,
+		"OperState":  msg.OperState.String(),
 		"AdminState": msg.OperState.String(),
-		"SerialNumber": o.SerialNumber,
+		"OnuSn":      o.Sn(),
 	}).Debug("Sent Indication_OnuInd")
 }
 
 func (o Onu) handleOmciMessage(msg OmciMessage, stream openolt.Openolt_EnableIndicationServer) {
 
 	onuLogger.WithFields(log.Fields{
-		"IntfId": o.PonPortID,
+		"IntfId":       o.PonPortID,
 		"SerialNumber": o.SerialNumber,
-		"omciPacket": msg.omciMsg.Pkt,
+		"omciPacket":   msg.omciMsg.Pkt,
 	}).Tracef("Received OMCI message")
 
 	var omciInd openolt.OmciIndication
@@ -277,36 +300,48 @@
 		onuLogger.Errorf("send omci indication failed: %v", err)
 	}
 	onuLogger.WithFields(log.Fields{
-		"IntfId": o.PonPortID,
+		"IntfId":       o.PonPortID,
 		"SerialNumber": o.SerialNumber,
-		"omciPacket": omciInd.Pkt,
+		"omciPacket":   omciInd.Pkt,
 	}).Tracef("Sent OMCI message")
 }
 
 func (o Onu) handleFlowUpdate(msg OnuFlowUpdateMessage, stream openolt.Openolt_EnableIndicationServer) {
 	onuLogger.WithFields(log.Fields{
-		"IntfId": msg.Flow.AccessIntfId,
-		"OnuId": msg.Flow.OnuId,
-		"EthType": fmt.Sprintf("%x", msg.Flow.Classifier.EthType),
+		"DstPort":   msg.Flow.Classifier.DstPort,
+		"EthType":   fmt.Sprintf("%x", msg.Flow.Classifier.EthType),
+		"FlowId":    msg.Flow.FlowId,
+		"FlowType":  msg.Flow.FlowType,
 		"InnerVlan": msg.Flow.Classifier.IVid,
+		"IntfId":    msg.Flow.AccessIntfId,
+		"IpProto":   msg.Flow.Classifier.IpProto,
+		"OnuId":     msg.Flow.OnuId,
+		"OnuSn":     o.Sn(),
 		"OuterVlan": msg.Flow.Classifier.OVid,
-		"FlowType": msg.Flow.FlowType,
-		"FlowId": msg.Flow.FlowId,
-		"UniID": msg.Flow.UniId,
-		"PortNo": msg.Flow.PortNo,
-	}).Infof("ONU receives Flow")
+		"PortNo":    msg.Flow.PortNo,
+		"SrcPort":   msg.Flow.Classifier.SrcPort,
+		"UniID":     msg.Flow.UniId,
+	}).Debug("ONU receives Flow")
+
 	if msg.Flow.Classifier.EthType == uint32(layers.EthernetTypeEAPOL) && msg.Flow.Classifier.OVid == 4091 {
 		// NOTE if we receive the EAPOL flows but we don't have GemPorts
 		// go an intermediate state, otherwise start auth
 		if o.InternalState.Is("enabled") {
 			if err := o.InternalState.Event("receive_eapol_flow"); err != nil {
-				log.Errorf("Can't go to eapol_flow_received: %v", err)
+				log.Warnf("Can't go to eapol_flow_received: %v", err)
 			}
-		} else if  o.InternalState.Is("gem_port_added"){
+		} else if o.InternalState.Is("gem_port_added") {
 			if err := o.InternalState.Event("start_auth"); err != nil {
-				log.Errorf("Can't go to auth_started: %v", err)
+				log.Warnf("Can't go to auth_started: %v", err)
 			}
 		}
+	} else if msg.Flow.Classifier.EthType == uint32(layers.EthernetTypeIPv4) &&
+		msg.Flow.Classifier.SrcPort == uint32(68) &&
+		msg.Flow.Classifier.DstPort == uint32(67) {
+		// NOTE we are receiving mulitple DHCP flows but we shouldn't call the transition multiple times
+		if err := o.InternalState.Event("start_dhcp"); err != nil {
+			log.Warnf("Can't go to dhcp_started: %v", err)
+		}
 	}
 }
 
@@ -321,4 +356,4 @@
 	}
 	onuLogger.Tracef("Omci decoded: %x.", p)
 	return p
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/devices/types.go b/internal/bbsim/devices/types.go
index 65aa09e..e012858 100644
--- a/internal/bbsim/devices/types.go
+++ b/internal/bbsim/devices/types.go
@@ -20,9 +20,10 @@
 	"bytes"
 	"errors"
 	"fmt"
-	"github.com/opencord/voltha-protos/go/openolt"
 	"github.com/looplab/fsm"
 	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
+	"github.com/opencord/voltha-protos/go/openolt"
+	"net"
 )
 
 // TODO get rid of this file
@@ -32,19 +33,25 @@
 
 // Devices
 type Onu struct {
-	ID uint32
-	PonPortID uint32
-	PonPort PonPort
+	ID            uint32
+	PonPortID     uint32
+	PonPort       PonPort
+	STag          int
+	CTag          int
+	HwAddress     net.HardwareAddr
 	InternalState *fsm.FSM
 
-	OperState *fsm.FSM
+	OperState    *fsm.FSM
 	SerialNumber *openolt.SerialNumber
 
-	channel chan Message
-	eapolPktOutCh chan *bbsim.ByteMsg
+	channel       chan Message        // this channel is to track state changes and OMCI messages
+	eapolPktOutCh chan *bbsim.ByteMsg // this channel is for EAPOL Packet Outs (coming from the controller)
+	dhcpPktOutCh  chan *bbsim.ByteMsg // this channel is for DHCP Packet Outs (coming from the controller)
 }
 
-
+func (o Onu) Sn() string {
+	return onuSnToString(o.SerialNumber)
+}
 
 type NniPort struct {
 	// BBSIM Internals
@@ -52,18 +59,18 @@
 
 	// PON Attributes
 	OperState *fsm.FSM
-	Type string
+	Type      string
 }
 
 type PonPort struct {
 	// BBSIM Internals
-	ID uint32
+	ID     uint32
 	NumOnu int
-	Onus []Onu
+	Onus   []Onu
 
 	// PON Attributes
 	OperState *fsm.FSM
-	Type string
+	Type      string
 
 	// NOTE do we need a state machine for the PON Ports?
 }
@@ -88,15 +95,16 @@
 
 type OltDevice struct {
 	// BBSIM Internals
-	ID int
-	SerialNumber string
-	NumNni int
-	NumPon int
-	NumOnuPerPon int
-	InternalState *fsm.FSM
-	channel chan Message
-	oltDoneChannel *chan bool
-	apiDoneChannel *chan bool
+	ID              int
+	SerialNumber    string
+	NumNni          int
+	NumPon          int
+	NumOnuPerPon    int
+	InternalState   *fsm.FSM
+	channel         chan Message
+	oltDoneChannel  *chan bool
+	apiDoneChannel  *chan bool
+	nniPktInChannel chan *bbsim.PacketMsg
 
 	Pons []PonPort
 	Nnis []NniPort
@@ -116,8 +124,10 @@
 	OnuDiscIndication MessageType = 3
 	OnuIndication     MessageType = 4
 	OMCI              MessageType = 5
-	FlowUpdate		  MessageType = 6
-	StartEAPOL		  MessageType = 7
+	FlowUpdate        MessageType = 6
+	StartEAPOL        MessageType = 7
+	DoneEAPOL         MessageType = 8
+	StartDHCP         MessageType = 9
 )
 
 func (m MessageType) String() string {
@@ -130,13 +140,15 @@
 		"OMCI",
 		"FlowUpdate",
 		"StartEAPOL",
+		"DoneEAPOL",
+		"StartDHCP",
 	}
 	return names[m]
 }
 
 type Message struct {
-	Type      MessageType
-	Data 	  interface{}
+	Type MessageType
+	Data interface{}
 }
 
 type OltIndicationMessage struct {
@@ -166,9 +178,9 @@
 }
 
 type OmciMessage struct {
-	OnuSN     *openolt.SerialNumber
-	OnuID 	  uint32
-	omciMsg   *openolt.OmciMsg
+	OnuSN   *openolt.SerialNumber
+	OnuID   uint32
+	omciMsg *openolt.OmciMsg
 }
 
 type OnuFlowUpdateMessage struct {
@@ -177,17 +189,16 @@
 	Flow      *openolt.Flow
 }
 
-type EapStartMessage struct {
+type PacketMessage struct {
 	PonPortID uint32
 	OnuID     uint32
 }
 
-
 type OperState int
 
 const (
-	UP OperState = iota
-	DOWN // The device has been discovered, but not yet activated
+	UP   OperState = iota
+	DOWN           // The device has been discovered, but not yet activated
 )
 
 func (m OperState) String() string {
@@ -196,4 +207,4 @@
 		"down",
 	}
 	return names[m]
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/grpc_api_server.go b/internal/bbsim/grpc_api_server.go
index 304d3fa..20b6164 100644
--- a/internal/bbsim/grpc_api_server.go
+++ b/internal/bbsim/grpc_api_server.go
@@ -89,10 +89,13 @@
 		for _, o := range pon.Onus {
 			onu := bbsim.ONU{
 				ID:            int32(o.ID),
-				SerialNumber:  o.SerialNumber.String(),
+				SerialNumber:  o.Sn(),
 				OperState:     o.OperState.Current(),
 				InternalState: o.InternalState.Current(),
 				PonPortID:     int32(o.PonPortID),
+				STag:          int32(o.STag),
+				CTag:          int32(o.CTag),
+				HwAddress:     o.HwAddress.String(),
 			}
 			onus.Items = append(onus.Items, &onu)
 		}
diff --git a/internal/bbsim/packetHandlers/filters.go b/internal/bbsim/packetHandlers/filters.go
new file mode 100644
index 0000000..3233c8c
--- /dev/null
+++ b/internal/bbsim/packetHandlers/filters.go
@@ -0,0 +1,43 @@
+/*
+ * 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 packetHandlers
+
+import (
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"net"
+)
+
+func IsDhcpPacket(pkt gopacket.Packet) bool {
+	if layerDHCP := pkt.Layer(layers.LayerTypeDHCPv4); layerDHCP != nil {
+		return true
+	}
+	return false
+}
+
+func IsIncomingPacket(packet gopacket.Packet) bool {
+	if ipLayer := packet.Layer(layers.LayerTypeIPv4); ipLayer != nil {
+
+		ip, _ := ipLayer.(*layers.IPv4)
+
+		// FIXME find a better way to filter outgoing packets
+		if ip.SrcIP.Equal(net.ParseIP("182.21.0.128")) {
+			return true
+		}
+	}
+	return false
+}
diff --git a/internal/bbsim/packetHandlers/packet_tags.go b/internal/bbsim/packetHandlers/packet_tags.go
new file mode 100644
index 0000000..3e31e3c
--- /dev/null
+++ b/internal/bbsim/packetHandlers/packet_tags.go
@@ -0,0 +1,123 @@
+/*
+ * 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 packetHandlers
+
+import (
+	"errors"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+)
+
+func PushSingleTag(tag int, pkt gopacket.Packet) (gopacket.Packet, error) {
+	// TODO can this method be semplified?
+	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(tag),
+		}
+
+		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,
+		)
+
+		return ret, nil
+	}
+	return nil, errors.New("Couldn't extract LayerTypeEthernet from packet")
+}
+
+func PopSingleTag(pkt gopacket.Packet) (gopacket.Packet, error) {
+	layer, err := getDot1QLayer(pkt)
+	if err != nil {
+		return nil, err
+	}
+
+	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,
+		)
+
+		return retpkt, nil
+	}
+	return nil, errors.New("no-ethernet-layer")
+}
+
+func PopDoubleTag(pkt gopacket.Packet) (gopacket.Packet, error) {
+	packet, err := PopSingleTag(pkt)
+	if err != nil {
+		return nil, err
+	}
+	packet, err = PopSingleTag(packet)
+	if err != nil {
+		return nil, err
+	}
+	return packet, nil
+}
+
+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) (*layers.Dot1Q, error) {
+	dot1q := &layers.Dot1Q{}
+	if dot1qLayer := pkt.Layer(layers.LayerTypeDot1Q); dot1qLayer != nil {
+		dot1q = dot1qLayer.(*layers.Dot1Q)
+		return dot1q, nil
+	}
+	return nil, errors.New("no-dot1q-layer-in-packet")
+}
+
+func getVlanTag(pkt gopacket.Packet) (uint16, error) {
+	dot1q, err := getDot1QLayer(pkt)
+	if err != nil {
+		return 0, err
+	}
+	return dot1q.VLANIdentifier, nil
+}
diff --git a/internal/bbsim/packetHandlers/packet_tags_test.go b/internal/bbsim/packetHandlers/packet_tags_test.go
new file mode 100644
index 0000000..91c944e
--- /dev/null
+++ b/internal/bbsim/packetHandlers/packet_tags_test.go
@@ -0,0 +1,152 @@
+/*
+ * 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 packetHandlers
+
+import (
+	"fmt"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"gotest.tools/assert"
+	"net"
+	"os"
+	"testing"
+)
+
+func setUp() {
+	fmt.Println("Test Setup")
+}
+
+func tearDown() {
+	fmt.Println("Test Teardown")
+}
+
+func TestMain(m *testing.M) {
+	setUp()
+	code := m.Run()
+	tearDown()
+	os.Exit(code)
+}
+
+// GO111MODULE=on go test -v -mod vendor ./internal/bbsim/... -run TestPushSingleTag
+func TestPushSingleTag(t *testing.T) {
+	rawBytes := []byte{10, 20, 30}
+	srcMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, byte(1), byte(1)}
+	dstMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
+
+	ethernetLayer := &layers.Ethernet{
+		SrcMAC:       srcMac,
+		DstMAC:       dstMac,
+		EthernetType: 0x8100,
+	}
+
+	buffer := gopacket.NewSerializeBuffer()
+	gopacket.SerializeLayers(
+		buffer,
+		gopacket.SerializeOptions{
+			FixLengths: false,
+		},
+		ethernetLayer,
+		gopacket.Payload(rawBytes),
+	)
+
+	untaggedPkt := gopacket.NewPacket(buffer.Bytes(), layers.LayerTypeEthernet, gopacket.Default)
+	taggedPkt, err := PushSingleTag(111, untaggedPkt)
+	if err != nil {
+		t.Fail()
+		t.Logf("Error in PushSingleTag: %v", err)
+	}
+
+	vlan, _ := getVlanTag(taggedPkt)
+	assert.Equal(t, vlan, uint16(111))
+}
+
+func TestPopSingleTag(t *testing.T) {
+	rawBytes := []byte{10, 20, 30}
+	srcMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, byte(1), byte(1)}
+	dstMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
+
+	ethernetLayer := &layers.Ethernet{
+		SrcMAC:       srcMac,
+		DstMAC:       dstMac,
+		EthernetType: 0x8100,
+	}
+
+	dot1qLayer := &layers.Dot1Q{
+		Type:           0x8100,
+		VLANIdentifier: uint16(111),
+	}
+
+	buffer := gopacket.NewSerializeBuffer()
+	gopacket.SerializeLayers(
+		buffer,
+		gopacket.SerializeOptions{
+			FixLengths: false,
+		},
+		ethernetLayer,
+		dot1qLayer,
+		gopacket.Payload(rawBytes),
+	)
+
+	untaggedPkt := gopacket.NewPacket(buffer.Bytes(), layers.LayerTypeEthernet, gopacket.Default)
+	taggedPkt, err := PopSingleTag(untaggedPkt)
+	if err != nil {
+		t.Fail()
+		t.Logf("Error in PushSingleTag: %v", err)
+	}
+
+	vlan, err := getVlanTag(taggedPkt)
+	assert.Equal(t, vlan, uint16(2580)) // FIXME where dows 2056 comes from??
+}
+
+func TestPopDoubleTag(t *testing.T) {
+	rawBytes := []byte{10, 20, 30}
+	srcMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, byte(1), byte(1)}
+	dstMac := net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
+
+	ethernetLayer := &layers.Ethernet{
+		SrcMAC:       srcMac,
+		DstMAC:       dstMac,
+		EthernetType: 0x8100,
+	}
+
+	dot1qLayer := &layers.Dot1Q{
+		Type:           0x8100,
+		VLANIdentifier: uint16(111),
+	}
+
+	buffer := gopacket.NewSerializeBuffer()
+	gopacket.SerializeLayers(
+		buffer,
+		gopacket.SerializeOptions{
+			FixLengths: false,
+		},
+		ethernetLayer,
+		dot1qLayer,
+		gopacket.Payload(rawBytes),
+	)
+
+	untaggedPkt := gopacket.NewPacket(buffer.Bytes(), layers.LayerTypeEthernet, gopacket.Default)
+	taggedPkt, err := PopDoubleTag(untaggedPkt)
+	if err != nil {
+		t.Fail()
+		t.Logf("Error in PushSingleTag: %v", err)
+	}
+
+	vlan, err := getVlanTag(taggedPkt)
+	assert.Equal(t, vlan, uint16(0))
+	assert.Equal(t, err.Error(), "no-dot1q-layer-in-packet")
+}
diff --git a/internal/bbsim/responders/dhcp/dhcp.go b/internal/bbsim/responders/dhcp/dhcp.go
new file mode 100644
index 0000000..d2a3db7
--- /dev/null
+++ b/internal/bbsim/responders/dhcp/dhcp.go
@@ -0,0 +1,387 @@
+/*
+ * 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 dhcp
+
+import (
+	"errors"
+	"fmt"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"github.com/looplab/fsm"
+	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
+	omci "github.com/opencord/omci-sim"
+	"github.com/opencord/voltha-protos/go/openolt"
+	log "github.com/sirupsen/logrus"
+	"net"
+	"reflect"
+)
+
+var dhcpLogger = log.WithFields(log.Fields{
+	"module": "DHCP",
+})
+
+var defaultParamsRequestList = []layers.DHCPOpt{
+	layers.DHCPOptSubnetMask,
+	layers.DHCPOptBroadcastAddr,
+	layers.DHCPOptTimeOffset,
+	layers.DHCPOptRouter,
+	layers.DHCPOptDomainName,
+	layers.DHCPOptDNS,
+	layers.DHCPOptDomainSearch,
+	layers.DHCPOptHostname,
+	layers.DHCPOptNetBIOSTCPNS,
+	layers.DHCPOptNetBIOSTCPScope,
+	layers.DHCPOptInterfaceMTU,
+	layers.DHCPOptClasslessStaticRoute,
+	layers.DHCPOptNTPServers,
+}
+
+func createDefaultDHCPReq(intfId uint32, onuId uint32) layers.DHCPv4 {
+	return layers.DHCPv4{
+		Operation:    layers.DHCPOpRequest,
+		HardwareType: layers.LinkTypeEthernet,
+		HardwareLen:  6,
+		HardwareOpts: 0,
+		Xid:          onuId,
+		ClientHWAddr: net.HardwareAddr{0x2e, 0x60, 0x70, 0x13, byte(intfId), byte(onuId)},
+	}
+}
+
+func createDefaultOpts() []layers.DHCPOption {
+	hostname := []byte("bbsim.onf.org")
+	opts := []layers.DHCPOption{}
+	opts = append(opts, layers.DHCPOption{
+		Type:   layers.DHCPOptHostname,
+		Data:   hostname,
+		Length: uint8(len(hostname)),
+	})
+
+	bytes := []byte{}
+	for _, option := range defaultParamsRequestList {
+		bytes = append(bytes, byte(option))
+	}
+
+	opts = append(opts, layers.DHCPOption{
+		Type:   layers.DHCPOptParamsRequest,
+		Data:   bytes,
+		Length: uint8(len(bytes)),
+	})
+	return opts
+}
+
+func createDHCPDisc(intfId uint32, onuId uint32) *layers.DHCPv4 {
+	dhcpLayer := createDefaultDHCPReq(intfId, onuId)
+	defaultOpts := createDefaultOpts()
+	dhcpLayer.Options = append([]layers.DHCPOption{layers.DHCPOption{
+		Type:   layers.DHCPOptMessageType,
+		Data:   []byte{byte(layers.DHCPMsgTypeDiscover)},
+		Length: 1,
+	}}, defaultOpts...)
+
+	return &dhcpLayer
+}
+
+func createDHCPReq(intfId uint32, onuId uint32) *layers.DHCPv4 {
+	dhcpLayer := createDefaultDHCPReq(intfId, onuId)
+	defaultOpts := createDefaultOpts()
+
+	dhcpLayer.Options = append(defaultOpts, layers.DHCPOption{
+		Type:   layers.DHCPOptMessageType,
+		Data:   []byte{byte(layers.DHCPMsgTypeRequest)},
+		Length: 1,
+	})
+
+	data := []byte{182, 21, 0, 128}
+	dhcpLayer.Options = append(dhcpLayer.Options, layers.DHCPOption{
+		Type:   layers.DHCPOptServerID,
+		Data:   data,
+		Length: uint8(len(data)),
+	})
+
+	data = []byte{0xcd, 0x28, 0xcb, 0xcc, 0x00, 0x01, 0x00, 0x01,
+		0x23, 0xed, 0x11, 0xec, 0x4e, 0xfc, 0xcd, 0x28, 0xcb, 0xcc}
+	dhcpLayer.Options = append(dhcpLayer.Options, layers.DHCPOption{
+		Type:   layers.DHCPOptClientID,
+		Data:   data,
+		Length: uint8(len(data)),
+	})
+
+	data = []byte{182, 21, 0, byte(onuId)}
+	dhcpLayer.Options = append(dhcpLayer.Options, layers.DHCPOption{
+		Type:   layers.DHCPOptRequestIP,
+		Data:   data,
+		Length: uint8(len(data)),
+	})
+	return &dhcpLayer
+}
+
+func serializeDHCPPacket(intfId uint32, onuId uint32, srcMac net.HardwareAddr, dhcp *layers.DHCPv4) ([]byte, error) {
+	buffer := gopacket.NewSerializeBuffer()
+	options := gopacket.SerializeOptions{
+		ComputeChecksums: true,
+		FixLengths:       true,
+	}
+
+	ethernetLayer := &layers.Ethernet{
+		SrcMAC:       srcMac,
+		DstMAC:       net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+		EthernetType: layers.EthernetTypeIPv4,
+	}
+
+	ipLayer := &layers.IPv4{
+		Version:  4,
+		TOS:      0x10,
+		TTL:      128,
+		SrcIP:    []byte{0, 0, 0, 0},
+		DstIP:    []byte{255, 255, 255, 255},
+		Protocol: layers.IPProtocolUDP,
+	}
+
+	udpLayer := &layers.UDP{
+		SrcPort: 68,
+		DstPort: 67,
+	}
+
+	udpLayer.SetNetworkLayerForChecksum(ipLayer)
+	if err := gopacket.SerializeLayers(buffer, options, ethernetLayer, ipLayer, udpLayer, dhcp); err != nil {
+		return nil, err
+	}
+
+	bytes := buffer.Bytes()
+	return bytes, nil
+}
+
+func getDhcpLayer(pkt gopacket.Packet) (*layers.DHCPv4, error) {
+	layerDHCP := pkt.Layer(layers.LayerTypeDHCPv4)
+	dhcp, _ := layerDHCP.(*layers.DHCPv4)
+	if dhcp == nil {
+		return nil, errors.New("Failed-to-extract-DHCP-layer")
+	}
+	return dhcp, nil
+}
+
+func getDhcpMessageType(dhcp *layers.DHCPv4) (layers.DHCPMsgType, error) {
+	for _, option := range dhcp.Options {
+		if option.Type == layers.DHCPOptMessageType {
+			if reflect.DeepEqual(option.Data, []byte{byte(layers.DHCPMsgTypeOffer)}) {
+				return layers.DHCPMsgTypeOffer, nil
+			} else if reflect.DeepEqual(option.Data, []byte{byte(layers.DHCPMsgTypeAck)}) {
+				return layers.DHCPMsgTypeAck, nil
+			} else if reflect.DeepEqual(option.Data, []byte{byte(layers.DHCPMsgTypeRelease)}) {
+				return layers.DHCPMsgTypeRelease, nil
+			} else {
+				msg := fmt.Sprintf("This type %x is not supported", option.Data)
+				return 0, errors.New(msg)
+			}
+		}
+	}
+	return 0, errors.New("Failed to extract MsgType from dhcp")
+}
+
+func sendDHCPPktIn(msg bbsim.ByteMsg, stream openolt.Openolt_EnableIndicationServer) error {
+	// FIXME unify sendDHCPPktIn and sendEapolPktIn methods
+	gemid, err := omci.GetGemPortId(msg.IntfId, msg.OnuId)
+	if err != nil {
+		dhcpLogger.WithFields(log.Fields{
+			"OnuId":  msg.OnuId,
+			"IntfId": msg.IntfId,
+		}).Errorf("Can't retrieve GemPortId: %s", err)
+		return err
+	}
+	data := &openolt.Indication_PktInd{PktInd: &openolt.PacketIndication{
+		IntfType: "pon", IntfId: msg.IntfId, GemportId: uint32(gemid), Pkt: msg.Bytes,
+	}}
+
+	if err := stream.Send(&openolt.Indication{Data: data}); err != nil {
+		dhcpLogger.Errorf("Fail to send DHCP PktInd indication. %v", err)
+		return err
+	}
+	return nil
+}
+
+func sendDHCPDiscovery(ponPortId uint32, onuId uint32, serialNumber string, onuHwAddress net.HardwareAddr, cTag int, stream openolt.Openolt_EnableIndicationServer) error {
+	dhcp := createDHCPDisc(ponPortId, onuId)
+	pkt, err := serializeDHCPPacket(ponPortId, onuId, onuHwAddress, dhcp)
+	if err != nil {
+		dhcpLogger.Errorf("Cannot serializeDHCPPacket: %s", err)
+		return err
+	}
+	// NOTE I don't think we need to tag the packet
+	//taggedPkt, err := packetHandlers.PushSingleTag(cTag, pkt)
+
+	msg := bbsim.ByteMsg{
+		IntfId: ponPortId,
+		OnuId:  onuId,
+		Bytes:  pkt,
+	}
+
+	if err := sendDHCPPktIn(msg, stream); err != nil {
+		return err
+	}
+	dhcpLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("DHCPDiscovery Sent")
+	return nil
+}
+
+func sendDHCPRequest(ponPortId uint32, onuId uint32, serialNumber string, onuHwAddress net.HardwareAddr, cTag int, stream openolt.Openolt_EnableIndicationServer) error {
+	dhcp := createDHCPReq(ponPortId, onuId)
+	pkt, err := serializeDHCPPacket(ponPortId, onuId, onuHwAddress, dhcp)
+
+	if err != nil {
+		dhcpLogger.Errorf("Cannot serializeDHCPPacket: %s", err)
+		return err
+	}
+	// NOTE I don't think we need to tag the packet
+	//taggedPkt, err := packetHandlers.PushSingleTag(cTag, pkt)
+
+	msg := bbsim.ByteMsg{
+		IntfId: ponPortId,
+		OnuId:  onuId,
+		Bytes:  pkt,
+	}
+
+	if err := sendDHCPPktIn(msg, stream); err != nil {
+		return err
+	}
+	dhcpLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("DHCPDiscovery Sent")
+	return nil
+}
+
+func CreateDHCPClient(onuId uint32, ponPortId uint32, serialNumber string, onuHwAddress net.HardwareAddr, cTag int, onuStateMachine *fsm.FSM, stream openolt.Openolt_EnableIndicationServer, pktOutCh chan *bbsim.ByteMsg) {
+	// NOTE pckOutCh is channel to listen on for packets received by VOLTHA
+	// the OLT device will publish messages on that channel
+
+	dhcpLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("DHCP State Machine starting")
+
+	defer dhcpLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("DHCP State machine completed")
+
+	// Send DHCP Discovery packet
+	if err := sendDHCPDiscovery(ponPortId, onuId, serialNumber, onuHwAddress, cTag, stream); err != nil {
+		dhcpLogger.WithFields(log.Fields{
+			"OnuId":  onuId,
+			"IntfId": ponPortId,
+			"OnuSn":  serialNumber,
+		}).Errorf("Can't send DHCP Discovery: %s", err)
+		if err := onuStateMachine.Event("dhcp_failed"); err != nil {
+			dhcpLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Errorf("Error while transitioning ONU State %v", err)
+		}
+		return
+	}
+
+	if err := onuStateMachine.Event("dhcp_discovery_sent"); err != nil {
+		dhcpLogger.WithFields(log.Fields{
+			"OnuId":  onuId,
+			"IntfId": ponPortId,
+			"OnuSn":  serialNumber,
+		}).Errorf("Error while transitioning ONU State %v", err)
+	}
+
+	dhcpLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("Listening on dhcpPktOutCh")
+
+	for msg := range pktOutCh {
+		dhcpLogger.Tracef("Received DHCP message %v", msg)
+
+		pkt := gopacket.NewPacket(msg.Bytes, layers.LayerTypeEthernet, gopacket.Default)
+		dhcpLayer, err := getDhcpLayer(pkt)
+		if err != nil {
+			dhcpLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Errorf("Can't get DHCP Layer from Packet: %v", err)
+			continue
+		}
+		dhcpMessageType, err := getDhcpMessageType(dhcpLayer)
+		if err != nil {
+			dhcpLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Errorf("Can't get DHCP Message Type from DHCP Layer: %v", err)
+			continue
+		}
+
+		if dhcpLayer.Operation == layers.DHCPOpReply {
+			if dhcpMessageType == layers.DHCPMsgTypeOffer {
+				if err := sendDHCPRequest(ponPortId, onuId, serialNumber, onuHwAddress, cTag, stream); err != nil {
+					dhcpLogger.WithFields(log.Fields{
+						"OnuId":  onuId,
+						"IntfId": ponPortId,
+						"OnuSn":  serialNumber,
+					}).Errorf("Can't send DHCP Request: %s", err)
+					if err := onuStateMachine.Event("dhcp_failed"); err != nil {
+						dhcpLogger.WithFields(log.Fields{
+							"OnuId":  onuId,
+							"IntfId": ponPortId,
+							"OnuSn":  serialNumber,
+						}).Errorf("Error while transitioning ONU State %v", err)
+					}
+					return
+				}
+				if err := onuStateMachine.Event("dhcp_request_sent"); err != nil {
+					dhcpLogger.WithFields(log.Fields{
+						"OnuId":  onuId,
+						"IntfId": ponPortId,
+						"OnuSn":  serialNumber,
+					}).Errorf("Error while transitioning ONU State %v", err)
+				}
+
+			} else if dhcpMessageType == layers.DHCPMsgTypeAck {
+				// NOTE once the ack is received we don't need to do anything but change the state
+				if err := onuStateMachine.Event("dhcp_ack_received"); err != nil {
+					dhcpLogger.WithFields(log.Fields{
+						"OnuId":  onuId,
+						"IntfId": ponPortId,
+						"OnuSn":  serialNumber,
+					}).Errorf("Error while transitioning ONU State %v", err)
+				}
+				return
+			}
+			// NOTE do we need to care about DHCPMsgTypeRelease??
+		} else {
+			dhcpLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Warnf("Unsupported DHCP Operation: %s", dhcpLayer.Operation.String())
+			continue
+		}
+	}
+}
diff --git a/internal/bbsim/responders/eapol/eapol.go b/internal/bbsim/responders/eapol/eapol.go
index d32999a..602a78e 100644
--- a/internal/bbsim/responders/eapol/eapol.go
+++ b/internal/bbsim/responders/eapol/eapol.go
@@ -19,15 +19,14 @@
 import (
 	"crypto/md5"
 	"errors"
-	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	"github.com/google/gopacket"
 	"github.com/google/gopacket/layers"
 	"github.com/looplab/fsm"
+	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	omci "github.com/opencord/omci-sim"
 	"github.com/opencord/voltha-protos/go/openolt"
 	log "github.com/sirupsen/logrus"
 	"net"
-	"sync"
 )
 
 var eapolLogger = log.WithFields(log.Fields{
@@ -36,25 +35,28 @@
 
 var eapolVersion uint8 = 1
 
-func CreateWPASupplicant(onuId uint32, ponPortId uint32, serialNumber *openolt.SerialNumber, onuStateMachine *fsm.FSM, stream openolt.Openolt_EnableIndicationServer, pktOutCh chan *bbsim.ByteMsg) {
+func CreateWPASupplicant(onuId uint32, ponPortId uint32, serialNumber string, onuStateMachine *fsm.FSM, stream openolt.Openolt_EnableIndicationServer, pktOutCh chan *bbsim.ByteMsg) {
 	// NOTE pckOutCh is channel to listen on for packets received by VOLTHA
 	// the OLT device will publish messages on that channel
 
 	eapolLogger.WithFields(log.Fields{
-		"OnuId": onuId,
+		"OnuId":  onuId,
 		"IntfId": ponPortId,
-		"OnuSn": serialNumber,
+		"OnuSn":  serialNumber,
 	}).Infof("EAPOL State Machine starting")
 
-	var wg sync.WaitGroup
-	wg.Add(1)
+	defer eapolLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("EAPOL State machine completed")
 
 	if err := sendEapStart(onuId, ponPortId, serialNumber, stream); err != nil {
 		eapolLogger.WithFields(log.Fields{
-			"OnuId": onuId,
+			"OnuId":  onuId,
 			"IntfId": ponPortId,
-			"OnuSn": serialNumber,
-		}).Errorf("Can't retrieve GemPortId: %s", err)
+			"OnuSn":  serialNumber,
+		}).Errorf("Can't send EapStart Message: %s", err)
 		if err := onuStateMachine.Event("auth_failed"); err != nil {
 			eapolLogger.WithFields(log.Fields{
 				"OnuId":  onuId,
@@ -72,104 +74,92 @@
 		}).Errorf("Error while transitioning ONU State %v", err)
 	}
 
-	// NOTE do we really need a thread here?
-	go func() {
-		eapolLogger.WithFields(log.Fields{
-			"OnuId": onuId,
-			"IntfId": ponPortId,
-			"OnuSn": serialNumber,
-		}).Infof("Listening on eapolPktOutCh")
-		for msg := range pktOutCh {
-			recvpkt := gopacket.NewPacket(msg.Bytes, layers.LayerTypeEthernet, gopacket.Default)
-			eap, err := extractEAP(recvpkt)
-			if err != nil {
-				eapolLogger.Errorf("%s", err)
-			}
+	eapolLogger.WithFields(log.Fields{
+		"OnuId":  onuId,
+		"IntfId": ponPortId,
+		"OnuSn":  serialNumber,
+	}).Infof("Listening on eapolPktOutCh")
 
-			if eap.Code == layers.EAPCodeRequest && eap.Type == layers.EAPTypeIdentity {
-				reseap := createEAPIdentityResponse(eap.Id)
-				pkt := createEAPOLPkt(reseap, onuId, ponPortId)
-
-				msg := bbsim.ByteMsg{
-					IntfId: ponPortId,
-					OnuId: onuId,
-					Bytes:  pkt,
-				}
-
-				sendEapolPktIn(msg, stream)
-				eapolLogger.WithFields(log.Fields{
-					"OnuId": onuId,
-					"IntfId": ponPortId,
-					"OnuSn": serialNumber,
-				}).Infof("Sent EAPIdentityResponse packet")
-				if err := onuStateMachine.Event("eap_resonse_identity_sent"); err != nil {
-					eapolLogger.WithFields(log.Fields{
-						"OnuId":  onuId,
-						"IntfId": ponPortId,
-						"OnuSn":  serialNumber,
-					}).Errorf("Error while transitioning ONU State %v", err)
-				}
-
-			} else if eap.Code == layers.EAPCodeRequest && eap.Type == layers.EAPTypeOTP {
-				senddata := getMD5Data(eap)
-				senddata = append([]byte{0x10}, senddata...)
-				sendeap := createEAPChallengeResponse(eap.Id, senddata)
-				pkt := createEAPOLPkt(sendeap, onuId, ponPortId)
-
-				msg := bbsim.ByteMsg{
-					IntfId: ponPortId,
-					OnuId: onuId,
-					Bytes:  pkt,
-				}
-
-				sendEapolPktIn(msg, stream)
-				eapolLogger.WithFields(log.Fields{
-					"OnuId": onuId,
-					"IntfId": ponPortId,
-					"OnuSn": serialNumber,
-				}).Infof("Sent EAPChallengeResponse packet")
-				if err := onuStateMachine.Event("eap_resonse_challenge_sent"); err != nil {
-					eapolLogger.WithFields(log.Fields{
-						"OnuId":  onuId,
-						"IntfId": ponPortId,
-						"OnuSn":  serialNumber,
-					}).Errorf("Error while transitioning ONU State %v", err)
-				}
-			} else if eap.Code == layers.EAPCodeSuccess && eap.Type == layers.EAPTypeNone {
-				eapolLogger.WithFields(log.Fields{
-					"OnuId": onuId,
-					"IntfId": ponPortId,
-					"OnuSn": serialNumber,
-				}).Infof("Received EAPSuccess packet")
-				if err := onuStateMachine.Event("eap_resonse_success_received"); err != nil {
-					eapolLogger.WithFields(log.Fields{
-						"OnuId":  onuId,
-						"IntfId": ponPortId,
-						"OnuSn":  serialNumber,
-					}).Errorf("Error while transitioning ONU State %v", err)
-				}
-				wg.Done()
-			}
-
+	for msg := range pktOutCh {
+		recvpkt := gopacket.NewPacket(msg.Bytes, layers.LayerTypeEthernet, gopacket.Default)
+		eap, err := extractEAP(recvpkt)
+		if err != nil {
+			eapolLogger.Errorf("%s", err)
 		}
 
+		if eap.Code == layers.EAPCodeRequest && eap.Type == layers.EAPTypeIdentity {
+			reseap := createEAPIdentityResponse(eap.Id)
+			pkt := createEAPOLPkt(reseap, onuId, ponPortId)
 
-	}()
+			msg := bbsim.ByteMsg{
+				IntfId: ponPortId,
+				OnuId:  onuId,
+				Bytes:  pkt,
+			}
 
-	defer eapolLogger.WithFields(log.Fields{
-		"OnuId": onuId,
-		"IntfId": ponPortId,
-		"OnuSn": serialNumber,
-	}).Infof("EAPOL State machine completed")
+			sendEapolPktIn(msg, stream)
+			eapolLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Infof("Sent EAPIdentityResponse packet")
+			if err := onuStateMachine.Event("eap_response_identity_sent"); err != nil {
+				eapolLogger.WithFields(log.Fields{
+					"OnuId":  onuId,
+					"IntfId": ponPortId,
+					"OnuSn":  serialNumber,
+				}).Errorf("Error while transitioning ONU State %v", err)
+			}
 
-	wg.Wait()
+		} else if eap.Code == layers.EAPCodeRequest && eap.Type == layers.EAPTypeOTP {
+			senddata := getMD5Data(eap)
+			senddata = append([]byte{0x10}, senddata...)
+			sendeap := createEAPChallengeResponse(eap.Id, senddata)
+			pkt := createEAPOLPkt(sendeap, onuId, ponPortId)
+
+			msg := bbsim.ByteMsg{
+				IntfId: ponPortId,
+				OnuId:  onuId,
+				Bytes:  pkt,
+			}
+
+			sendEapolPktIn(msg, stream)
+			eapolLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Infof("Sent EAPChallengeResponse packet")
+			if err := onuStateMachine.Event("eap_response_challenge_sent"); err != nil {
+				eapolLogger.WithFields(log.Fields{
+					"OnuId":  onuId,
+					"IntfId": ponPortId,
+					"OnuSn":  serialNumber,
+				}).Errorf("Error while transitioning ONU State %v", err)
+			}
+		} else if eap.Code == layers.EAPCodeSuccess && eap.Type == layers.EAPTypeNone {
+			eapolLogger.WithFields(log.Fields{
+				"OnuId":  onuId,
+				"IntfId": ponPortId,
+				"OnuSn":  serialNumber,
+			}).Infof("Received EAPSuccess packet")
+			if err := onuStateMachine.Event("eap_response_success_received"); err != nil {
+				eapolLogger.WithFields(log.Fields{
+					"OnuId":  onuId,
+					"IntfId": ponPortId,
+					"OnuSn":  serialNumber,
+				}).Errorf("Error while transitioning ONU State %v", err)
+			}
+			return
+		}
+	}
 }
 
 func sendEapolPktIn(msg bbsim.ByteMsg, stream openolt.Openolt_EnableIndicationServer) {
+	// FIXME unify sendDHCPPktIn and sendEapolPktIn methods
 	gemid, err := omci.GetGemPortId(msg.IntfId, msg.OnuId)
 	if err != nil {
 		eapolLogger.WithFields(log.Fields{
-			"OnuId": msg.OnuId,
+			"OnuId":  msg.OnuId,
 			"IntfId": msg.IntfId,
 		}).Errorf("Can't retrieve GemPortId: %s", err)
 		return
@@ -198,9 +188,9 @@
 
 func createEAPChallengeResponse(eapId uint8, payload []byte) *layers.EAP {
 	eap := layers.EAP{
-		Code: layers.EAPCodeResponse,
-		Id: eapId,
-		Length: 22,
+		Code:     layers.EAPCodeResponse,
+		Id:       eapId,
+		Length:   22,
 		Type:     layers.EAPTypeOTP,
 		TypeData: payload,
 	}
@@ -226,7 +216,6 @@
 		EthernetType: layers.EthernetTypeEAPOL,
 	}
 
-
 	gopacket.SerializeLayers(buffer, options,
 		ethernetLayer,
 		&layers.EAPOL{Version: eapolVersion, Type: 0, Length: eap.Length},
@@ -246,7 +235,7 @@
 	return eap, nil
 }
 
-var sendEapStart = func(onuId uint32, ponPortId uint32, serialNumber *openolt.SerialNumber, stream openolt.Openolt_EnableIndicationServer) error  {
+var sendEapStart = func(onuId uint32, ponPortId uint32, serialNumber string, stream openolt.Openolt_EnableIndicationServer) error {
 
 	// send the packet (hacked together)
 	gemid, err := omci.GetGemPortId(ponPortId, onuId)
@@ -254,6 +243,7 @@
 		return err
 	}
 
+	// TODO use createEAPOLPkt
 	buffer := gopacket.NewSerializeBuffer()
 	options := gopacket.SerializeOptions{}
 
@@ -269,13 +259,14 @@
 	)
 
 	msg := buffer.Bytes()
+	// TODO end createEAPOLPkt
 
 	data := &openolt.Indication_PktInd{
 		PktInd: &openolt.PacketIndication{
-			IntfType: "pon",
-			IntfId: ponPortId,
+			IntfType:  "pon",
+			IntfId:    ponPortId,
 			GemportId: uint32(gemid),
-			Pkt: msg,
+			Pkt:       msg,
 		},
 	}
 	// end of hacked (move in an EAPOL state machine)
@@ -284,4 +275,4 @@
 		return err
 	}
 	return nil
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/responders/eapol/eapol_test.go b/internal/bbsim/responders/eapol/eapol_test.go
index 2d8a06c..9e37dae 100644
--- a/internal/bbsim/responders/eapol/eapol_test.go
+++ b/internal/bbsim/responders/eapol/eapol_test.go
@@ -17,8 +17,8 @@
 package eapol
 
 import (
-	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	"github.com/looplab/fsm"
+	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	"github.com/opencord/voltha-protos/go/openolt"
 	"google.golang.org/grpc"
 	"gotest.tools/assert"
@@ -29,7 +29,7 @@
 )
 
 var (
-	originalSendEapStart func(onuId uint32, ponPortId uint32, serialNumber *openolt.SerialNumber, stream openolt.Openolt_EnableIndicationServer) error
+	originalSendEapStart func(onuId uint32, ponPortId uint32, serialNumber string, stream openolt.Openolt_EnableIndicationServer) error
 )
 
 type fakeStream struct {
@@ -42,12 +42,11 @@
 	return nil
 }
 
-func setUp()  {
+func setUp() {
 	originalSendEapStart = sendEapStart
 }
 
-
-func tearDown()  {
+func tearDown() {
 	sendEapStart = originalSendEapStart
 }
 
@@ -63,12 +62,12 @@
 	// mocks
 	mockSendEapStartCalled := 0
 	mockSendEapStartArgs := struct {
-		onuId uint32
-		ponPortId uint32
+		onuId        uint32
+		ponPortId    uint32
 		serialNumber *openolt.SerialNumber
-		stream openolt.Openolt_EnableIndicationServer
+		stream       openolt.Openolt_EnableIndicationServer
 	}{}
-	mockSendEapStart := func(onuId uint32, ponPortId uint32, serialNumber *openolt.SerialNumber, stream openolt.Openolt_EnableIndicationServer) error {
+	mockSendEapStart := func(onuId uint32, ponPortId uint32, serialNumber string, stream openolt.Openolt_EnableIndicationServer) error {
 		mockSendEapStartCalled++
 		mockSendEapStartArgs.onuId = onuId
 		mockSendEapStartArgs.ponPortId = ponPortId
@@ -79,20 +78,17 @@
 	// params for the function under test
 	var onuId uint32 = 1
 	var ponPortId uint32 = 0
-	var serialNumber = new(openolt.SerialNumber)
-
-	serialNumber.VendorId = []byte("BBSM")
-	serialNumber.VendorSpecific = []byte{0, byte(0 % 256), byte(ponPortId), byte(onuId)}
+	var serialNumber string = "BBSM00000001"
 
 	eapolStateMachine := fsm.NewFSM(
-	"auth_started",
-	fsm.Events{
-		{Name: "eap_start_sent", Src: []string{"auth_started"}, Dst: "eap_start_sent"},
-		{Name: "eap_resonse_identity_sent", Src: []string{"eap_start_sent"}, Dst: "eap_resonse_identity_sent"},
-		{Name: "eap_resonse_challenge_sent", Src: []string{"eap_resonse_identity_sent"}, Dst: "eap_resonse_challenge_sent"},
-		{Name: "eap_resonse_success_received", Src: []string{"eap_resonse_challenge_sent"}, Dst: "eap_resonse_success_received"},
-	},
-	fsm.Callbacks{},
+		"auth_started",
+		fsm.Events{
+			{Name: "eap_start_sent", Src: []string{"auth_started"}, Dst: "eap_start_sent"},
+			{Name: "eap_response_identity_sent", Src: []string{"eap_start_sent"}, Dst: "eap_response_identity_sent"},
+			{Name: "eap_response_challenge_sent", Src: []string{"eap_response_identity_sent"}, Dst: "eap_response_challenge_sent"},
+			{Name: "eap_response_success_received", Src: []string{"eap_response_challenge_sent"}, Dst: "eap_response_success_received"},
+		},
+		fsm.Callbacks{},
 	)
 
 	pktOutCh := make(chan *bbsim.ByteMsg, 1024)
@@ -103,7 +99,7 @@
 	wg.Add(1)
 
 	go CreateWPASupplicant(onuId, ponPortId, serialNumber, eapolStateMachine, stream, pktOutCh)
-	go func(){
+	go func() {
 		time.Sleep(1 * time.Second)
 		close(pktOutCh)
 		wg.Done()
@@ -114,4 +110,4 @@
 	assert.Equal(t, mockSendEapStartCalled, 1)
 	assert.Equal(t, mockSendEapStartArgs.onuId, onuId)
 	assert.Equal(t, mockSendEapStartArgs.ponPortId, ponPortId)
-}
\ No newline at end of file
+}
diff --git a/internal/bbsim/types.go b/internal/bbsim/types.go
index 0da944a..76c23cd 100644
--- a/internal/bbsim/types.go
+++ b/internal/bbsim/types.go
@@ -19,10 +19,11 @@
 // General
 
 type CliOptions struct {
-	OltID 	 	 	int
-	NumNniPerOlt 	int
-	NumPonPerOlt 	int
-	NumOnuPerPon 	int
-	profileCpu		*string
+	OltID        int
+	NumNniPerOlt int
+	NumPonPerOlt int
+	NumOnuPerPon int
+	STag         int
+	CTagInit     int
+	profileCpu   *string
 }
-
diff --git a/internal/bbsim/types/types.go b/internal/bbsim/types/types.go
index 1a1788c..731ca58 100644
--- a/internal/bbsim/types/types.go
+++ b/internal/bbsim/types/types.go
@@ -16,8 +16,14 @@
 
 package types
 
+import "github.com/google/gopacket"
+
 type ByteMsg struct {
 	IntfId uint32
 	OnuId  uint32
-	Bytes   []byte
-}
\ No newline at end of file
+	Bytes  []byte
+}
+
+type PacketMsg struct {
+	Pkt gopacket.Packet
+}
diff --git a/internal/bbsimctl/commands/onu.go b/internal/bbsimctl/commands/onu.go
index 7d6da8e..6422f0a 100644
--- a/internal/bbsimctl/commands/onu.go
+++ b/internal/bbsimctl/commands/onu.go
@@ -29,7 +29,7 @@
 )
 
 const (
-	DEFAULT_ONU_DEVICE_HEADER_FORMAT = "table{{ .PonPortID }}\t{{ .ID }}\t{{ .SerialNumber }}\t{{ .OperState }}\t{{ .InternalState }}"
+	DEFAULT_ONU_DEVICE_HEADER_FORMAT = "table{{ .PonPortID }}\t{{ .ID }}\t{{ .SerialNumber }}\t{{ .STag }}\t{{ .CTag }}\t{{ .OperState }}\t{{ .InternalState }}"
 )
 
 type ONUOptions struct{}
