Why Do We Use Text Data Formats? (CCNA Automation & DevNet Guide)(200-901) - Post 2

 

Why Do We Use Text Data Formats? (CCNA Automation Beginner Guide (200-901))


If you are learning Automation (DevNet), one of the first concepts you must understand is text data formats.

Modern networks are no longer configured only with CLI commands. Today, routers, switches, controllers, APIs, cloud platforms, and automation tools constantly exchange structured data.

But here’s the big question:

👉 Why can’t applications just send raw data?

The answer is simple: computers need structure to understand information.

In this guide, you’ll learn:

  • Why data formats are necessary

  • How structured data works

  • What key-value pairs are

  • What serialization and parsing mean

  • Why XML, JSON, and YAML are future-proof

This is foundational knowledge for every CCNA Automation student.


language as a data format.
language as a data format.



Why Do We Need Data Formats?

When humans communicate, we follow rules.

We speak a common language.
We structure sentences properly.
We use grammar.
We start conversations with greetings.

Language itself is a format.

Think about it this way:

Your thoughts are data inside your brain.
You cannot send thoughts directly to someone.
You must convert them into a shared language like English.

That process is similar to what happens in networking.

When applications communicate, they also need a common format. Without it, they cannot understand each other.

If two people speak different languages, communication fails.

The same thing happens between software applications.


People communicating without using a common language.
 People communicating without using a common language.


What Happens Without a Data Format?

Imagine an application sends this information:


encapsulation
encapsulation


Where does the interface name end?
Where does the IP address start?
What is the description?

Humans can guess.

Computers cannot.

Applications need exact rules that define:

  • Where data begins

  • Where it ends

  • What each value represents

That is why we use structured data formats like:

  • XML

  • JSON


Sending data without data format.
Sending data without data format.



Apps communicate using XML data format.
Apps communicate using XML data format.



How Do Data Formats Work?

Every data format defines two things:

1️⃣ Structure

Structure defines how information is organized.

Example:
An interface has:

  • Name

  • IP address

  • Description

The structure decides where each piece belongs.


2️⃣ Syntax

Syntax defines the characters and symbols used.

For example:

  • XML uses tags <interface>

  • JSON uses { }, quotes, and colons

  • YAML uses indentation

  • CSV uses commas

The information stays the same.
Only the wrapping format changes.

XML, JSON and YAML structure and syntax example.
XML, JSON and YAML structure and syntax example.


Most beginners find YAML easiest to read.

That is why it is widely used in:

  • Ansible

  • Kubernetes

  • DevOps tools


Understanding Key-Value Pairs (Very Important!)

This is the most important concept in CCNA Automation.

A key-value pair means:

  • The key is the label

  • The value is the data



Example:
Example:

Without the key, the number 75 means nothing.

Is it temperature?
Is it CPU usage?
Is it interface speed?

The key gives meaning to the value.

In automation:

👉 Data without keys is useless.

All structured formats (XML, JSON, YAML) are built on key-value pairs.

Label and Box pair.
Label and Box pair







Cisco CLI:
Cisco CLI:



XML
XML format

JSON
JSON format



YAML
YAML format


What Is Serialization and Parsing in Automation?

Now let’s connect this to programming.

Applications store data in memory as objects.

When they need to:

  • Save it

  • Send it over a network

  • Store it in a file

They must convert it into text format.

This process is called:

Serialization

Converting data → into text format (JSON/XML/YAML)



Serialization and Parsing example.
Serialization and Parsing example.


When receiving data:

Parsing

Reading text → converting it back into usable program data


In simple terms:

  • Serialization = Data → Text

  • Parsing = Text → Data

These are core skills in Python-based automation.

Common Problems with Data Formats in Automation

Text formats are powerful, but strict.

Common issues:

  • Missing comma in JSON → breaks parser

  • Wrong indentation in YAML → breaks file

  • Missing closing tag in XML → invalid file

  • CSV values containing commas → format errors

Always validate your files.

Many DevNet exam questions are based on incorrect formatting examples.


Why Are Text Data Formats Future-Proof related to CCNA automation?

Text formats are not tied to any programming language.

Every major language supports them:

  • Python

  • Java

  • C++

  • Go

  • JavaScript

They integrate with:

  • Git

  • CI/CD pipelines

  • Cloud tools

  • DevOps workflows

That makes them universal and future-ready.



Data Formats are future-proof.
Data Formats are future-proof.


Why This Matters for CCNA Automation

If you want to succeed in:

  • CCNA Automation

  • DevNet Associate

  • Network Automation roles

  • Infrastructure as Code

You must understand:

  • Key-value structure

  • XML

  • JSON

  • YAML

  • Serialization

  • Parsing

