Search in sources :

Example 16 with MapReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.

the class MappingServiceIntegrationTest method testTTLAfterClean.

private void testTTLAfterClean(MapRequest mapRequest) throws SocketTimeoutException {
    MapReply mapReply;
    sendMapRequest(mapRequest);
    mapReply = receiveMapReply();
    assertCorrectMapReplyTTLAndAction(mapReply, 15, Action.NativelyForward);
}
Also used : MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply) GotMapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)

Example 17 with MapReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.

the class MappingServiceIntegrationTest method testPositivePrefixOverlappingNegativePrefix_moreSpecific.

private void testPositivePrefixOverlappingNegativePrefix_moreSpecific() {
    cleanUP();
    insertNBMappings(1L, "192.167.0.0/16", "192.169.0.0/16");
    MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
    Eid expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
    MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
    assertEquals(expectedNegativePrefix, mr.getEid());
    assertTrue(MappingRecordUtil.isNegativeMapping(mr));
    insertNBMappings(1L, "192.168.1.0/24");
    MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
    mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
    expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/24");
    mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
    assertEquals(expectedNegativePrefix, mr.getEid());
    assertTrue(MappingRecordUtil.isNegativeMapping(mr));
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply) GotMapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply) MappingRecord(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)

Example 18 with MapReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.

the class MappingServiceIntegrationTest method registerAndQuery__SrcDestLCAFOverlap.

public void registerAndQuery__SrcDestLCAFOverlap() throws SocketTimeoutException {
    cleanUP();
    String ipString1 = "10.10.10.0";
    String ipString2 = "20.20.20.0";
    String ipPrefix1 = ipString1 + "/24";
    String ipPrefix2 = ipString2 + "/24";
    Eid srcDst = LispAddressUtil.asSrcDstEid(ipString1, ipString2, 24, 24, 0);
    registerAddress(LispAddressUtil.asIpv4PrefixBinaryEid(ipPrefix2));
    registerAddress(srcDst);
    // exact match
    MapReply reply = queryForAddress(srcDst, null);
    Eid fromNetwork = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
    assertEquals(SourceDestKeyLcaf.class, fromNetwork.getAddressType());
    SourceDestKey sourceDestFromNetwork = (SourceDestKey) fromNetwork.getAddress();
    IpPrefix receivedAddr1 = sourceDestFromNetwork.getSourceDestKey().getSource().getIpPrefix();
    IpPrefix receivedAddr2 = sourceDestFromNetwork.getSourceDestKey().getDest().getIpPrefix();
    assertNotNull(receivedAddr1.getIpv4Prefix());
    assertNotNull(receivedAddr2.getIpv4Prefix());
    assertEquals(ipPrefix1, receivedAddr1.getIpv4Prefix().getValue());
    assertEquals(ipPrefix2, receivedAddr2.getIpv4Prefix().getValue());
    // srcEid/dstEid match
    reply = queryForAddress(LispAddressUtil.asIpv4PrefixBinaryEid("20.20.20.1/32"), "10.10.10.1");
    fromNetwork = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
    assertEquals(Ipv4PrefixBinaryAfi.class, fromNetwork.getAddressType());
    assertEquals(LispAddressUtil.asIpv4PrefixBinaryEid(ipPrefix2), fromNetwork);
    // dstEid match only
    reply = queryForAddress(LispAddressUtil.asIpv4PrefixBinaryEid("20.20.20.1/32"), "1.2.3.4");
    fromNetwork = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
    assertEquals(Ipv4PrefixBinaryAfi.class, fromNetwork.getAddressType());
    assertEquals(LispAddressUtil.asIpv4PrefixBinaryEid(ipPrefix2), fromNetwork);
}
Also used : IpPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix) Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply) GotMapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply) SourceDestKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey)

Example 19 with MapReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.

the class MappingServiceIntegrationTest method mapRegisterWithMapNotifyAndMapRequest.

public void mapRegisterWithMapNotifyAndMapRequest() throws SocketTimeoutException {
    cleanUP();
    Eid eid = LispAddressUtil.asIpv4PrefixBinaryEid("1.2.3.4/32");
    MapReply mapReply = registerAddressAndQuery(eid);
    assertEquals(4, mapReply.getNonce().longValue());
    assertEquals(MappingServiceIntegrationTestUtil.DEFAULT_IPV4_RLOC, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().get(0).getRloc());
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply) GotMapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)

Example 20 with MapReply

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.

the class MultiSiteScenario method assertPing.

private void assertPing(final Site srcSite, final int srcHostIndex, final Site dstSite, final int dstHostIndex, boolean expectedPingWorks, final Site... additionalSitesFromMapping) {
    final MapReply mapReplyFromSrcToDst = emitMapRequestMessage(srcSite.getHost(srcHostIndex), dstSite.getHost(dstHostIndex), dstSite.getVNI());
    if (checkActionAndRloc(dstSite, expectedPingWorks, mapReplyFromSrcToDst, additionalSitesFromMapping)) {
        return;
    }
    final MapReply mapReplyFromDstToSrc = emitMapRequestMessage(dstSite.getHost(dstHostIndex), srcSite.getHost(srcHostIndex), srcSite.getVNI());
    if (checkActionAndRloc(srcSite, expectedPingWorks, mapReplyFromDstToSrc)) {
        return;
    }
    final InstanceIdType iidDst = mapReplyFromSrcToDst.getMappingRecordItem().get(0).getMappingRecord().getEid().getVirtualNetworkId();
    final InstanceIdType iidSrc = mapReplyFromDstToSrc.getMappingRecordItem().get(0).getMappingRecord().getEid().getVirtualNetworkId();
    final boolean isIIDEqual = iidDst.equals(iidSrc);
    if (expectedPingWorks != isIIDEqual) {
        fail("IID problem. Dst value " + iidDst.getValue() + ". Src value " + iidSrc.getValue() + ".");
    }
}
Also used : InstanceIdType(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType) MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)

Aggregations

MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)44 GotMapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)38 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)25 MappingRecord (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)12 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)9 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)9 Test (org.junit.Test)8 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)8 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)8 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)6 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)6 ItrRloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.ItrRloc)6 GotMapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapNotify)5 MapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify)5 EidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)5 EidItemBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItemBuilder)5 InstanceIdType (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType)4 MapRegister (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister)4 MappingRecordItem (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.list.MappingRecordItem)4 MapRequestBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestnotification.MapRequestBuilder)4