WEBVTT

0:00:02.620000 --> 0:00:08.300000
 Hello and welcome to this video entitled
 Encoding Data with JSON.

0:00:08.300000 --> 0:00:12.760000
 In this video I'm going to give an
 overview of what JSON data encoding

0:00:12.760000 --> 0:00:20.120000
 is. We're going to talk about now because
 JSON is a part of JavaScript

0:00:20.120000 --> 0:00:23.880000
 and just going to give a real high
 level foundational overview of what

0:00:23.880000 --> 0:00:28.560000
 JavaScript is and what its intent and
 purpose was in case you've never

0:00:28.560000 --> 0:00:30.460000
 researched that.

0:00:30.460000 --> 0:00:34.060000
 Then we're going to look at some of
 the benefits of JSON encoded data.

0:00:34.060000 --> 0:00:37.700000
 We're going to look at the value types,
 syntax rules and then we're actually

0:00:37.700000 --> 0:00:42.060000
 going to have a lab where you get to
 practice what you've learned to see

0:00:42.060000 --> 0:00:46.160000
 if you can read through some JSON data
 and recognize what it is that you're

0:00:46.160000 --> 0:00:50.200000
 looking at. So let's start
 with an overview of JSON.

0:00:50.200000 --> 0:00:52.200000
 So as I mentioned, it's
 pronounced JSON.

0:00:52.200000 --> 0:00:56.900000
 Now no one's going to kill you if you
 pronounce it like the name JSON.

0:00:56.900000 --> 0:01:02.140000
 Some people call it JSON but from my understanding
 the correct pronunciation

0:01:02.140000 --> 0:01:06.300000
 is JSON. So you probably
 want to call it that.

0:01:06.300000 --> 0:01:07.480000
 It stands for something.

0:01:07.480000 --> 0:01:11.220000
 It stands for the JavaScript
 Object Notation.

0:01:11.220000 --> 0:01:13.420000
 JavaScript Object Notation.

0:01:13.420000 --> 0:01:19.120000
 It is a subset of
 JavaScript syntax.

0:01:19.120000 --> 0:01:23.140000
 So JSON objects are used for representing
 data that is transferred between

0:01:23.140000 --> 0:01:24.260000
 server and client.

0:01:24.260000 --> 0:01:28.160000
 Basically, it's just a way of
 generically describing data.

0:01:28.160000 --> 0:01:29.500000
 What does that mean?

0:01:29.500000 --> 0:01:33.860000
 That means that if you and I have some
 protocol, let's say that you are

0:01:33.860000 --> 0:01:38.320000
 a network of device and I'm an SDN controller
 or just something else that's

0:01:38.320000 --> 0:01:42.480000
 trying to get data off of you like
 your routing table, your interface

0:01:42.480000 --> 0:01:44.680000
 statistics, whatever it is.

0:01:44.680000 --> 0:01:49.140000
 Well, we have to have some agreement on
 how that data is going to be formatted

0:01:49.140000 --> 0:01:52.780000
 and structured. Is it going
 to be using binary digits?

0:01:52.780000 --> 0:01:54.960000
 Is it going to be
 using ASCII text?

0:01:54.960000 --> 0:01:59.680000
 How do I delineate the difference between
 where interface ends and fast

0:01:59.680000 --> 0:02:01.120000
 ethernet begins?

0:02:01.120000 --> 0:02:03.520000
 All this stuff has
 to be agreed upon.

0:02:03.520000 --> 0:02:08.520000
 That's one of the purposes of JSON is
 to agree upon how the data should

0:02:08.520000 --> 0:02:12.600000
 be formatted so you and I can
 read it and understand it.

0:02:12.600000 --> 0:02:16.680000
 It is used extensively
 by web service APIs.

0:02:16.680000 --> 0:02:21.060000
 So if you ever learn about REST APIs
 or you have to use REST APIs, REST

0:02:21.060000 --> 0:02:24.920000
 APIs have to encode data
 in a certain way.

0:02:24.920000 --> 0:02:31.060000
 Some REST APIs are meant to encode
 data in XML, but most REST APIs use

0:02:31.060000 --> 0:02:34.100000
 JSON to encode their data.

0:02:34.100000 --> 0:02:36.400000
 And so if you want to read that data
 and understand what you're looking

0:02:36.400000 --> 0:02:39.320000
 at, you have to understand JSON.

