Expose PCEP peer IP address in topology 91/3991/1
authorRobert Varga <rovarga@cisco.com>
Tue, 31 Dec 2013 12:06:08 +0000 (13:06 +0100)
committerRobert Varga <rovarga@cisco.com>
Tue, 31 Dec 2013 12:06:08 +0000 (13:06 +0100)
This patch adjusts the PCEP topology extensions to explicitly expose the
PCC IP address as visible by the PCE. Note that this address may be
subject to NAT and thus may not bear any relationship with the IP
address as seen on the PCC.

Change-Id: I7513a6278fadc023a624367a99df2b9edd4e13ca
Signed-off-by: Robert Varga <rovarga@cisco.com>
pcep/topology-api/src/main/yang/network-topology-pcep.yang
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java

index 3077cde6b04b181a1fe6bc64337f65d2d8d712cb..b3bf6e391cf2c83d4132a0b3fe6dbc9d1d99fc47 100644 (file)
@@ -1,79 +1,91 @@
 module network-topology-pcep {
-       // vi: set et smarttab sw=4 tabstop=4:
-       yang-version 1;
-       namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep";
-       prefix "pn";
+    // vi: set et smarttab sw=4 tabstop=4:
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep";
+    prefix "pn";
 
-       import network-topology { prefix nt; revision-date 2013-10-21; }
-       import pcep-types { prefix pcep; revision-date 2013-10-05; }
-       import pcep-ietf-stateful { prefix stateful; revision-date 2013-12-22; }
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import network-topology { prefix nt; revision-date 2013-10-21; }
+    import pcep-types { prefix pcep; revision-date 2013-10-05; }
+    import pcep-ietf-stateful { prefix stateful; revision-date 2013-12-22; }
 
-       organization "Cisco Systems, Inc.";
-       contact "Robert Varga <rovarga@cisco.com>";
+    organization "Cisco Systems, Inc.";
+    contact "Robert Varga <rovarga@cisco.com>";
 
-       description
-               "This module contains the PCEP extensions to base topology model. It
+    description
+        "This module contains the PCEP extensions to base topology model. It
         exposes the LSPs for which a particular node is the head end.
 
         This module exposes three programming instructions,add-lsp,
-        remove-lsp and update-lsp, which map to actively-stateful PCEP
-        operations using PCInitiate and PCUpd messages to initiate,
-        destroy and udpate LSP configuration. The lifecycle of these
-        instructions follows draft-crabbe-pce-pce-initiated-lsp and
-        draft-ietf-pce-stateful-pce, completing execution once the head-end
-        router has acknowledged operation success. Should the router become
-        disconnected, the instruction resolve to Cancelled if the message
-        has not been sent into the TCP socket, or Failed it they have.
-
-               Copyright (c)2013 Cisco Systems, Inc. All rights reserved.";
-
-       revision "2013-10-24" {
-               description
-                       "Initial revision.";
-               reference "";
-       }
-
-       typedef pcc-sync-state {
-               type enumeration {
-                       enum initial-resync {
-                               description
-                                       "Initial state resynchronization is being performed.";
-                       }
-                       enum synchronized {
-                               description
-                                       "State synchronization has been achieved.";
-                       }
-               }
-       }
-
-       grouping topology-pcep-type {
-               container topology-pcep {
-                       presence "indicates a PCEP-aware topology";
-               }
-       }
-
-       augment "/nt:network-topology/nt:topology/nt:topology-types" {
-               uses topology-pcep-type;
-       }
-
-       grouping pcep-client-attributes {
+             remove-lsp and update-lsp, which map to actively-stateful PCEP
+                 operations using PCInitiate and PCUpd messages to initiate,
+             destroy and udpate LSP configuration. The lifecycle of these
+                 instructions follows draft-crabbe-pce-pce-initiated-lsp and
+                 draft-ietf-pce-stateful-pce, completing execution once the head-end
+                 router has acknowledged operation success. Should the router become
+                 disconnected, the instruction resolve to Cancelled if the message
+                 has not been sent into the TCP socket, or Failed it they have.
+
+                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.";
+
+    revision "2013-10-24" {
+        description
+            "Initial revision.";
+        reference "";
+    }
+
+    typedef pcc-sync-state {
+        type enumeration {
+            enum initial-resync {
+                description
+                    "Initial state resynchronization is being performed.";
+            }
+            enum synchronized {
+                description
+                    "State synchronization has been achieved.";
+            }
+        }
+    }
+
+    grouping topology-pcep-type {
+        container topology-pcep {
+            presence "indicates a PCEP-aware topology";
+        }
+    }
+
+    augment "/nt:network-topology/nt:topology/nt:topology-types" {
+        uses topology-pcep-type;
+    }
+
+    grouping pcep-client-attributes {
         description "Data present in a node which is a PCEP client (PCC).";
 
-               container path-computation-client {
-                       description
+        container path-computation-client {
+            description
                 "PCC-related run-time information. This container is only
                 present when the node is connected through PCEP in a PCC
                 role.";
             config false;
 
-                       container stateful-tlv {
-                               uses pcep:stateful-capability-tlv;
-                       }
+            leaf ip-address {
+                description
+                    "IP address which the node used to connected to the PCE.
+                    There are no guarantees as to reachability of the address,
+                    nor its relationship to other control, management, or
+                    data plane addresses.";
 
-                       leaf state-sync {
-                               when "../stateful-tlv";
-                               type pcc-sync-state;
-                       }
+                type inet:ip-address;
+                mandatory true;
+            }
+
+            container stateful-tlv {
+                uses pcep:stateful-capability-tlv;
+            }
+
+            leaf state-sync {
+                when "../stateful-tlv";
+                type pcc-sync-state;
+            }
 
             list reported-lsps {
                 leaf name {
@@ -88,13 +100,13 @@ module network-topology-pcep {
                 }
             }
         }
-       }
+    }
 
-       augment "/nt:network-topology/nt:topology/nt:node" {
+    augment "/nt:network-topology/nt:topology/nt:node" {
         when "../../nt:topology-types/topology-pcep";
 
-               uses pcep-client-attributes;
-       }
+        uses pcep-client-attributes;
+    }
 
     typedef failure-type {
         type enumeration {
@@ -131,7 +143,7 @@ module network-topology-pcep {
                 default true;
             }
 
-                       uses pcep:endpoints-object;
+            uses pcep:endpoints-object;
 
             uses pcep:path-definition;
         }
@@ -195,7 +207,7 @@ module network-topology-pcep {
     rpc ensure-lsp-operational {
         description
             "Ensure that the target LSP is provisioned and has specified
-             operational status.";
+            operational status.";
 
         input {
             uses ensure-lsp-operational-args;
index 06a5ac0b996579052d93d1c97b8273ef51bb70b8..4d5c9be45fc8b803af7ec4e69eac67e5b0cbcd48 100644 (file)
@@ -27,6 +27,7 @@ import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionListener;
 import org.opendaylight.protocol.pcep.PCEPTerminationReason;
 import org.opendaylight.protocol.pcep.TerminationReason;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.PcinitiateBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.pcinitiate.message.PcinitiateMessageBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.pcinitiate.message.pcinitiate.message.RequestsBuilder;
@@ -160,6 +161,7 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
 
                        // Our augmentation in the topology node
                        this.pccBuilder = new PathComputationClientBuilder();
+                       this.pccBuilder.setIpAddress(IpAddressBuilder.getDefaultInstance(peerAddress.getHostAddress()));
 
                        final Tlvs tlvs = session.getRemoteTlvs();
                        final Stateful stateful = tlvs.getStateful();