This is the foundation of modern networking.

Without structured data, automation does not exist.


#CCNAAutomation
#DevNet
#NetworkAutomation
#JSON
#XML
#YAML
#PythonNetworking
#AutomationBasics
#NetDevOps
#DataFormats


Data Formats: click here

Data Formats and Data Models for CCNA Automation (DevNet) (200-901) - Post 1

Data Formats and Data Models for CCNA (200-901) Automation (DevNet) – Complete Beginner Guide

Data Formats and Data Models
Data Formats and Data Models


If you are preparing for CCNA Automation (formerly DevNet) or planning to move into network automation, understanding data formats is not optional — it is essential.

Modern networks no longer rely only on CLI commands. Today, devices communicate using APIs, controllers, and automation tools. These systems exchange information using structured data formats like XML, JSON, and YAML.

In this guide, you will learn:

  • Why structured data formats are important

  • How XML, JSON, and YAML work

  • How these formats are used in real automation

  • How to parse them using Python

By the end, you will be comfortable reading, creating, and processing automation data just like a network automation engineer.


Why Data Formats Matter in Network Automation

In traditional networking, we configured routers and switches manually. But in automation, systems must communicate with each other automatically.

For example:

  • A controller sends configuration to a router.

  • An API returns device status in structured format.

  • An automation tool like Ansible reads YAML playbooks.

  • NETCONF and RESTCONF use XML or JSON to exchange data.

All of this depends on structured data formats.

Without structure, systems cannot understand each other.


What Are Structured Data Formats?

Structured data formats organize information in a predictable way so machines can read and process it.

The three most important formats in network automation are:

1. XML (Extensible Markup Language)

  • Uses opening and closing tags

  • Very structured and hierarchical

  • Common in NETCONF and older APIs

  • Highly descriptive but more verbose

Best used when strict structure and validation are required.


2. JSON (JavaScript Object Notation)

  • Uses key-value pairs

  • Lightweight and easy to read

  • Very common in REST APIs

  • Used heavily in modern automation

Example structure:

{
"hostname": "R1",
"ip": "10.1.1.1"
}

Best used for API communication and web-based automation.


3. YAML (YAML Ain’t Markup Language)

  • Uses indentation instead of brackets

  • Very clean and human-readable

  • Used in Ansible playbooks

  • Common in configuration management

Example structure:

hostname: R1
ip: 10.1.1.1

Best used for configuration files and automation frameworks.


XML vs JSON vs YAML – Which One Should You Use?

XML vs JSON vs YAML
XML vs JSON vs YAML 


In real-world automation:

  • REST APIs → JSON

  • NETCONF → XML

  • Ansible → YAML

Understanding when to use each format is a key CCNA Automation skill.


Parsing XML, JSON, and YAML with Python

Learning the syntax is not enough. You must also know how to process these formats programmatically.

Python makes this simple using built-in libraries:

  • json module for JSON

  • xml.etree.ElementTree for XML

  • yaml library for YAML

Example (JSON parsing):

import json

data = '{"hostname": "R1", "ip": "10.1.1.1"}'
parsed = json.loads(data)

print(parsed["hostname"])

With Python, you can:

  • Load API responses

  • Extract specific values

  • Modify configuration data

  • Automate network tasks

This is the foundation of DevNet and automation careers.


What You Will Learn in This Course

This course is designed step-by-step for CCNA Automation students.

Section 1 – Data Formats Fundamentals

You will learn:

  • Why structured text formats are required

  • How XML, JSON, and YAML organize data

  • Differences between hierarchical and key-value structures

  • Advantages and disadvantages of each format


Section 2 – Parsing with Python

You will practice:

  • Loading XML trees

  • Extracting JSON values

  • Reading YAML configuration files

  • Working with real API response examples

  • Automating structured data handling

This section bridges theory with real automation practice.


Real-World Applications

After completing this course, you will be able to:

  • Read API responses confidently

  • Create structured configuration files

  • Work with NETCONF and RESTCONF

  • Build Python scripts for automation

  • Understand Ansible playbooks

  • Choose the correct data format for any automation scenario

These are core skills required for:

  • CCNA Automation

  • Cisco DevNet Associate

  • Network Automation Engineer roles

  • Infrastructure as Code environments


CCNA Automation - Post 2 - Click Here



#CCNAAutomation
#DevNet
#NetworkAutomation
#PythonForNetworking
#XML
#JSON
#YAML
#CiscoDevNet
#RESTAPI
#NETCONF
#Ansible