0:02:39.320000 --> 0:02:44.040000
 So because JSON is a subset of JavaScript
 syntax, I thought it would be

0:02:44.040000 --> 0:02:49.760000
 useful to do just a real quick like
 50,000 foot one slide overview of

0:02:49.760000 --> 0:02:52.220000
 what JavaScript is.

0:02:52.220000 --> 0:02:55.320000
 So let's talk a little bit about that
 so you know where JSON falls in

0:02:55.320000 --> 0:02:59.620000
 all of this. So JavaScript is a
 scripting language as it sounds.

0:02:59.620000 --> 0:03:03.760000
 It's one of the core languages used
 in websites along with HTML and CSS.

0:03:03.760000 --> 0:03:06.400000
 So it's a scripting language.

0:03:06.400000 --> 0:03:11.460000
 It defines things like variables,
 objects, functions.

0:03:11.460000 --> 0:03:15.980000
 And if you ever looked at a raw HTML
 page, if you looked at the HTML code

0:03:15.980000 --> 0:03:21.420000
 of any website and you saw the tags
 of script, something in the middle

0:03:21.420000 --> 0:03:28.140000
 of that, and then slash script, well then
 what you're looking at is JavaScript.

0:03:28.140000 --> 0:03:31.740000
 So JavaScript is within HTML
 identified with those tags.

0:03:31.740000 --> 0:03:33.520000
 Now what does JavaScript do?

0:03:33.520000 --> 0:03:40.100000
 Well its main purpose is to add behaviors
 and interactivity to websites.

0:03:40.100000 --> 0:03:42.380000
 I mean think about this, if you were
 to download a web page that were

0:03:42.380000 --> 0:03:48.580000
 just a static web page, if all
 it used was HTML and CSS.

0:03:48.580000 --> 0:03:52.600000
 If those were the only protocols and
 languages used to construct that

0:03:52.600000 --> 0:03:56.620000
 website, that page would always look the
 exact same way whenever you downloaded

0:03:56.620000 --> 0:04:02.240000
 it. And you know when, you know, if
 you've been around long enough, if

0:04:02.240000 --> 0:04:06.680000
 you first learned about designing websites
 like 30 years ago, back in

0:04:06.680000 --> 0:04:10.820000
 the day when websites first were developed,
 it was basically just HTTP.

0:04:10.820000 --> 0:04:13.420000
 So website was just static data.

0:04:13.420000 --> 0:04:16.880000
 There wasn't even really images
 back then, it was just text.

0:04:16.880000 --> 0:04:19.200000
 And it always looked
 exactly the same way.

0:04:19.200000 --> 0:04:23.920000
 Well what JavaScript does is it gives
 you the ability to have interactivity

0:04:23.920000 --> 0:04:27.620000
 in your website by
 invoking a script.

0:04:27.620000 --> 0:04:31.120000
 Now notice this, that it's
 run client side only.

0:04:31.120000 --> 0:04:31.940000
 What does that mean?

0:04:31.940000 --> 0:04:36.640000
 That means that when a website is downloaded
 to your laptop or your tablet,

0:04:36.640000 --> 0:04:41.540000
 it might have some JavaScript inside
 there with a script and slash script

0:04:41.540000 --> 0:04:44.980000
 and then the middle, it's telling
 JavaScript what to do.

0:04:44.980000 --> 0:04:48.700000
 Now what that JavaScript is doing is
 adding interactivity to the website.

0:04:48.700000 --> 0:04:51.940000
 So for example, if you ever download
 a website that has like a little

0:04:51.940000 --> 0:04:56.980000
 video in the coordinates playing, like
 maybe a video of some news broadcaster

0:04:56.980000 --> 0:05:01.480000
 talking or just something that's moving
 on the page and something that

0:05:01.480000 --> 0:05:04.620000
 can change over the time, whatever's
 in that little box right now, might

0:05:04.620000 --> 0:05:08.240000
 look differently if you look at that
 same website an hour from now, or

0:05:08.240000 --> 0:05:11.640000
 date from now, well it's JavaScript
 that's enabling that interactivity,

0:05:11.640000 --> 0:05:15.760000
 that box to appear and show you something
 moving or giving you the ability

0:05:15.760000 --> 0:05:18.640000
 to click on something like a page might
 have a survey on it that you can

0:05:18.640000 --> 0:05:21.520000
 click on. That would be JavaScript
 that does that.

0:05:21.520000 --> 0:05:23.880000
 Now it's client side only.

