Stanford OpenFlow Forums: Installing different flows to two different switches - Stanford OpenFlow Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Installing different flows to two different switches No rules installed on the destination's switch Rate Topic: -----

#1 User is offline   Dario 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 19-March 15

Posted 19 March 2015 - 02:31 AM

Hi all,
I have the following topology:

https://www.dropbox....ologia.png?dl=0

I'm trying to perform an iperf from server2 to server4 and a problem arise: it seems it doesn't install any rules on the destination's switch. If I try an iperf between two servers of the same switch everything works fine. I don't understand why this problem arise. Can anyone help me? Any suggestion may be usefull.
The code which installs the flows on the switches is the following:

//source Switch != destination Switch
			IOFSwitch srcSwitch = sw;
			IOFSwitch dstSwitch = this.floodlightProvider.getSwitch(destSwitchID);
			
			
			
			/* Create match:			
			 * source Mac: always host mac  
			 * dest Mac: always dest host mac 
			 * source Ip: vIP or external 
			 * dest Ip: rIP or vIP */
			
			int srcIp = IPv4.toIPv4Address(toVirtualIp(sourceIp));
			
			//get inPort of dest Switch on the inter-switch link 
			short inPort = topology.getInterSwitchPort(destSwitchID);
			
			OFMatch matchDst = createMatch(srcHostMac, destHostMac, srcIp, destIp, inPort);
			
			short[] actionsLengthDst = {0};
			
			int dstIp = IPv4.toIPv4Address(toRealIp(destIp));
			
			// Initialize list of actions
			//realSrcToVirtualSrc = false because sourceIp has not to be translated to realIp in the dest switch
			 ArrayList<OFAction> actionsDst = createActions(false, 0, //vIP
					 				virtualDestToRealDest, dstIp, //rIP
									destHostMac, destSwitchID, actionsLengthDst,
									false);
			
			OFFlowMod ruleDst = createRule(matchDst, actionsDst, actionsLengthDst[0]);
			
    		System.out.println("Installing flows to dest OF switch ID " + dstSwitch.getId());
			try {
				dstSwitch.write(ruleDst, cntx);
			} catch (Exception e) {
				e.printStackTrace();
				return false;
			}
			
			/* Create match:			
			 * source Mac: always host mac  
			 * dest Mac: gateway MAC or host MAC  
			 * source Ip: rIP  
			 * dest Ip: rIP or vIP */
			OFMatch matchSrc = createMatch(srcHostMac, destMac, sourceIp, destIp, pi.getInPort());
			
			short[] actionsLengthSrc = {0};
			
			// Initialize list of actions
			//virtualDestToRealDest = false because destIp has not to be translated to realIp int the source switch
			 ArrayList<OFAction> actionsSrc = createActions(realSrcToVirtualSrc, sourceIp, //not translated (always rIP)
									false, 0, //not translated (rIP or vIP)
									destHostMac, sw.getId(), actionsLengthSrc,
									false);
			
			OFFlowMod ruleSrc = createRule(matchSrc, actionsSrc, actionsLengthSrc[0]);
			
    		System.out.println("Installing flows to source OF switch ID " + srcSwitch.getId());
			try {
				srcSwitch.write(ruleSrc, cntx);
			} catch (Exception e) {
				e.printStackTrace();
				return false;
			}



Thanks in advance
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users