19.05.2016 1
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
N E T C O N F u n d Y A N G
Eine kurze Einführung
19.05.2016 2
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
W T F is N E T C O N F o r Y A N G ?
Netconf isteinProtokoll fürdasinstallieren,manipulierenundlöschenvonNetzwerkgeräten.[RFC 6241]
YANG isteineDatenmodellierungssprache (datamodellinglanguage),benutztumKonfigurations-undStatus-informationenzumodellieren,diedurch
Netconf, NetconfremoteprocedurecallsundNetconfnotificationsverändertwerden.
19.05.2016 3
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Kurze Timeline
NETCONF
● 2001 IETF Treffen mit Umfrage
zur Benutzung von SNMP SET
● Juni 2002 IAB Network Mgmt
Workshop
● May 2003 Gründung der
NETCONF WG
● Dezember 2006 NETCONF
core RFCs wurden
veröffentlicht
● YANG
● 2007 Vorschlag des YANG
Design-teams
● April 2008 NETMOD WG wird
Gegründet
● Oct 2010 YANG RFC 6020 wird
veröffentlicht
19.05.2016 4
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
SNMP NETCONF SOAP REST
Standard IETF IETF W3C -
Resources OIDs Paths URLs
Data models Defined in
MIBs
YANG Core
Models
Data
Modeling
Language
SMI YANG (WSDL, not
data)
Undefined,
(WSDL),
WADL, text…
Management
Operations
SNMP NETCONF In the XML
Schema, not
standardized
HTTP
operations
Encoding BER XML XML XML, JSON,
…
Transport
Stack
UDP SSH
TCP
SSL
HTTP
TCP
SSL
HTTP
TCP
“RESTConf”
Aus tail-f Tutorial: NETCONF and YANG
19.05.2016 5
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Netconf
Features:
● Unterscheidet zwischen
Konfiguration und
momentanem Status
● Unterscheidet zwischen
running, startup und (optional)
candidate Konfiguration
● Bietet Tests, Validierung und
roll-back on error
● Streaming und playback von
Benachrichtigungen
19.05.2016 6
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Netconf vs SNMP
● Bietet aber auch einen SNMP
Trap ähnlichen Mechanismus
namens Notifications
● Circa eine Größenordnung
schneller als SNMP
● War nie als Ersatz für SNMP
gedacht
● Netconf ist Session basiert
● Es existiert ein unoffizieller
Mechanismus zum
konvertieren von SNMP MIBs
zu YANG Modellen (habe ich
noch nicht getestet)
● NETCONF ersetzt auch nicht
COBRA/SOAP/REST
19.05.2016 7
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Die wichtigsten NETCONF Operationen
● Get configuration <get-config> - Teile oder Komplette Datensätze
● Get all information <get> - komplette running configuration und
Statusinformationen
● Edit configuration <edit-config>
● Copy configuration <copy-config>
● Delete configuration <delete-config>
● Lock and unlock <lock>, <unlock> Kurzlebiger Sperrmechanismus
● Close and kill session <close-session> (sanft), <kill-session>
(nicht so sanft)
19.05.2016 8
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Netconf – Grundlegende Operationen und Speicherorte
● Drei Standard Konfigurationsspeicherorte
– running: obligatorische Represäntation des Ist-Statusses
– candidate: optional, wird zur running nach <commit>
– startup: optional, Konfiguration die für den nächsten Reboot verwendet
wird
● Vier wichtige Kombinationen zum Editieren je nach Kombination der
Capabilities
– direct (:writeable-running), direct + startup (:writeable-running + startup)
– indirect (:candidate), indirect + startup (:candidate + :startup)
19.05.2016 9
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Direktes Editieren
:writeable-running
:writeable-running + :startup
19.05.2016 10
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Indirektes Editieren
:candidate
:candidate + startup
19.05.2016 11
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
YANG – Features und Designziele
● Lesbar und leicht lernbar
● Hierarchische (Baumartige)
Datenmodelle
● Wiederverwendbare Typen
und Gruppen
● Erweiterbarkeit durch die
Möglichkeit der Anpassung
existierender Objekte
● Unterstützt die Definition von
Operationen (RPCs)
● Constraints für das Validieren
von Konfigurationen
● Modularität
● Versionierung
● YANG kann auch nicht XML
Schema (xsd), WSDL oder
RelaxNG ersetzen, denn es hat
viele Merkmale, die spezifisch
für das
Konfigurationsmanagement
sind
19.05.2016 12
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Das YANG Datenmodell
module acme-system {
namespace "http://acme.example.com/system";
prefix "acme”;
container system {
leaf host-name {
type string;
mandatory true;
config true;
description "Hostname for this system”;
}
list interface {
key "name";
description "List of interfaces in the system”;
leaf name {
type string;
}
leaf type {
type string;
}
leaf mtu {
type int32;
}
}
}
}
organization "ACME Inc.”;
contact "joe@acme.example.com";
description
"The module for entities implementing the ACME
system.”;
revision 2007-11-05 {
description "Initial revision.”;
}
Aus Karl Moberg, A 30-minute Introduction to NETCONF and YANG
19.05.2016 13
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Attribute eines Leafs
config Wenn false, dann ist das Leaf read-only
default Default Werte
mandatory Optional oder Obligatorisch
must Xpath-Bedingung muss für dieses Leaf erfüllbar sein
type Der Datentyp
when Bedingtes Leaf. Existiert nur, wenn Xpath-Bedingung wahr ist
description Beschreibung (Lesbar)
reference Lesbarer Bezug auf andere Elemente oder Spezifikationen
units Maßeinheit (z.B. cm, Hz, °C)
status Ob das Lead 'current', 'deprecated' oder 'obsolete' ist
19.05.2016 14
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
useruser
namename classclassfull-namefull-nameuiduid
Default
list user {
key name;
leaf name {
type string;
}
leaf uid {
type uint32;
}
leaf full-name {
type string;
}
leaf class {
type string;
default viewer;
}
}
Das List Statement
Aus Tail-F Tutorial: NETCONF AND YANG
19.05.2016 15
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Das Leafref Statement
● Bezieht sich auf ein Element einer Liste, z.B.: ein Management
Interface bezieht sich auf ein existierendes Element einer Liste von
Interfaces
● Das referenzierte Element kann nicht gelöscht oder umbenannt
werden
● Kann nicht null oder empty sein, das Elternleaf kann aber optional
sein
19.05.2016 16
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Das „rip Routing“ subsystem
referenziert existierende
interfaces aus der Liste
interfacse.
interfaceinterface
addressaddressnamename
0 .. 64
container rip {
list network-ifname {
key ifname;
leaf ifname {
type leafref {
path “/interface/name”;
}
}
eth0.16
eth0.19 192.168.0.1
eth2.5 24.97.238.15
riprip
network-ifnamenetwork-ifname
ifnameifname
eth0.19
Aus Tail-F Tutorial: NETCONF AND YANG
RIP ist das Routing Information Protocol
19.05.2016 17
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
'Schmakerl' – das must Statement
container timeout {
leaf access-timeout {
description "Maximum time without server response";
units seconds;
mandatory true;
type uint32;
}
leaf retry-timer {
description "Period to retry operation";
units seconds;
type uint32;
must ”current() < ../access-timeout" {
error-app-tag retry-timer-invalid;
error-message "The retry timer must be "
+ "less than the access timeout";
}
}
}
19.05.2016 18
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
'Schmakerl' – das must Statement (2)
leaf max-weight {
type uint32 {
range "0..1000";
}
default 100;
must "sum(/sys:sys/interface[enabled = 'true']/weight)
< current()" {
error-message "The total weight exceeds the configured
max weight";
}
}
19.05.2016 19
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
'Schmakerl': Das augment Statement
augment /sys:system/sys:user {
leaf expire {
type yang:date-and-time;
}
}
useruser
namename classclassfull-namefull-nameuiduid expireexpire
+
Default
Aus Tail-F Tutorial: NETCONF AND YANG
19.05.2016 20
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
augment /sys:system/sys:user {
when ”sys:class = ‘wheel’";
leaf shell {
type string;
}
}
useruser
namename classclassfull-namefull-nameuiduid expireexpire
+
Default
shellshell
When
'Schmakerl': Das when Statement
Aus Tail-F Tutorial: NETCONF AND YANG
19.05.2016 21
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Was NETCONF und YANG nicht ist
● NETCONF ersetzt nicht COBRA/SOAP/REST, leistet jedoch eine
vollständige Darstellung des Konfigurationsmanagements
19.05.2016 22
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
choice transfer-method {
leaf transfer-interval {
description "Frequency at which file transfer happens";
type uint16 {
range "15 .. 2880";
}
units minutes;
}
leaf transfer-on-commit {
description "Transfer after each commit";
type empty;
}
}
transfer-intervaltransfer-interval
transfer-on-committransfer-on-commit
transfer-methodtransfer-method
'Schmakerl': Das choice Statement
Aus Tail-F Tutorial: NETCONF AND YANG
19.05.2016 23
Zentrum für
Informations- und
Medientechnologie
konrad.heimel@uni-siegen.de
Mein Verständnis der Beziehung von NETCONF und Openflow
● NETCONF betrifft Gerätekonfigurationen, während Openflow die
Forwarding Tables modifiziert. (Was auch, aber umständlicher mit
NETCONF möglich wäre)
● Aber es gibt OF-Config, welches Konfigurationen gemeinsam mit /
parallel zu Openflow mittels NETCONF verwaltet, bzw. die
Fähigkeiten von Openflow mittels NETCONF erweitert
● Bitte mit einem Körnchen Salz nehmen

