SlideShare a Scribd company logo
1 of 37
Download to read offline
Mobile Convergence Laboratory
안계완(Gyewan An)
danielahn@khu.ac.kr
YANG 세미나
Mobile Convergence Laboratory
1
Mobile Convergence Laboratory
YANG
‣YANG is a data modeling language for the definition of data sent over the NETCONF
network configuration protocol.
‣The name is an acronym for “Yet Another Next Generation”.
‣The data modeling language can be used to model both configuration data as well as state
data of network elements.
‣The language being protocol independent can then be converted into any encoding format,
e.g. XML or JSON, that the network configuration protocol supports.
‣YANG is a modular language representing data structures in an XML tree format.
‣YANG data models can use XPATH expressions to define constraints on the elements of a
YANG data model.
Mobile Convergence Laboratory
2
Mobile Convergence LaboratoryMobile Convergence Laboratory
3
Mobile Convergence Laboratory
YANG
Mobile Convergence Laboratory
‣YANG is Data modeling language
‣Tree structure
‣Data and Types.
• Configuration Data
• State data
4
Mobile Convergence Laboratory
YANG 저장형태
Mobile Convergence Laboratory
‣ YANG 모듈은 .yang 파일로 작성된다.
‣ YANG 파일은 관리하는 지정된 경로의 yin 파일에 xml 형식으로 저장한다.
‣ 관리하는 실제 값들은 네트워크 디바이스의 datastore 경로에 xml 형태로 데이터들을 저장한다.
5
Mobile Convergence LaboratoryMobile Convergence Laboratory
Example: turing-machine.yang
6
Mobile Convergence LaboratoryMobile Convergence Laboratory
Example: turing-machine.yin
7
Mobile Convergence LaboratoryMobile Convergence Laboratory
Example: datastore.xml
8
Mobile Convergence Laboratory
YANG Module Contents
Mobile Convergence Laboratory
Header information
Imports & Includes
Type definitions
Configuration & Operational
data declarations
Action (RPC) & Notification declarations
9
Mobile Convergence Laboratory
Imports & Includes
Mobile Convergence Laboratory
Fragment
A.yang
Fragment
B.yang
Fragment
C.yang
Fragment
D.yang
Fragment
E.yang
Module X Namespace Module Y Namespace
import
include
includeinclude Submodule Z Namespace
Fragment
F.yang
10
Mobile Convergence Laboratory
YANG Header
Mobile Convergence Laboratory
11
Mobile Convergence Laboratory
YANG Types
Mobile Convergence Laboratory
12
Mobile Convergence Laboratory
YANG Base Types
Mobile Convergence Laboratory
‣YANG의 모든 데이터들은 데이터 타입을 가져야만 한다.
‣데이터 타입들은 base type 혹은 derived type이다.
• Derived type은 typedef 혹은 grouping으로 정의한다.
• Base Type은 20개 이상을 기본적으로 제공한다.
Type Name Meaning
int8/16/32/64 Integer
uint8/16/32/64 Unsigned Integer
Decimal64 Non-integer
String Unicode string
Enumeration Set of alternatives
Boolean True of false
Bits Boolean array
Binary Binary BLOB
Leafref Reference “pointer”
Identityref Unique identity
Empty No value, void
… and more
13
Mobile Convergence Laboratory
Types Statement
Mobile Convergence Laboratory
‣ 기존에 흔히 사용하는것 처럼 type define이 가능하다.
‣ type define 뿐만 아니라 type restrict 역시 가능하다.
typedef percent {
type uint16 {
range “0 .. 100”;
}
description “Percentage”;
}
14
Mobile Convergence Laboratory
Types Statement (Cont’d)
Mobile Convergence Laboratory
• Integers • Strings
typedef my-base-int32-type {
type int32 {
range “1..4 | 10..20”;
}
}
typedef derived-int32 {
type my-base-int32-type {
range “11..max”;
}
}
typedef my-base-str-type {
type string {
length “1..255”;
}
}
typedef derived-str {
type my-base-str-type {
length “11 | 42..max”;
pattern “[0-0a-fA-F]*”;
}
}
15
Mobile Convergence Laboratory
Types Statement (Cont’d)
Mobile Convergence Laboratory
• Union Statement
typedef threshold {
description “Threshold value in percent”;
type union {
type uint16 {
range “0..100”;
}
type enumeration {
enum disabled {
description “No threshold”;
}
}
}
}
*유니언 타입 멤버중 한개만이 이 데이터를 나타낸다
16
Mobile Convergence Laboratory
Types Statement (Cont’d)
Mobile Convergence Laboratory
• Grouping Statement
grouping target {
leaf address {
type inet:ip-address;
}
leaf port {
type inet:port-number;
}
}
container peer {
container destination {
uses target;
}
}
17
Mobile Convergence Laboratory
Types Statement (Cont’d)
Mobile Convergence Laboratory
• Grouping Statement
grouping target {
leaf address {
type inet:ip-address;
}
leaf port {
type inet:port-number;
}
}
*refine도 할 수 있다.
container servers {
container http {
uses target {
refine port {
default 80;
}
}
}
}
18
Mobile Convergence Laboratory
Common YANG Types
Mobile Convergence Laboratory
‣ 많이 사용되는 데이터 타입들은 고맙게도 RFC 6021에서
정의 되어 있고, 제공을 한다.
• 사용하기 위해선 import 한 후에 해야한다.
import “ietf-yang-types” {
prefix yang;
}
사용하기 위해선 아래와 같이 사용하면된다.
type yang:counter64
counter32/64 ipv4-address
gauge32/64 ipv6-address
object-identifier ip-prefix
date-and-time ipv4-prefix
timeticks ipv6-prefix
timestamp domain-name
phys-address uri
ip-version mac-address
flow-label bridgeid
port-number vlanid
ip-address … and more
19
Mobile Convergence Laboratory
YANG Data Definitions
Mobile Convergence Laboratory
20
Mobile Convergence Laboratory
Leaf Statement
Mobile Convergence Laboratory
‣ 특정 타입을 가지는 하나의 Data 값.
‣ child 노드를 가지지 않는다.
leaf host-name {
type string;
mandatory true;
config true;
description “Hostname for this system”;
}
leaf cpu-temp {
type int32;
units degrees-celsius;
config false;
description “Current temperature in CPU”;
}
21
Mobile Convergence Laboratory
Attributes for leaf
Mobile Convergence Laboratory
config
Whether this leaf is configurable value (“true”) or operational value (“false”).
Inherited from parent container if not specified
default Specifies default value for this leaf. Implies that leaf is optional
mandatory Whether the leaf is mandatory (“true”) or optional (“false”)
must XPath constraint that will be enforced for this leaf
type The data type (and range etc) of this leaf
when Conditional leaf, only present if Path expression is true
description Human readable definition and help text for this leaf
reference Human readable reference to some other element or spec
units Human readable unit specification (e.g. Hz, MB/s, )
status Whether this leaf is “current”, “deprecated” or “obsolete”
22
Mobile Convergence Laboratory
Container Statement
Mobile Convergence Laboratory
‣ 관련된 leaf 혹은 container 들끼리의
group인 데이터 타입.
container system {
container services {
container ssh {
presence “Enables SSH”;
description “blahblah”;
// more leafs, container and etc.
}
}
}
23
Mobile Convergence Laboratory
Leaf-list Statement
Mobile Convergence Laboratory
‣ 특정 타입을 가지는 하나의 Data 값.
‣ child 노드를 가지지 않는다.
‣ list 형태로 여러개를 가질 수 있다.
leaf-list domain-search {
type string;
ordered-by user;
description “List of domain names to search”;
}
24
Mobile Convergence Laboratory
List Statement
Mobile Convergence Laboratory
‣ List구조를 가진다.
‣ Key가 존재.
‣ Key를 이용해 리스트의 data에 접근할 수 있다.
( e.g. /user[uid=‘1000’]/name = yang)
‣ Unique를 이용해서 유일한 값을 가지게 할 수도 있다.
‣ Multiple key도 가능.
list user {
key uid;
unique name;
leaf name {
type string;
}
leaf uid {
type uint32;
}
leaf full-name {
type string;
}
leaf class {
type string;
default viewer;
}
}
25
Mobile Convergence Laboratory
Leafref
Mobile Convergence Laboratory
‣ 이미 존재하는 다른 leaf를 참조하는 pointer 타입.
‣ A valid leafref는 절대로 null 이나 empty가 될 수 없지
만, pearent leaf가 optional 할 수 있다.
‣ leafref로 지정된 값은 지워지거나 이름이 바뀌면 안된다.
‣ system이 leafref의 validity를 자동적으로 체크한다.
‣ XPath Operator도 사용이 가능하다
(e.g. path “/client[ip=current()/../v-ip]/port”)
container user {
list network-ifname {
key ifname;
leaf ifname {
type leafref {
path “/interface/name”;
}
}
}
26
Mobile Convergence Laboratory
YANG RPC & Notifications
Mobile Convergence Laboratory
27
Mobile Convergence Laboratory
RPC Statement
Mobile Convergence Laboratory
‣ input 과 output parameter를 정해
RPC를 정의할 수 있다.
rpc activate-software-image {
input {
leaf image {
type binary;
}
}
output {
leaf status {
type string;
}
}
}
28
Mobile Convergence Laboratory
Notification Statement
Mobile Convergence Laboratory
‣ output만이 존재한다.
‣ 여러 parameter 를 이용해 정의.
notification config-change {
description “blahblah”
leaf operator-name {
type string;
}
leaf-list change{
type instance-identifier;
}
}
29
Mobile Convergence Laboratory
Advanced YANG statements
Mobile Convergence Laboratory
30
Mobile Convergence Laboratory
Must Statement
Mobile Convergence Laboratory
‣ 반드시 정의되어야 하는 조건이 있을 때 사용한다.
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”
}
}
31
Mobile Convergence Laboratory
Augment Statement
Mobile Convergence Laboratory
‣ 기존의 정의된 list에 추가하려할 때 사용한다.
augment /sys:system/sys:user {
leaf expire {
type yang:date-and-time;
}
}
32
Mobile Convergence Laboratory
When Statement
Mobile Convergence Laboratory
‣ 조건문을 추가해주는 용도.
augment /sys:system/sys:user {
when “sys:class = ‘whell’ “;
leaf shell {
type string;
}
}
33
Mobile Convergence Laboratory
Choice Statement
Mobile Convergence Laboratory
‣ 여러 종류의 leaf 들을 사용할 수 있게 해준다.
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 “Frequency at which file transfer happens”;
type empty;
}
}
34
Mobile Convergence Laboratory
Identity Statement
Mobile Convergence Laboratory
module phys-if {
…
identity ethernet {
description “blahblah”;
}
identity eth-1G {
base ethernet;
description “blahblah”;
}
identity eth-10G {
base ethernet;
description “blahblah”;
}
}
35
‣ Identities for modeling families of related enumeration constants
module newer {
…
identity eth-40G {
base phys-if:ethernet;
description “blahblah”;
}
…
leaf eth-type {
type identityref {
base ”phys-if:ethernet”;
description “blahblah”;
}
}
Mobile Convergence LaboratoryMobile Convergence Laboratory
‣ hardware 같은 조건들을 mark 하여준다. 한다.
feature has-local-disk {
description
“System has a local file system
that can be used for storing log files”;
}
container system {
container logging {
if-feature has-local-disk;
presence “Logging enabled”;
leaf buffer-size {
type filesize;
}
}
}
36
Feature Statement
Mobile Convergence LaboratoryMobile Convergence Laboratory
‣ System should conform to standard YAMs.
deviation /base:system/base:user/base:type {
deviate add {
default “admin”; // new users are ‘admin’ by default
}
}
deviation /base:system/base:name-server {
deviate replace {
max-elements 3;
}
}
37
Deviations

More Related Content

What's hot

ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection7mind
 
The hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixThe hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixRicardo Santos
 
Java IO Streams V4
Java IO Streams V4Java IO Streams V4
Java IO Streams V4Sunil OS
 
The Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingThe Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingJosé Paumard
 
BGP Graceful Shutdown - IOS XR
BGP Graceful Shutdown - IOS XR BGP Graceful Shutdown - IOS XR
BGP Graceful Shutdown - IOS XR Bertrand Duvivier
 
Huawei cisco command conversion
Huawei cisco command conversionHuawei cisco command conversion
Huawei cisco command conversionjames Omara
 
Asignación de bloques de direcciones IPv6
Asignación de bloques de direcciones IPv6Asignación de bloques de direcciones IPv6
Asignación de bloques de direcciones IPv6Educática
 
Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File HandlingSunil OS
 
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONArun Sial
 
OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGTail-f Systems
 
Eng. Johor Alam Presentation Slide on icinga 2
Eng. Johor Alam Presentation Slide on icinga 2Eng. Johor Alam Presentation Slide on icinga 2
Eng. Johor Alam Presentation Slide on icinga 2Eng. Johor Alam
 
Full Stack Web Development.pptx
Full Stack Web Development.pptxFull Stack Web Development.pptx
Full Stack Web Development.pptxDineshGokuladas
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondMario Fusco
 
Open network operating system (onos)
Open network operating system (onos)Open network operating system (onos)
Open network operating system (onos)Ameer Sameer
 
Lab- Full IPsec Implementation.pdf
Lab- Full IPsec Implementation.pdfLab- Full IPsec Implementation.pdf
Lab- Full IPsec Implementation.pdfNesibusami
 

What's hot (20)

ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
The hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixThe hidden power of network maps on Zabbix
The hidden power of network maps on Zabbix
 
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
 
Java IO Streams V4
Java IO Streams V4Java IO Streams V4
Java IO Streams V4
 
The Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingThe Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern Matching
 
Jdbc
JdbcJdbc
Jdbc
 
BGP Graceful Shutdown - IOS XR
BGP Graceful Shutdown - IOS XR BGP Graceful Shutdown - IOS XR
BGP Graceful Shutdown - IOS XR
 
Huawei cisco command conversion
Huawei cisco command conversionHuawei cisco command conversion
Huawei cisco command conversion
 
Juniper
JuniperJuniper
Juniper
 
Asignación de bloques de direcciones IPv6
Asignación de bloques de direcciones IPv6Asignación de bloques de direcciones IPv6
Asignación de bloques de direcciones IPv6
 
Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File Handling
 
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
 
OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANG
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
 
Eng. Johor Alam Presentation Slide on icinga 2
Eng. Johor Alam Presentation Slide on icinga 2Eng. Johor Alam Presentation Slide on icinga 2
Eng. Johor Alam Presentation Slide on icinga 2
 
Full Stack Web Development.pptx
Full Stack Web Development.pptxFull Stack Web Development.pptx
Full Stack Web Development.pptx
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyond
 
Open network operating system (onos)
Open network operating system (onos)Open network operating system (onos)
Open network operating system (onos)
 
Lab- Full IPsec Implementation.pdf
Lab- Full IPsec Implementation.pdfLab- Full IPsec Implementation.pdf
Lab- Full IPsec Implementation.pdf
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
 

Viewers also liked

netconf, restconf, grpc_basic
netconf, restconf, grpc_basicnetconf, restconf, grpc_basic
netconf, restconf, grpc_basicGyewan An
 
KhuHub student guideline
KhuHub student guidelineKhuHub student guideline
KhuHub student guidelinesangyun han
 
OpenWRT/Hostapd with ONOS
OpenWRT/Hostapd with ONOSOpenWRT/Hostapd with ONOS
OpenWRT/Hostapd with ONOSsangyun han
 
XOS in open CORD project
XOS in open CORD projectXOS in open CORD project
XOS in open CORD projectsangyun han
 
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발sangyun han
 
Introduction of ONOS and core technology
Introduction of ONOS and core technologyIntroduction of ONOS and core technology
Introduction of ONOS and core technologysangyun han
 
ONOS - setting, configuration, installation, and test
ONOS - setting, configuration, installation, and testONOS - setting, configuration, installation, and test
ONOS - setting, configuration, installation, and testsangyun han
 
[SoftCon]SDN/IoT 그리고 Testbed
[SoftCon]SDN/IoT 그리고 Testbed[SoftCon]SDN/IoT 그리고 Testbed
[SoftCon]SDN/IoT 그리고 Testbedsangyun han
 
Introduction to CORD project
Introduction to CORD projectIntroduction to CORD project
Introduction to CORD projectsangyun han
 
ONOS - multiple instance setting(Distributed SDN Controller)
ONOS - multiple instance setting(Distributed SDN Controller)ONOS - multiple instance setting(Distributed SDN Controller)
ONOS - multiple instance setting(Distributed SDN Controller)sangyun han
 
Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)sangyun han
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Cisco DevNet
 

