Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'insert': 0.05; 'that?': 0.05; 'url:bitbucket': 0.05; 'debug': 0.07; 'debugging': 0.07; 'method.': 0.07; 'none,': 0.07; 'none:': 0.07; 'paths': 0.07; 'tests.': 0.07; 'advance': 0.07; '#print': 0.09; '[0]': 0.09; 'dst': 0.09; 'function,': 0.09; 'guys.': 0.09; 'lawrence': 0.09; 'method,': 0.09; 'method:': 0.09; 'snippet': 0.09; 'subject:method': 0.09; 'tcp/ip': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'bug': 0.12; 'language.': 0.14; '"""install': 0.16; '"some': 0.16; "'''": 0.16; "','": 0.16; '-1):': 0.16; '-1,': 0.16; 'attaching': 0.16; 'caused.': 0.16; 'dst):': 0.16; 'dst,': 0.16; 'dst:': 0.16; 'elephant': 0.16; 'eliminating': 0.16; 'event):': 0.16; 'fetches': 0.16; 'flow,': 0.16; 'hashed': 0.16; 'instantiated': 0.16; 'lot!': 0.16; 'param': 0.16; 'path.': 0.16; 'paths.': 0.16; 'specific,': 0.16; 'src': 0.16; 'src,': 0.16; 'subject:class': 0.16; 'suggestion.': 0.16; 'switches': 0.16; 'traverse': 0.16; 'true:': 0.16; '\xc2\xa0if': 0.16; 'exception': 0.16; 'sat,': 0.16; 'skip:= 10': 0.16; 'language': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'bit': 0.19; 'trying': 0.19; '<': 0.19; 'everyone,': 0.19; 'pieces': 0.19; 'skip:p 40': 0.19; 'later': 0.20; 'fit': 0.20; 'help.': 0.21; 'seems': 0.21; '8bit%:5': 0.22; '>>>': 0.22; 'example': 0.22; 'import': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'install': 0.23; 'either.': 0.24; 'entries': 0.24; 'specify': 0.24; 'earlier': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'source': 0.25; '>': 0.26; 'logging': 0.26; 'nearly': 0.26; 'post': 0.26; 'defined': 0.27; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'point': 0.28; 'host': 0.29; 'skip:p 30': 0.29; 'am,': 0.29; 'raise': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.31; "skip:' 10": 0.31; '>>>>': 0.31; 'context,': 0.31; 'context.': 0.31; 'description,': 0.31; 'helpful.': 0.31; 'node': 0.31; 'object.': 0.31; 'piece': 0.31; 'skip:= 20': 0.31; 'file': 0.32; 'class': 0.32; 'run': 0.32; '(including': 0.33; 'says': 0.33; 'url:python': 0.33; 'running': 0.33; 'mac': 0.33; 'skip:# 10': 0.33; 'skip:t 40': 0.33; 'comment': 0.34; 'sense': 0.34; 'skip:_ 10': 0.34; 'skip:d 20': 0.34; 'could': 0.34; 'problem': 0.35; 'here': 0.66; 'between': 0.67; 'results': 0.69; 'url:info': 0.73; '2015': 0.84; 'irrelevant': 0.84; 'route': 0.84; 'subject:base': 0.84; 'url:log': 0.84; 'utilized': 0.84; 'angel': 0.91; 'careful': 0.91; 'destination': 0.91; 'resolved.': 0.91; 'subject:results': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=P9CAL8OSaOlNLaHEBSC808HMoObDg1KaSBB9sIpoUUs=; b=pxY4+oHWzUynSn/+OrnsdTnJwsai/Z/3nMZBuQD32m4vwS2BxnskoJ7JaVn4Xlfzxl GCOr9My8zffjNj44rR1ma9ZRF8pfbhftnfNjomMJt/oh9e+PcQY0hWXW6EAr4HeIIijQ SGH5MaENVyL9uXVl9qQnbM2UEPO79DIVc0yBfTxPwjjznbMd+ZRq51/getZ7MYnRFbxf uEFKQaBAYpHxhafjUJ5meYdOwBgC1VYuZKPKeJFiygxVr52kJMTE0EuRroAK92jDKOyF QhY9IPQJlewPtsOTExwWc5abYl0C/Xg7KSxUfzeJNF1Dhw9wi57RR5dMV6RoqK3/4Elo nDxg== MIME-Version: 1.0 X-Received: by 10.107.15.129 with SMTP id 1mr3042769iop.20.1431173285234; Sat, 09 May 2015 05:08:05 -0700 (PDT) In-Reply-To: <554DF14B.6020604@davea.name> References: <554DF14B.6020604@davea.name> Date: Sat, 9 May 2015 17:08:05 +0500 Subject: Re: calling base class method fetches no results From: david jhon To: Dave Angel Cc: python-list@python.org Content-Type: multipart/alternative; boundary=001a113e94b2474db70515a4ff04 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 925 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431173294 news.xs4all.nl 2908 [2001:888:2000:d::a6]:60955 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90272 --001a113e94b2474db70515a4ff04 Content-Type: text/plain; charset=UTF-8 I am really sorry for any inconvenience caused, I was trying to fix this bug from last 2 days so I had to post it here. It now has been resolved. Thanks a lot for your time. I'll be careful again. Have a great weekend! On Sat, May 9, 2015 at 4:36 PM, Dave Angel wrote: > On 05/09/2015 03:59 AM, david jhon wrote: > >> Hi, I am sorry for sending in five attachments, I cloned the code from >> here >> : Let me explain it here: >> >> > Please don't top-post. Your earlier problem description, which I could > make no sense of, is now located after your later "clarification". > > Thanks for eliminating the attachments. Many cannot see them. And for > extracting only part of the code into the message. It's still too much for > me, but others may manage it okay. To me, it seems likely that most of > that code will not have any part in the problem you're describing. And in > some places you have code that's missing its context. > > Now, eliminate the pieces of code that are irrelevant to your question, > and state the problem in terms that make sense. Somebody is instantiating > an object. Exactly which class is being used for that? Somebody else is > calling a particular method (be specific, rather than just saying "some > method"), and it's giving the wrong results. And apparently, those wrong > results depend on which source file something happens in. > > > > Routing Base class defined in DCRouting.py: >> >> import logging >> from copy import copy >> >> class Routing(object): >> '''Base class for data center network routing. >> >> Routing engines must implement the get_route() method. >> ''' >> >> def __init__(self, topo): >> '''Create Routing object. >> >> @param topo Topo object from Net parent >> ''' >> self.topo = topo >> >> def get_route(self, src, dst, hash_): >> '''Return flow path. >> >> @param src source host >> @param dst destination host >> @param hash_ hash value >> >> @return flow_path list of DPIDs to traverse (including hosts) >> ''' >> raise NotImplementedError >> >> def routes(self, src, dst): >> ''' Return list of paths >> >> Only works for Fat-Tree topology >> >> @ param src source host >> @ param dst destination host >> >> @ return list of DPIDs (including inputs) >> ''' >> >> complete_paths = [] # List of complete dpid routes >> >> src_paths = { src : [[src]] } >> dst_paths = { dst : [[dst]] } >> >> dst_layer = self.topo.layer(dst) >> src_layer = self.topo.layer(src) >> >> lower_layer = src_layer >> if dst_layer > src_layer: >> lower_layer = dst_layer >> >> >> for front_layer in range(lower_layer-1, -1, -1): >> if src_layer > front_layer: >> # expand src frontier >> new_src_paths = {} >> for node in sorted(src_paths): >> path_list = src_paths[node] >> for path in path_list: >> last_node = path[-1] >> for frontier_node in >> self.topo.upper_nodes(last_node): >> new_src_paths[frontier_node] = [path + >> [frontier_node]] >> >> if frontier_node in dst_paths: >> dst_path_list = dst_paths[frontier_node] >> for dst_path in dst_path_list: >> dst_path_copy = copy ( dst_path ) >> dst_path_copy.reverse() >> complete_paths.append( path + >> dst_path_copy) >> src_paths = new_src_paths >> >> if dst_layer > front_layer: >> # expand dst frontier >> new_dst_paths = {} >> for node in sorted(dst_paths): >> path_list = dst_paths[node] >> for path in path_list: >> last_node = path[-1] >> for frontier_node in >> self.topo.upper_nodes(last_node): >> new_dst_paths[frontier_node] = [ path + >> [frontier_node]] >> >> if frontier_node in src_paths: >> src_path_list = src_paths[frontier_node] >> dst_path_copy = copy( path ) >> dst_path_copy.reverse() >> for src_path in src_path_list: >> complete_paths.append( src_path + >> dst_path_copy) >> >> dst_paths = new_dst_paths >> >> if complete_paths: >> return complete_paths >> class HashedRouting(Routing): >> ''' Hashed routing ''' >> >> def __init__(self, topo): >> self.topo = topo >> >> def get_route(self, src, dst, hash_): >> ''' Return flow path. ''' >> >> if src == dst: >> return [src] >> >> paths = self.routes(src,dst) >> if paths: >> #print 'hash_:', hash_ >> choice = hash_ % len(paths) >> #print 'choice:', choice >> path = sorted(paths)[choice] >> #print 'path:', path >> return path >> >> ============> >> Instantiated in util.py: >> >> from DCTopo import FatTreeTopo >> from mininet.util import makeNumeric >> from DCRouting import HashedRouting, Routing >> >> TOPOS = {'ft': FatTreeTopo} >> ROUTING = {'ECMP' : HashedRouting} >> >> >> def buildTopo(topo): >> topo_name, topo_param = topo.split( ',' ) >> return TOPOS[topo_name](makeNumeric(topo_param)) >> >> >> def getRouting(routing, topo): >> return ROUTING[routing](topo) >> > > A comment on that last line that says it instantiates the child class > would have been very helpful. > > But even though I can now search for calls to that function, I still > cannot make sense out of that context, either. > > > >> ============================> utilized in HController. py: >> A Piece of code which works with self.r.routes() method: >> Following list of methods are defined in HController.py >> >> def _ecmp_hash(self, packet): >> ''' Return an ECMP-style 5-tuple hash for TCP/IP packets, >> otherwise >> 0. >> RFC2992 ''' >> hash_input = [0] * 5 >> if isinstance(packet.next, ipv4): >> ip = packet.next >> hash_input[0] = ip.srcip.toUnsigned() >> hash_input[1] = ip.dstip.toUnsigned() >> hash_input[2] = ip.protocol >> if isinstance(ip.next, tcp) or isinstance(ip.next, udp): >> l4 = ip.next >> hash_input[3] = l4.srcport >> hash_input[4] = l4.dstport >> return crc32(pack('LLHHH', *hash_input)) >> return 0 >> >> def _install_reactive_path(self, event, out_dpid, final_out_port, >> packet): >> ''' Install entries on route between two switches. ''' >> in_name = self.t.node_gen(dpid = event.dpid).name_str() >> out_name = self.t.node_gen(dpid = out_dpid).name_str() >> hash_ = self._ecmp_hash(packet) >> paths = self.r.routes(src_name, dst_name) >> if paths == None: >> print "PATH is None :(" >> return >> route = self.r.get_route(in_name, out_name, hash_) >> print "Route:",route >> print '-'*80 >> if route == None: >> print None, "route between", in_name, "and", out_name >> return >> >> match = of.ofp_match.from_packet(packet) >> >> for i, node in enumerate(route): >> node_dpid = self.t.node_gen(name = node).dpid >> if i < len(route) - 1: >> next_node = route[i + 1] >> out_port, next_in_port = self.t.port(node, next_node) >> else: >> out_port = final_out_port >> self.switches[node_dpid].install(out_port, match, >> idle_timeout >> = 10) >> >> if isinstance(packet.next, of.ipv4) and >> isinstance(packet.next.next, of.tcp): >> self.matchDict[(packet.next.srcip, packet.next.dstip, >> packet.next.next.srcport, packet.next.next.dstport)] = (route, match) >> >> def _handle_PacketIn(self, event): >> if not self.all_switches_up: >> #log.info("Saw PacketIn before all switches were up - >> ignoring." ) >> return >> >> packet = event.parsed >> dpid = event.dpid >> in_port = event.port >> >> # Learn MAC address of the sender on every packet-in. >> self.macTable[packet.src] = (dpid, in_port) >> sw_name = self.t.node_gen(dpid = dpid).name_str() >> #print "Sw:", sw_name, packet.src, packet.dst,"port", in_port, >> packet.dst.isMulticast(),"macTable", packet.dst in self.macTable >> #print '-'*80 >> >> # Insert flow, deliver packet directly to destination. >> >> if packet.dst in self.macTable: >> out_dpid, out_port = self.macTable[packet.dst] >> self._install_reactive_path(event, out_dpid, out_port, >> packet) >> >> self.switches[out_dpid].send_packet_data(out_port, >> event.data) >> >> else: >> self._flood(event) >> >> ===================> code snippet which returns 'None' number of paths. >> def _GlobalFirstFit(self,flow): >> '''do the Hedera global first fit here''' >> src_name = self.t.node_gen(dpid = flow['src']).name_str() >> dst_name = self.t.node_gen(dpid = flow['dst']).name_str() >> print 'Global Fisrt Fit for the elephant flow from >> ',src_name,'to', >> dst_name >> paths = self.r.routes(src_name,dst_name) >> print 'all routes found for the big flow:\n',paths >> GFF_route = None >> if paths == None: >> return >> else: >> for path in paths: >> fitCheck = True >> >> for i in range(1,len(path)): >> fitCheck = False >> if self.bwReservation.has_key(path[i-1]) and >> self.bwReservation[path[i-1]].has_key(path[i]): >> if >> self.bwReservation[path[i-1]][path[i]]['reserveDemand'] + flow['demand'] > >> 1 : >> break >> else: >> >> #self.bwReservation[path[i-1]][path[i]]['reserveDemand'] += flow['demand'] >> fitCheck = True >> else: >> self.bwReservation[path[i-1]]={} >> >> self.bwReservation[path[i-1]][path[i]]={'reserveDemand':0} >> fitCheck = True >> if fitCheck == True: >> for i in range(1,len(path)): >> >> self.bwReservation[path[i-1]][path[i]]['reserveDemand'] >> += flow['demand'] >> GFF_route = path >> print "GFF route found:", path >> break >> if GFF_route != None: >> """install new GFF_path between source and destintaion""" >> self. _install_GFF_path(GFF_route,flow['match']) >> >> def launch(topo = None, routing = None, bw = None ): >> #print topo >> if not topo: >> raise Exception ("Please specify the topology") >> else: >> t = buildTopo(topo) >> >> r = getRouting(routing, t) >> if bw == None: >> bw = 10.0 #Mb/s >> bw = float(bw/1000) #Gb/s >> else: >> bw = float(bw)/1000 >> core.registerNew(HController, t, r, bw) >> log.info("** HController is running >> >> I am really sorry for any inconvenience caused. I, ve tried to make it a >> bit clear here. I am not even able to debug the code by setting a python >> debugging point pdb. I need help from you guys. Thanks a lot again for >> your >> time and help. >> >> Best Regards, >> David >> >> >> On Sat, May 9, 2015 at 12:07 PM, Mark Lawrence >> wrote: >> >> On 09/05/2015 07:41, david jhon wrote: >>> >>> Hello everyone, >>>> >>>> I am new to python and trying to run an example code from mininet tests. >>>> Basically, I am trying to call a method in Hcontroller.py from base >>>> class >>>> Routing defined in DCRouting.py which runs and fetches all the required >>>> results in install_reactive_path() method, but it returns None when it >>>> is >>>> called from _GlobalFirstFit. I hope someone here could help me fix this >>>> bug.. >>>> >>>> I am attaching all the three files(DCRouting.py, HController.py, >>>> util.py) >>>> to have a look into. Thanks in advance for your time, help or >>>> suggestion. >>>> Thanks a lot! >>>> >>>> kind regards, >>>> David >>>> >>>> >>>> I'm sorry but I'm not wading through nearly 30kb of code in five >>> attachments. Please see http://sscce.org/ for how to put your question >>> so you're more likely to get answers. >>> >>> -- >>> My fellow Pythonistas, ask not what our language can do for you, ask >>> what you can do for our language. >>> >>> Mark Lawrence >>> >>> -- >>> https://mail.python.org/mailman/listinfo/python-list >>> >>> >> >> >> > > -- > DaveA > -- > https://mail.python.org/mailman/listinfo/python-list > --001a113e94b2474db70515a4ff04 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am really sorry for any inconvenience caused, I was tryi= ng to fix this bug from last 2 days so I had to post it here. It now has be= en resolved. Thanks a lot for your time. I'll be careful again. Have a = great weekend!