NETCONF & YANG

  • 1.
    19.05.2016 1 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de N E T C O N F u n d Y A N G Eine kurze Einführung
  • 2.
    19.05.2016 2 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de W T F is N E T C O N F o r Y A N G ? Netconf isteinProtokoll fürdasinstallieren,manipulierenundlöschenvonNetzwerkgeräten.[RFC 6241] YANG isteineDatenmodellierungssprache (datamodellinglanguage),benutztumKonfigurations-undStatus-informationenzumodellieren,diedurch Netconf, NetconfremoteprocedurecallsundNetconfnotificationsverändertwerden.
  • 3.
    19.05.2016 3 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Kurze Timeline NETCONF ● 2001 IETF Treffen mit Umfrage zur Benutzung von SNMP SET ● Juni 2002 IAB Network Mgmt Workshop ● May 2003 Gründung der NETCONF WG ● Dezember 2006 NETCONF core RFCs wurden veröffentlicht ● YANG ● 2007 Vorschlag des YANG Design-teams ● April 2008 NETMOD WG wird Gegründet ● Oct 2010 YANG RFC 6020 wird veröffentlicht
  • 4.
    19.05.2016 4 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de SNMP NETCONF SOAP REST Standard IETF IETF W3C - Resources OIDs Paths URLs Data models Defined in MIBs YANG Core Models Data Modeling Language SMI YANG (WSDL, not data) Undefined, (WSDL), WADL, text… Management Operations SNMP NETCONF In the XML Schema, not standardized HTTP operations Encoding BER XML XML XML, JSON, … Transport Stack UDP SSH TCP SSL HTTP TCP SSL HTTP TCP “RESTConf” Aus tail-f Tutorial: NETCONF and YANG
  • 5.
    19.05.2016 5 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Netconf Features: ● Unterscheidet zwischen Konfiguration und momentanem Status ● Unterscheidet zwischen running, startup und (optional) candidate Konfiguration ● Bietet Tests, Validierung und roll-back on error ● Streaming und playback von Benachrichtigungen
  • 6.
    19.05.2016 6 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Netconf vs SNMP ● Bietet aber auch einen SNMP Trap ähnlichen Mechanismus namens Notifications ● Circa eine Größenordnung schneller als SNMP ● War nie als Ersatz für SNMP gedacht ● Netconf ist Session basiert ● Es existiert ein unoffizieller Mechanismus zum konvertieren von SNMP MIBs zu YANG Modellen (habe ich noch nicht getestet) ● NETCONF ersetzt auch nicht COBRA/SOAP/REST
  • 7.
    19.05.2016 7 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Die wichtigsten NETCONF Operationen ● Get configuration <get-config> - Teile oder Komplette Datensätze ● Get all information <get> - komplette running configuration und Statusinformationen ● Edit configuration <edit-config> ● Copy configuration <copy-config> ● Delete configuration <delete-config> ● Lock and unlock <lock>, <unlock> Kurzlebiger Sperrmechanismus ● Close and kill session <close-session> (sanft), <kill-session> (nicht so sanft)
  • 8.
    19.05.2016 8 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Netconf – Grundlegende Operationen und Speicherorte ● Drei Standard Konfigurationsspeicherorte – running: obligatorische Represäntation des Ist-Statusses – candidate: optional, wird zur running nach <commit> – startup: optional, Konfiguration die für den nächsten Reboot verwendet wird ● Vier wichtige Kombinationen zum Editieren je nach Kombination der Capabilities – direct (:writeable-running), direct + startup (:writeable-running + startup) – indirect (:candidate), indirect + startup (:candidate + :startup)
  • 9.
    19.05.2016 9 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Direktes Editieren :writeable-running :writeable-running + :startup
  • 10.
    19.05.2016 10 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Indirektes Editieren :candidate :candidate + startup
  • 11.
    19.05.2016 11 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de YANG – Features und Designziele ● Lesbar und leicht lernbar ● Hierarchische (Baumartige) Datenmodelle ● Wiederverwendbare Typen und Gruppen ● Erweiterbarkeit durch die Möglichkeit der Anpassung existierender Objekte ● Unterstützt die Definition von Operationen (RPCs) ● Constraints für das Validieren von Konfigurationen ● Modularität ● Versionierung ● YANG kann auch nicht XML Schema (xsd), WSDL oder RelaxNG ersetzen, denn es hat viele Merkmale, die spezifisch für das Konfigurationsmanagement sind
  • 12.
    19.05.2016 12 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Das YANG Datenmodell module acme-system { namespace "http://acme.example.com/system"; prefix "acme”; container system { leaf host-name { type string; mandatory true; config true; description "Hostname for this system”; } list interface { key "name"; description "List of interfaces in the system”; leaf name { type string; } leaf type { type string; } leaf mtu { type int32; } } } } organization "ACME Inc.”; contact "joe@acme.example.com"; description "The module for entities implementing the ACME system.”; revision 2007-11-05 { description "Initial revision.”; } Aus Karl Moberg, A 30-minute Introduction to NETCONF and YANG
  • 13.
    19.05.2016 13 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Attribute eines Leafs config Wenn false, dann ist das Leaf read-only default Default Werte mandatory Optional oder Obligatorisch must Xpath-Bedingung muss für dieses Leaf erfüllbar sein type Der Datentyp when Bedingtes Leaf. Existiert nur, wenn Xpath-Bedingung wahr ist description Beschreibung (Lesbar) reference Lesbarer Bezug auf andere Elemente oder Spezifikationen units Maßeinheit (z.B. cm, Hz, °C) status Ob das Lead 'current', 'deprecated' oder 'obsolete' ist
  • 14.
    19.05.2016 14 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de useruser namename classclassfull-namefull-nameuiduid Default list user { key name; leaf name { type string; } leaf uid { type uint32; } leaf full-name { type string; } leaf class { type string; default viewer; } } Das List Statement Aus Tail-F Tutorial: NETCONF AND YANG
  • 15.
    19.05.2016 15 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Das Leafref Statement ● Bezieht sich auf ein Element einer Liste, z.B.: ein Management Interface bezieht sich auf ein existierendes Element einer Liste von Interfaces ● Das referenzierte Element kann nicht gelöscht oder umbenannt werden ● Kann nicht null oder empty sein, das Elternleaf kann aber optional sein
  • 16.
    19.05.2016 16 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Das „rip Routing“ subsystem referenziert existierende interfaces aus der Liste interfacse. interfaceinterface addressaddressnamename 0 .. 64 container rip { list network-ifname { key ifname; leaf ifname { type leafref { path “/interface/name”; } } eth0.16 eth0.19 192.168.0.1 eth2.5 24.97.238.15 riprip network-ifnamenetwork-ifname ifnameifname eth0.19 Aus Tail-F Tutorial: NETCONF AND YANG RIP ist das Routing Information Protocol
  • 17.
    19.05.2016 17 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de 'Schmakerl' – das must Statement container timeout { leaf access-timeout { description "Maximum time without server response"; units seconds; mandatory true; type uint32; } leaf retry-timer { description "Period to retry operation"; units seconds; type uint32; must ”current() < ../access-timeout" { error-app-tag retry-timer-invalid; error-message "The retry timer must be " + "less than the access timeout"; } } }
  • 18.
    19.05.2016 18 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de 'Schmakerl' – das must Statement (2) leaf max-weight { type uint32 { range "0..1000"; } default 100; must "sum(/sys:sys/interface[enabled = 'true']/weight) < current()" { error-message "The total weight exceeds the configured max weight"; } }
  • 19.
    19.05.2016 19 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de 'Schmakerl': Das augment Statement augment /sys:system/sys:user { leaf expire { type yang:date-and-time; } } useruser namename classclassfull-namefull-nameuiduid expireexpire + Default Aus Tail-F Tutorial: NETCONF AND YANG
  • 20.
    19.05.2016 20 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de augment /sys:system/sys:user { when ”sys:class = ‘wheel’"; leaf shell { type string; } } useruser namename classclassfull-namefull-nameuiduid expireexpire + Default shellshell When 'Schmakerl': Das when Statement Aus Tail-F Tutorial: NETCONF AND YANG
  • 21.
    19.05.2016 21 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Was NETCONF und YANG nicht ist ● NETCONF ersetzt nicht COBRA/SOAP/REST, leistet jedoch eine vollständige Darstellung des Konfigurationsmanagements
  • 22.
    19.05.2016 22 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de choice transfer-method { leaf transfer-interval { description "Frequency at which file transfer happens"; type uint16 { range "15 .. 2880"; } units minutes; } leaf transfer-on-commit { description "Transfer after each commit"; type empty; } } transfer-intervaltransfer-interval transfer-on-committransfer-on-commit transfer-methodtransfer-method 'Schmakerl': Das choice Statement Aus Tail-F Tutorial: NETCONF AND YANG
  • 23.
    19.05.2016 23 Zentrum für Informations-und Medientechnologie konrad.heimel@uni-siegen.de Mein Verständnis der Beziehung von NETCONF und Openflow ● NETCONF betrifft Gerätekonfigurationen, während Openflow die Forwarding Tables modifiziert. (Was auch, aber umständlicher mit NETCONF möglich wäre) ● Aber es gibt OF-Config, welches Konfigurationen gemeinsam mit / parallel zu Openflow mittels NETCONF verwaltet, bzw. die Fähigkeiten von Openflow mittels NETCONF erweitert ● Bitte mit einem Körnchen Salz nehmen