ofsoftswitch13 icon indicating copy to clipboard operation
ofsoftswitch13 copied to clipboard

Problem in connecting ofsoftswitch to OpenDaylight

Open antonmatsiuk opened this issue 8 years ago • 1 comments

Recently, I was trying to connect the ofsoftswitch13 to one of the recent releases of ODL (Boron SR-1). During the handshake ofsoftswitch gives a warning and the breaks the connection: Jan 20 10:53:16|00008|vconn|WARN|tcp:localhost:6653: extra-long hello: 00000000 04 00 00 10 98 b0 d1 5a-00 01 00 08 00 00 00 12 |.......Z........|

The reason is that ofsoftswitch does not accept OFPT_HELLO messages longer than ofp_header = 8 bytes. However, OpenFlow1.3.0 specification says "Implementations must be prepared to receive a hello message that includes a body, ignoring its contents, to allow for later extensions." The ODL sends (according to OpenFlow 1.3.1) additional OFPHET_VERSIONBITMAP in its hello message, making OFPT_HELLO= 16 bytes. This message is destroyed by ofsoftswitch and, after hello timer expires, the connection becomes rebooted. A quick'n'dirty fix below solves this issue:

--- a/lib/vconn.c +++ b/lib/vconn.c @@ -382,7 +382,7 @@ vcs_recv_hello(struct vconn *vconn) struct ofp_header *oh = b->data;

     if (oh->type == OFPT_HELLO) {
  •        if (b->size > sizeof *oh) {
    
  •        if (b->size > 2*sizeof *oh) {
               struct ds msg = DS_EMPTY_INITIALIZER;
               ds_put_format(&msg, "%s: extra-long hello:\n", vconn->name);
               ds_put_hex_dump(&msg, b->data, b->size, 0, true);
    

Probably, this check: if (b->size > sizeof *oh) can be removed completely.

antonmatsiuk avatar Jan 20 '17 14:01 antonmatsiuk

Revisiting the issue.

I have checked and ODL sends a FEATURES_REQUEST in the same Hello Message, so only removing the code would not be enough.

There is need to handle the messages that come in sequence and preferentially handle OFPHET_VERSIONBITMAP too.

I hope to implement it soonish.

Edit: Well, ignore everything I said before. It is not the FEATURE_REQUEST fault. I just need to handle the bitmap.

ederlf avatar Aug 17 '18 19:08 ederlf