Committed by
Pavlin Radoslavov
fix switch negociation for non spec compliant devices.
ONOS now waits for switches to advertise their highest version via a hello message. ONOS then replies with a hello of the appropriate version. [Merged from 1.0] Change-Id: I6ebe3f1b8f513920dc62016347a40f503de01457 (cherry picked from commit d9b2f404)
Showing
1 changed file
with
12 additions
and
1 deletions
... | @@ -185,11 +185,17 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -185,11 +185,17 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
185 | if (m.getVersion() == OFVersion.OF_13) { | 185 | if (m.getVersion() == OFVersion.OF_13) { |
186 | log.debug("Received {} Hello from {}", m.getVersion(), | 186 | log.debug("Received {} Hello from {}", m.getVersion(), |
187 | h.channel.getRemoteAddress()); | 187 | h.channel.getRemoteAddress()); |
188 | + h.sendHandshakeHelloMessage(); | ||
188 | h.ofVersion = OFVersion.OF_13; | 189 | h.ofVersion = OFVersion.OF_13; |
189 | } else if (m.getVersion() == OFVersion.OF_10) { | 190 | } else if (m.getVersion() == OFVersion.OF_10) { |
190 | log.debug("Received {} Hello from {} - switching to OF " | 191 | log.debug("Received {} Hello from {} - switching to OF " |
191 | + "version 1.0", m.getVersion(), | 192 | + "version 1.0", m.getVersion(), |
192 | h.channel.getRemoteAddress()); | 193 | h.channel.getRemoteAddress()); |
194 | + OFHello hi = | ||
195 | + h.factory10.buildHello() | ||
196 | + .setXid(h.handshakeTransactionIds--) | ||
197 | + .build(); | ||
198 | + h.channel.write(Collections.singletonList(hi)); | ||
193 | h.ofVersion = OFVersion.OF_10; | 199 | h.ofVersion = OFVersion.OF_10; |
194 | } else { | 200 | } else { |
195 | log.error("Received Hello of version {} from switch at {}. " | 201 | log.error("Received Hello of version {} from switch at {}. " |
... | @@ -1026,7 +1032,12 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -1026,7 +1032,12 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
1026 | channel = e.getChannel(); | 1032 | channel = e.getChannel(); |
1027 | log.info("New switch connection from {}", | 1033 | log.info("New switch connection from {}", |
1028 | channel.getRemoteAddress()); | 1034 | channel.getRemoteAddress()); |
1029 | - sendHandshakeHelloMessage(); | 1035 | + /* |
1036 | + hack to wait for the switch to tell us what it's | ||
1037 | + max version is. This is not spec compliant and should | ||
1038 | + be removed as soon as switches behave better. | ||
1039 | + */ | ||
1040 | + //sendHandshakeHelloMessage(); | ||
1030 | setState(ChannelState.WAIT_HELLO); | 1041 | setState(ChannelState.WAIT_HELLO); |
1031 | } | 1042 | } |
1032 | 1043 | ... | ... |
-
Please register or login to post a comment