Introduction to Networking: Application Layer (Layers 5–7) — Simple Guide

 In CCNA we usually treat layers 5, 6, and 7 (Session, Presentation, Application) as a single top layer called the Application layer. These layers are mostly about how software talks to the network, so network teams often consider them together.


TCP-IP Application layer.
 TCP-IP Application layer.


Why group them as one layer?

The OSI model has seven layers, but in practice:

  • Session, Presentation, and Application are about applications and user-facing software.

  • They don’t normally change how routers and switches work.

  • For CCNA and CCNP, we usually talk about them together as the Application layer — the place where apps use rules (protocols) to communicate.

What does the Application layer do?

The Application layer is where applications (like browsers, email clients, and apps) meet the network. It defines the rules apps use to send and receive data. These rules are called protocols — for example, HTTP, FTP, SMTP, etc.

Real-world analogy: two people speaking different languages

Imagine Joe speaks only English and Bob speaks only French. They can’t talk unless they use the same language. Protocols are like that common language or grammar. If both computers follow the same protocol (like HTTP), they understand each other.


Application Layer as a language example.
Application Layer as a language example.


How HTTP works — simple steps

When you type a website address in your browser, here’s what happens at the Application layer:

  1. Request (GET)
    The browser sends an HTTP request to the server asking for a page (for example, GET /index.html).

  2. Server response (200 OK / 404 Not Found)
    The server replies. If the page exists, it sends HTTP 200 OK and the page contents. If not, it may send HTTP 404 Not Found.

  3. Data transfer
    The server can send the page in parts. The first HTTP message includes headers; following parts carry data.

  4. Follow-up requests
    When you click another link, the browser sends another GET request and the server responds again.

HTTP is a client-server, request-response protocol: the client asks; the server answers.


HTTP example.
HTTP example.


How does HTTP work?
How does HTTP work?


Where is the network in all this?

The Application layer defines the rules and formats for messages, but the actual transport of those messages is handled by lower layers (Transport, Network, Data Link, Physical). The Application layer doesn’t send bits itself — it relies on the lower layers to carry the data across the network.

Introduction to Networking: Understanding the OSI Model (Simple Explanation for CCNA & CCNP)

Understanding the OSI Model




What is Data Encapsulation?

Before you understand the OSI model, you must first understand data encapsulation.

Let’s use a simple example.

Imagine you want to send a wedding invitation letter to your friend in another city. If you just write the letter and drop it into the mailbox without an envelope, address, or stamp — will it reach your friend?

Of course not.

The postal service needs extra information:

  • Sender name

  • Sender address

  • Recipient name

  • Recipient address

  • Postcode

  • Stamp

Without this information, the letter cannot be delivered.

This process of putting a letter inside an envelope with proper details is similar to data encapsulation in networking.


What is Data Encapsulation in Networking?

In computer networks, we cannot send raw data directly.

For example, when you send a Facebook message:

  1. You type the message.

  2. The browser sends it to the Operating System.

  3. The OS sends it to the Network Interface Card (NIC).

  4. The NIC sends it to the network.

At each step, extra information is added to your data. This extra information is called a header.

These headers include:

  • Source address (where it came from)

  • Destination address (where it is going)

  • Protocol type

  • Port numbers

  • Error-checking information

This process of adding extra information to data is called:

Encapsulation = Adding headers to data so it can travel across the network properly.

At the receiving side, the process is reversed. Headers are removed one by one. This is called de-encapsulation.


Why Do We Need the OSI Model?

In the early days of networking, different companies created their own networking systems. These systems did not follow common rules.

As a result:

  • Devices from different vendors could not communicate.

  • Troubleshooting was difficult.

  • There was no standard structure.

To solve this problem, engineers created a standard framework called the OSI Model.


What is the OSI Model?

OSI stands for Open Systems Interconnection.

It is a 7-layer model that explains how data moves from one device to another.

Each layer has a specific job.

The OSI model helps:

  • Standardize networking

  • Ensure devices from different vendors work together

  • Make troubleshooting easier

  • Explain how data is encapsulated step by step


The 7 Layers of the OSI Model

  1. Layer 7 – Application
    Handles user applications like web browsers, email, etc.

  2. Layer 6 – Presentation
    Handles data formatting, encryption, and compression.

  3. Layer 5 – Session
    Manages sessions between devices.

  4. Layer 4 – Transport
    Handles reliable communication (TCP/UDP).
    Data is called a segment here.

  5. Layer 3 – Network
    Handles IP addressing and routing.
    Data is called a packet here.

  6. Layer 2 – Data Link
    Handles MAC addresses and switching.
    Data is called a frame here.

  7. Layer 1 – Physical
    Sends bits over cables or wireless signals.

#OSIModel #CCNA #CCNP #NetworkingBasics #DataEncapsulation #TCPIP #NetworkEngineer #CiscoNetworking #Subnetting #ITStudents

How Encapsulation Works in the OSI Model

When data is sent:

Application Data
↓
Transport Layer adds TCP/UDP header → Segment
↓
Network Layer adds IP header → Packet
↓
Data Link Layer adds MAC header + trailer → Frame
↓
Physical Layer sends bits

At the destination, headers are removed in reverse order.


OSI Model vs TCP/IP Model

Even though we use the TCP/IP model in real networks, many engineers still refer to OSI layers.

For example:

  • “Is this a Layer 2 issue?”

  • “Do you need a Layer 3 port?”

  • “This is a Layer 7 protocol.”

The modern TCP/IP model has 5 layers, but it maps closely to the lower 4 layers of the OSI model.

For CCNA and CCNP students, understanding both models is very important.


Important Note for CCNA & CCNP Students

The CCNA exam does not deeply test the OSI model anymore. However, networking professionals still use OSI layer terminology daily.

If you want to:

  • Troubleshoot networks

  • Work as a network engineer

  • Pass CCNA or CCNP

  • Understand packet flow

You must clearly understand the OSI model.


#OSIModel
#CCNA
#CCNP
#NetworkingBasics
#DataEncapsulation
#TCPIP
#NetworkEngineer
#CiscoNetworking
#Subnetting
#ITStudents




Subnetting Practice Questions with Solved Answers

 

Subnetting Practice Questions with Solved Answers



Question 1

Find the network address and broadcast address of:
192.168.1.10 /24

Solution

  • /24 means subnet mask = 255.255.255.0

  • Network address → 192.168.1.0

  • Broadcast address → 192.168.1.255

✅ Answer:
Network: 192.168.1.0
Broadcast: 192.168.1.255


Question 2

How many hosts are available in a /26 network?

Solution

  • Total bits = 32

  • Host bits = 32 − 26 = 6

  • Hosts = 26−2=622^6 − 2 = 62

✅ Answer: 62 usable hosts


Question 3

What is the subnet mask of /27?

Solution

  • /27 means 27 network bits

  • Subnet mask = 255.255.255.224

✅ Answer: 255.255.255.224


Question 4

Find the subnet size (block size) of a /28 network.

Solution

  • Last octet mask = 240

  • Block size = 256 − 240 = 16

✅ Answer: 16 IP addresses per subnet


Question 5

How many subnets are created if you borrow 3 bits?

Solution

  • Number of subnets = 23=82^3 = 8

✅ Answer: 8 subnets


Question 6

Identify the subnet of IP address:
10.0.0.77 /25

Solution

  • /25 subnet mask = 255.255.255.128

  • Block size = 128

  • Subnets:

    • 10.0.0.0 – 10.0.0.127

    • 10.0.0.128 – 10.0.0.255

  • IP 10.0.0.77 falls in first subnet

✅ Answer: 10.0.0.0 /25


Question 7

What is the broadcast address of:
172.16.5.33 /30

Solution

  • /30 mask = 255.255.255.252

  • Block size = 4

  • Nearest network = 172.16.5.32

  • Broadcast = 172.16.5.35

✅ Answer: 172.16.5.35


Question 8

How many usable hosts are in a /30 subnet and where is it used?

Solution

  • Host bits = 2

  • Usable hosts = 22−2=22^2 − 2 = 2

  • Commonly used for point-to-point links

✅ Answer:
2 usable hosts, used for router-to-router links

Practice Questions - Subnetting -1

 

Subnetting is one of the most important concepts in computer networking and a must-have skill for network engineers, cybersecurity professionals, and IT students. It helps in dividing a large IP network into smaller, manageable sub-networks, improving performance, security, and efficient IP address utilization.
In this blog series, you will learn subnetting step-by-step with simple explanations, real examples, and hands-on practice questions.


Question #1

What is the range of assignable IP addresses for a subnet containing an IP address of 172.16.1.10 /19?

a. 172.16.0.1 – 172.16.31.254

b. 172.16.0.1 – 172.16.63.254

c. 172.16.0.0 – 172.16.31.255

d. 172.16.0.1 – 172.16.31.255

e. 172.16.0.0 – 172.16.63.254

Question #2

You are assigning IP addresses to hosts in the 192.168.4.0 /26 subnet. Which two of the following IP addresses are assignable IP addresses that reside in that subnet?

a. 192.168.4.0

b. 192.168.4.63

c. 192.168.4.62

d. 192.168.4.32

e. 192.168.4.64

Question #3

A host in your network has been assigned an IP address of 192.168.181.182 /25. What is the subnet to which the host belongs?

a. 192.168.181.128 /25

b. 192.168.181.0 /25

c. 192.168.181.176 /25

d. 192.168.181.192 /25

e. 192.168.181.160 /25

Question #4

You are working with a Class B network with the private IP address of 172.16.0.0 /16. You need to maximize the number of broadcast domains, where each broadcast domain can accommodate 1000 hosts. What subnet mask should you use?

a. /22

b. /23

c. /24

d. /25

e. /26

Question #5

What is the directed broadcast address of a subnet containing an IP address of 172.16.1.10 /19?

a. 172.16.15.255

b. 172.16.31.255

c. 172.16.255.255

d. 172.16.95.255

e. 172.16.0.255

Question #6

A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many subnets can be created by using this subnet mask?

a. 32

b. 16

c. 30

d. 8

e. 14

Question #7

Given a subnet of 172.16.56.0 /21, identify which of the following IP addresses belong to this subnet. (Select 2.)

a. 172.16.54.129

b. 172.16.62.255

c. 172.16.61.0

d. 172.16.65.255

e. 172.16.64.1

Question #8

What is the subnet address of the IP address 192.168.5.55 with a subnet mask of 255.255.255.224?

a. 192.168.5.0 /27

b. 192.168.5.16 /27

c. 192.168.5.32 /27

d. 192.168.5.48 /27

e. 192.168.5.64 /27



Question #9

You are working for a company that will be using the 192.168.1.0 /24 private IP address space for IP addressing inside their organization.

They have multiple geographical locations and want to carve up the 192.168.1.0 /24 address space into subnets. Their largest subnet will need 13 hosts.

What subnet mask should you use to accommodate at least 13 hosts per subnet, while maximizing the number of subnets that can be created?

a. 255.255.255.248

b. 255.255.255.224

c. 255.255.255.252

d. 255.255.255.192

e. 255.255.255.240

Question #10

A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many assignable addresses are available in each of the subnets?

a. 32

b. 16

c. 30

d. 8

e. 14

Question #11

An IP address of 192.168.0.100 /27 belongs to which of the following subnets?

a. 192.168.0.92

b. 192.168.0.128

c. 192.168.0.64

d. 192.168.0.96

e. 192.168.0.32

Question #12

What subnet mask should be used to subnet the 192.168.10.0 network to support the number of subnets and IP addresses per subnet shown in the following topology?



a. 255.255.255.0

b. 255.255.255.128

c. 255.255.255.192

d. 255.255.255.224

e. 255.255.255.240





Solutions

Question #1

What is the range of assignable IP addresses for a subnet containing an IP address of 172.16.1.10 /19?

a. 172.16.0.1 – 172.16.31.254

b. 172.16.0.1 – 172.16.63.254

c. 172.16.0.0 – 172.16.31.255

d. 172.16.0.1 – 172.16.31.255

e. 172.16.0.0 – 172.16.63.254

Answer: a

To determine the subnets, assignable IP address ranges, and directed broadcast addresses created by the 19-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 19-bit subnet mask, which is written in binary as:

11111111 11111111 11100000 00000000

The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0

Since the third octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

172.16.0.0/19

We then count by the block size (of 32) in the interesting octet (the third octet in this question) to determine the remaining subnets:

172.16.32.0 /19

172.16.64.0 /19

172.16.96.0 /19

172.16.128.0 /19

172.16.160.0 /19

172.16.192.0 /19

172.16.224.0 /19

Step #5: Identify the subnet address, the directed broadcast address, and the usable range of addresses.

Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet.

The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.

The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is:

172.16.31.255

The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is:

172.16.0.1 – 172.16.31.254

Question #2

You are assigning IP addresses to hosts in the 192.168.4.0 /26 subnet. Which two of the following IP addresses are assignable IP addresses that reside in that subnet?

a. 192.168.4.0

b. 192.168.4.63

c. 192.168.4.62

d. 192.168.4.32

e. 192.168.4.64

Answer: c and d

To determine subnets and usable address ranges created by the 26-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 26-bit subnet mask, which is written in binary as:

11111111 11111111 11111111 11000000

The interesting octet is the forth octet, because the forth octet (i.e. 11000000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 26-bit subnet mask can be written in dotted decimal notation as: 255.255.255.192

Since the forth octet is the interesting octet, the decimal value in the interesting octet is 192.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 192 = 64

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

192.168.4.0 /26

We then count by the block size (of 64) in the interesting octet (the forth octet in this question) to determine the remaining subnets:

192.168.4.64 /26

192.168.4.128 /26

192.168.4.192 /26

Step #5:

This question is asking about the 192.168.4.0 /26 subnet. From the above list of subnets, we can determine that the assignable range of IP addresses for this subnet is 192.168.4.1 – 192.168.4.62. We can also determine that 192.168.4.0 is the network address, and 192.168.4.63 is the directed broadcast address.

From the assignable range of IP addresses we have calculated, we can determine that the two assignable IP addresses given as options in this question are: 192.168.4.62 and 192.168.4.32.

Question #3

A host in your network has been assigned an IP address of 192.168.181.182 /25. What is the subnet to which the host belongs?

a. 192.168.181.128 /25

b. 192.168.181.0 /25

c. 192.168.181.176 /25

d. 192.168.181.192 /25

e. 192.168.181.160 /25

Answer: a

To determine subnets and usable address ranges created by the 25-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 25-bit subnet mask, which is written in binary as:

11111111 11111111 11111111 10000000

The interesting octet is the forth octet, because the forth octet (i.e. 10000000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 25-bit subnet mask can be written in dotted decimal notation as: 255.255.255.128

Since the forth octet is the interesting octet, the decimal value in the interesting octet is 128.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 128 = 128

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

192.168.181.0 /25

We then count by the block size (of 128) in the interesting octet (the forth octet in this question) to determine the remaining subnets, or in this case just a single additional subnet


192.168.181.128 /25

Now that we have our two subnets identified, we can determine the subnet in which the IP address of 192.168.181.182 resides.

Since the usable range of IP addresses for the 192.168.181.128 /25 network is 192.168.181.129 – 192.168.181.254 (because 192.168.181.128 is the network address, and 192.168.181.255 is the directed broadcast address), and since 192.168.181.182 is in that range, the subnet to which 192.168.181.182 /25 belongs is:

192.168.181.128 /25

Question #4

You are working with a Class B network with the private IP address of 172.16.0.0 /16. You need to maximize the number of broadcast domains, where each broadcast domain can accommodate 1000 hosts. What subnet mask should you use?

a. /22

b. /23

c. /24

d. /25

e. /26

Answer: a

In addition to testing your knowledge of subnetting, this question is also making sure you understand that a subnet is a broadcast domain. This should not be confused with a collision domain (i.e. each port on a switch is in its own collision domain).

To determine how many host bits are required to support 1000 hosts, we can create a table from the following formula:

Number of Hosts = 2h – 2, where h is the number of host bits

From this formula, we can create the following table:

1 Host Bit => 0 Hosts

2 Host Bits => 2 Hosts

3 Host Bits => 6 Hosts

4 Host Bits => 14 Hosts

5 Host Bits => 30 Hosts

6 Host Bits => 62 Hosts


7 Host Bits => 126 Hosts

8 Host Bits => 254 Hosts

9 Host Bits => 510 Hosts

10 Host Bits => 1022 Hosts

This table tells us that a subnet with 10 host bits will accommodate the requirement of 1000 hosts. If we have 10 host bits, then we have a 22-bit subnet mask (i.e. 32 – 10 = 22). Also, by not using more host bits than we need, we are maximizing the number of subnets that can be created.

Question #5

What is the directed broadcast address of a subnet containing an IP address of 172.16.1.10 /19?

a. 172.16.15.255

b. 172.16.31.255

c. 172.16.255.255

d. 172.16.95.255

e. 172.16.0.255

Answer: b

To determine the subnets, assignable IP address ranges, and directed broadcast addresses created by the 19-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 19-bit subnet mask, which is written in binary as:

11111111 11111111 11100000 00000000

The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0

Since the third octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.


Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

172.16.0.0 /19

We then count by the block size (of 32) in the interesting octet (the third octet in this question) to determine the remaining subnets:

172.16.32.0 /19

172.16.64.0 /19

172.16.96.0 /19

172.16.128.0 /19

172.16.160.0 /19

172.16.192.0 /19

172.16.224.0 /19

Step #5: Identify the subnet address, the directed broadcast address, and the usable range of addresses.

Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet.

The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.

The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is:

172.16.31.255

The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is:

172.16.0.1 – 172.16.31.254

Question #6

A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many subnets can be created by using this subnet mask?

a. 32

b. 16

c. 30

d. 8


e. 14

Answer: b

The subnet in this question is a Class C network, because there is a 192 in the first octet. A class C network has a natural mask of 24 bits. However, this network has a 28-bit subnet mask. Therefore, we have 4 borrowed bits, which are network bits added to a network’s natural mask (i.e. 28 – 24 = 4). The number of subnets can be calculated as follows:

Number of Subnets = 2s, where s is the number of borrowed bits.

Therefore, in this question, the number of created subnets is 16:

Number of Subnets = 24 = 16

Question #7

Given a subnet of 172.16.56.0 /21, identify which of the following IP addresses belong to this subnet. (Select 2.)

a. 172.16.54.129

b. 172.16.62.255

c. 172.16.61.0

d. 172.16.65.255

e. 172.16.64.1

Answer: b, c

To determine subnets and usable address ranges created by the 21-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 21-bit subnet mask, which is written in binary as:

11111111 11111111 11111000 00000000

The interesting octet is the third octet, because the third octet (i.e. 11111000) is the first octet to contain a 0 in the binary subnet mask.

Step #2: Identify the decimal value in the interesting octet of the subnet mask. A 21-bit subnet mask can be written in dotted decimal notation as: 255.255.248.0


Since the third octet is the interesting octet, the decimal value in the interesting octet is 248.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 248 = 8

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

172.16.0.0 /21

We then count by the block size (of 8) in the interesting octet (the third octet in this question) to determine the remaining subnets:

172.16.8.0 /21 172.16.16.0 /21 172.16.24.0 /21 172.16.32.0 /21 172.16.40.0 /21 172.16.48.0 /21 172.16.56.0 /21 172.16.64.0 /21 ... SUBNETS OMITTED ...

We can stop counting after we pass the subnet we are being asked about. Specifically, in this question, we’re being asked about 172.16.56.0 /21.

Step #5: Identify the subnet address, the directed broadcast address, and the usable range of addresses.

The subnet address, where all host bits are set to a 0, is given:

172.16.56.0 /24

The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.

The next subnet address is 172.16.64.0. So, the directed broadcast address for the 172.16.54.0 /21 subnet is 1 less than 172.16.64.0, which is: 172.16.63.255

The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the usable IP address range for the 172.16.56.0 /21 network is:

172.16.56.1 – 172.16.63.254

The only IP addresses in this question that reside in this range are:

172.16.62.255 172.16.61.0

WARNING: Many CCNA R&S candidates look at IP addresses like these and immediately assume they are not usable IP addresses, because they have a 0 or a 255 in the forth octet. They argue that 172.16.61.0 is a subnet address and that 172.16.62.255 is a directed broadcast address.

While that would only be true of the subnet mask were 24-bits, remember that, by definition, a subnet address has all of its host bits set to a 0, and a directed broadcast address has all of its host bits set to a 1. In this question, we have 11 host bits (i.e. 32 – 21 = 11), not 8 host bits. So, 172.16.62.255 and 172.16.61.0 are actually usable IP addresses.

Question #8

What is the subnet address of the IP address 192.168.5.55 with a subnet mask of 255.255.255.224?

a. 192.168.5.0 /27

b. 192.168.5.16 /27

c. 192.168.5.32 /27

d. 192.168.5.48 /27

e. 192.168.5.64 /27

Answer: c

To determine subnets and usable address ranges created by the 27-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 27-bit subnet mask, which is written in binary as:

11111111 11111111 11111111 11100000

The interesting octet is the forth octet, because the forth octet (i.e. 11100000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 27-bit subnet mask can be written in dotted decimal notation as: 255.255.255.224


Since the forth octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

192.168.5.0 /27

We then count by the block size (of 32) in the interesting octet (the forth octet in this question) to determine the remaining subnets:

192.168.5.32 /27

192.168.5.64 /27

192.168.5.96 /27

192.168.5.128 /27

192.168.5.160 /27

192.168.5.192 /27

192.168.5.224 /27

Now that we have all of our subnets identified, we can determine the subnet in which the IP address of 192.168.5.55 resides.

Since the usable range of IP addresses for the 192.168.5.32 /27 network is 192.168.5.33 – 192.168.5.62 (because 192.168.5.32 is the network address, and 192.168.5.63 is the directed broadcast address), and since 192.168.5.55 is in that range, the subnet to which 192.168.5.55 /27 belongs is:

192.168.5.32 /27

Question #9

You are working for a company that will be using the 192.168.1.0 /24 private IP address space for IP addressing inside their organization.

They have multiple geographical locations and want to carve up the 192.168.1.0 /24 address space into subnets. Their largest subnet will need 13 hosts.

What subnet mask should you use to accommodate at least 13 hosts per subnet, while maximizing the number of subnets that can be created?

a. 255.255.255.248


b. 255.255.255.224

c. 255.255.255.252

d. 255.255.255.192

e. 255.255.255.240

Answer: e

We can determine the maximum number of hosts allowed in a subnet by raising the number 2 to the power of the number of host bits and then subtracting 2. So, the formula looks like this:

Maximum Number of Hosts per Subnet = 2h – 2, where h is the number of host bits.

Why are we subtracting two? Well, there are two IP addresses in the subnet that cannot be assigned. These addresses are: (1) the network address, where all of the host bits are set to a 0 and (2) the directed broadcast address, where all of the host bits are set to a 1.

In the actual exam, if you are given scratch paper or access to a note taking application, you might want to write out a table such as the following for your reference:

1 Host Bit: 21 – 2 = 0

2 Host Bits: 22 – 2 = 2

3 Host Bits: 23 – 2 = 6

4 Host Bits: 24 – 2 = 14

5 Host Bits: 25 – 2 = 30

6 Host Bits: 26 – 2 = 62

7 Host Bits: 27 – 2 = 126

8 Host Bits: 28 – 2 = 254

In this question, we’re asked to determine a subnet mask that accommodates at least 13 hosts per subnet. By looking at the reference table we created, we can see that 4 host bits (which support 14 hosts) would work, while 3 host bits (which supports only 6 hosts) would not be enough.

So, we need a subnet with 4 host bits, which are enough host bits to meet the design goal, but not more than we need. Using more host bits than we need would violate the requirement to maximize the number of subnets.

A subnet mask with 4 host bits has 28 network bits (i.e. 32 – 4 = 28), and therefore a 28-bit subnet mask. A 28-bit subnet mask can be written as:

255.255.255.240


Question #10

A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many assignable addresses are available in each of the subnets?

a. 32

b. 16

c. 30

d. 8

e. 14

Answer: e

An IPv4 address contains a total of 32 bits. Since, in this question, we have 28 subnet bits, the number of host bits is 4 (i.e. 32 – 28 = 4). The number of assignable IP addresses in a subnet can be calculated as follows:

Number of Assignable IP Addresses = 2h – 2, where h is the number of host bits.

Therefore, in this question, each subnet has 14 assignable IP addresses:

Number of Assignable IP Addresses = 24 – 2 = 16 – 2 = 14

Question #11

An IP address of 192.168.0.100 /27 belongs to which of the following subnets?

a. 192.168.0.92

b. 192.168.0.128

c. 192.168.0.64

d. 192.168.0.96

e. 192.168.0.32

Answer: d

To determine the subnets created by the 27-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).

In this question, we have a 19-bit subnet mask, which is written in binary as:

11111111 11111111 11111111 11100000

The interesting octet is the forth octet, because the forth octet (i.e. 11100000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.

A 27-bit subnet mask can be written in dotted decimal notation as: 255.255.255.224

Since the forth octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.

Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.

Placing a zero in the first interesting octet identifies the first subnet as:

192.168.0.0 /27

We then count by the block size (of 32) in the interesting octet (the forth octet in this question) to determine the remaining subnets:

192.168.0.32 /27

192.168.0.64 /27

192.168.0.96 /27

192.168.0.128 /27

192.168.0.160 /27

192.168.0.192 /27

192.168.0.224 /27

Step #5: Identify the subnet address of the IP address 192.168.0.100 /27.

Looking through the subnets created by the 27-bit subnet mask reveals that the IP address of 192.168.0.100 resides in the 192.168.0.96 subnet.

Question #12

What subnet mask should be used to subnet the 192.168.10.0 network to support the number of subnets and IP addresses per subnet shown in the following topology?




a. 255.255.255.0

b. 255.255.255.128

c. 255.255.255.192

d. 255.255.255.224

e. 255.255.255.240

Answer: c

To meet the design requirements, four subnets must be created, and each subnet must accommodate a maximum of 50 IP addresses.

We can begin by creating a listing of how many subnets are created from different numbers of borrowed bits, using the formula:

Number of Subnets Created = 2n, where n is the number of borrowed bits

1 borrowed bits => 2 subnets

2 borrowed bits => 4 subnets

3 borrowed bits => 8 subnets

4 borrowed bits => 16 subnets

5 borrowed bits => 32 subnets

6 borrowed bits => 64 subnets

7 borrowed bits => 128 subnets

From this, we can see we need at least 2 borrowed bits to accommodate 4 subnets. However, we need to make sure the subnet will accommodate 50 IP addresses. To determine this, we can use the formula:

Number of IP Addresses = 2h – 2, where h is the number of host bits


If we have 2 borrowed bits (i.e. the minimum number of borrowed bits required for 4 subnets), we have 6 host bits (i.e. 8 – 2 = 6). From the above formula, we can determine the number of IP addresses supported by 6 host bits.

Number of IP Addresses = 26 – 2 = 62

Since 6 host bits meet our requirement of at least 50 IP addresses per subnet, we can use a 26-bit subnet mask (i.e. 2 bits added to the Class C default mask (also known as the natural mask) of 24 bits). A 26-bit subnet mask can be written as:

255.255.255.192




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...