Viewers also liked (12)

netconf, restconf, grpc_basic
netconf, restconf, grpc_basicnetconf, restconf, grpc_basic
netconf, restconf, grpc_basic
 
KhuHub student guideline
KhuHub student guidelineKhuHub student guideline
KhuHub student guideline
 
OpenWRT/Hostapd with ONOS
OpenWRT/Hostapd with ONOSOpenWRT/Hostapd with ONOS
OpenWRT/Hostapd with ONOS
 
XOS in open CORD project
XOS in open CORD projectXOS in open CORD project
XOS in open CORD project
 
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발
ONOS와 Raspberry Pi 기반 가상물리 SDN 실증 환경 구축과 응용 개발
 
Introduction of ONOS and core technology
Introduction of ONOS and core technologyIntroduction of ONOS and core technology
Introduction of ONOS and core technology
 
ONOS - setting, configuration, installation, and test
ONOS - setting, configuration, installation, and testONOS - setting, configuration, installation, and test
ONOS - setting, configuration, installation, and test
 
[SoftCon]SDN/IoT 그리고 Testbed
[SoftCon]SDN/IoT 그리고 Testbed[SoftCon]SDN/IoT 그리고 Testbed
[SoftCon]SDN/IoT 그리고 Testbed
 
Introduction to CORD project
Introduction to CORD projectIntroduction to CORD project
Introduction to CORD project
 
