diff --git a/src/python/oftest/controller/controller.py b/src/python/oftest/controller/controller.py
new file mode 100644
index 0000000..1526cee
--- /dev/null
+++ b/src/python/oftest/controller/controller.py
@@ -0,0 +1,113 @@
+"""
+OpenFlow Test Framework
+
+Controller class
+
+Provide the interface to the control channel to the switch under test.  
+
+Class inherits from thread so as to run in background allowing
+asynchronous callbacks (if needed, not required).  Also supports
+polling.
+
+The controller thread maintains a queue.  Incoming messages that
+are not handled by a callback function are placed in this queue for 
+poll calls.  
+
+Callbacks and polling support specifying the message type
+
+@todo Support transaction semantics via xid
+"""
+
+import sys
+sys.path.append("../ofmsg")
+import os
+import socket
+import time
+import promisc
+from threading import Thread
+from threading import Lock
+from message import *
+
+class Controller(Thread):
+    """
+    Class abstracting the control interface to the switch.  
+
+    For receiving messages, two mechanism will be implemented.  First,
+    query the interface with poll.  Second, register to have a
+    function called by message type.  The callback is passed the
+    message type as well as the raw packet (or message object)
+
+    One of the main purposes of this object is to translate between network 
+    and host byte order.  'Above' this object, things should be in host
+    byte order.
+    """
+
+    def __init__(port=6633, passive=1):
+        if (passive):
+            # FIXME: add error handling
+            self.sock = open_ctrlsocket()
+            self.clientsock, self.clientaddr = self.sock.accept()
+        else:
+            print "Error in controller init: Active cxn not supported"
+
+    def register(self, msg_type, handler):
+        """
+        Register a callback to receive a specific message type.
+
+        Only one handler may be registered for a given message type.
+        @param msg_type The type of message to receive.  May be DEFAULT 
+        for all non-handled packets.  
+        @param handler The function to call when a message of the given 
+        type is received.
+        """
+        print "Controller message handler registration not supported"
+
+    def poll(self, exp_msg=None, timeout=None):
+        """
+        Wait for the next OF message received from the switch.
+
+        @param exp_msg If set, return only when this type of message 
+        is received.
+
+        @param timeout If set, return E_TIMEOUT if mesage is not
+        received in this time.  If set to 0, will not block.
+
+        @retval A triple (msg_type, msg, data) where msg_type is the OpenFlow 
+        message type value OFPT_xxx, msg is a message object (from a 
+        SWIG generated class) appropriate to the message type and data is
+        a string of any additional information following the 
+        normal message.  Note that
+        many messages do not have classes so ofp_hello is returned which 
+        simply has the header.
+        The data members in the message are in host endian order.
+        If a timeout (or other error) occurs, None is returned
+        """
+        while 1:
+            okay, pkt = rcv_data_from_socket(self.clientsoc, timeout)
+            if not okay or not pkt:
+                # FIXME: Check for error
+                return None, None
+            # Convert msg to the proper OpenFlow message object
+            msg_type, msg = ofpkt.pkt_to_msg(pkt)
+            print "DEBUG: Got msg type %d of len %d" % (msg_type, len(msg))
+
+            if not exp_msg or (exp_msg and (hdr.type == exp_msg)):
+                return msg_type, msg
+
+    def flow_install(self, flow):
+        """
+        Install the flow indicated through the control interface
+        TBD:  We may just use message_send below with ofp_flow_mod objects
+        @param flow The ofp_flow_mod object to install
+        """
+
+    def message_send(self, msg):
+        """
+        Send the message to the switch
+        @param msg An OpenFlow message object (from a SWIG generated
+        class) to be forwarded to the switch.  The data members of the
+        object must be in host endian order when pased to message_send.
+        """
+
+    def kill(self):
+        self.clientsock.close()
diff --git a/src/python/oftest/dataplane/dataplane.py b/src/python/oftest/dataplane/dataplane.py
new file mode 100644
index 0000000..7a2e8cd
--- /dev/null
+++ b/src/python/oftest/dataplane/dataplane.py
@@ -0,0 +1,98 @@
+"""
+OpenFlow Test Framework
+
+Dataplane class
+
+Provide the interface to the control the set of ports being used
+to stimulate the switch under test.
+
+See the class dataplaneport for more details.  This class wraps
+a set of those objects allowing general calls and parsing 
+configuration.
+
+"""
+
+from dataplaneport import *
+
+class DataPlane:
+    """
+    Class defining access primitives to the data plane
+    Controls a list of DataPlanePort objects
+    """
+    def __init__(self):
+        self.port_list = {}
+
+    def port_add(self, interface_name, port_number):
+        """
+        Add a port to the dataplane
+        TBD:  Max packets for queue?
+        @param interface_name The name of the physical interface like eth1
+        @param port_number The port number used to refer to the port
+        """
+        
+        self.port_list[port_number] = DataPlanePort(interface_name)
+        self.port_list[port_number].start()
+
+    def send(self, port_number, packet):
+        """
+        Send a packet to the given port
+        @param port_number The port to send the data to
+        @param packet Raw packet data to send to port
+        """
+        bytes = self.port_list[port_number].send(packet)
+        if bytes != len(packet):
+            print "Unhandled send error, length mismatch %d != %d" % \
+                (bytes, len(packet))
+        return bytes
+
+    def flood(self, packet):
+        """
+        Send a packet to all ports
+        @param packet Raw packet data to send to port
+        """
+        for port_number in self.port_list.keys():
+            bytes = self.port_list[port_number].send(packet)
+            if bytes != len(packet):
+                print "Unhandled send error" + \
+                    ", port %d, length mismatch %d != %d" % \
+                    (port_number, bytes, len(packet))
+
+    def packet_get(self, port_number=None):
+        """
+        Get a packet from the data plane
+        If port_number is given, get the packet from that port.
+        Otherwise, find the port with the oldest packet and return
+        that packet.
+        @param port_number If set, get packet from this port
+        @retval The triple port_number, packet, pkt_time where packet 
+        is received from port_number at time pkt_time.  
+        """
+
+        if port_number:
+            if self.port_list[port_number].packets_pending != 0:
+                pkt, time = self.port_list[port_number].dequeue()
+                return port_number, pkt, time
+            else:
+                return None, None, None
+
+        # Find port with oldest packet
+        min_time = 0
+        min_port = -1
+        for port_number in self.port_list.keys():
+            ptime = self.port_list[port_number].timestamp_head()
+            if ptime:
+                if (min_port == -1) or (ptime < min_time):
+                    min_time = ptime 
+                    min_port = port_number
+
+        if min_port == -1:
+            return None, None, None
+
+        pkt, time = self.port_list[min_port].dequeue()
+        return min_port, pkt, time
+
+    def kill(self):
+        for port_number in self.port_list.keys():
+            self.port_list[port_number].kill()
+
+        print "DataPlane shutdown"
diff --git a/src/python/oftest/dataplane/dataplaneport.py b/src/python/oftest/dataplane/dataplaneport.py
new file mode 100644
index 0000000..f461dfa
--- /dev/null
+++ b/src/python/oftest/dataplane/dataplaneport.py
@@ -0,0 +1,152 @@
+"""
+OpenFlow Test Framework
+
+Dataplane Port class
+
+Control a dataplane port connected to the switch under test.
+
+Class inherits from thread so as to run in background allowing
+asynchronous callbacks (if needed, not required).  Also supports
+polling.
+
+The port object thread maintains a queue.  Incoming packets that
+are not handled by a callback function are placed in this queue for 
+poll calls.  
+
+"""
+
+import sys
+sys.path.append("../packet")  # Needed?
+import os
+import socket
+import time
+import promisc
+from threading import Thread
+from threading import Lock
+
+ETH_P_ALL = 0x03
+RCV_TIMEOUT = 10000
+RCV_SIZE = 4096
+
+class DataPlanePort(Thread):
+    """
+    Class defining a port monitoring object.
+    Creates a promiscuous socket on a physical interface
+    Queues the packets received on that interface with time stamps
+    Inherits from Thread class as meant to run in background
+    Use accessors to dequeue packets for proper synchronization
+    """
+
+    def __init__(self, interface_name, max_pkts=1024):
+        """
+        Set up a port monitor object
+        @param interface_name The name of the physical interface like eth1
+        @param max_pkts Maximum number of pkts to keep in queue
+        """
+        Thread.__init__(self)
+        self.interface_name = interface_name
+        self.max_pkts = max_pkts
+        self.packets_pending = 0
+        self.packets_total = 0
+        self.packets = []
+        self.packet_times = []
+        self.sync = Lock()
+        self.socket = self.interface_open(interface_name)
+        print "Openned port monitor socket " + interface_name
+
+    def interface_open(self, interface_name):
+        """
+        Open a socket in a promiscuous mode for a data connection.
+        @param interface_name port name as a string such as 'eth1'
+        @retval s socket
+        """
+        s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 
+                          socket.htons(ETH_P_ALL))
+        s.bind((interface_name, 0))
+        promisc.set_promisc(s, interface_name)
+        s.settimeout(RCV_TIMEOUT)
+        return s
+
+    def kill(self):
+        """
+        Terminate the running thread
+        """
+        self.running = False
+        self.socket.close()
+        print "Port monitor for " + self.interface_name + " exiting"
+
+    def run(self):
+        """
+        Activity function for class
+        """
+        self.running = True
+        while self.running:
+            try:
+                rcvmsg = self.socket.recv(RCV_SIZE)
+                rcvtime = time.clock()
+
+                self.sync.acquire()
+                self.packets.append(rcvmsg)
+                self.packet_times.append(rcvtime)
+                self.packets_pending += 1
+                self.packets_total += 1
+                self.sync.release()
+
+            except socket.timeout:
+                print "Socket timeout for " + self.interface_name
+            except socket.error:
+                print "Socket closed for " + self.interface_name
+                if self.running:
+                    self.kill()
+                break
+
+    def dequeue(self):
+        """
+        Get the oldest packet in the queue
+        """
+        self.sync.acquire()
+        pkt = self.packets.pop(0)
+        pkt_time = self.packet_times.pop(0)
+        self.packets_pending -= 1
+        self.sync.release()
+        return pkt, pkt_time
+
+    def timestamp_head(self):
+        """
+        Return the timestamp of the head of queue or None if empty
+        """
+        if self.packets_pending:
+            return self.packet_times[0]
+        return None
+
+    def flush(self):
+        """
+        Clear the packet queue
+        """
+        self.sync.acquire()
+        self.packets = []
+        self.packet_times = []
+        self.packets_pending = 0
+        self.sync.release()
+
+
+    def send(self, packet):
+        """
+        Send a packet to the dataplane port
+        @param packet The packet data to send to the port
+        @retval The number of bytes sent
+        """
+        return self.socket.send(packet)
+
+
+    def register(self, handler):
+        """
+        Register a callback function to receive packets from this
+        port.  The callback will be passed the packet, the 
+        interface name and the port number (if set) on which the 
+        packet was received.
+
+        To be implemented
+        """
+        pass
+
diff --git a/src/python/oftest/oft_config.py b/src/python/oftest/oft_config.py
new file mode 100644
index 0000000..643c63a
--- /dev/null
+++ b/src/python/oftest/oft_config.py
@@ -0,0 +1,97 @@
+"""
+OpenFlow Test Framework
+
+Configuration fragment
+
+This file contains Python code to specify the configuration
+of the system under test.
+
+This is a work in progress.  The code below is for illustration only.
+
+The configuration information is extensible in that any 
+Python code may be added to this file (or its imports) and will 
+be available to test cases.  
+
+A platform identifier is given at the top of the file and most
+other information is determined by testing this value.  Additional
+files may also be imported based on the platform.
+
+The configuration must specify a mapping from system interfaces
+available to the test framework to OpenFlow port numbers on the
+switch under test.  This is done in the interface_ofport_map
+dictionary.  Future extensions may include specifying a driver
+for the port (so as to allow remote packet generation) and to
+specify a switch instance (to allow multiple switches to be
+tested together).
+
+Currently, the assumption is that ports are bidirectional, so
+specifying "OF port 1 is connnected to eth2" implies this is so
+for both TX and RX.
+
+"""
+
+##@var platform
+# A string representing the platform under test.  Tested below
+# for determining other variables.
+
+##@var switch_cxn_type
+# How does the test framework communicate to the switch?
+#
+# Options include:
+# @arg localhost:   Switch is running on same host as tests
+# @arg ssh:         Use paramiko to control ssh connection. Needs switch
+# IP and other params
+#
+# For ssh, additional variables include
+# @arg switch_ip = "192.168.2.21"
+# @arg switch_username = "root"
+# @arg switch_password
+
+##@var switch_init
+# A function to be called to initialize the switch.  May be None
+# to indicate no such function needs to be called.
+
+##@var switch_connect
+# Function to be called to prompt the switch to connect to the
+# controller.  The function may need to maintain connection state 
+# as it could be called multiple times between disconnects.
+
+##@var switch_disconnect
+# Function to be called to force the switch to disconnect from the
+# controller. 
+
+##@var controller_ip
+# Gives the controller IP address to use
+
+##@var controller_port
+# Gives the controller port to use
+
+platform = "sw_userspace"
+# platform = "sw_kernelspace"
+# platform = "bcm_indigo"
+# platform = "stanford_lb4g"
+
+if platform == "sw_userspace":
+    interface_ofport_map = {
+        1 : "eth2",
+        2 : "eth3",
+        3 : "eth4",
+        4 : "eth5"
+        }
+    switch_cxn_type = "localhost"
+    switch_init = None  # TBD
+    switch_connect = None  # TBD
+    switch_disconnect = None  # TBD
+    controller_ip = "172.27.74.158"
+    controller_port = 7000
+
+elif platform == "bcm_indigo":
+    switch_cxn_type = "ssh"
+    switch_ip = "192.168.2.21"
+    switch_username = "root"
+    switch_password = "OpenFlow"
+    switch_init = None  # TBD
+    switch_connect = None  # TBD
+    switch_disconnect = None  # TBD
+    controller_ip = "172.27.74.158"
+    controller_port = 7000
