Okay friends, big topic coming up. What we're going to talk about now is data
modeling.
Now this might sound like a peculiar term. How on earth is data going to be
walking in the runway
on a catwalk? Obviously this is not what we're going to be talking about. Data
modeling is actually
all over the place. The issue we have though is that we want to introduce it
into the network
basically for network automation. So I just kind of hinted at the fact that
data modeling is all
over the place. Let me give you my favorite example to highlight this. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
over the place. Let me give you my favorite example to highlight this.
Something that really
does stick to a very strict model. Now suppose you want to go traveling abroad.
What is the one
thing you are told never to forget? It's very, very important. You in order to
get abroad need to
provide a passport. Now this passport is going to be chock full of some very
important information.
Now this information is not just going to be random. It's going to strictly
follow a particular
data model. Basically what I'm talking about, that's in order for a passport to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
data model. Basically what I'm talking about, that's in order for a passport to
be valid to be accepted
by customs. Well it's got to have certain characteristics. So the first
characteristic would be you're
going to have to have some type of photograph on this. After all if you try to
get into a country with
a passport that has no picture, good luck doing that. You'll be sent on your
way and told to turn
right by it. Now say for example me, I have a passport in the United Kingdom,
the UK. So let me just
show you my Bob Ross skills and I'll do a little drawing right here. Okay. Now
the passport here
is going to have a picture roundabout here. Okay so this is me right here. Now WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
is going to have a picture roundabout here. Okay so this is me right here. Now
the fact of the matter
is that everyone with the UK passport is going to have a similar looking thing.
We're going to have a
picture on the left hand side and it's going to be the same size. For example
if someone in the UK
happened to have a passport whereby their picture would just randomly appear.
Well that's not going
to be a valid passport and you're not going to get where you want to go. Now it
's not just that.
What I'm also going to see on the passport are things such as my date of birth.
This is obviously
very very important. Now it's not just important that we have the date of birth WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
very very important. Now it's not just important that we have the date of birth
in the actual passport.
The way the actual data is presented must comply with a particular format. Say
for example you were
maybe born on the 15th of September 1987. Well that information could be
presented like so. 15,
7, 87. And the point I'm making here is that this is going to be a consistent
format. You're not going
to have some passport utilizing this format whereas other passports are doing
you know the first of
January 1985. Okay completely different. This one here has four digits as well WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
January 1985. Okay completely different. This one here has four digits as well
as we're utilizing
numerical values to denote the month as opposed to saying a shorthand of the
month like
Jan or Feb that type of thing. So once again if we are not following this very
consistent and precise
format the passport is going to be deemed invalid. Similarly you're not just
going to get random
data that is unexpected like a random email address just slapped on someone's
passport randomly.
We know that this is not part of the specifications within the passport. There WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We know that this is not part of the specifications within the passport. There
are for
there's no reason to see this particular piece of data on it at all. Now
ultimately what this does
it brings about consistency and reliability. Okay there is no ambiguity we know
exactly the
information we're looking for and when we see it we can easily assess it. These
are good things
and this is the type of thing we want in the network hence why we are now
moving towards data
modeling. Now in the world of network automation there actually is a particular
data modeling language
that seems to be the primary way to do this and this is something known as Yang WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
that seems to be the primary way to do this and this is something known as Yang
. So you know the way
we've talked about previously the challenges automating things like the CLI
that do not have
modern interfaces. Pretty much because our old devices were not designed with
automation in
mind while the newer iteration of devices the new generation of devices coming
out from all of
these vendors such as Cisco but they now have more modern interfaces that are
used to manage them
things like netcon and things like restconned both of which we'll get to look
at a little bit later
on within this course. But ultimately these two protocols which are used to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
on within this course. But ultimately these two protocols which are used to
manage your devices
in a programmatic manner they both are heavily relied on the Yang data modeling
language so
pretty much all of our configurations and all of our state data within our
devices are modeled
utilizing Yang. Now let me just highlight the benefits first by highlighting
the shortcomings of
the CLI. Well think about the CLI as it stands right now the CLI has a lot of
variation between
different vendors. Say for example Cisco syntax is completely different to Jun WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
different vendors. Say for example Cisco syntax is completely different to Jun
iper syntax and even
within vendors themselves. Cisco's iOS XR configurations are very very
different from the regular old
Cisco iOS legacy CLI configurations. The Y is actually a problem while when it
comes to automation
we want things to be as repeatable as possible as well as predictable as
possible otherwise
we're going to have a hard time maintaining consistency and we're going to also
have to build
out more complex logic to handle all of these subtle variations between vendors WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
out more complex logic to handle all of these subtle variations between vendors
and between models
that type of thing whereas if we can have a nice repeatable and predictable way
to model our data
then what we can do is we can easily build programmability into your
configurations. Well what do I
mean when I say this well let's just say we wanted to model the data for our
general configurations
let's maybe say we're going to well I don't know let's maybe imagine a VLAN
okay but what we could
specify is that when someone goes through a sign a VLAN number such as you know
VLAN 15 within our
data model what we can do is have particular constraints to say hey this number WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
data model what we can do is have particular constraints to say hey this number
it must actually be
between a particular value such as one and you know 4,095 I believe it is so
this is the valid range
similarly let's say imagine we go and create a switched virtual interface for
that VLAN
while the actual IP address if it's going to be say for example IPv4 it's got
to follow a very
particular format it's going to have a number between 0 and 255 then a dot then
again 0 to 255 then WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
again 0 to 255 then
a dot then again all the way until we have 4 octets with each value between
this particular range
so if someone tries to go and configure an IP address on the switch virtual
interface for 111
432 10.1 then clearly we know as per the constraints specified in our data
model
that this is not going to be allowed now in a similar way we do have these kind
of constraints
on the actual CLI itself but here is a little bit of a problem if we go let me
just do this here WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
just do this here
if I log into a Cisco device and I say configure terminal okay and that's maybe
say I try to create
a look back interface also interface look back let's just go with 1234 if I say
IP address
111 432 10.1 or whatever it was and give it a subnet mask over slash 32 if I
hit enter here
but we do actually see we have some type of validation going on we're seeing
here that the box is
spitting out some type of error this is an invalid input now the problem here
though is that we are
relying on the software on the box to detect that particular problem once we WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
relying on the software on the box to detect that particular problem once we
actually attempt to
push the configurations to the device whereas if we actually have just some
type of general data
model that we can reference as opposed to attempted to validate our
configurations directly on the
machine that we're trying to configure what we can do is something called
client side validation
meaning that here on my machine before I even attempt to push the changes to a
remote device
on my local machine I can look at the configurations that I have generated and WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
on my local machine I can look at the configurations that I have generated and
just use some specialized
tools to compare them versus what is expected within the acceptable data model
and if there happens
to be any type of errors say for example my VLAN number is like negative 5
which is not in the
valid range before I even attempt to push the configurations right here on my
box I can just
compare my automated configs against what is actually acceptable and I can
already be told before
I attempt to disturb the network that my configurations are indeed invalid
because what I don't want
to do as I don't want to have the power of automation generate all these WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to do as I don't want to have the power of automation generate all these
configurations for let's
maybe say 500 devices push those configurations to the network and maybe say
you know 50 of them
have some bad invalid configs and now 50 get rejected okay that's fine but the
remaining 450
have now been updated which means we might have a network and in consistent
state maybe we don't
actually want to change the configurations of the entire network unless all of
the devices are
in sync with the latest configurations and updates so like you say once again WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
in sync with the latest configurations and updates so like you say once again
when we have a data
model we have a very strict way in which we can specify what our data is
allowed to be this is done
by specifying particular constraints and ultimately just makes for a much more
robust way to automate
networks so now we know some of the motives and driving forces behind the
adoption of data models
with the network automation let's talk a little bit about how they actually are
implemented and the
different variations that we have