0

I have the following topology: topology

I'm trying to perform an iperf from server2 to server4 and a problem arise: it seems (by analyzing the traffic using wireshark) 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)     
                                          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.

nik
  • 726
  • 2
  • 12
  • 28
damaar
  • 171
  • 1
  • 2
  • 11

0 Answers0