ONOS - multiple instance setting(Distributed SDN Controller)
ONOS - multiple instance setting(Distributed SDN Controller)ONOS - multiple instance setting(Distributed SDN Controller)
ONOS - multiple instance setting(Distributed SDN Controller)
 
Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
 

Similar to Yang detail introduction

Oracle plsql and d2 k interview questions
Oracle plsql and d2 k interview questionsOracle plsql and d2 k interview questions
Oracle plsql and d2 k interview questionsArunkumar Gurav
 
javascript
javascript javascript
javascript Kaya Ota
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
Overview of c language
Overview of c languageOverview of c language
Overview of c languageshalini392
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentalsHCMUTE
 
Declarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTDeclarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTLaura Chiticariu
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Soham Kulkarni
 
Impl reference manual_for_quantities
Impl reference manual_for_quantitiesImpl reference manual_for_quantities
Impl reference manual_for_quantitiesAlkis Vazacopoulos
 
Computational Problem Solving 016 (1).pptx
Computational Problem Solving 016 (1).pptxComputational Problem Solving 016 (1).pptx
Computational Problem Solving 016 (1).pptx320126552027SURAKATT
 
Oracle plsql and d2 k interview question1
Oracle plsql and d2 k interview question1Oracle plsql and d2 k interview question1
Oracle plsql and d2 k interview question1Arunkumar Gurav
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsJudy Breedlove
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesJamund Ferguson
 
Presentation1
Presentation1Presentation1
Presentation1Jay Patel
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typedhruv patel
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy
 

Similar to Yang detail introduction (20)

Oracle plsql and d2 k interview questions
Oracle plsql and d2 k interview questionsOracle plsql and d2 k interview questions
Oracle plsql and d2 k interview questions
 
javascript
javascript javascript
javascript
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 
Variables and Data Types
Variables and Data TypesVariables and Data Types
Variables and Data Types
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Declarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTDeclarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemT
 
Json
JsonJson
Json
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
 
Impl reference manual_for_quantities
Impl reference manual_for_quantitiesImpl reference manual_for_quantities
Impl reference manual_for_quantities
 
Text processing by Rj
Text processing by RjText processing by Rj
Text processing by Rj
 
ORM JPA
ORM JPAORM JPA
ORM JPA
 
Computational Problem Solving 016 (1).pptx
Computational Problem Solving 016 (1).pptxComputational Problem Solving 016 (1).pptx
Computational Problem Solving 016 (1).pptx
 
Oracle plsql and d2 k interview question1
Oracle plsql and d2 k interview question1Oracle plsql and d2 k interview question1
Oracle plsql and d2 k interview question1
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
 
Unit 1
Unit  1Unit  1
Unit 1
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax Trees
 