0:05:23.880000 --> 0:05:29.100000
 Some client devices have JavaScript
 disabled, maybe for security reasons

0:05:29.100000 --> 0:05:33.120000
 or whatever. So if you turn off JavaScript
 in your browser and your laptop

0:05:33.120000 --> 0:05:36.660000
 or your tablet or your smartphone,
 you'll still be able to see all the

0:05:36.660000 --> 0:05:41.820000
 text of that website, whatever was written
 in HTML, but the interactivity

0:05:41.820000 --> 0:05:52.500000
 component of it won't function because
 JavaScript will no longer be there.

0:05:52.500000 --> 0:05:59.380000
 JavaScript deals with objects, which
 is a container that encloses one

0:05:59.380000 --> 0:06:04.340000
 or more name value pair, sometimes
 called a key value pair.

0:06:04.340000 --> 0:06:10.000000
 And it is JSON that says how we should
 write this, like look at this right

0:06:10.000000 --> 0:06:14.360000
 here, we've got some curly brackets,
 we've got some quotation marks, we've

0:06:14.360000 --> 0:06:21.080000
 got some, some colons in there, some
 commas, so where that stuff should

0:06:21.080000 --> 0:06:24.980000
 be and when it should be there and when
 it should not be there, JSON is

0:06:24.980000 --> 0:06:29.180000
 what defines that, what
 defines how that looks.

0:06:29.180000 --> 0:06:35.480000
 Now in a lot of APIs, especially when
 talking about REST APIs or a web

0:06:35.480000 --> 0:06:39.440000
 service API, a web service API might
 say, okay, well, when you and I are

0:06:39.440000 --> 0:06:42.820000
 going to exchange data, what should
 the format of that data be?

0:06:42.820000 --> 0:06:47.940000
 Sometimes it might be XML, which is another
 way of formatting data, sometimes

0:06:47.940000 --> 0:06:52.680000
 it's JSON. When you read up on this
 stuff, a lot of documents will tell

0:06:52.680000 --> 0:06:58.640000
 you that JSON is far superior to XML, so
 if you have a choice of representing

0:06:58.640000 --> 0:07:02.780000
 your data, you should choose
 to use JSON rather than XML.

0:07:02.780000 --> 0:07:07.840000
 Let's take a look at a real functional
 application of this.

0:07:07.840000 --> 0:07:12.480000
 So as compared to XML, JSON is lightweight,
 meaning that it requires less

0:07:12.480000 --> 0:07:17.340000
 characters to describe the same piece
 of data that XML requires, is language

0:07:17.340000 --> 0:07:20.700000
 independent, which means that JSON, even
 though it was originally written

0:07:20.700000 --> 0:07:26.060000
 in the context of JavaScript to define
 the syntax of JavaScript objects,

0:07:26.060000 --> 0:07:29.480000
 JSON was later determined to be useful
 in a lot of different things, like

0:07:29.480000 --> 0:07:35.200000
 REST APIs and other things, as easy to
 read and write and it's human readable.

0:07:35.200000 --> 0:07:39.140000
 Like for example, on the left there,
 we have some data written in XML

0:07:39.140000 --> 0:07:44.300000
 format on the right, we have that exact
 same data written in JSON format.

0:07:44.300000 --> 0:07:50.000000
 And although you can read the XML,
 you can read the JSON a lot faster.

0:07:50.000000 --> 0:07:54.360000
 And for programming languages and for memory
 usage, it's a lot more efficient

0:07:54.360000 --> 0:07:57.820000
 to use JSON than is to use XML.

0:07:57.820000 --> 0:08:01.120000
 Now, sometimes you don't have a choice,
 sometimes certain APIs or whatever

0:08:01.120000 --> 0:08:03.980000
 use XML, and that's just
 the way they work.

0:08:03.980000 --> 0:08:07.780000
 But if you ever are given the option
 of choosing between the two, I think

0:08:07.780000 --> 0:08:12.520000
 you can see here that JSON is a lot
 more human friendly than XML is.

0:08:12.520000 --> 0:08:17.240000
 Now, let's talk about
 JSON value types.

0:08:17.240000 --> 0:08:23.360000
 In other words, what is the format that's
 available in JSON to represent

0:08:23.360000 --> 0:08:27.180000
 my data? Whatever my data might be,
 maybe an entry in a routing table

0:08:27.180000 --> 0:08:32.780000
 or an IP address, what formats can
 JSON use to represent that data?

0:08:32.780000 --> 0:08:35.860000
 Well, let's start with the high level
 concept of something called a JSON

0:08:35.860000 --> 0:08:41.040000
 object. Because remember, JSON stands
 for JavaScript object notation.

0:08:41.040000 --> 0:08:42.820000
 How do I notate an object?

0:08:42.820000 --> 0:08:44.740000
 What does an object look like?

0:08:44.740000 --> 0:08:49.220000
 Well, the rules of JSON say that an
 object is always surrounded at the

0:08:49.220000 --> 0:08:58.140000
 both the beginning and at
 the name value pairs.

0:08:58.140000 --> 0:09:01.580000
 So for example, here
 is a JSON object.

0:09:01.580000 --> 0:09:05.240000
 Notice we got curly brackets at
 both the beginning and the end.

0:09:05.240000 --> 0:09:08.960000
 And we have three name value
 pairs inside of it.

0:09:08.960000 --> 0:09:12.240000
 One of those name value pairs is department,
 which is paired up with the

0:09:12.240000 --> 0:09:15.440000
 name of the department, which is so
 the so the name is department, the

0:09:15.440000 --> 0:09:16.960000
 value is payroll.

0:09:16.960000 --> 0:09:20.740000
 Now we have another name value pair,
 the name being VLAN, the value being

0:09:20.740000 --> 0:09:23.560000
 300. And then another
 name value pair.

0:09:23.560000 --> 0:09:28.300000
 So all of this because it's enclosed
 in curly brackets is considered a

0:09:28.300000 --> 0:09:37.620000
 JSON object. Okay, so now we're drilling
 down into the name value pairs.

0:09:37.620000 --> 0:09:39.400000
 What can they be?

0:09:39.400000 --> 0:09:40.920000
 What kind of format can they take?


0:09:40.920000 --> 0:09:46.460000
 Well, the probably the most popular
 common one you'll see is a string.

0:09:46.460000 --> 0:09:51.460000
 A string is just characters
 enclosed in double quotes.

0:09:51.460000 --> 0:10:00.680000
 Now, JSON always specifies that in a
 JSON object, remember this part here,

0:10:00.680000 --> 0:10:05.160000
 I know it says name, but is just
 generically called the name.

0:10:05.160000 --> 0:10:11.500000
 And then here you have the value.

0:10:11.500000 --> 0:10:22.900000
 And between the name,
 colon, value.

0:10:22.900000 --> 0:10:28.460000
 Well, whatever the name is, whether it
 be department, whether it be VLAN,

0:10:28.460000 --> 0:10:32.760000
 whether it be manager, this is
 always going to be a string.

0:10:32.760000 --> 0:10:38.280000
 So in your name value pair, the
 name always has to be a string.

0:10:38.280000 --> 0:10:42.600000
 And then what describes that name, the
 specifics, the specific information

0:10:42.600000 --> 0:10:46.180000
 about that name could
 be another string.

0:10:46.180000 --> 0:10:51.540000
 So the value, so in this case, the value
 of John, that's also a string.

0:10:51.540000 --> 0:10:57.960000
 Or another way of describing a name
 instead of a value, you could use,

0:10:57.960000 --> 0:11:00.360000
 you could use a number.

0:11:00.360000 --> 0:11:03.220000
 For example, an integer
 or a float.

0:11:03.220000 --> 0:11:07.920000
 So here our name is age, once again,
 surrounded by double quotes.

0:11:07.920000 --> 0:11:11.780000
 And the value is an integer,
 the number five.

0:11:11.780000 --> 0:11:16.320000
 Other ways you can describe name value
 pairs, you could have an array.

0:11:16.320000 --> 0:11:20.480000
 This is similar to what we call a
 list, which is comma separated.

0:11:20.480000 --> 0:11:24.420000
 So here our name value pair, our name
 is class ages, that's a string once

0:11:24.420000 --> 0:11:27.620000
 again, we have to have that
 colon there in the middle.

0:11:27.620000 --> 0:11:31.720000
 And then the value is the array, which
 is in this case, some numbers,

0:11:31.720000 --> 0:11:35.360000
 separate by commas, that's
 called an array.

0:11:35.360000 --> 0:11:38.780000
 We could also have a Boolean, which
 is a true or false statement.

0:11:38.780000 --> 0:11:41.380000
 For example, sale is true.

0:11:41.380000 --> 0:11:46.100000
 Notice the true here is
 not in double quotes.

0:11:46.100000 --> 0:11:47.760000
 So that's not a string.

0:11:47.760000 --> 0:11:49.100000
 That is a Boolean.

0:11:49.100000 --> 0:11:52.420000
 A true can only be one of two
 things, either true or false.

0:11:52.420000 --> 0:11:54.340000
 Those are the only two
 things it could be.

0:11:54.340000 --> 0:11:57.420000
 Or you could have no.

0:11:57.420000 --> 0:12:02.880000
 Now, JSON does not support functions,
 dates, or undefined.

0:12:02.880000 --> 0:12:06.360000
 Now, if you're a programmer, you
 may be familiar with those terms.

0:12:06.360000 --> 0:12:08.540000
 If you're not a programmer,
 don't worry about it.

0:12:08.540000 --> 0:12:15.560000
 Not a big deal. One thing I would, now
 let's do a little, just something

0:12:15.560000 --> 0:12:20.520000
 you can play around with, with JSON,
 especially if your network engineer

0:12:20.520000 --> 0:12:23.220000
 is a little trick here.

0:12:23.220000 --> 0:12:27.240000
 Let's just generate some JSON data
 so we can see what it looks like.

0:12:27.240000 --> 0:12:32.080000
 So the vast majority of routers and
 switches, you can get into them.

0:12:32.080000 --> 0:12:36.680000
 And normally when you issue the command
 show running config to take a

0:12:36.680000 --> 0:12:39.020000
 look at the running config,
 it's what we're used to.

0:12:39.020000 --> 0:12:41.220000
 It's the Cisco iOS command
 line output.

0:12:41.220000 --> 0:12:43.440000
 But there's a little tweak
 we can do in here.

0:12:43.440000 --> 0:12:44.780000
 We can do show running config.

0:12:44.780000 --> 0:12:48.460000
 We can put the pipe symbol, a little
 vertical bar, which in my keyboard

0:12:48.460000 --> 0:12:50.800000
 is directly above my return key.

0:12:50.800000 --> 0:12:53.480000
 And then you can put
 in the word format.

0:12:53.480000 --> 0:12:59.620000
 And what this will do is it will represent
 my running config in XML format.

0:12:59.620000 --> 0:13:02.060000
 Now I'm sorry you can't get
 it to do it in JSON format.

0:13:02.060000 --> 0:13:07.280000
 By the way, I'll show you in a second,
 it can represent it in XML.

0:13:07.280000 --> 0:13:10.420000
 And it's going to
 be a lot of stuff.

0:13:10.420000 --> 0:13:14.020000
 Matter of fact, what I'm going to do
 here is I'm going to say terminal

0:13:14.020000 --> 0:13:18.580000
 length zero, so I don't have to
 keep getting the more symbol.

0:13:18.580000 --> 0:13:23.480000
 And now I'm going to say show
 running dash config format.

0:13:23.480000 --> 0:13:26.860000
 It'll represent my running
 config in XML format.

0:13:26.860000 --> 0:13:29.620000
 So I get to the very bottom.

0:13:29.620000 --> 0:13:34.540000
 All right, so there it is.

0:13:34.540000 --> 0:13:36.960000
 So now I'm going to go
 to the top of that.

0:13:36.960000 --> 0:13:39.760000
 And I'm going to copy it from the very
 beginning of the output where it

0:13:39.760000 --> 0:13:41.120000
 says XML version.

0:13:41.120000 --> 0:13:45.780000
 So from here, I'm just going to copy
 it all the way down to the bottom.

0:13:45.780000 --> 0:13:48.440000
 There's the end right there.

0:13:48.440000 --> 0:13:50.500000
 Now I'm using secure CRT.

0:13:50.500000 --> 0:13:53.480000
 So simply by highlighting
 it, it copies it.

0:13:53.480000 --> 0:13:57.040000
 I don't have to right click or anything
 highlighting copies it by default.

0:13:57.040000 --> 0:14:01.560000
 Now I can go to this
 page right here.

0:14:01.560000 --> 0:14:06.640000
 I'll zoom in on this for you, which
 is an XML to JSON converter.

0:14:06.640000 --> 0:14:11.800000
 So you can paste in XML here and
 have it convert to JSON for you.

0:14:11.800000 --> 0:14:14.120000
 So you can actually see
 what JSON looks like.

