CCNA Notes

200-301 Exam Prep

Progress0/67

0% complete

Practice TestsNew
1Networking Devices2Interfaces And Cables3OSI Model and TCP/IP Suite4Intro to the CLI5Ethernet LAN Switching - Part 16Ethernet LAN Switching - Part 27IPv4 Addressing - Part 18IPv4 Addressing - Part 29Switch Interfaces10The IPv4 Header11Routing Fundamentals - Part 111Static Routing - Part 212Life of a Packet13Subnetting - Part 114Subnetting - Part 215Subnetting (VLSM) - Part 316VLANs - Part 117VLANs - Part 218VLANs - Part 319DTP / VTP20Spanning Tree Protocol - Part 121Spanning Tree Protocol - Part 222Rapid Spanning Tree Protocol23Etherchannel24Dynamic Routing25RIP / EIGRP26OSPF - Part 127OSPF - Part 228OSPF - Part 329First Hop Redundancy Protocol30TCP and UDP31IPv6 - Part 132IPv6 - Part 233IPv6 - Part 334Standard Access Control List35Extended Access Control List36CDP and LLDP37NTP - Network Time Protocol38DNS - Domain Name System39DHCP - Dynamic Host Configuration Protocol40SNMP - Simple Network Management Protocol41SYSLOG42SSH - Secure Shell43FTP and TFTP44NAT (Static) - Part 145NAT (Dynamic) - Part 246QoS (Voice VLAN) - Part 147QoS (Quality of Service) - Part 248Security Fundamentals49Port Security50DHCP Snooping51Dynamic ARP Inspection52LAN Architectures53WAN Architectures54Virtualization and Cloud - Part 154Virtualization (Containers) - Part 254Virtualization (VRF) - Part 355Wireless Fundamentals56Wireless Architectures57Wireless Security58Wireless Configuration59Introduction to Network Automation60JSON, XML, and YAML61REST APIs62Software Defined Networking63Ansible, Puppet, and Chef67CCNA Complete Cheatsheet
/JSON, XML, and YAML
Topic 603 min read

JSON, XML, and YAML

/
Tip: Select text to highlight or pin your reading position

60. JSON, XML, AND YAML

DATA SERIALIZATION

  • DATA SERIALIZATION is the process of converting DATA into a standardized format/structure that can be stored (in a file) or transmitted (over a network) and reconstructed later (ie: by a different application)

    • This allows the DATA to be communicated between applications in a way both APPLICATIONS understand.
  • DATA SERIALIZATION languages allow us to represent variables with text

imageClick to enlarge


JSON (JAVASCRIPT OBJECT NOTATION)

  • JSON (JAVASCRIPT OBJECT NOTATION) **is an open standard FILE FORMAT and DATA INTERCHANGE FORMAT that uses human-readable text to store and transmit data objects

  • It is standardized in RFC 8259 (https://datatracker.ietf.org/doc/html/rfc8259)

  • It was derived from JavaScript, but it is language-independent and many modern programming languages are able to generate and read JSON data

    • REST APIs often use JSON
  • Whitespace is insignificant

  • JSON can represent FOUR “primitive” DATA Types:

    • String
    • Number
    • Boolean
    • Null
  • JSON also has TWO “structured” DATA Types:

    • Object
    • Array

JSON PRIMITIVE DATA TYPES:

  • A STRING is a text value. It is surrounded by double quotes “ “

    • “Hello”
    • “Five”
    • “5”
  • A NUMBER is a numeric value. It is NOT surrounded by quotes

    • 5
    • 100
  • A BOOLEAN is a DATA Type that has only TWO possible values, not surrounded by quotes

    • true
    • false
  • A NULL value represents the intentional absence of any object value. It is not surrounded by quotes

    • null

JSON STRUCTURED DATA TYPES:

  • An OBJECT is an unordered list of key-value pairs (variables)
    • Sometimes called a DICTIONARY
    • OBJECTS are surrounded by curly brackets {}
    • The key is a STRING
    • The value is any valid JSON DATA Type (string, number, boolean, null, object, array)
    • The key and value are separated by a colon :
    • If there are multiple key-value pairs, each pair is separated by a comma

imageClick to enlarge

imageClick to enlarge

imageClick to enlarge

  • An ARRAY is a series of values separated by commas
    • Not key-value pairs
    • The values do NOT have to be the same DATA Type

imageClick to enlarge

imageClick to enlarge


XML (EXTENSIBLE MARKUP LANGUAGE)

  • XML (EXTENSIBLE MARKUP LANGUAGE) was developed as a MARKUP language, but is now used as a general data serialization language
    • Markup languages (ie: HTML) are used to format text (font, size, color, headings, etc)
    • XML is generally less human-readable than JSON
    • Whitespace is insignificant
    • Often used by REST APIs
    • <key> value </key> (similar to HTML)

imageClick to enlarge

imageClick to enlarge


YAML (YAML AIN’T MARKUP LANGUAGE)

  • YAML originally meant YET ANOTHER MARKUP LANGUAGE but to distinguish its purpose as a data-serialization language rather than a markup language, it was repurposed to YAML AINT MARKUP LANGUAGE
  • YAML is used by the network automation tool ANSIBLE (covered later in the course)
  • YAML is VERY Human-Readable
  • Whitespace is significant (unlike JSON and XML)
    • Indentation is very important
  • YAML files start with - - - (three dashes)
    • is used to indicate a list
  • Keys and Values are represented as key : value

imageClick to enlarge

COMPARISON BETWEEN JSON and YAML using the same DATA

imageClick to enlarge

PreviousIntroduction to Network Automation
NextREST APIs