You can do number #1 pretty easily.  Look up the Connection by DPID.  
Connections have a socket to their switch, and just use the socket's 
.getpeername().  Something like...

print core.openflow.connections[dpid].sock.getpeername()

I've thought about wrapping the sock.getpeername() part with a nice property, 
but haven't done it.

-- Murphy

On Jun 27, 2013, at 2:25 PM, Bob Lantz wrote:

> 1. Can you not determine the IP address of the incoming TCP connection from 
> the switch to the controller?
> 2. You could maintain a table which maps DPIDs to IP addresses, although I'm 
> really not sure why you would care.
> 3. Or you could encode the IP address in the DPID if you wanted to, although 
> I'm really not sure of the use case.
> 
> On Jun 27, 2013, at 10:44 AM, adria sole <adrias...@gmail.com> wrote:
> 
>> Hi everyone, I am trying to get the IP addresses from my OF switches through 
>> their DPID, does anyone know how to? I have been searching and I only found 
>> this for nox: self.ctxt.get_switch_ip(<numeric dpid>) but it doesn't work 
>> for pox.
>> 
>> Thank you in advance,
>> 
>> 
>> AdriĆ  
>> _______________________________________________
>> openflow-discuss mailing list
>> openflow-discuss@lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
> 
> _______________________________________________
> openflow-discuss mailing list
> openflow-discuss@lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to