0:14:14.120000 --> 0:14:17.060000
 You can. So let's do that.

0:14:17.060000 --> 0:14:19.660000
 So I'm going to paste
 in here the XML.

0:14:19.660000 --> 0:14:23.640000
 I just copied. Paste.

0:14:23.640000 --> 0:14:27.920000
 There we go. Now I'm just going to
 click on this button XML to JSON.

0:14:27.920000 --> 0:14:29.960000
 And there it is.

0:14:29.960000 --> 0:14:32.140000
 Now we have my running config.

0:14:32.140000 --> 0:14:37.060000
 Properly formatted
 into JSON output.

0:14:37.060000 --> 0:14:43.800000
 And you can see all these objects here
 are enclosed with curly brackets.

0:14:43.800000 --> 0:14:47.900000
 So if we just let's just
 start the very beginning.

0:14:47.900000 --> 0:14:50.480000
 So this whole thing
 is one giant object.

0:14:50.480000 --> 0:14:52.120000
 So look at the indentation
 right here.

0:14:52.120000 --> 0:14:54.680000
 So here we have the
 very beginning.

0:14:54.680000 --> 0:14:57.720000
 And where do we so that's the
 starting curly bracket.

0:14:57.720000 --> 0:15:00.140000
 Where do we see the closing
 curly bracket for that?

0:15:00.140000 --> 0:15:02.660000
 Probably not until we get
 to the very bottom.

0:15:02.660000 --> 0:15:04.460000
 There we see that.

0:15:04.460000 --> 0:15:05.680000
 There's the curly brackets.

0:15:05.680000 --> 0:15:18.580000
 It's on the same sort of format.

0:15:18.580000 --> 0:15:21.840000
 Is for example, well, for example,
 let's take a look at.

0:15:21.840000 --> 0:15:24.220000
 Well, you can sort of look through
 this at your own time.

0:15:24.220000 --> 0:15:26.900000
 But I'd recommend doing
 this on yourself.

0:15:26.900000 --> 0:15:28.480000
 Just take a router switch.

0:15:28.480000 --> 0:15:30.460000
 You know if it doesn't have any
 configuration whatsoever.

0:15:30.460000 --> 0:15:35.500000
 Just issue the show run pipe
 format, get your XML format.

0:15:35.500000 --> 0:15:38.760000
 And then you can convert you can convert
 it to JSON and just go through

0:15:38.760000 --> 0:15:44.340000
 this at your bottom.

0:15:44.340000 --> 0:15:55.060000
 So we've we've already seen the
 data is in name value key pairs.

0:15:55.060000 --> 0:16:00.060000
 Multiple pairs are delineated
 with commas.

0:16:00.060000 --> 0:16:05.120000
 We know that curly braces hold objects
 square brackets hold arrays.

0:16:05.120000 --> 0:16:07.340000
 Spaces and line breaks
 don't matter.

0:16:07.340000 --> 0:16:13.020000
 So in other words, right here, this is
 a JSON object, all in one horizontal

0:16:13.020000 --> 0:16:19.420000
 line. Now you could now for example,
 that that XML to JSON format, or

0:16:19.420000 --> 0:16:21.860000
 I just looked at, we
 just showed you.

0:16:21.860000 --> 0:16:28.480000
 It actually displays it like this, vertically,
 which in some ways is easier

0:16:28.480000 --> 0:16:30.120000
 to read than horizontally.

0:16:30.120000 --> 0:16:31.860000
 They both are want
 they're both fine.

0:16:31.860000 --> 0:16:35.400000
 From a JSON perspective, one is not
 correct, the other is incorrect.

0:16:35.400000 --> 0:16:36.460000
 They're both correct.

0:16:36.460000 --> 0:16:39.640000
 It just depends on how you want to read
 it, how you want to look at it.

0:16:39.640000 --> 0:16:43.040000
 But they both mean exactly
 the same thing.

0:16:43.040000 --> 0:16:50.480000
 Now the last the last thing I want
 to do is interpret some JSON data.

0:16:50.480000 --> 0:16:53.220000
 So one of the things you need to be
 able to do is you might not have to

0:16:53.220000 --> 0:16:55.920000
 create JSON data from scratch.

0:16:55.920000 --> 0:17:00.640000
 Very rarely will somebody say, Hey,
 here's a file in ASCII format or a

0:17:00.640000 --> 0:17:01.840000
 text editor, whatever.

