Search in sources :

Example 46 with ConnectPoint

use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.

the class DcsBasedTapiDataProducerTest method makeTestData.

private void makeTestData() {
    did1 = DeviceId.deviceId("netconf:127.0.0.1:11001");
    did2 = DeviceId.deviceId("netconf:127.0.0.1:11002");
    cp11 = new ConnectPoint(did1, PortNumber.portNumber(1, "TRANSCEIVER"));
    cp12 = new ConnectPoint(did1, PortNumber.portNumber(2, "TRANSCEIVER"));
    cp21 = new ConnectPoint(did2, PortNumber.portNumber(1, "TRANSCEIVER"));
    cp22 = new ConnectPoint(did2, PortNumber.portNumber(2, "TRANSCEIVER"));
    context = new DefaultContext();
    topology = TapiTopologyHandler.create().getModelObject();
    DefaultTopologyContext topologyContext = TapiTopologyContextHandler.create().getModelObject();
    DefaultAugmentedTapiCommonContext augmentedTopologyContext = new DefaultAugmentedTapiCommonContext();
    Augmentable augmentableContext = context;
    augmentableContext.addAugmentation(augmentedTopologyContext);
    augmentedTopologyContext.topologyContext(topologyContext);
    topologyContext.addToTopology(topology);
    node1 = TapiNodeHandler.create().setTopologyUuid(topology.uuid()).setDeviceId(did1).getModelObject();
    node2 = TapiNodeHandler.create().setTopologyUuid(topology.uuid()).setDeviceId(did2).getModelObject();
    sip11 = TapiSipHandler.create().setConnectPoint(cp11).getModelObject();
    sip21 = TapiSipHandler.create().setConnectPoint(cp21).getModelObject();
    nep11 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp11).addSip(sip11.uuid()).getModelObject();
    nep12 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp12).getModelObject();
    nep21 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp21).addSip(sip21.uuid()).getModelObject();
    nep22 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp22).getModelObject();
}
Also used : DefaultTopologyContext(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext) DefaultAugmentedTapiCommonContext(org.onosproject.yang.gen.v1.tapitopology.rev20181210.tapitopology.context.DefaultAugmentedTapiCommonContext) DefaultContext(org.onosproject.yang.gen.v1.tapicommon.rev20181210.tapicommon.DefaultContext) ConnectPoint(org.onosproject.net.ConnectPoint) Augmentable(org.onosproject.yang.model.Augmentable)

Example 47 with ConnectPoint

use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.

the class DefaultTapiResolverTest method setUp.

@Before
public void setUp() {
    nodeRef = TapiNodeRef.create("49e2ac46-3975-44b4-b84f-8fab28222a39", "5638e8e6-ac17-40d9-86e4-7c1febab6f1a");
    nepRef = TapiNepRef.create("59e2ac46-3975-44b4-b84f-8fab28222a39", "6638e8e6-ac17-40d9-86e4-7c1febab6f1a", "cd673055-e2b2-4f67-88c8-adfae96385bc");
    nodeRefNullAttr = TapiNodeRef.create("59e2ac46-3975-44b4-b84f-8fab28222a39", "6638e8e6-ac17-40d9-86e4-7c1febab6f1a");
    nepRefNullAttr = TapiNepRef.create("69e2ac46-3975-44b4-b84f-8fab28222a39", "7638e8e6-ac17-40d9-86e4-7c1febab6f1a", "dd673055-e2b2-4f67-88c8-adfae96385bc");
    deviceId = DeviceId.deviceId("netconf:172.24.3.5:11011");
    cp = new ConnectPoint(deviceId, PortNumber.portNumber("42"));
    sipId = "01c39723-7c0d-4754-8d64-fd9ff412404c";
    portType = OdtnDeviceDescriptionDiscovery.OdtnPortType.CLIENT.value();
    nodeRef.setDeviceId(deviceId);
    nepRef.setConnectPoint(cp).setSipId(sipId).setPortType(portType);
    dummyDeviceId = DeviceId.deviceId("dummy");
    dummyPort = 4;
    dummyCp = new ConnectPoint(dummyDeviceId, PortNumber.portNumber(dummyPort));
    dummySipId = "00000000-0000-0000-0000-000000000000";
    tapiResolver = new DefaultTapiResolver();
    mockTapiDataProducer = EasyMock.createMock(TapiDataProducer.class);
    mockTapiDataProducer.updateCacheRequest(tapiResolver);
    replay(mockTapiDataProducer);
    tapiResolver.dataProvider = mockTapiDataProducer;
}
Also used : ConnectPoint(org.onosproject.net.ConnectPoint) Before(org.junit.Before)

Example 48 with ConnectPoint

use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.

the class VirtualNetworkIntentManager method validateIntent.

/**
 * Returns true if the virtual network intent is valid.
 *
 * @param intent virtual network intent
 * @return true if intent is valid
 */
private boolean validateIntent(VirtualNetworkIntent intent) {
    checkNotNull(intent, INTENT_NULL);
    checkNotNull(intent.networkId(), NETWORK_ID_NULL);
    checkNotNull(intent.appId(), APP_ID_NULL);
    checkNotNull(intent.key(), INTENT_KEY_NULL);
    ConnectPoint ingressPoint = intent.ingressPoint();
    ConnectPoint egressPoint = intent.egressPoint();
    return (validateConnectPoint(ingressPoint) && validateConnectPoint(egressPoint));
}
Also used : ConnectPoint(org.onosproject.net.ConnectPoint)

Example 49 with ConnectPoint

use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.

the class VirtualLinkRemoveCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    ConnectPoint src = new ConnectPoint(DeviceId.deviceId(srcDeviceId), PortNumber.portNumber(srcPortNum));
    ConnectPoint dst = new ConnectPoint(DeviceId.deviceId(dstDeviceId), PortNumber.portNumber(dstPortNum));
    service.removeVirtualLink(NetworkId.networkId(networkId), src, dst);
    if (bidirectional) {
        service.removeVirtualLink(NetworkId.networkId(networkId), dst, src);
    }
    print("Virtual link successfully removed.");
}
Also used : VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService) ConnectPoint(org.onosproject.net.ConnectPoint)

Example 50 with ConnectPoint

use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.

the class VirtualNetworkIntentCreateCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkService service = get(VirtualNetworkService.class);
    IntentService virtualNetworkIntentService = service.get(NetworkId.networkId(networkId), IntentService.class);
    ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressDeviceString);
    ConnectPoint egress = ConnectPoint.deviceConnectPoint(egressDeviceString);
    TrafficSelector selector = buildTrafficSelector();
    TrafficTreatment treatment = buildTrafficTreatment();
    List<Constraint> constraints = buildConstraints();
    Intent intent = VirtualNetworkIntent.builder().networkId(NetworkId.networkId(networkId)).appId(appId()).key(key()).selector(selector).treatment(treatment).ingressPoint(ingress).egressPoint(egress).constraints(constraints).priority(priority()).build();
    virtualNetworkIntentService.submit(intent);
    print("Virtual intent submitted:\n%s", intent.toString());
}
Also used : IntentService(org.onosproject.net.intent.IntentService) Constraint(org.onosproject.net.intent.Constraint) VirtualNetworkService(org.onosproject.incubator.net.virtual.VirtualNetworkService) TrafficSelector(org.onosproject.net.flow.TrafficSelector) VirtualNetworkIntent(org.onosproject.incubator.net.virtual.VirtualNetworkIntent) Intent(org.onosproject.net.intent.Intent) TrafficTreatment(org.onosproject.net.flow.TrafficTreatment) ConnectPoint(org.onosproject.net.ConnectPoint)

Aggregations

ConnectPoint (org.onosproject.net.ConnectPoint)536 Test (org.junit.Test)149 DeviceId (org.onosproject.net.DeviceId)125 FilteredConnectPoint (org.onosproject.net.FilteredConnectPoint)91 Link (org.onosproject.net.Link)88 Set (java.util.Set)86 PortNumber (org.onosproject.net.PortNumber)86 TrafficTreatment (org.onosproject.net.flow.TrafficTreatment)83 VlanId (org.onlab.packet.VlanId)78 TrafficSelector (org.onosproject.net.flow.TrafficSelector)75 DefaultTrafficTreatment (org.onosproject.net.flow.DefaultTrafficTreatment)72 Logger (org.slf4j.Logger)71 Port (org.onosproject.net.Port)70 List (java.util.List)69 Ethernet (org.onlab.packet.Ethernet)69 DeviceService (org.onosproject.net.device.DeviceService)67 Collectors (java.util.stream.Collectors)66 MacAddress (org.onlab.packet.MacAddress)64 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)64 Intent (org.onosproject.net.intent.Intent)62