What is CIDR?

Classless Inter-Domain Routing – method of allocating IP addresses for networks & sub-networks. It improves the distribution of IP addresses.

In this blog we will explore the IPv4 IP Address, Classes of IPv4, Method for allocation IP addresses using CIDR – Classless Inter-Domain Routing.

  • IPv4 – 4th version of the Internet Protocol.
  • Addresses are 32 bits Integer. Binary at back-end
  • Divided in 4 Octets
  • It has Network Component & Host Component depending upon Subnet Mask. Will see later.

For example – Valid IPv4 Address. Lets see its binary representation. Below table is used to binary conversion.


192 – Let see which bits are turned on. (128 + 62 = 192)


168 – (128 + 32 + 8 = 168)


0: All are turned off



00000001 – Binary Representation:


Classes of IP:

ClassRangeCIDR NotationDefault Subnet
A0.0.0.0 –
B128.0.0.0 –
C192.0.0.0 –
D224.0.0.0 –
E –
D class reserved for Multicast IPs and E for experimental IP addresses.

CIDR Notation – Subnet masks tells us the Network & Host Details:

  • /8 – First 8 bits reserved for network & rest are for host
  • /16 – First 16 bits reserved for network & rest are forhost
  • /24 – First 24 bits reserved for network & rest are forhost – Reserved for loopback network

Reserved Private IPv4 (Which can be used within the local networks)

  • –
  • –
  • –

Network Part & Host Part:

IPv4 has two main component : Network Part & Host Part. To identify the these parts we need Subnet Mask. Subnet Mask is also 32-bit number where network bits are represent as 1 & host bits as 0.

Example 1: Network IP its default Subnet mask = (CIDR /24)

CIDR Notation (/24) – Means 24 bits reserved for network. Rest of 8 for Host. : Binary Representation

Network BitsNetwork BitsNetwork BitsHost Bits
192 Fixed0 Fixed0 Fixed0 – 255
  • Total no of IP in network = 2No of Host Bits = 28 = 256
  • Total no of usable IP in network = 2No of Host Bits – 2= 256
  • As 2 IP address reserved for Network IP & Broadcast IP
  • First IP – (Network IP)
  • Last IP – (Broadcast IP)
  • First Usable IP –
  • Last Usable IP –

Example 2: its Subnet mask = (CIDR /16)

Network BitsNetwork BitsHost BitsHost Bits
192 Fixed0 Fixed0 – 2550 – 255
  • Total no of IP in network = 2No of Host Bits = 216 = 65,536
  • Total no of usable IP in network = 2No of Host Bits – 2= 65,534
  • As 2 IP address reserved for Network IP & Broadcast IP
  • First IP – (Network IP)
  • Last IP – (Broadcast IP)
  • First Usable IP –
  • Last Usable IP –


So if you are using the default subnets – you are getting list of IPs in that network. Suppose you want to manage the network such like within network you want some sub networks, so you have to borrow the bits from host parts i.e. change the CIDR.

Let see some examples in details.

Example 1: IP :

Subnet Mask: ( CIDR Notation /20)

CIDR Notation (/20) – Means 20 bits turned true for network.

Network BitsNetwork BitsNetwork/Host BitsHost Bits

So we have borrowed here 4 bits (red) from the 3 octet & make it CIDR 20 instead of 16 ( . Red underlined one is magic number 4th one i.e. 16
Logical AND00001010000000000000000000000000

Network Address: , Broadcast Address:

  • Total no of subnets = 2No of Subnets Bits = 24 = 16 Sub Networks
  • Total no of IP in each sub network = 2No of Host Bits = 212 = 4,096
  • Total no of usable IP in each sub network = 2No of Host Bits – 2= 4,094
  • First IP address reserved for Network IP & Last for Broadcast IP for each subnet
Network AddressRange – – – – – – – – – – – – – – – –

Example 2: IP Address :

Subnet Mask: ( CIDR Notation /27)

Network BitsNetwork BitsNetworkNw Bits<->Host Bits
192 Fixed168 Fixed100 Fixed

So we have borrowed here 3 bits (red) from the 4th octet host bits& make it CIDR 27 instead of 24 ( . Red underlined one is magic number 3rd one i.e. 32 from binary table. Binary representation
Logical AND11000000101010000110010010000000

Network Address:, Broadcast Address:

  • Total no of subnets = 2No of Subnets Bits = 23 = 8 Sub Networks
  • Total no of IP in each sub network = 2No of Host Bits = 25 = 32
  • Total no of usable IP in each sub network = 2No of Host Bits – 2= 30
  • First IP address reserved for Network IP & Last for Broadcast IP for each subnet
Network AddressRange – – – – – – – –


Happy Learning! Your feedback would be appreciated!

Oracle Autonomous Database

Oracle Autonomous Database – Machine learning driven cloud-based database. Fully Automated – Self driving, Self-securing & Self-repairing. As a end-user we just have to focus on our data/business logic etc.
Available for both types of workloads Transaction Processing or Data Warehouse in Shared/Dedicated Exadata Infrastructure.

In this blog we will explore the basics of Oracle Autonomous Database (ADB).

Workloads Types

Autonomous Data Warehouse (ADW)

  • Best Suited for Analytics workloads, where data not changing too frequently. Like OLAP Systems
  • Data Warehouse, Data Mart, Data Lakes & Business Intelligence etc.
  • When your data resides is mainly summarized & aggregated form
  • When you have Massive datasets for Machine Learning Testing

Autonomous Transaction Processing (ATP)

  • Best suited for Transnational system, where data changing frequently. Like OLTP Systems
  • When you have mixed workloads (OLTP + OLAP) – Hybrid Load.
  • Mainly suited for batch processing & reporting
  • ATP suited for Application Development & Real time analytics

Features of ADB:

  • Self Driving:
    • Rapid Provisioning, Self Scaling (Upto 3x of base OCPU) – No Downtime
    • Automatic Tuning & Indexing. No need to create by yourself.
    • Automatic stats gather, user can also do manually.
    • Hints disabled by default in ADW.
    • Self Tuning – Index, Materialized Views, Partition, Compression – Not Recommend in ADB.
    • Automated Backup – 60 days retention default. (For Dedicated ADB User can control retention days : 7,15,30,60)
    • Automatic Patching in Shared Hosting. Patching can be controlled way in dedicated.
  • Self Securing:
    • Only authenticated users/app allow to access data in ADB
    • Connection used certificate based authentication & SSL (Secure Socket Layer)
    • Certificate based authentication present at both sides client & server
    • Default Encryption for data at rest – Transparent Data Encryption (TDE). For Backups also data is encrypted.
    • Encryption for data at motion – Transport Layer Security (TLS v1.2) by default. User can select other option like Oracle Native Network Encryption
    • Admin is default database user and only privileged user. There is no sys, sysadmin or system users in ADB.
    • In ADB Oracle is responsible for Platform security, Patch & Upgrades. Data encryption by default.
    • Customer Responsibility : Security assessment, sensitive data discovery, data protection, data masking & redaction.
    • Oracle Data Safe : Free tool that provide – Sensitive data discovery, data protection, data masking, user auditing. Security Assessments.
  • Self Repairing:
    • Self Healing H/W & S/W. Automatically detect any fault & recover from it.
    • Advance ML based predictive failure capabilities
    • Detection of failures – 24*7 Monitoring
    • Pattern recognizing using ML for any problem using logs.

Deployment Choice

Shared Infrastructure

  • Sharing the infrastructure with other tenants.
  • Min Size – 1x OCPU & 1TB of storage (128 OCPU Maximum)
  • Automatic scale online

Shared Infrastructure

  • Dedicated, un-shared cloud infrastructure
  • Complete Isolation
  • More control over Infrastructure & Patching process

Main Architectural Components

Exadata Cloud Infrastructure:

  • ADB is placed on Exadata Systems hosted on OCI Data Centers
  • ADB Database storage directly attached to Exadata Systems
  • OCI Object Storage (Bucket) – used for file storage.
  • Automated backups stored on dedicated OCI storage, which cannot access by user directly.
  • Staging Files, Dump Files, External Tables are stored in Bucket.


  • Database actions are exposed through Cloud UI and REST APIs
    • Create/terminate/backup/restore/stop/start
    • Change – CPU or Storage
  • Monitoring – User can monitor using ‘Cloud Service Dashboard’
  • Developer – SQL Developer & Web etc.
  • ORDS – Oracle Rest Data Services

Oracle Data Visualization Desktop :

  • Analysis Tool – Light weighted
  • It can be installed on Windows & Mac OS10.
  • Offline Availability
  • No remote server required

Loading /Migrating Data to ADB

  • ORCL SQL*LOADER – Data sitting on local client.
  • ORCL DATA PUMP (impdp/expdp .DMP) Using Object Storage
  • .CSV/JSON/Parquet Files
  • External Tables

Refer DBMS_CLOUD package for more details for data loading & credentials setup.

Move data into the ADB database :

  • Data Pump – Portable way to load data in new ADB
  • Golden Gate – Replication for on-prem & non-autonomous. It has some restrictions for rowids, nested table & identity column.

Wallet Credentials:

  • Wallet is used for connecting the ADB.
  • Certificate authentication uses an encrypted key stored in a wallet on both client as well as server side.
  • Listener Port: 1522 (Standard on Shared & default on Dedicated)

Wallet contains collection of files.

  • truststore.jks
  • tnsnames.ora
  • sqlnet.ora – Connector Strings details
  • README – expiry date – 2.5 years approx
  • keystore.jks
  • ewallet.p12
  • cwallet.sso

Pre-defined Database Service

tp & tpurjent best suited for OLTP. low best suited for warehousing as high concurency.

  • tpurjent – ATP Only (Support Manual Parallelism) High concurrency & resources. For batch processing when parallel required.
  • tp – ATP Only (No Parallelism) as DOP=1. High concurrency & resources. When parallel not required
  • high (All operations parallel) All CPUs
  • medium DOP=4 limited
  • low – (No Parallelism) as DOP = 1
1tpurjent (ATP)Manual12100 X CPU
2tp (ATP)18100 X CPU
3highALL CPU43
5medium421.25 X CPU
6low11100 X CPU
  • In ADW – there will be only high, medium & low.
  • In ATP – All 5 services are present.


  • Independently scale compute (OCPU) & storage for ADB
  • Resizing occur instantly, fully online.
  • Memory, IO bandwidth, concurrency scales linearly with OCPU

Backup ADB

  • Automated backup
  • Retention period shared – 60 days
  • Retention period dedicated – 7, 15, 30, 60 days
  • Database can be restored at any point in time within retention
  • User can create manual backups also
  • Recovery can be done using Cloud Console/API – from timestamp (point in time) or using backup

Cloning ADB

Create a new database as a clone of an existing ADB.

  • Either full copy or Just Metadata depending upon requirement
  • Create clone from a live running DB instance or from a backup of ADB


Happy Learning! Your feedback would be appreciated!

Oracle Cloud Infrastructure Foundations

In this blog we will explore some of the core cloud concepts & foundations knowledge of Oracle Cloud Infrastructure (OCI).

Core Cloud Concept

Here we will see some of the important cloud terminologies.

IaaS, PaaS & SaaS: Cloud Computing Service Models

Cloud Deployment Model:

  • Fully Cloud – When every single resource is present on cloud.
  • Hybrid – (Cloud + On-Premise) – Some apps on cloud & some on-prem. For example database is on-prem.
  • Cross Cloud – Using multiple Cloud Service Providers. Like Azure + OCI

Scalability: Let say you have web-application and visitors are increasing and performing various operations, so it requires the more memory/computing power. Here comes the definition: Ability to increase of the capacity based on the demand.

  • Case 1: You can add more memory, hard disk to existing machine i.e. Vertical Scaling. Scaling up/down.
  • Case 2: You can add more machines/server. Horizontal scaling. Like distributed system . Scaling In/Out

Elasticity: Ability to automatically increase/decrease capacity based on demands in terms of Horizontal Scaling.

  • Scaling Out – Adding more servers.
  • Scaling In – Removing servers.

Auto-scaling configuration rules for the instances can Out/In depending upon the traffic or computing power.

Cloud Agility: Ability of rapid provisioning of cloud resources. How fast you can launch, develop & test the service in cloud.

Fault Tolerance: Ability of system to continue operations without interruption when its component fail. Like if one of the database for down you can switch to standby database to avoid interruptions.

High Availability: Operating continuous without interruptions. Full time availability for systems & applications. i.e. No single point of failure.

High Durability: Ability to recover from disaster i.e. (DR) Disaster Recovery.

  • Recovery Point Objective – Tolerable data loss
  • Recovery Time Objective – Tolerable down time after disaster

Capex vs Opex: If you are operating the business on-prem, then your capital expenditure (capex) is more, as you have to pay for infrastructure, environments, maintenance etc.

If you go for cloud then you have pay-as-you–go model so the operational expenditure (opex) is very less than capex. i.e. reduced TCO (total cost ownership).

Pay-as-you-go: Consumption based pricing. Pay only how much you consume.

OCI Architecture

Region: Distinct geographical location. Region can have one or more Availability Domains (AD). Fault tolerant Data centers isolated to each other, but connected to each other by a low latency, high bandwidth network. Types of region:

  • Commercial Region
  • Government Region
  • Microsoft Azure Connect

Availability Domains (AD): Nothing but a physical data center in region.

Fault Domains (FD): Grouping of the hardware within AD to avoid single point of failure. Its like logical data center. Each AD has 3 FDs.

Oracle Regions & Availability Domains

Multi AD Region
Fault Domains

To avoid single point of failure, better to to replicate the application in different FD or AD.

Compartment: Collection of related resources in account. Helps to isolate and control access for OCI resources.

  • Tenancy or root compartment – main compartment for an account
  • Resources belong to single compartment, can interact with others.
  • User can add/delete resources/compartment from account.
  • User can move resources from one compartment to another.
  • Compartments can be nested up-to 6 levels.
  • User can group resources from different region in same compartment.

When you sign up for the Oracle Cloud you have to select home region, it is not changeable after tenancy is provisioned. User can subscribe for other region.

Core OCI Services

Computing Services

  • Bare Metal: Server without any hypervisor. User have access to the h/w like processor/ memory resources of server. Best suited for:
    • When virtualization is not required
    • Or when user want their own hypervisor installed.
    • BYOL – Kind of work. If user has own licenses.
  • Dedicated Virtual Host: Bare Metal + Hypervisor. Single tenant server. User can run multiple VMs Instance. Greater security & performance. User have no control over Hypervisor.
  • Virtual Machines (VM): Multi tenant server running a hypervisor later. Guest on Host server. Choose your OS virtual image & launch instance. Here you are sharing the cost with others.
  • Containers Engine: User can run containers using Docker. Oracle K8S Engine.
  • Functions: Server-less Compute. User just want to run a code. Consumption based billing.

Storage Services

Block Volume:

  • Data is highly durable & persistent here
  • Remote storage for compute instances
  • Two types:
    • Boot Volume – Instance boot using this volume. Directly accessed by the OS.
    • Block Volume – For Data.
  • As it is separated from the instance. So data resides independently.
  • Data replicated in multiple FDs, hence highly durable.
  • Use Cases: Instance Storage, Boot Storage, Database

Block Volume Backup – in an automated way user can backup the block volume as object in object storage & later restore it.

  • Basic Tier – (Streaming, Log Processing, Data warehouse) User have to read a lot of data.
  • Balanced – Suited for Transaction Systems
  • Higher Performance – Critical databases.

Volumes can be 50 GB to 32 TB. 32 volumes/instance.

Local NVMe: Non-Volatile Memory Express

  • Millions of IOPS.
  • Block based storage service, locally attached to compute instance.
  • Non-persistent memory, but it can survives reboot.
  • Use Case: In Memory Db, NoSQL, Data Warehousing
  • No Backup capability provided for NVMe.

File Storage: Distributed File System. File standard – NFS (Network File System) & SMB (Server Message Block)

  • Highly durable & persistent
  • Supported by many OS like Windows & Unix
  • Access over the network
  • Snapshot of files – like backup. You can restore file.
  • Data replicated in multiple FDs, hence highly durable.

Object Storage:

  • Data stored as object regardless of content.
  • Best suited for unstructured data.
  • Not tied to any compute service.
  • Data stored in bucket without any folder hierarchy like NFS.
  • Object is composed of object & its metadata
  • High Scalability & Durable. Stores replica in multi AD.
  • Access data using HTTP.


  • Standard – Frequent Data access. Can’t be downgraded to archive.
  • Archive – Non-Frequent Data. Cheaper. 90 days min retention. Can’t be downgraded to standard.

Networking Services

Virtual Cloud Network (VNC): Logically isolated section within the OCI where you can launch resources.

Subnets: Logical partition of network into multiple smaller network. Resources launched in subnets. Each resources will get its own IP address . So that they can isolate & secured. There are Private & Public Subnets.

  • CIDR Range: /24= 256 IP Addresses (For Subnets)
  • Refer What is CIDR? blog for more information
  • Internet Gateway: Provide a path for network traffic between your VCN & internet. Bi-directional traffic. Public subnets resources can access the internet through this gateway.
  • Network Address Translation (NAT) Gateway: Resources in private subnet reach out to internet using NAT gateway. Secured way access internet. Only outbound traffic.
  • Dynamic Routing Gateway (DRG): Virtual Router. Path for private traffic b/w VCN & Outside network (other than internet).
  • Fast Connect: Dedicated, private secure connection to your on-prem to OCI.
  • IPSec VPN: Secure connection to your on-prem to OCI. Through internet.
  • Service Gateway: Secure tunnel that keeps within OCI Network. If some internal resource need to connect. Like bucket.

VCN Peering: Network connection b/w VNCs.

  • Local VCN Peering – Same region
  • Remote VCN Peering – Different region

VCN Security:

  • Firewall rules associated with the subnet & applied to all resources inside the subnet.
  • Security List – Associated with subnets
  • Network Security Group – Apply at VNIC

Database Service

  • VM DB System Managed database, block storage, fast provisioning
  • Bare Metal DB – Systems – Local Storage. Fast Performance
  • RAC – application Cluster. Managed HA
  • Exadata DB System. Suited for high performance loads.
  • Autonomous DB – Self driving, CPU Storage Scaling. Refer Oracle Autonomous Database blog for more details.

Identity & Access Management:

Users belongs to Groups. Groups at least one policy with permissions to tenancy or compartment. So that user can access resources.

User enforces security principle of least privilege. Everything denied by default.

  • Instance Principle – Resources make API calls other OCI service.
  • Authentication: User Name Password, API Signing Key & Auth Token.
  • Authorization : Policies can be attached to compartment/tenancy.


Happy Learning! Your feedback would be appreciated!

Cloud Computing Service Models

Cloud Computing Service Models

In this blog we will explore the three different service models of cloud computing.

  • IaaS – Infrastructure as Service
  • Paas – Platform as Service
  • SaaS – Software as Service

Infrastructure as Service

When user/business is only interested to purchase infrastructure like physical machines, storage, server, network etc. So instead of buying & setting up on-premise hardware, go for Iaas from cloud service provider.

This type of model allows user to purchase computing resources such as server, storage & networking on-demand from service provider. Rest of the thing will be manage by user/business like OS, applications environment, runtime, application data etc.

Common Service Providers: Oracle Cloud, AWS, Azure, GCP.

Platform as Service

When user/business is interested to purchase a platform where they can start develop, manage & operate applications.

For example you want to develop a web application. For that you need a platform where you can write your code, execute the code & database to store the application data. So instead of taking purchasing Iaas and setup everything else by own. You can go with the option of Paas i.e. Iaas + software required to build application.

Enable user/business to focus on development instead of setting up the infra required to build that application. User just have to manage its application, rest of the things manage by service provider.

Software as Service

Cloud based software available over the internet. User can avail the services by purchasing the license/subscription. These application completely managed by the service providers. User does not have to worry about Infrastructure, runtime environment or any application code upgrade.

Best Saas software example: Salesforce.com, JIRA, Netflix, Dropbox, Slack etc.

Image courtesy (Free for commercial use): pixabay.com/illustrations/cloud-computing-network-internet-2001090/


Happy Learning! Your feedback would be appreciated!

Connecting MySQL DB Instance present on AWS Cloud


For creation of any Amazon RDS DB Instance (Free Tier), kindly visit this blog: Link

In this blog we will learn how to connect MySQL Database present on AWS Cloud.

Here is my MySQL DB Instance in “available” Status. Please note the End Point, which is basically the HOST.

RDS Dashboard

Step for adding new Inbound Rule for allowing connection on port 3306.

Select MySQL Instance & Click on “Instance Actions“->”See Details“.


After that click on “Security Groups“.


Now click on the “Inbound Rules” in Security Groups page.

Security Groups Page

Create a Inbound Rule for Type: MYSQL, Protocol: TCP , Port: 3306 Source: Anywhere. So that you can connect this instance from any machine. After creation of rule click on Save.

Security Group is basically allowing the connections on the port.


After Saving Inbound Rule. Go to RDS Dashboard.

RDS Dashboard

Now MySQL Instance is ready to connect & use it.


Steps for connecting MySQL Database: Using CMD

Install MySQL Server on your machine. Copy the location on bin folder in program files.

Also check your firewall settings for port 3306.


Also check the MySQL service is running properly or not.


Open Command Prompt: Use this command: cd <bin folder location> then Press Enter.

Example:  cd C:\Program Files\MySQL\MySQL Server 5.1\bin

Now you are in bin folder.


Use below command in cmd & it will ask for password.

mysql – h <host> -P <port> – u <username> – p

Where <host>: Your End Point, <post>:3306, <username>: Master username


Now we are connected to the MySQL DB Instance.


Steps for connecting MySQL Database: Using MySQL GUI

I’m using SQLyog GUI. Please provide below details.


Provide your password & test the connection.


Click on connect to connect the database.


Now we are connected to the MySQL DB Instance.


Happy Learning!

Oracle DB on Cloud (AWS Free Tier)


AWS Free Tier (Link), the Amazon RDS Free Tier helps us to get started with a database instance in the cloud. Free for 12 months starting with the date on which we create our AWS account.

We can use this to develop new applications or simply gain hands-on experience with Cloud Computing. It is easy to set up, operate, and scale DB.

Database Available:- MySQL, MariaDB, PostgreSQL, Oracle & SQL Server.

Steps for creating your own: Oracle DB Instance on Cloud (Free Tier)

Login AWS with your amazon account. Link

Amazon Web Services Login Page

After login AWS redirect to this below Home Page.

Select “RDS” in the Database Section. RDS –  Relational Database Service.

AWS Home Page

After selecting “RDS” in the Database Section. Below RDS Dashboard comes up.

Click on “Launch a DB Instance” in this screen.

AWS RDS Dashboard

Now from here the main setup starts…

 Step 1: Select Engine: Select the DB Engine:

I’m selecting the Oracle EE Database Engine.


Step 2: Production Or Free Tier

For Free Tier: Select Option Second: “Dev/Test”


After that click on Next Step.

Step 3: Specify DB Details:

Select check box for options available for free tier RDS.


Provide DB details here like master username & password. Please note down these details for future reference.


After that click on Next Step.

Step 4:  Configure Advanced Settings:

Use default setting here for free tier service.


Now we can launch the Instance.


After launching: Db instance is being created.


Go to the RDS Dashboard: Instance Tab:  You can check your instance here.

DB Instance Creation is in process

After some time…

Oracle DB Instance is ready. Note down your Endpoint, which is basically the HOST.

Db Instance is available now

My End Point: shobhitdbdemo.cbxoxihdzrvi.us-west-2.rds.amazonaws.com:1521

Steps for Connecting Oracle Database: Windows

Install Oracle Client on machine. Also check your firewall settings for port 1521. Open Command Prompt & use below command to connect DB.

sqlplus username/password@host:port/service 

Where username: Your Database Master Username in Step 3



Now you can create your own database & other database objects.


Happy Learning!