0:17:01.840000 --> 0:17:06.260000
 I want you to manually create this into
 JSON data, or I want you to create

0:17:06.260000 --> 0:17:09.260000
 a routing table and look at routing
 table and convert that into JSON for

0:17:09.260000 --> 0:17:11.760000
 me. Very rarely will
 you have to do that.

0:17:11.760000 --> 0:17:16.580000
 But you might be given a piece of data
 that's already in JSON format and

0:17:16.580000 --> 0:17:19.880000
 be able to interpret that be able to
 read through that and identify the

0:17:19.880000 --> 0:17:21.760000
 pieces of it that are
 interesting to you.

0:17:21.760000 --> 0:17:24.100000
 So here's what I'm going to do.

0:17:24.100000 --> 0:17:29.420000
 I have already right here
 got some JSON data.

0:17:29.420000 --> 0:17:32.880000
 This is the exact same running config
 that we just looked at from the

0:17:32.880000 --> 0:17:37.660000
 router. So what I'd like you to do
 is I'd like you to pause this slide

0:17:37.660000 --> 0:17:40.640000
 for a moment, maybe take a screenshot
 of it because you have two questions

0:17:40.640000 --> 0:17:42.220000
 you need to answer.

0:17:42.220000 --> 0:17:45.440000
 Question number one, I'm going to
 scroll through that JSON data.

0:17:45.440000 --> 0:17:49.540000
 I'm going to pause every few seconds
 so you can take a screenshot as I

0:17:49.540000 --> 0:17:52.700000
 do it. And as I scroll through that
 data, you need to look through it

0:17:52.700000 --> 0:17:56.200000
 with the intent of answering
 the following two questions.

0:17:56.200000 --> 0:18:03.340000
 Number one, where would this router
 send a packet going to 44.1.1.55?

0:18:03.340000 --> 0:18:06.540000
 So by looking through the JSON data, I'm
 going to show you in just a second,

0:18:06.540000 --> 0:18:09.280000
 you should be able to answer the question
 where the router would send

0:18:09.280000 --> 0:18:12.240000
 a packet going to 44.1.1.55.

0:18:12.240000 --> 0:18:14.060000
 I'm looking for an interface.

0:18:14.060000 --> 0:18:18.180000
 Would it send the packet out serial
 11 out fast, east and at 0.0?

0:18:18.180000 --> 0:18:21.080000
 Where would it send it
 based on the JSON data?

0:18:21.080000 --> 0:18:28.480000
 And number two, if this router had
 a packet that was sourced from 1.1

0:18:28.480000 --> 0:18:35.500000
.1.1, it was a telnet packet
 and is going to 20.20.30.1.

0:18:35.500000 --> 0:18:40.660000
 Would that packet be allowed to go out
 to be transmitted out fast, east

0:18:40.660000 --> 0:18:45.840000
 and at 0.1? So if you haven't already
 done so, pause this slide for just

0:18:45.840000 --> 0:18:48.560000
 a moment, take a screenshot
 of these two pictures.

0:18:48.560000 --> 0:18:54.440000
 I'm going to pause for a moment
 and let you do that.

0:18:54.440000 --> 0:19:00.360000
 Okay, now here is your JSON data.

0:19:00.360000 --> 0:19:06.140000
 I'm going to scroll through this, pausing
 momentarily so you can take

0:19:06.140000 --> 0:19:09.860000
 screenshots or you can just pause the
 video and look at it and see as

0:19:09.860000 --> 0:19:14.300000
 I scroll through this if you can answer
 the following two questions.

0:19:14.300000 --> 0:19:17.600000
 So here's the first section
 of my JSON data.

0:19:17.600000 --> 0:19:26.640000
 Here's the next section
 of my JSON data.

0:19:26.640000 --> 0:19:29.160000
 Go ahead and pause and take a look at
 this and see if you can answer your

0:19:29.160000 --> 0:19:48.480000
 question yet. Here's the third
 section of our JSON data.

0:19:48.480000 --> 0:19:53.440000
 Here's the fourth section of our
 running config, JSON formatted.

0:19:53.440000 --> 0:20:11.440000
 Here is the fifth section of our running
 config that's JSON formatted.

0:20:11.440000 --> 0:20:14.700000
 Here's the next section
 of our running config.

0:20:14.700000 --> 0:20:17.020000
 We're almost at the bottom now.

0:20:17.020000 --> 0:20:25.860000
 Here's another section of
 our JSON configuration.

