Index: fedd/federation/experiment_control.py
===================================================================
--- fedd/federation/experiment_control.py	(revision 3132419f8fa708f9ae8528f77ace7a936c2989eb)
+++ fedd/federation/experiment_control.py	(revision 5b74b6303e37a36fa075228a647fcae696e3cbf6)
@@ -923,4 +923,5 @@
 	    try:
 		self.log.debug("Calling StartSegment at %s " % uri)
+		print req
 		r = self.caller(uri, req, self.cert_file, self.cert_pwd,
 			self.trusted_certs)
@@ -1324,5 +1325,5 @@
 
     def new_portal_node(self, st, dt, tbparams, master, eid, myname, desthost,
-	    portal_type, iface_desc=()):
+	    portal_type, iface_desc=(), conn_type="ssh", conn_attrs=[]):
 	"""
 	Return a new internet portal node and a dict with the connectionInfo to
@@ -1344,4 +1345,5 @@
 	for sub, attrs in iface_desc:
 	    inf = topdl.Interface(
+		    name="inf%03d" % len(ifaces),
 		    substrate=sub,
 		    attribute=[
@@ -1354,8 +1356,7 @@
 	    ifaces.append(inf)
 	info = {
-		"type" : "ssh", 
+		"type" : conn_type, 
 		"portal": myname,
-		'peer': "%s.%s.%s%s" %  (desthost.lower(), eid.lower(),
-			    dproject.lower(), ddomain.lower()),
+		'peer': desthost,
 		'fedAttr': [ 
 			{ 'attribute': 'masterdomain', 'value': mdomain},
@@ -1368,4 +1369,10 @@
 		    ],
 		}
+
+	if conn_type == 'transit':
+	    info['member'] = [ { 'element': myname, 'interface': 'inf000'} ]
+	if conn_attrs:
+	    info['fedAttr'].extend(con_attrs)
+
 	return (topdl.Computer(
 		name=myname,
@@ -1447,8 +1454,9 @@
 			)
 
-    def create_dragon_substrate(self, sub, topo, tbs, tbparams, master, eid):
+    def create_dragon_substrate(self, sub, topo, tbs, tbparams, master, eid,
+	    connInfo):
 	"""
 	Add attribiutes to the various elements indicating that they are to be
-	dragon connected and create a dragon segment in tops to be
+	dragon connected and create a dragon segment in topo to be
 	instantiated.
 	"""
@@ -1459,18 +1467,33 @@
 	    else: return None
 
+	# dn is the number of previously created dragon nets.  This routine
+	# creates a net numbered by dn
 	dn = len([x for x in topo.keys() if x.startswith('dragon')])
-	elements = [ i.element for i in sub.interfaces ]
+	# Count the number of interfaces on this substrate in each testbed from
+	# the global topology
 	count = { }
-	for e in elements:
+	for e in [ i.element for i in sub.interfaces ]:
 	    tb = e.get_attribute('testbed')
 	    count[tb] = count.get(tb, 0) + 1
 
+	# Set the attributes in the copies that will allow setup of dragon
+	# connections.
 	for tb in tbs.keys():
 	    s = get_substrate_from_topo(sub.name, topo[tb])
 	    if s:
-		for i in s.interfaces:
-		    i.set_attribute('dragon_vlan', 'unassigned%d' % dn)
-		    if count[tb] > 1: i.set_attribute('dragon_type', 'lan')
-		    else: i.set_attribute('dragon_type', 'link')
+		if not connInfo.has_key(tb):
+		    connInfo[tb] = [ ]
+		info = {
+			'type': 'transit',
+			'member': [ {
+			    'element': i.element.name[0], 
+			    'interface': i.name 
+			    } for i in s.interfaces ],
+			'fedAttr': [ { 
+			    'attribute': 'vlan_id',
+			    'value': 'unassigned%d' % dn
+			    } ]
+			}
+		connInfo[tb].append(info)
 	    else:
 		raise service_error(service_error.internal,
@@ -1530,5 +1553,7 @@
 			portal_type = "experiment"
 			myname = "%stunnel%d" % (dt, len(portals[st][dt]))
-			desthost = "%stunnel%d" % (st, len(portals[st][dt]))
+			desthost = "%stunnel%d.%s.%s%s" % (st, 
+				len(portals[st][dt]), eid.lower(),
+				dproject.lower(), ddomain.lower())
 		    else:
 			new_i = topdl.Interface(
@@ -1547,5 +1572,7 @@
 		    portals[st][dt] = [ ]
 		    myname = "%stunnel%d" % (dt, len(portals[st][dt]))
-		    desthost = "%stunnel%d" % (st, len(portals[st][dt]))
+		    desthost = "%stunnel%d.%s.%s%s" % (st.lower(), 
+			    len(portals[st][dt]), eid.lower(), 
+			    dproject.lower(), ddomain.lower())
 
 		    if dt == master or st == master: portal_type = "both"
@@ -1599,11 +1626,13 @@
 	desthost = "%s" % ip_addr(dip)
 
-	portal = self.new_portal_node(st, dt, tbparams, master,
+	portal, info = self.new_portal_node(st, dt, tbparams, master,
 		eid, myname, desthost, "control", 
 		((substrate.name,(
 		    ('portal','true'),
-		    ('ip4_address', "%s" % ip_addr(myip)),
-		    ('dragon_vlan', 'unassigned%d' % idx),
-		    ('dragon_type', 'link'),)),))
+		    ('ip4_address', "%s" % ip_addr(myip)),)),),
+		conn_type="transit",
+		conn_attrs = [ {
+		    'attribute': 'vlan_id', 'value': 'unassigned%d' % idx
+		    }])
 	if self.fedkit:
 	    self.add_kit(portal, self.fedkit)
@@ -1611,5 +1640,5 @@
 	    self.add_kit(portal, self.gatewaykit)
 
-	return portal
+	return portal, info
 
     def add_portals(self, top, topo, eid, master, tbparams, ip_allocator, 
@@ -1640,5 +1669,5 @@
 		    all([tbparams[x].has_key('dragon') for x in tbs]):
 		self.create_dragon_substrate(s, topo, tbs, tbparams, 
-			master, eid)
+			master, eid, connInfo)
 	    else:
 		self.insert_internet_portals(s, topo, tbs, tbparams, master,
@@ -1692,9 +1721,13 @@
 				],
 			    )
+		    portal, info = self.new_dragon_portal(tb, master,
+			    master, eid, dip, mip, idx, csub, tbparams)
 		    topo[tb].substrates.append(csub)
-		    topo[tb].elements.append(
-			    self.new_dragon_portal(tb, master, master, eid, 
-				dip, mip, idx, csub, tbparams))
+		    topo[tb].elements.append(portal)
 		    topo[tb].elements.append(seg)
+		    if not connInfo.has_key(tb):
+			connInfo[tb] = [info]
+		    else:
+			connInfo[tb].append(info)
 
 		    mcsub = csub.clone()
@@ -1719,9 +1752,13 @@
 				],
 			    )
+		    portal, info = self.new_dragon_portal(master, tb, master,
+			    eid, mip, dip, idx, mcsub, tbparams)
 		    topo[master].substrates.append(mcsub)
-		    topo[master].elements.append(
-			    self.new_dragon_portal(master, tb, master, eid, 
-				mip, dip, idx, mcsub, tbparams))
+		    topo[master].elements.append(portal)
 		    topo[master].elements.append(seg)
+		    if not connInfo.has_key(master):
+			connInfo[master] = [info]
+		    else:
+			connInfo[master].append(info)
 
 		    self.create_dragon_substrate(csub, topo, 
