0% found this document useful (0 votes)
50 views

Lect4 IoT NetConf Yang1

This document discusses IoT system management using NETCONF-YANG. NETCONF is an IETF network management protocol that allows configuration and retrieval of state data from network devices using XML-encoded messages over SSH. YANG is a data modeling language used to model the configuration and state data exchanged between NETCONF clients and servers. The document outlines how NETCONF provides capabilities like distinguishing configuration from state data, locking for atomic transactions, and capability discovery. It then discusses using NETCONF and YANG for IoT system management, including components like a management system, transaction manager, and data model manager.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Lect4 IoT NetConf Yang1

This document discusses IoT system management using NETCONF-YANG. NETCONF is an IETF network management protocol that allows configuration and retrieval of state data from network devices using XML-encoded messages over SSH. YANG is a data modeling language used to model the configuration and state data exchanged between NETCONF clients and servers. The document outlines how NETCONF provides capabilities like distinguishing configuration from state data, locking for atomic transactions, and capability discovery. It then discusses using NETCONF and YANG for IoT system management, including components like a management system, transaction manager, and data model manager.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

IoT System Management

with NETCONF-YANG
Presented by
Dr. Amany AbdElSamea

1
Outline

• Need for IoT Systems Management


• SNMP
• Network Operator Requirements
• NETCONF
• YANG
• IoT Systems Management with NETCONF-YANG

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)

• SNMP is a well-known and widely used network management


protocol that allows monitoring and configuring network
devices such as routers, switches, servers, printers, etc.,.

• SNMP component include


– Network Management Station (NMS)
– Managed Device
– Management Information Base (MIB)
– SNMP Agent the runs on the device.

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>

Secure Transport SSH


Common Operations
Data Manipulation Locking
• <get> • <lock>
• <get-config> • <unlock>
• <edit-config>
• <copy-config> Transaction Management
• <delete-config> • <commit> (:candidate,
• <discard-changes> :confirmed)
(:candidate) • <cancel-commit>
(:confirmed)
Session Management
• <close-session> Schema Management
• <kill-session> • <get-schema>
(:monitoring)

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

Imports & Includes

Type definitions

Configuration & Operational


data declarations

Action (RPC) & Notification declarations


IoT System Management with NETCONF-YANG

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

• Basically it’s an asynchronous multi-master


protocol based on the Serial communication,
which will allow you to communicate between
the 2 boards. Be reassured, there are libraries
that will handle all the low layers for you.
• Multi-master means that all connected
devices will be free to send data when they
want.
Raspberry Pi Arduino Serial
Communication
• The Arduino Uno board has one UART that
you can use either with a USB cable or from
the RX/TX pins (don’t use it with both at the
same time).
• On the Raspberry Pi, you can connect many
Serial devices on the USB ports. Each will have
a different device name (we’ll see how to find
them later in this tutorial). You can also use
the GPIOs (RX0/TX0) for an additional UART.
Serial via USB
Serial via GPIOs

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.

• Now, on your Raspberry Pi, a few things are required to


make the communication work.

• Connect to your Raspberry Pi, either via ssh, or by


plugin a screen+mouse+keyboard, and open a terminal.
If you haven’t installed an OS on your Pi yet, you can
install Raspbian or Ubuntu very easily on a SD card.

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’.

$ sudo adduser your_username dialout

• This will make sure you have access to Serial devices


(/dev/ttyACMx, /dev/ttyUSBx, …).

• After you’ve added yourself to the dialout group, you need


to reboot your Pi (or at least logout/login) to apply the
change
https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/
Install Python Serial library on
Raspberry Pi
• You need to install a library to be able to use the Serial
interface with Python.
• For this tutorial we’ll use the pySerial library. To install it:

python3 -m pip install pyserial

• This Python library is well-known and used in a lot of


applications.
• When installing, if you get an error such as
“/usr/bin/python3: No module named pip”, then you need
to install pip first with

sudo apt install python3-pip


Simple Serial communication from
Arduino to Raspberry Pi
Testing Serial communication

Testing Serial communication

Now, unplug your Arduino board from your computer and connect it to your
Raspberry Pi board.

The Arduino code is already running, as soon as it’s powered up.

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

Using Raspberry Pi Proteus


With a visual designer for a Raspberry Pi, you can create as well as test new
embedded products before you deploy them to real hardware. Usually, a visual
designer is unique, and it has an incredible ability to bring software and
hardware together. This allows you to simulate the embedded Raspberry Pi
system within Proteus directly.

https://www.labcenter.com/downloads/
https://www.youtube.com/watch?v=sO9Yz65dT3U
Questions

You might also like