The Ultimate Beginner’s Guide to JSON: What It Is, How It Works, and Why We Use It: CCNA Automation (200-901)

 Have you ever wondered how different apps, websites, and servers talk to each other so flawlessly? Whether you are refreshing your social media feed, managing network devices, or running a DevOps script, there is an invisible language flying across the internet making it all happen.

That language is JSON.

If you look under the hood of network automation tools like Cisco DNA Center, Cisco Meraki, or everyday web APIs, you will see JSON everywhere. It has become the universal translator between scripts, network devices, and controllers.

In this guide, we are going to break down exactly what JSON is, why it replaced older formats, how it works, and how to read it yourself.

XML based prompt Engineering

XML DOM explained

XML Basics

Why Do We Need JSON? (The Problem of Scale)

Before JSON, the first widely adopted plaintext data format was XML (eXtensible Markup Language). XML is incredibly powerful, flexible, and relatively easy for humans to read. For a long time, it was the gold standard for sending data over the web.

But as the internet exploded in popularity, developers ran into a major roadblock. The web had to scale to millions of users making millions of requests every single minute. At that massive scale, XML’s biggest strength—its detail—became its greatest weakness.


When were different data formats introduced.
When were different data formats introduced.


KEY POINT: Some problems only appear at a massive scale.

XML is quite "wordy." Every piece of data needs an opening tag and a closing tag.

  • <name>John</name>

You might be thinking: Okay, it’s just a few extra characters. What’s the big deal?

At a small scale, it doesn't matter. But when servers are sending responses to millions of clients every second, those extra characters add up to extra kilobytes. Extra kilobytes mean more bandwidth and more processing power required. In the tech world, that ultimately translates to money.

Web and API developers realized they needed a data format that was highly efficient, easy for programs to generate, but still readable by humans. That is why JSON was born.


What is JSON?

JSON stands for JavaScript Object Notation.

Despite the name, you do not need to know JavaScript to use it. JSON is not tied exclusively to JavaScript anymore; it is a simple, universal text format used for representing structured data. Humans can easily read it, and computers can process it at lightning speed.

JSON became the industry favorite because it maps perfectly to the common data structures found in almost every programming language:

  • Objects / Dictionaries: Collections of key-value pairs.

  • Arrays / Lists: Ordered lists of items.

  • Strings: Text.

  • Numbers: Integers and decimals.

  • Booleans: True or False.

  • Null: Empty values.

The Big Advantages of JSON

  • Compact: It uses minimal punctuation, saving bandwidth.

  • Readable: Both humans and machines can understand it easily.

  • Language Independent: It is just plain text, meaning a Python script can easily read JSON sent from a Java server.

  • Universal Support: Virtually every programming language has built-in tools to read and write JSON.


How Does JSON Work?

At a high level, JSON is all about serialization.

Imagine you have a complex idea in your brain (in-memory data structures). To share it with a friend over text message, you have to type it out into words (a standard text format). Your friend receives the text and translates those words back into an idea in their brain.

JSON works exactly the same way between computers:

  1. Serialization: The sender takes data from its memory and turns it into JSON text.

  2. Transmission: The JSON text is sent over the network.

  3. Deserialization: The receiver takes the JSON text and turns it back into usable data in its own memory.

As long as both sides agree on the "shape" of the data, the communication is flawless.


The Big Showdown: JSON vs. XML

Today, both JSON and XML are still used, but JSON dominates modern web and API development. Here is a simple breakdown of how they compare:

FeatureJSONXML
FormattingHighly compact and lightweight.Very wordy; heavily relies on tags.
ReadabilityClean and easy to read, even in large files.Becomes cluttered and hard to manage in large files.
Arrays (Lists)Fully supports arrays.Does not natively support arrays.
Data TypesSupports Text, Numbers, Booleans, Null.Supports many types, including images and graphs.
Human ParsingVery human-readable.Less human-readable due to tag repetition.

XML based prompt Engineering

XML DOM explained

XML Basics

Let's Look at an Example

To really understand why JSON is preferred for data transfer, let's look at the exact same network data formatted in both languages.

The XML Way:

XML
XML  Example

The JSON Way:

JSON Example
JSON Example



Notice how JSON eliminates all the repetitive closing tags like </name> and </interface>? By using simple brackets [] and braces {}, JSON passes the exact same information using significantly less text.


More JSON Examples Explained

If you are new to reading JSON, all the brackets can look a bit confusing. Let's break down a few more examples so you can read JSON like a pro.

Example 1: A Simple Object (Dictionary)

An object in JSON is wrapped in curly braces {}. It holds data in "key-value" pairs. Think of it like a dictionary word and its definition.


JSON Example
JSON Example


  • Explanation: This JSON represents a single network router. The keys (left side) are wrapped in quotes. The values (right side) can be text (wrapped in quotes) or numbers (no quotes needed).

Example 2: An Array (List)

An array in JSON is wrapped in square brackets []. It is used to hold a list of items.


JSON Array
JSON Array

  • Explanation: Here, the key is "allowed_vlans", and the value is a list of five different numbers. Arrays are perfect when you have multiple items of the same type.

Example 3: A Complex Object (Mixing Everything Together)

JSON allows you to nest objects and arrays inside one another to create rich, detailed data profiles.

JSON Complex Example
JSON Complex Example


Explanation: This starts with a main object employee. Inside that, we have nested a name (String), a role (String), an active status (Boolean true), and a list of her certifications (Array). This clean, logical hierarchy is exactly why programmers love JSON!

XML based prompt Engineering

XML DOM explained

XML Basics

What is JSON Used For in the Real World?

JSON is the absolute backbone of modern data exchange. Its most common daily uses include:

  • Web Browsers (AJAX): When you scroll down a webpage and new content loads without the page refreshing (like on X/Twitter or Instagram), that is your browser secretly asking a web server for more data. The server sends that data back formatted as JSON.

  • Network Automation: Modern networking platforms have APIs (Application Programming Interfaces). If you want to use a Python script to tell Cisco DNA Center to update 100 routers, your script will package those instructions into a JSON payload and send it over HTTP.

  • Configuration Files: Many modern software tools and text editors (like VS Code) use JSON files to save your user settings and preferences.

JSON is incredibly powerful, universally accepted, and entirely scalable. Once you learn how to read its simple brackets and braces, a whole new world of automation and web development opens up to you!


Featured Post

Day 41 — BGP Confederations: Sub-AS Design, External View and Migration

1. Opening Confederations are another way to scale BGP inside a large administrative domain. They divide the domain into member autonomous systems while presenting a single confederation identifier to external peers. They are powerful, but their operational model is more complex than simply 'using private ASNs inside.' The engineering goal is not to memorize another BGP command. It is to understand what information each speaker is allowed to propagate, what path information can be hidden, and what failure domain is created by the chosen control-plane architecture . 2. Concept and standards behavior RFC 5065 defines AS_CONFED_SEQUENCE and AS_CONFED_SET and how member-AS relationships are represented. Confederation external sessions have eBGP-like properties inside the confederation, while the confederation is presented externally as one AS. Modern guidance must also account for the fact that RFC 9774 prohibits new origination of AS_SET/AS_CONFED_SET in ordinary aggregation c...