Hello, and thank you for your answer. I got this working and using send_stats_request was the way to go. I now have something similar to an available bandwith (assuming speed is the max_bandwidth, i do speed-link_utilization)
I would like now to get the latency between two switches. I would be curious to know what the best way to do this is. My idea, though i can't figure out which commands to use, is the following: have a switch send a packet to the neighbor switch, have it timestamp it, send it back to the first switch, have it timestamp it, return it to the controller, and from that, get the latency. If someone has thought of this already, could you point me to the functions i should be using to get this working? Thank you in advance, Walid van Boetzelaer 2011/12/18 Murphy McCauley <jam...@nau.edu> > On Dec 18, 2011, at 11:52 AM, Walid van Boetzelaer wrote: > > > Openflow does maintain counters for each flow table, and these counters > have the number of received packets per port, etc... How can I retrieve > these? > > At the OpenFlow level, you do this by sending an ofp_port_stats_request > asking for stats of type OFPST_PORT. You'll get back a response of > ofp_port_stats which contains byte and packet counters for the port. > > The easiest way to do this from Python in NOX is using component's > register_for_port_stats_in() to set a callback for port stats messages, and > then using pycontext's send_port_stats_request() to send an actual request. > (From inside your component, I think these are > self.register_for_port_stats_in() and self.ctxt.send_port_stats_request().) > > Alternatively, the switchstats or monitoring components may do what you > need. > > Hope that helps. > > -- Murphy Walid wrote: > Hi all! > > I need to calculate the bandwidth and latency between two switches. To > achieve this, I plan to: > > C > ___|___ > / \ > / \ > h1------p1:s1:p2-----p1:s2:p2--------h2 > -bandwidth: > > 1. stat0 = number of packets that went through s1_p1 and s2_port1 at > time t1 > > > 1. generate traffic from s1 to s2 > > > 1. stat1 = number of packets that went through s1_p1 and s2_port1 at > time t2 > > > 1. bandwidth = (stat1-stat0)*size_of_packet/(t2-t1) > > -latency: > > 1. latency = send a packet from s1 to s2, check the timestamp at s1, > s2, subtract them > > > However, I am having trouble as to generating traffic. I checked the stats > *variable* passed to the datapath_join events, and i get the following: > I've been looking into these stats (and switchstats as well) for a while, > because I believe they can help me retrieve the information I need. > However, I am unsure as to what '*speed*' here means. Also, I can't see > where the number of packets that traverse a port is. > Openflow does maintain counters for each flow table, and these counters > have the number of received packets per port, etc... How can I retrieve > these? > Thank you in advance! > Best regards > > {'ports': [ > > {'hw_addr': 'b\x9e\x04\xb9h,', 'curr': 192, 'name': 's1-eth2', 'speed': >> 10000, 'supported': 0, 'enabled': True, 'flood': True, 'state': 0, 'link': >> True, 'advertised': 0, 'peer': 0, 'config': 0, 'port_no': 2}, {'hw_addr': >> '\x00# \xba\xc0\x97', 'curr': 0, 'name': 'dp0', 'speed': 0, 'supported': >> 0, 'enabled': False, 'flood': True, 'state': 1, 'link': False, >> 'advertised': 0, 'peer': 0, 'config': 1, 'port_no': 65534}, {'hw_addr': >> '\x9e\xe7\xf1\xcb\xdd\x17', 'curr': 192, 'name': 's1-eth1', 'speed': >> 10000, 'supported': 0, 'enabled': True, 'flood': True, 'state': 0, 'link': >> True, 'advertised': 0, 'peer': 0, 'config': 0, 'port_no': 1}], 'n_tables': >> 2, 'n_bufs': 256L, 'actions': 4095L, 'caps': 135L} > >
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev