Thanks, I think the timeout was what I was looking for.

Regards, Daniel

-----Ursprüngliche Nachricht-----
Von: Yusuke Iwase [mailto:[email protected]] 
Gesendet: Freitag, 16. Oktober 2015 02:21
An: [email protected]
Cc: [email protected]
Betreff: Re: [Ryu-devel] Timeout between ryu and switch

Hi,

On 2015年10月16日 02:31, Daniel Reutter wrote:
> Hi,
> 
>  
> 
> does ryu detect connection interruptions between ryu und the openflow switch?
> 
> For example, when I pull the cable between the two parts.
> 
>  
> 
> In my ryu app I observe the EventDP from DPSet. But even after about five 
> minutes ryu doesn’t recognize that the switch isn’t reachable.
> 
>  
> 
> When I disable the OpenFlow instance on the switch, the EventDP gets fired 
> and the switch is recognized as down as it should be.
> 
>  
> 
> But not when I pull the cable between them.
> 
>  
> 
> Is there a solution to this problem?

This problem is not Ryu but Python socket, I think.

Ryu receives the packets from the switch here.
  https://github.com/osrg/ryu/blob/master/ryu/controller/controller.py#L165
But Python socket does not return when disconnecting the cables, because the 
socket cannot receive any disconnect message (e.g. FIN, RST, ...).

If the switches or your RyuApp send OpenFlow Echo messages periodically, how 
about setting the timeout into datapath.socket?
  e.g.)
    @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
    def switch_features_handler(self, ev):
        datapath = ev.msg.datapath
        datapath.socket.settimeout(TIME_OUT)

I recommend the TIME_OUT value to be:
  (TIME_OUT) >= (Echo messages interval) + (Network jitter, etc)

Thanks,
Iwase

> 
>  
> 
> Regards, Daniel
> 
> 
> 
> ----------------------------------------------------------------------
> --------
> 
> 
> 
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to