On Sat, May 9, 2015 at 4:36 PM, Dave Angel <davea@davea.name>= wrote:
On 05/09/= 2015 03:59 AM, david jhon wrote:
Hi, I am sorry for sending in five attachments, I cloned the code from here=
<= https://bitbucket.org/msharif/hedera/src>: Let me explain it here:

Please don't top-post.=C2=A0 Your earlier problem description, which I = could make no sense of, is now located after your later "clarification= ".

Thanks for eliminating the attachments.=C2=A0 Many cannot see them.=C2=A0 A= nd for extracting only part of the code into the message.=C2=A0 It's st= ill too much for me, but others may manage it okay.=C2=A0 To me, it seems l= ikely that most of that code will not have any part in the problem you'= re describing. And in some places you have code that's missing its cont= ext.

Now, eliminate the pieces of code that are irrelevant to your question, and= state the problem in terms that make sense.=C2=A0 Somebody is instantiatin= g an object.=C2=A0 Exactly which class is being used for that? Somebody els= e is calling a particular method (be specific, rather than just saying &quo= t;some method"), and it's giving the wrong results.=C2=A0 And appa= rently, those wrong results depend on which source file something happens i= n.



Routing Base class defined in DCRouting.py:

import logging
from copy import copy

class Routing(object):
=C2=A0 =C2=A0 =C2=A0'''Base class for data center network routi= ng.

=C2=A0 =C2=A0 =C2=A0Routing engines must implement the get_route() method.<= br> =C2=A0 =C2=A0 =C2=A0'''

=C2=A0 =C2=A0 =C2=A0def __init__(self, topo):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''Create Routing object.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@param topo Topo object from Net parent =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.topo =3D topo

=C2=A0 =C2=A0 =C2=A0def get_route(self, src, dst, hash_):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''Return flow path.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@param src source host
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@param dst destination host
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@param hash_ hash value

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@return flow_path list of DPIDs to traver= se (including hosts)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise NotImplementedError

=C2=A0 =C2=A0 =C2=A0def routes(self, src, dst):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0''' Return list of paths

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Only works for Fat-Tree topology

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@ param src source host
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@ param dst destination host

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@ return list of DPIDs (including inputs)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0complete_paths =3D [] # List of complete = dpid routes

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src_paths =3D { src : [[src]] }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_paths =3D { dst : [[dst]] }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_layer =3D self.topo.layer(dst)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src_layer =3D self.topo.layer(src)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lower_layer =3D src_layer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if dst_layer > src_layer:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lower_layer =3D dst_layer

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for front_layer in range(lower_layer-1, -= 1, -1):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if src_layer > front_lay= er:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# expand src frontier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new_src_paths= =3D {}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for node in s= orted(src_paths):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0path_list =3D src_paths[node]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0for path in path_list:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0last_node =3D path[-1]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0for frontier_node in
self.topo.upper_nodes(last_node):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new_src_paths[frontier_node] =3D [path +
[frontier_node]]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if frontier_node in dst_paths:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_path_list =3D dst_paths[fr= ontier_node]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for dst_path in dst_path_list:=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_path_copy = =3D copy ( dst_path )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_path_copy.re= verse()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0complete_paths.a= ppend( path +
dst_path_copy)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src_paths =3D= new_src_paths

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if dst_layer > front_lay= er:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# expand dst frontier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new_dst_paths= =3D {}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for node in s= orted(dst_paths):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0path_list =3D dst_paths[node]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0for path in path_list:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0last_node =3D path[-1]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0for frontier_node in
self.topo.upper_nodes(last_node):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0new_dst_paths[frontier_node] =3D [ path + [frontier_node]]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if frontier_node in src_paths:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src_path_list =3D src_paths[fr= ontier_node]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_path_copy =3D copy( path )=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_path_copy.reverse()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for src_path in src_path_list:=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0complete_paths.a= ppend( src_path +
dst_path_copy)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_paths =3D= new_dst_paths

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if complete_paths:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return comple= te_paths
class HashedRouting(Routing):
=C2=A0 =C2=A0 =C2=A0''' Hashed routing '''

=C2=A0 =C2=A0 =C2=A0def __init__(self, topo):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.topo =3D topo

=C2=A0 =C2=A0 =C2=A0def get_route(self, src, dst, hash_):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0''' Return flow path. '&#= 39;'

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if src =3D=3D dst:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return [src]

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0paths =3D self.routes(src,dst)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if paths:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#print 'hash_:', ha= sh_
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0choice =3D hash_ % len(path= s)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#print 'choice:', c= hoice
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0path =3D sorted(paths)[choi= ce]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#print 'path:', pat= h
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return path

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>
Instantiated in util.py:

from DCTopo import FatTreeTopo
from mininet.util import makeNumeric
from DCRouting import HashedRouting, Routing

TOPOS =3D {'ft': FatTreeTopo}
ROUTING =3D {'ECMP' : HashedRouting}


def buildTopo(topo):
=C2=A0 =C2=A0 =C2=A0topo_name, topo_param =3D topo.split( ',' )
=C2=A0 =C2=A0 =C2=A0return TOPOS[topo_name](makeNumeric(topo_param))


def getRouting(routing, topo):
=C2=A0 =C2=A0 =C2=A0return ROUTING[routing](topo)

A comment on that last line that says it instantiates the child class would= have been very helpful.

But even though I can now search for calls to that function, I still cannot= make sense out of that context, either.



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D> utilized in HController. py:
A Piece of code which works with self.r.routes() method:
Following list of methods are defined in HController.py

=C2=A0 =C2=A0 =C2=A0def _ecmp_hash(self, packet):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0''' Return an ECMP-style 5-tu= ple hash for TCP/IP packets, otherwise
0.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RFC2992 '''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input =3D [0] * 5
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if isinstance(packet.next, ipv4):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ip =3D packet.next
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input[0] =3D ip.srcip.= toUnsigned()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input[1] =3D ip.dstip.= toUnsigned()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input[2] =3D ip.protoc= ol
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if isinstance(ip.next, tcp)= or isinstance(ip.next, udp):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0l4 =3D ip.nex= t
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input[3]= =3D l4.srcport
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_input[4]= =3D l4.dstport
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return crc32(= pack('LLHHH', *hash_input))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0

=C2=A0 =C2=A0 =C2=A0def _install_reactive_path(self, event, out_dpid, final= _out_port,
packet):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0''' Install entries on route = between two switches. '''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0in_name =3D self.t.node_gen(dpid =3D even= t.dpid).name_str()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out_name =3D self.t.node_gen(dpid =3D out= _dpid).name_str()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hash_ =3D self._ecmp_hash(packet)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0paths =3D self.r.routes(src_name, dst_nam= e)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if paths =3D=3D None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print "PATH is None := ("
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0route =3D self.r.get_route(in_name, out_n= ame, hash_)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print "Route:",route
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print '-'*80
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if route =3D=3D None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print None, "route bet= ween", in_name, "and", out_name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match =3D of.ofp_match.from_packet(packet= )

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i, node in enumerate(route):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0node_dpid =3D self.t.node_g= en(name =3D node).dpid
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if i < len(route) - 1: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0next_node =3D= route[i + 1]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out_port, nex= t_in_port =3D self.t.port(node, next_node)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out_port =3D = final_out_port
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.switches[node_dpid].in= stall(out_port, match, idle_timeout
=3D 10)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if isinstance(packet.next, of.ipv4) and isinstance(packet.next.next, of.tcp):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.matchDict[(packet.next= .srcip, packet.next.dstip,
packet.next.next.srcport, packet.next.next.dstport)] =3D (route, match)

=C2=A0 =C2=A0 =C2=A0def _handle_PacketIn(self, event):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not self.all_switches_up:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#log.info("Saw PacketIn before all switches wer= e up -
ignoring." )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0packet =3D event.parsed
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dpid =3D event.dpid
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0in_port =3D event.port

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Learn MAC address of the sender on ever= y packet-in.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.macTable[packet.src] =3D (dpid, in_p= ort)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sw_name =3D self.t.node_gen(dpid =3D dpid= ).name_str()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#print "Sw:", sw_name, packet.s= rc, packet.dst,"port", in_port,
packet.dst.isMulticast(),"macTable", packet.dst in self.macTable<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#print '-'*80

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Insert flow, deliver packet directly to= destination.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if packet.dst in self.macTable:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out_dpid, out_port =3D self= .macTable[packet.dst]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._install_reactive_path= (event, out_dpid, out_port, packet)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.switches[out_dpid].sen= d_packet_data(out_port, event.data)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._flood(event)

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> code snippet = which returns 'None' number of paths.
=C2=A0 =C2=A0 =C2=A0def _GlobalFirstFit(self,flow):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'''do the Hedera global first= fit here'''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src_name =3D self.t.node_gen(dpid =3D flo= w['src']).name_str()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_name =3D self.t.node_gen(dpid =3D flo= w['dst']).name_str()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print 'Global Fisrt Fit for the eleph= ant flow from ',src_name,'to',
dst_name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0paths =3D self.r.routes(src_name,dst_name= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print 'all routes found for the big f= low:\n',paths
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GFF_route =3D None
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if paths =3D=3D None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for path in paths:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fitCheck =3D True

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i in range(1,len(path))= :
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fitCheck =3D = False
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if self.bwRes= ervation.has_key(path[i-1]) and
self.bwReservation[path[i-1]].has_key(path[i]):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0if
self.bwReservation[path[i-1]][path[i]]['reserveDemand'] + flow['= ;demand'] >
1 :
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0break
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0else:

#self.bwReservation[path[i-1]][path[i]]['reserveDemand'] +=3D flow[= 'demand']
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0fitCheck =3D True
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0self.bwReservation[path[i-1]]=3D{}

self.bwReservation[path[i-1]][path[i]]=3D{'reserveDemand':0}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0fitCheck =3D True
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if fitCheck =3D=3D True: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i in rang= e(1,len(path)):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0self.bwReservation[path[i-1]][path[i]]['reserveDemand']
+=3D flow['demand']
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GFF_route =3D= path
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print "G= FF route found:", path
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if GFF_route !=3D None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""install n= ew GFF_path between source and destintaion"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self. _install_GFF_path(GFF= _route,flow['match'])

def launch(topo =3D None, routing =3D None, bw =3D None ):
=C2=A0 =C2=A0 =C2=A0#print topo
=C2=A0 =C2=A0 =C2=A0if not topo:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise Exception ("Please specify the= topology")
=C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0t =3D buildTopo(topo)

=C2=A0 =C2=A0 =C2=A0r =3D getRouting(routing, t)
=C2=A0 =C2=A0 =C2=A0if bw =3D=3D None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bw =3D 10.0 #Mb/s
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bw =3D float(bw/1000) #Gb/s
=C2=A0 =C2=A0 =C2=A0else:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bw =3D float(bw)/1000
=C2=A0 =C2=A0 =C2=A0core.registerNew(HController, t, r, bw)
=C2=A0 =C2=A0 =C2=A0log.info<= /a>("** HController is running

I am really sorry for any inconvenience caused. I, ve tried to make it a bit clear here. I am not even able to debug the code by setting a python debugging point pdb. I need help from you guys. Thanks a lot again for your=
time and help.

Best Regards,
David


On Sat, May 9, 2015 at 12:07 PM, Mark Lawrence <
breamoreboy@yahoo.co.uk>
wrote:

On 09/05/2015 07:41, david jhon wrote:

Hello everyone,

I am new to python and trying to run an example code from mininet tests. Basically, I am trying to call a method in Hcontroller.py from base class Routing defined in DCRouting.py which runs and fetches all the required
results in install_reactive_path() method, but it returns None when it is called from _GlobalFirstFit. I hope someone here could help me fix this
bug..

I am attaching all the three files(DCRouting.py, HController.py, util.py) to have a look into. Thanks in advance for your time, help or suggestion. Thanks a lot!

kind regards,
David


I'm sorry but I'm not wading through nearly 30kb of code in five attachments.=C2=A0 Please see http://sscce.org/ for how to put your question
so you're more likely to get answers.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list






--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list

--001a113e94b2474db70515a4ff04--