Beginner's Guide to AWS VPC, Subnets, IGWs, and Route Table Management

Amitabh soniAmitabh soni
5 min read

VPC:

A Virtual Private Cloud (VPC) is a secure, isolated portion of a public cloud infrastructure that allows users to create their own virtual network, similar to a private cloud. It enables organizations to host and manage their resources within a specific, controlled environment, providing security and flexibility on a public cloud platform.

Here's a more detailed explanation:

  • Isolation:

    VPCs offer logical isolation, separating resources from other users and tenants on the same public cloud.

  • Control:

    Users can configure and manage their VPC, including setting up subnets, assigning IP addresses, and managing security groups.

  • Benefits:

    VPCs offer benefits such as increased security, flexibility, and scalability, allowing users to adapt their infrastructure to changing needs.

  • Use Cases:

    VPCs are commonly used for hosting web applications, migrating workloads to the cloud, and building secure environments for sensitive data and applications.

  • Cloud Providers:

    Major cloud providers like AWS, Google Cloud, and IBM offer VPC services, allowing users to leverage the advantages of public cloud infrastructure while maintaining control over their virtual network.


Subnet:

A subnet, or subnetwork, is a logical division of a larger IP network. It allows for the efficient management of network traffic and resource allocation by breaking down a large network into smaller, more manageable segments. Each subnet has its own unique IP address range.

Key Concepts:

  • Logical Partition:

    Subnets are not physical divisions of a network but rather logical groupings of devices based on their IP addresses.

  • IP Address Ranges:

    Each subnet is assigned a specific range of IP addresses, and devices within that range can communicate directly without needing to go through a router.

  • Subnet Mask:

    A subnet mask is used to identify the network portion and host portion of an IP address, determining which IP addresses belong to a specific subnet.

  • Benefits:

    • Improved Network Efficiency: Subnets reduce the amount of traffic on the main network by isolating communication within each subnet.

    • Simplified Management: Subnets make it easier to manage and troubleshoot network issues by isolating problems within specific subnet segments.

    • Enhanced Security: Subnets can be used to create separate security zones, limiting access and protecting sensitive data.

    • Better Scalability: Subnets allow for a more flexible and scalable network design, making it easier to add new devices or expand network segments.

  • Types of Subnets

    1. Public Subnets:

    • These subnets have a direct route to an internet gateway, allowing resources within the subnet to access the public internet.

    • Instances in public subnets can be assigned public IP addresses.

    • They are commonly used for web servers, applications, or services that need to be accessed from the internet.

2. Private Subnets:

  • These subnets do not have a direct route to an internet gateway.

  • Resources in a private subnet typically require a NAT device (Network Address Translation) or VPN connection to access the internet.

  • Private subnets are often used for internal applications, databases, or other services that do not need to be publicly accessible.

  • Example:

    Imagine a company with multiple departments on different floors. Each department could be assigned a subnet, allowing devices within each department to communicate directly, while routing between departments would occur through the company's main router.


Internet Gateway:

An internet gateway is a virtual component that facilitates communication between a virtual private cloud (VPC) and the internet. It acts as a bridge, enabling resources within public subnets of a VPC, such as EC2 instances, to connect to the internet and vice versa. Essentially, it allows your VPC to interact with the wider internet.

Here's a more detailed explanation:

Functionality:

  • Two-way communication:

    Internet gateways enable both outbound (from VPC to internet) and inbound (from internet to VPC) traffic.

  • Public IP addresses:

    Resources within public subnets that have public IP addresses can use the internet gateway to connect to the internet.

  • Network Address Translation (NAT):

    For IPv4 traffic, internet gateways perform NAT, which translates private IP addresses within the VPC to public IP addresses when communicating with the internet.

  • Routing:

    They serve as the target in route tables within the VPC for internet-routable traffic, ensuring that traffic destined for the internet is routed correctly.

  • Highly available and redundant:

    Internet gateways are designed to be highly available and redundant, ensuring reliable connectivity.

Key Use Cases:

  • Connecting EC2 instances to the internet:

    You can use internet gateways to allow EC2 instances in your VPC to access the internet for tasks like software updates, data transfer, or accessing web services.

  • Providing public access to web applications:

    You can use internet gateways to make web applications running in your VPC accessible to users on the internet.

  • Receiving inbound connections from the internet:

    Internet gateways enable your VPC resources to accept connections from the internet, which is crucial for services that need to receive data or handle requests from external sources.

In essence, an internet gateway is a vital component for enabling your VPC to interact with the internet, allowing your resources to connect to and be accessed from the wider web.


Routing Table:

A routing table is a database that helps determine the best path for data packets to travel across a network. It's like a map that tells devices (like routers) where to send network traffic based on the destination IP address.

Key aspects of a routing table:

  • Routing Decisions:

    Routers use routing tables to make decisions about where to forward data packets, ensuring efficient and reliable network traffic flow.

  • Database of Network Paths:

    The table contains information about the network, including the destination IP address, the next hop IP address, and the interface to use for forwarding.

  • Stored in RAM:

    Routing tables are typically stored in the random access memory (RAM) of routers or network switches.

  • Dynamic Updates:

    Routing tables can be updated dynamically, for example, when a network link goes down or a new network is discovered.

How it works:

When a router receives a data packet, it looks up the destination IP address in its routing table. Based on the table's information, the router determines the best next hop IP address and the interface to use for forwarding the packet towards its destination.

Types of Routing Tables:

  • Static Routing Tables: These are manually configured and do not dynamically update.

  • Dynamic Routing Tables: These automatically update based on network changes, using routing protocols like Open Shortest Path First (OSPF) or Border Gateway Protocol (BGP).

0
Subscribe to my newsletter

Read articles from Amitabh soni directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Amitabh soni
Amitabh soni

DevOps Enthusiast | Passionate Learner in Tech | BSc IT Student I’m a second-year BSc IT student with a deep love for technology and an ambitious goal: to become a DevOps expert. Currently diving into the world of automation, cloud services, and version control, I’m excited to learn and grow in this dynamic field. As I expand my knowledge, I’m eager to connect with like-minded professionals and explore opportunities to apply what I’m learning in real-world projects. Let’s connect and see how we can innovate together!