Lect4 IoT NetConf Yang1
Lect4 IoT NetConf Yang1
with NETCONF-YANG
Presented by
Dr. Amany AbdElSamea
1
Outline
2
Need for IoT Systems Management
• Automating Configuration
• Monitoring Operational & Statistical Data
• Improved Reliability
• System Wide Configurations
• Multiple System Configurations
• Retrieving & Reusing Configurations
3
What is a Data-Model? What is a Network
Management Protocol?
Data-Model
A data-model explicitly and precisely
Protocol
determines the structure, syntax and
semantics of the data…
…that is externally visible
Data-Model Consistent and complete
Protocol
Remote primitives to view and
manipulate the data
Encoding of the data as defined by the
data-model
4
Simple Network Management Protocol
(SNMP)
5
Limitations of SNMP
• SNMP is stateless in nature and each SNMP request contains all the
information to process the request. The application needs to be
intelligent to manage the device.
• SNMP is a connectionless protocol which uses UDP as the
transport protocol, making it unreliable as there was no support
for acknowledgement of requests.
• It is difficult to differentiate between configuration and state data
in MIBs
• Retrieving the current configuration from a device can be difficult
with SNMP.
• Earlier versions of SNMP did not have strong security features
6
Network Operator Requirements
• Ease of use
• Distinction between configuration and state data
• Configuration of the network as a whole
• Configuration transactions across devices
• Consistency of access control lists
• Support for both data-oriented and task-oriented access control
7
NETCONF
• IETF network management protocol
• Network Configuration Protocol (NETCONF) is a
session-based network management protocol.
• Distinction between configuration and state data
• NETCONF works on SSH protocol.
• NETCONF uses XML-encoded Remote Procedure Calls
(RPCs) for framing request and response messages.
The RPC layer provides mechanism for encoding of
RPC calls and notifications.
• NETCONF provides various operations to retrieve and
edit configuration data from network devices
• The schema of the configuration and state data is
defined in a data modeling language called yang.
• NETCONF provides a clear separation of the
configuration and state data
• The configuration data resides within a NETCONF
configuration data store on the server.
Why you should care:
NETCONF provides the fundamental programming features
for comfortable and robust automation of network services
NETCONF Features
Client
Application
API to configure network devices
XML RPC mechanism
Connection-oriented (SSH)
Closely mirrors the device functionality
Capability Discovery
Separation of configuration and state data
Server
Device
Layers
Config Notification
Content
Data Data
<EDIT-CONFIG>
Operations
<GET-CONFIG>
<RPC>
Messages <NOTIFICATION>
<RPC-REPLY>
RPC Extensions
YANG
• Yang is a data modeling language used to model acme-box
configuration and state data manipulated by NETCONF module
protocol
• Yang modules contain the definitions of the configuration properties
data, state data, RPC calls that can be issued and the format container
of the notifications
• Yang modules defines the data exchanged between the name: string, config
NETCONF client and server
• A module comprises of number of leaf nodes which are
interfaces
organized into hierarchical tree structure
container
• The leaf nodes are specified using the ‘leaf’ or ‘leaf-list’
constructs interface: list,
• Leaf nodes are organized using containers or list constructs index = name
• A YANG module can import definitions from other modules name: string, config
• Yang can model both configuration data and state data
using the ‘config’ statement.
oper-state: enum
YANG Module Contents
Header information
Type definitions
1) Management System
2) Management API
3) Transaction Manager
4) Rollback
5) Data Model Manager
6) Configuration Validator
7) Configuration Database
8) Configuration API
9) Data Provider API
SNMP vs. NETCONF
Raspberry Pi + Arduino
Serial Communication
• Serial communication is simply a way to transfer
data. The data will be sent sequentially, one bit at
a time (1 byte = 8 bits), contrary to parallel
communication, where many bits are sent at the
same time.
UART protocol
• More specifically, when you use Serial with
Arduino and Raspberry Pi, you’re using the UART
protocol. UART means “Universal Asynchronous
Reception and Transmission”.
UART protocol
https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/
Raspberry Pi Software setup
• You don’t need any special setup for Arduino. Just make
sure you have downloaded and installed the Arduino
IDE.
https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/
Detect the Arduino board
• When connecting the Arduino with a USB cable, you should
see it appear as /dev/ttyACM0, or /dev/ttyUSB0 (sometimes
the number can be different, for example /dev/ttyACM1).
Simply run
ls /dev/tty*
and you should see it. At this point if you’re not sure which
device is the Arduino board, simply disconnect the board
(remove the USB cable), and run ls /dev/tty*
• again. This way you will easily spot the serial device name of
your Arduino.
https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/
Hardware permissions for Serial
• Also, you may want to add your user to the dialout group, to
avoid errors such as: serial.serialutil.SerialException: [Errno
13] could not open port /dev/ttyACM0: [Errno 13]
Permission denied: ‘/dev/ttyACM0’.
Now, unplug your Arduino board from your computer and connect it to your
Raspberry Pi board.
On the Raspberry Pi, make the Python file executable and launch it.
$ chmod +x receive_serial_data_from_arduino.py
$ ./receive_serial_data_from_arduino.py
Hello from Arduino!
Hello from Arduino!
Hello from Arduino!
Bidirectional Serial communication
between Raspberry Pi and Arduino
You’ve seen how to send data from Arduino to Raspberry Pi. In this part you’ll see how
to talk from Raspberry Pi to Arduino.
Testing Bidirectional Serial
communication
Proteus Simulator
https://www.labcenter.com/downloads/
https://www.youtube.com/watch?v=sO9Yz65dT3U
Questions