Package net.floodlightcontroller.routing

Examples of net.floodlightcontroller.routing.Route


            int srcVsDest = srcCluster.compareTo(dstCluster);
            if (srcVsDest == 0) {
                if (!srcDap.equals(dstDap) &&
                        (srcCluster != null) &&
                        (dstCluster != null)) {
                    Route routeIn =
                            routingEngine.getRoute(srcDap.getSwitchDPID(),
                                                   (short)srcDap.getPort(),
                                                   dstDap.getSwitchDPID(),
                                                   (short)dstDap.getPort(), 0);
                    Route routeOut =
                            routingEngine.getRoute(dstDap.getSwitchDPID(),
                                                   (short)dstDap.getPort(),
                                                   srcDap.getSwitchDPID(),
                                                   (short)srcDap.getPort(), 0);
View Full Code Here


                srcId = nexthoplinks.get(srcId).getDst();
            }
        }
        // else, no path exists, and path equals null

        Route result = null;
        if (switchPorts != null && !switchPorts.isEmpty())
            result = new Route(id, switchPorts);
        if (log.isTraceEnabled()) {
            log.trace("buildroute: {}", result);
        }
        return result;
    }
View Full Code Here

        if (srcId == dstId && srcPort == dstPort)
            return null;

        List<NodePortTuple> nptList;
        NodePortTuple npt;
        Route r = getRoute(srcId, dstId, 0);
        if (r == null && srcId != dstId) return null;

        if (r != null) {
            nptList= new ArrayList<NodePortTuple>(r.getPath());
        } else {
            nptList = new ArrayList<NodePortTuple>();
        }
        npt = new NodePortTuple(srcId, srcPort);
        nptList.add(0, npt); // add src port to the front
        npt = new NodePortTuple(dstId, dstPort);
        nptList.add(npt); // add dst port to the end

        RouteId id = new RouteId(srcId, dstId);
        r = new Route(id, nptList);
        return r;
    }
View Full Code Here

        // Return null route if srcId equals dstId
        if (srcId == dstId) return null;


        RouteId id = new RouteId(srcId, dstId);
        Route result = null;

        try {
            result = pathcache.get(id);
        } catch (Exception e) {
            log.error("{}", e);
View Full Code Here

                        topology.getL2DomainId(dstDap.getSwitchDPID());

                int srcVsDest = srcCluster.compareTo(dstCluster);
                if (srcVsDest == 0) {
                    if (!srcDap.equals(dstDap)) {
                        Route route =
                                routingEngine.getRoute(srcDap.getSwitchDPID(),
                                                       (short)srcDap.getPort(),
                                                       dstDap.getSwitchDPID(),
                                                       (short)dstDap.getPort(), 0); //cookie = 0, i.e., default route
                        if (route != null) {
View Full Code Here

        long longSrcDpid = HexString.toLong(srcDpid);
        short shortSrcPort = Short.parseShort(srcPort);
        long longDstDpid = HexString.toLong(dstDpid);
        short shortDstPort = Short.parseShort(dstPort);
       
        Route result = routing.getRoute(longSrcDpid, shortSrcPort, longDstDpid, shortDstPort, 0);
       
        if (result!=null) {
            return routing.getRoute(longSrcDpid, shortSrcPort, longDstDpid, shortDstPort, 0).getPath();
        }
        else {
View Full Code Here

* @author David Erickson (daviderickson@cs.stanford.edu)
*/
public class RouteTest extends FloodlightTestCase {
    @Test
    public void testCloneable() throws Exception {
        Route r1 = new Route(1L, 2L);
        Route r2 = new Route(1L, 3L);

        assertNotSame(r1, r2);
        assertNotSame(r1.getId(), r2.getId());

        r1 = new Route(1L, 3L);
        r1.getPath().add(new NodePortTuple(1L, (short)1));
        r1.getPath().add(new NodePortTuple(2L, (short)1));
        r1.getPath().add(new NodePortTuple(2L, (short)2));
        r1.getPath().add(new NodePortTuple(3L, (short)1));

        r2.getPath().add(new NodePortTuple(1L, (short)1));
        r2.getPath().add(new NodePortTuple(2L, (short)1));
        r2.getPath().add(new NodePortTuple(2L, (short)2));
        r2.getPath().add(new NodePortTuple(3L, (short)1));

        assertEquals(r1, r2);

        NodePortTuple temp = r2.getPath().remove(0);
        assertNotSame(r1, r2);

        r2.getPath().add(0, temp);
        assertEquals(r1, r2);

        r2.getPath().remove(1);
        temp = new NodePortTuple(2L, (short)5);
        r2.getPath().add(1, temp);
        assertNotSame(r1, r2);
    }
View Full Code Here

                new Capture<FloodlightContext>(CaptureType.ALL);
        Capture<FloodlightContext> bc2 =
                new Capture<FloodlightContext>(CaptureType.ALL);


        Route route = new Route(1L, 2L);
        List<NodePortTuple> nptList = new ArrayList<NodePortTuple>();
        nptList.add(new NodePortTuple(1L, (short)1));
        nptList.add(new NodePortTuple(1L, (short)3));
        nptList.add(new NodePortTuple(2L, (short)1));
        nptList.add(new NodePortTuple(2L, (short)3));
        route.setPath(nptList);
        expect(routingEngine.getRoute(1L, (short)1, 2L, (short)3, 0)).andReturn(route).atLeastOnce();

        // Expected Flow-mods
        OFMatch match = new OFMatch();
        match.loadFromPacket(testPacketSerialized, (short) 1);
View Full Code Here

    @Test
    public void testForwardSingleSwitchPath() throws Exception {
        learnDevices(DestDeviceToLearn.DEVICE2);

        Route route = new  Route(1L, 1L);
        route.getPath().add(new NodePortTuple(1L, (short)1));
        route.getPath().add(new NodePortTuple(1L, (short)3));
        expect(routingEngine.getRoute(1L, (short)1, 1L, (short)3, 0)).andReturn(route).atLeastOnce();

        // Expected Flow-mods
        OFMatch match = new OFMatch();
        match.loadFromPacket(testPacketSerialized, (short) 1);
View Full Code Here

        .andReturn(true).anyTimes();
        expect(topology.getL2DomainId(1L)).andReturn(1L).anyTimes();
        replay(topology);


        Route route = new  Route(1L, 1L);
        route.getPath().add(new NodePortTuple(1L, (short)1));
        route.getPath().add(new NodePortTuple(1L, (short)3));
        expect(routingEngine.getRoute(1L, (short)1, 1L, (short)3, 0)).andReturn(route).atLeastOnce();

        // Expected Flow-mods
        OFMatch match = new OFMatch();
        match.loadFromPacket(testPacketSerialized, (short) 1);
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.routing.Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.