DevOps Training
  • DevOps
  • What is DevOps
    • What DevOps Look like
    • Why DevOps Needed
    • DevOps Automation Tools
    • DevOps Principles
  • cloud computing
    • How DevOps links with Cloud Computing
    • What is cloud computing?
      • Platform as a service (PaaS)
      • Infrastructure as a service (IaaS)
      • Software as a service (SaaS)
      • Function as a Service
      • SaaS, PaaS, IaaS
  • Version Control
    • Git as Version Control
      • Setting up Remote Repo
      • Git Hooks
      • github vs gitlab vs bitbucket
      • Quick Recap Git
  • DevOps #01 Continuous Integration
    • Continuous Integration & Continuous Delivery
      • Understanding CI Tools
      • Prerequisite
      • Continuous Integration
      • CI Tools
      • Travis-CI
        • Travis CI with S3
        • Static Site Build S3
        • Beanstalk with AWS CLI
          • Elastic Beanstalk with Travis CI
        • Travis using Code Deploy EC2
          • Github and Code Deploy
          • Travis CI with Code Deploy
      • Gitlab-CI
        • CI Setup for application
        • Gitlab Runners on EC2
        • CI Integration with AWS
          • Deploying App using Gitlab CI
          • Gitlab CI with AWS S3
          • Gitlab CI with ECS
          • CI Integration with EC2
            • Update and Clean Gitlab.yml
        • Install Gitlab on EC2
      • CI/CD using Jenkins CI
        • Jenkins Build on EC2
        • Jenkins Build EC2 Ubuntu
        • Jenkins CI/CD
          • Create a Build Item
          • Create a Build Pipleine
            • Pipeline Using Docker
            • Pipeline Examples
          • Jenkins CI with S3
            • Jenkins CI - S3
          • Jenkins CI with EC2
    • Jenkins CI Cluster Mode
    • AWS Code Pipeline CI/CD
      • AWS CI/CD Tools
        • AWS Code Build
        • AWS Code Deploy to Beanstalk
        • AWS Code Deploy to EC2
        • AWS Pipeline - Example CI/CD
  • Docker
    • Docker
      • Docker for Developers
        • Install and setup
        • Docker Commands
        • Docker Images Container
        • Docker Architecture
    • Docker Demos
      • Node JS Container
    • Docker-compose
      • Using Docker Compose
      • Docker Compose Demo
  • AWS Quick Refresh
    • AWS Quick Recap - Videos
    • AWS Quick Recap
  • AWS Architecture - Lab
    • Application Deployment - 01
    • Application Deployment - 02
    • Application 3 tier Architecture
  • Basic Networking
    • Computer Networking for Beginners
      • Basic of Networking
      • Networking Protocols
      • OSI Model
      • Network address and Host address
      • Subnetting Type
    • Network Architecture
    • Networking Layers OSI Model
    • Internet protocol
      • CIDR and subnetting
        • Examples
      • AWS VPC Subnets
  • VPC and Networking
    • AWS VPC
    • VPC Demo
      • Bastion Host | Jump Server
  • AWS Components
    • AWS Components In Depth
      • AWS Storage
        • AWS EBS
        • AWS Cloudfront
        • AWS S3
      • AWS Compute
        • ECS
        • AWS VPC
          • VPC Components
        • AWS EC2
        • AWS ELB
          • Application Load balancer
            • Example
        • AWS EC2 Auto Scaling
          • Demo
        • AWS Route 53
        • AWS Lambda Serverless
          • AWS Lambda Serverless Computing
  • Assignments
    • Assignment 01-Node JS app on EC2
    • Assignment 02-Node JS with Mysql
    • Assignment-03
  • Microservices
    • Microservices Architecture
      • Docker and Docker-Compose
      • Docker-Compose Example 01
      • Docker-Compose Example 02
      • Hand-on | Building Microservices
    • Architecture Components
  • AWS ECS
    • AWS ECS
      • Introduction of ECS
Powered by GitBook
On this page
  • Problem-01:
  • Solution-
  • Problem-02:
  • Solution-
  • Problem-03:
  • Solution-
  • Rule-01:
  • Rule-02:
  • Rule-03:

Was this helpful?

  1. Basic Networking
  2. Internet protocol
  3. CIDR and subnetting

Examples

Problem-01:

Given the CIDR representation 20.10.30.35 / 27. Find the range of IP Addresses in the CIDR block.

Solution-

Given CIDR representation is 20.10.30.35 / 27.

It suggests-

  • 27 bits are used for the identification of network.

  • Remaining 5 bits are used for the identification of hosts in the network.

Given CIDR IP Address may be represented as-

00010100.00001010.00011110.00100011 / 27

So,

  • First IP Address = 00010100.00001010.00011110.00100000 = 20.10.30.32

  • Last IP Address = 00010100.00001010.00011110.00111111 = 20.10.30.63

Thus, Range of IP Addresses = [ 20.10.30.32 , 20.10.30.63]

Problem-02:

Given the CIDR representation 100.1.2.35 / 20. Find the range of IP Addresses in the CIDR block.

Solution-

Given CIDR representation is 100.1.2.35 / 20.

It suggests-

  • 20 bits are used for the identification of network.

  • Remaining 12 bits are used for the identification of hosts in the network.

Given CIDR IP Address may be represented as-

01100100.00000001.00000010.00100011 / 20

So,

  • First IP Address = 01100100.00000001.00000000.00000000 = 100.1.0.0

  • Last IP Address = 01100100.00000001.00001111.11111111 = 100.1.15.255

Thus, Range of IP Addresses = [ 100.1.0.0 , 100.1.15.255]

Problem-03:

Consider a block of IP Addresses ranging from 100.1.2.32 to 100.1.2.47.

  1. Is it a CIDR block?

  2. If yes, give the CIDR representation.

Solution-

For any given block to be a CIDR block, 3 rules must be satisfied-

Rule-01:

  • According to Rule-01, all the IP Addresses must be contiguous.

  • Clearly, all the given IP Addresses are contiguous.

  • So, Rule-01 is satisfied.

Rule-02:

  • According to Rule-02, size of the block must be presentable as 2n.

  • Number of IP Addresses in the given block = 47 – 32 + 1 = 16.

  • Size of the block = 16 which can be represented as 24.

  • So, Rule-02 is satisfied.

Rule-03:

  • According to Rule-03, first IP Address must be divisible by size of the block.

  • So, 100.1.2.32 must be divisible by 24.

  • 100.1.2.32 = 100.1.2.00100000 is divisible by 24 since its 4 least significant bits are zero.

  • So, Rule-03 is satisfied.

Since all the rules are satisfied, therefore given block is a CIDR block.

PreviousCIDR and subnettingNextAWS VPC Subnets

Last updated 5 years ago

Was this helpful?