0:20:25.860000 --> 0:20:29.020000
 I think you can tell that this section
 is referring to BGP which may or

0:20:29.020000 --> 0:20:38.860000
 may not be able to help you answer
 one of the two questions.

0:20:38.860000 --> 0:20:39.300000
 Here's the next section
 of our running config.

0:20:39.300000 --> 0:20:42.200000
 Getting down towards the bottom now,
 now we're looking at some access

0:20:42.200000 --> 0:20:45.340000
 lists formatted in JSON.

0:20:45.340000 --> 0:20:58.220000
 Now we're coming to the end of the
 access list almost at the bottom of

0:20:58.220000 --> 0:21:05.260000
 the configuration.

0:21:05.260000 --> 0:21:09.880000
 And here's the last bit of the configuration
 formatted via JSON.

0:21:09.880000 --> 0:21:15.060000
 All right, so let's see how would we
 have answered question number one.

0:21:15.060000 --> 0:21:20.840000
 Where would the router send
 a packet going to 44.1.1.55?

0:21:20.840000 --> 0:21:24.980000
 Well, hopefully as you pause and look
 to the JSON you notice if I go up

0:21:24.980000 --> 0:21:29.380000
 here under the interface
 section right here.

0:21:29.380000 --> 0:21:39.320000
 Here we have an interface object
 and we have fast JSON at 0 0.

0:21:39.320000 --> 0:21:52.180000
 Fast JSON at 0 0 has the IP address
 of 44.1.1.1 with the following mask.

0:21:52.180000 --> 0:21:55.180000
 A slash 24 subnet mask.

0:21:55.180000 --> 0:22:00.380000
 So we can tell from this because this
 guy on fast JSON at 0 0 is directly

0:22:00.380000 --> 0:22:03.280000
 connected to the 44.1.1 network.

0:22:03.280000 --> 0:22:09.600000
 If he received a packet going to 44
.1.1.55 this is the interface where

0:22:09.600000 --> 0:22:10.860000
 he would send it.

0:22:10.860000 --> 0:22:13.120000
 So this is the answer to
 question number one.

0:22:13.120000 --> 0:22:18.380000
 A packet going to 44.1.1.55 would have
 been transmitted out fast ethernet

0:22:18.380000 --> 0:22:22.480000
 0 0. Question number two.

0:22:22.480000 --> 0:22:27.680000
 Would a telnet packet sourced from 1
 1 1 and going to 20 30.1 be allowed

0:22:27.680000 --> 0:22:30.180000
 to be transmitted out
 fast ethernet 0 1.

0:22:30.180000 --> 0:22:34.860000
 Now you may have been tempted to have
 gone straight to the access list

0:22:34.860000 --> 0:22:40.000000
 section which was down here and try
 to figure that out via access list.

0:22:40.000000 --> 0:22:44.140000
 I'll tell you what you would have been
 wasting your time because if we

0:22:44.140000 --> 0:22:47.580000
 go up back to our interfaces again
 and take a look at fast ethernet 0

0:22:47.580000 --> 0:22:53.740000
 1 which is right here here's
 fast ethernet 0 1.

0:22:53.740000 --> 0:22:57.720000
 We would have seen something under
 this interface that fast ethernet 0

0:22:57.720000 --> 0:23:06.320000
 0 did not have this shutdown.

0:23:06.320000 --> 0:23:10.660000
 So we can see here if I compare the
 two if I sort of line them up.

0:23:10.660000 --> 0:23:18.500000
 There's fast ethernet 0 0 no mention
 of shutdown fast ethernet 0 1 has

0:23:18.500000 --> 0:23:21.860000
 shut down so the answer is no.

0:23:21.860000 --> 0:23:26.080000
 A telnet packet a ping packet nothing is
 going to be allowed to be transmitted

0:23:26.080000 --> 0:23:31.080000
 out fast ethernet 0 1 because that interface
 is administratively disabled

0:23:31.080000 --> 0:23:36.160000
 it is in the shutdown state.

0:23:36.160000 --> 0:23:40.940000
 So that concludes this video on introducing
 you to JSON and interpreting

0:23:40.940000 --> 0:23:44.640000
 JSON formatted data.

0:23:44.640000 --> 0:23:48.580000
 I hope this video has been useful
 and informative to you.

0:23:48.580000 --> 0:23:49.320000
 Thank you for watching.

