Networking contd
Examples
- Create private network 4 subnets with 50000 devices
size = 200000
2^n ~= 200000
n = 18
N = 14
ip: 172.16.0.0/14
nsm: 11111111.11111100.00000000.00000000
size = 50000
2^n ~= 50000
n = 16
nsm: 11111111.11111100.00000000.00000000
ssm: 11111111.11111111.00000000.00000000
ip: 172.000100xx.0.0/16
s1: 172.00010000.0.0/16 = 172.16.0.0/16
s2: 172.00010001.0.0/16 = 172.17.0.0/16
s3: 172.00010010.0.0/16 = 172.18.0.0/16
s4: 172.00010011.0.0/16 = 172.19.0.0/16
AWS
- In AWS all basic networking activities are handle by a service called as VPC (Virtual Private Cloud)
- At its very core vpc can create a network
- Core components of vpc

- Internet Gateway: This provides dual internet access
- Egress Gateway: This provides internet access to vpc (similar to home connections)
- Subnet: This is subnetwork where resources are connected to the network
- Route table: simulates the router
- Security Group: kind of a firewall for server
- Network ACL: kind of firewall for subnet
-
NAT Gateway: when you want to provide internet for private subnets
-
When we create a vpc, AWS creates
- a route table which is associated to all subnets and enables all internal communication.
- A default security group and default NACL are created.
- Also aws creates one default vpc in every network.
Lets create a vpc with 4 subnets
Principle
- Two networks cannot be connected if they have common ip addresses
- Example
- Network A has cidr range of 192.168.0.0/24 and network 2 has cidr range 192.168.0.0/16
- network a = 192.168.0.0 to 192.168.0.255
- netowrk b = 192.168.0.0 to 192.168.255.255
- Network A has cidr range of 10.100.100.0/24 and network B has cidr range of 10.100.101.0/24 can they communicate
- network A = 10.100.100.0 to 10.100.100.255
- network B = 10.100.101.0 to 10.100.101.255
Exercise: