VPC - Virtual Private Cloud
OSI model consists of 7 layer :
1. Physical layer - Raw bits transfered over cable via electrical signals.
2. Data link - Switches direct these electrical signals. They use MAC address to identify the next destination.
3. Network layer - Routers receive frames from Data link layer and directs them to the destination based on the address defined in the frame. They use IP (Internet protocol) to identify the next destination. ICMP, ARP are example protocols work on this layer.
4. Transport layer - This layer manages delivery and error checking. TCP,UDP are the examples of protocols work on this layer.
5. Session layer - This layer controls communication between two computers. Netbios,PPTP is the one of the example works on this layer.
6. Presentation layer - This layer is responsible for encryption/decryption of data. SSL, TLS are examples.
7. Application layer - The final layer where user interacts. Example protocols : HTTP,SMTP, FTP etc.
So we can say that switches connect computers within a local area network (LAN), while routers are used to connect computers across wide area networks (WANs). Routers must know where they have access and where they don't. That is why there is a table called router table that allows you to specify this.
CIDR notation :
192.168.0.0/24 -> means that IP address has mask of 24 bits.
As we know that 1 byte equals 8 bits, so that we have 24 bits mask 255.255.255.0
This means that only the last digit can change rest are masked
192.168. 0. X -> only X can change, rest should stand still.
255.255.255.0
Let's create our own VPC, private and public subnets
- Type VPC in the searchbar
- Okay, now create subnet for this VPC, I will create 2 public and 2 private subnet for my VPC, you can create as much as you want. The most important thing at this phase is taking into consideration the subnet CIDRs. CIDR range for each subnet must align with the CIDR range of VPC and should not overlap with other subnets.
- As a result when we connect our instances in the public subnet, we will be able to connect internet , but connecting to EC2 instances directly won't be possible due to no public IP address. But after connecting public instance since they are located in the same VPC we can SSH to private subnet instances too.
Comments
Post a Comment