Presentation1
Presentation1Presentation1
Presentation1
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoC
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Yang detail introduction

  • 1. Mobile Convergence Laboratory 안계완(Gyewan An) danielahn@khu.ac.kr YANG 세미나 Mobile Convergence Laboratory 1
  • 2. Mobile Convergence Laboratory YANG ‣YANG is a data modeling language for the definition of data sent over the NETCONF network configuration protocol. ‣The name is an acronym for “Yet Another Next Generation”. ‣The data modeling language can be used to model both configuration data as well as state data of network elements. ‣The language being protocol independent can then be converted into any encoding format, e.g. XML or JSON, that the network configuration protocol supports. ‣YANG is a modular language representing data structures in an XML tree format. ‣YANG data models can use XPATH expressions to define constraints on the elements of a YANG data model. Mobile Convergence Laboratory 2
  • 3. Mobile Convergence LaboratoryMobile Convergence Laboratory 3
  • 4. Mobile Convergence Laboratory YANG Mobile Convergence Laboratory ‣YANG is Data modeling language ‣Tree structure ‣Data and Types. • Configuration Data • State data 4
  • 5. Mobile Convergence Laboratory YANG 저장형태 Mobile Convergence Laboratory ‣ YANG 모듈은 .yang 파일로 작성된다. ‣ YANG 파일은 관리하는 지정된 경로의 yin 파일에 xml 형식으로 저장한다. ‣ 관리하는 실제 값들은 네트워크 디바이스의 datastore 경로에 xml 형태로 데이터들을 저장한다. 5
  • 6. Mobile Convergence LaboratoryMobile Convergence Laboratory Example: turing-machine.yang 6
  • 7. Mobile Convergence LaboratoryMobile Convergence Laboratory Example: turing-machine.yin 7
  • 8. Mobile Convergence LaboratoryMobile Convergence Laboratory Example: datastore.xml 8
  • 9. Mobile Convergence Laboratory YANG Module Contents Mobile Convergence Laboratory Header information Imports & Includes Type definitions Configuration & Operational data declarations Action (RPC) & Notification declarations 9
  • 10. Mobile Convergence Laboratory Imports & Includes Mobile Convergence Laboratory Fragment A.yang Fragment B.yang Fragment C.yang Fragment D.yang Fragment E.yang Module X Namespace Module Y Namespace import include includeinclude Submodule Z Namespace Fragment F.yang 10
  • 11. Mobile Convergence Laboratory YANG Header Mobile Convergence Laboratory 11
  • 12. Mobile Convergence Laboratory YANG Types Mobile Convergence Laboratory 12
  • 13. Mobile Convergence Laboratory YANG Base Types Mobile Convergence Laboratory ‣YANG의 모든 데이터들은 데이터 타입을 가져야만 한다. ‣데이터 타입들은 base type 혹은 derived type이다. • Derived type은 typedef 혹은 grouping으로 정의한다. • Base Type은 20개 이상을 기본적으로 제공한다. Type Name Meaning int8/16/32/64 Integer uint8/16/32/64 Unsigned Integer Decimal64 Non-integer String Unicode string Enumeration Set of alternatives Boolean True of false Bits Boolean array Binary Binary BLOB Leafref Reference “pointer” Identityref Unique identity Empty No value, void … and more 13
  • 14. Mobile Convergence Laboratory Types Statement Mobile Convergence Laboratory ‣ 기존에 흔히 사용하는것 처럼 type define이 가능하다. ‣ type define 뿐만 아니라 type restrict 역시 가능하다. typedef percent { type uint16 { range “0 .. 100”; } description “Percentage”; } 14
  • 15. Mobile Convergence Laboratory Types Statement (Cont’d) Mobile Convergence Laboratory • Integers • Strings typedef my-base-int32-type { type int32 { range “1..4 | 10..20”; } } typedef derived-int32 { type my-base-int32-type { range “11..max”; } } typedef my-base-str-type { type string { length “1..255”; } } typedef derived-str { type my-base-str-type { length “11 | 42..max”; pattern “[0-0a-fA-F]*”; } } 15
  • 16. Mobile Convergence Laboratory Types Statement (Cont’d) Mobile Convergence Laboratory • Union Statement typedef threshold { description “Threshold value in percent”; type union { type uint16 { range “0..100”; } type enumeration { enum disabled { description “No threshold”; } } } } *유니언 타입 멤버중 한개만이 이 데이터를 나타낸다 16
  • 17. Mobile Convergence Laboratory Types Statement (Cont’d) Mobile Convergence Laboratory • Grouping Statement grouping target { leaf address { type inet:ip-address; } leaf port { type inet:port-number; } } container peer { container destination { uses target; } } 17
  • 18. Mobile Convergence Laboratory Types Statement (Cont’d) Mobile Convergence Laboratory • Grouping Statement grouping target { leaf address { type inet:ip-address; } leaf port { type inet:port-number; } } *refine도 할 수 있다. container servers { container http { uses target { refine port { default 80; } } } } 18
  • 19. Mobile Convergence Laboratory Common YANG Types Mobile Convergence Laboratory ‣ 많이 사용되는 데이터 타입들은 고맙게도 RFC 6021에서 정의 되어 있고, 제공을 한다. • 사용하기 위해선 import 한 후에 해야한다. import “ietf-yang-types” { prefix yang; } 사용하기 위해선 아래와 같이 사용하면된다. type yang:counter64 counter32/64 ipv4-address gauge32/64 ipv6-address object-identifier ip-prefix date-and-time ipv4-prefix timeticks ipv6-prefix timestamp domain-name phys-address uri ip-version mac-address flow-label bridgeid port-number vlanid ip-address … and more 19
  • 20. Mobile Convergence Laboratory YANG Data Definitions Mobile Convergence Laboratory 20
  • 21. Mobile Convergence Laboratory Leaf Statement Mobile Convergence Laboratory ‣ 특정 타입을 가지는 하나의 Data 값. ‣ child 노드를 가지지 않는다. leaf host-name { type string; mandatory true; config true; description “Hostname for this system”; } leaf cpu-temp { type int32; units degrees-celsius; config false; description “Current temperature in CPU”; } 21
  • 22. Mobile Convergence Laboratory Attributes for leaf Mobile Convergence Laboratory config Whether this leaf is configurable value (“true”) or operational value (“false”). Inherited from parent container if not specified default Specifies default value for this leaf. Implies that leaf is optional mandatory Whether the leaf is mandatory (“true”) or optional (“false”) must XPath constraint that will be enforced for this leaf type The data type (and range etc) of this leaf when Conditional leaf, only present if Path expression is true description Human readable definition and help text for this leaf reference Human readable reference to some other element or spec units Human readable unit specification (e.g. Hz, MB/s, ) status Whether this leaf is “current”, “deprecated” or “obsolete” 22
  • 23. Mobile Convergence Laboratory Container Statement Mobile Convergence Laboratory ‣ 관련된 leaf 혹은 container 들끼리의 group인 데이터 타입. container system { container services { container ssh { presence “Enables SSH”; description “blahblah”; // more leafs, container and etc. } } } 23
  • 24. Mobile Convergence Laboratory Leaf-list Statement Mobile Convergence Laboratory ‣ 특정 타입을 가지는 하나의 Data 값. ‣ child 노드를 가지지 않는다. ‣ list 형태로 여러개를 가질 수 있다. leaf-list domain-search { type string; ordered-by user; description “List of domain names to search”; } 24
  • 25. Mobile Convergence Laboratory List Statement Mobile Convergence Laboratory ‣ List구조를 가진다. ‣ Key가 존재. ‣ Key를 이용해 리스트의 data에 접근할 수 있다. ( e.g. /user[uid=‘1000’]/name = yang) ‣ Unique를 이용해서 유일한 값을 가지게 할 수도 있다. ‣ Multiple key도 가능. list user { key uid; unique name; leaf name { type string; } leaf uid { type uint32; } leaf full-name { type string; } leaf class { type string; default viewer; } } 25
  • 26. Mobile Convergence Laboratory Leafref Mobile Convergence Laboratory ‣ 이미 존재하는 다른 leaf를 참조하는 pointer 타입. ‣ A valid leafref는 절대로 null 이나 empty가 될 수 없지 만, pearent leaf가 optional 할 수 있다. ‣ leafref로 지정된 값은 지워지거나 이름이 바뀌면 안된다. ‣ system이 leafref의 validity를 자동적으로 체크한다. ‣ XPath Operator도 사용이 가능하다 (e.g. path “/client[ip=current()/../v-ip]/port”) container user { list network-ifname { key ifname; leaf ifname { type leafref { path “/interface/name”; } } } 26
  • 27. Mobile Convergence Laboratory YANG RPC & Notifications Mobile Convergence Laboratory 27
  • 28. Mobile Convergence Laboratory RPC Statement Mobile Convergence Laboratory ‣ input 과 output parameter를 정해 RPC를 정의할 수 있다. rpc activate-software-image { input { leaf image { type binary; } } output { leaf status { type string; } } } 28
  • 29. Mobile Convergence Laboratory Notification Statement Mobile Convergence Laboratory ‣ output만이 존재한다. ‣ 여러 parameter 를 이용해 정의. notification config-change { description “blahblah” leaf operator-name { type string; } leaf-list change{ type instance-identifier; } } 29
  • 30. Mobile Convergence Laboratory Advanced YANG statements Mobile Convergence Laboratory 30
  • 31. Mobile Convergence Laboratory Must Statement Mobile Convergence Laboratory ‣ 반드시 정의되어야 하는 조건이 있을 때 사용한다. 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” } } 31
  • 32. Mobile Convergence Laboratory Augment Statement Mobile Convergence Laboratory ‣ 기존의 정의된 list에 추가하려할 때 사용한다. augment /sys:system/sys:user { leaf expire { type yang:date-and-time; } } 32
  • 33. Mobile Convergence Laboratory When Statement Mobile Convergence Laboratory ‣ 조건문을 추가해주는 용도. augment /sys:system/sys:user { when “sys:class = ‘whell’ “; leaf shell { type string; } } 33
  • 34. Mobile Convergence Laboratory Choice Statement Mobile Convergence Laboratory ‣ 여러 종류의 leaf 들을 사용할 수 있게 해준다. 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 “Frequency at which file transfer happens”; type empty; } } 34
  • 35. Mobile Convergence Laboratory Identity Statement Mobile Convergence Laboratory module phys-if { … identity ethernet { description “blahblah”; } identity eth-1G { base ethernet; description “blahblah”; } identity eth-10G { base ethernet; description “blahblah”; } } 35 ‣ Identities for modeling families of related enumeration constants module newer { … identity eth-40G { base phys-if:ethernet; description “blahblah”; } … leaf eth-type { type identityref { base ”phys-if:ethernet”; description “blahblah”; } }
  • 36. Mobile Convergence LaboratoryMobile Convergence Laboratory ‣ hardware 같은 조건들을 mark 하여준다. 한다. feature has-local-disk { description “System has a local file system that can be used for storing log files”; } container system { container logging { if-feature has-local-disk; presence “Logging enabled”; leaf buffer-size { type filesize; } } } 36 Feature Statement
  • 37. Mobile Convergence LaboratoryMobile Convergence Laboratory ‣ System should conform to standard YAMs. deviation /base:system/base:user/base:type { deviate add { default “admin”; // new users are ‘admin’ by default } } deviation /base:system/base:name-server { deviate replace { max-elements 3; } } 37 Deviations