• For the CCNA exam, you need to be able to understand and interpret JSON (JavaScript Object Notation).
    To begin this lesson, we will answer two questions:

    • Why do we need JSON?

    • What problem does JSON solve in networking?

    Let’s start with a simple example.

    Why we need JSON

    Imagine you are using a network monitoring application.
    This application needs to regularly check the status of interfaces on multiple routers to make sure the network is operating correctly.

    Network monitoring application requesting interface status information such as UP, DOWN, and IP address from a router

    Figure 1 - Network monitoring application requesting interface status information

    Modern network devices provide APIs that allow applications to request this information.

    At first glance, this seems simple:

    • the monitoring application sends a GET request

    • the router replies with the requested information

    The Problem Without a Standard Format

    Figure 2 illustrates this process.

    1. The monitoring application sends a GET request to the router.

    2. The router accesses its internal variables, such as interface status and IP address.

    3. The router sends the information back without a standardized format, making the response not machine-readable.

    Monitoring application attempting to retrieve interface information from a router without a standardized data format

    Figure 2 – Interface information exchanged without a standardized format

    However, this is where the problem appears.
    The router cannot simply send its raw internal variables back to the application in a usable form.

    Internal device variables:

    • are designed for the router’s operating system

    • are not readable by external applications

    As a result, the monitoring application cannot interpret the data directly.

    Answer the question below

    Why can't the monitoring application interpret the data sent by the router?

    JSON as the Standard Data Format

    We need a standard and structured format to exchange system information.

    This format must be:

    • readable by machines

    • vendor-independent

    • easy to parse

    JSON is used to represent internal device variables in a standard format that can be exchanged over the network.
    This is called a data format.

    Let’s return to our example.

    1. The monitoring application sends an API request to the router.

    2. The router checks its internal variables to retrieve the requested information.

    3. These internal variables are then converted into JSON format by the API.

    4. The information is sent to the monitoring application encoded in JSON.

    Monitoring application receiving interface variables from a router in JSON format through a REST API

    Figure 3 – Interface variables exchanged using JSON format

    When the monitoring application receives the JSON message:

    • it reads the structured data

    • it extracts the values

    • it converts them into its own internal representation

    In this way, different devices and applications are able to exchange data using the same standard format.

    Answer the question below

    What data format is used for exchanging information?