EC2 Networking Fundamentals Flashcards
In Networking, what are the type types of IPs?
-
IPv4: most common format used online
(ex: 1.160.10.240) - IPv6: newer; solves problems for Internet of Things (IoT) (ex: 3ffe:1900:4545:3:200:f8ff:fe21:67cf)
What is a Public IP (IPv4)?
- 🌎 machine can be identified on public internet (WWW)
- 🥇unique across whole web (NO two machines can have same public IP)
- 📍geo-located easilty
💡 TIP: if EC2 machine is stopped & then started, public IP can CHANGE
public IP used to SSH into EC2 Machine
What is a Private IP (IPv4)?
- 🔓 machine can be identified on private network ONLY
- 🥇🥇unique across private network (BUT two different private networks (two companies) can have same IPs
- 🚪machines connect to WWW using a NAT + internet gateway (proxy)
- 📝 ONLY specified range of IPs can be used as private IP
What is an Elastic IP?
fixed public IPv4 IP that can be attached to an EC2 instance;
Attached Elastic IP will NOT change if EC2 is stopped & restarted
When is it recommended to use an Elastic IP?
mask failure of instance or software by rapidly remapping address to another instance
* NOTE: public IP can change when instance is stopped & started
✨ Best Practice: AVOID using Elastic IP
* often poor architectural decision
* Alternative 1: Random public IP & register a DNS name to it
* Alternative 2: Load Balancer & don’t use a public IP
What is a Placement Group?
specified strategy to control the placement of EC2 instances
What are the 3 Placement Group strategies?
- Cluster: high-performance; clusters instances into a low-latency group in a single Availability Zone (AZ)
- Spread: critical; spreads instances across underlying hardware (max 7 instances per group per AZ)
- Partition: distributed; spreads instances across many different partitions (which rely on different sets of racks) within an AZ. Scales to 100s of EC2 instances per group
What are the pros & cons of using the Cluster Placement Group strategy?
✅ PROS:
* great, low-latency network (10 Gbps)
⛔️ CONS:
* Instanced place on Same Rack & Same AZ
* If rack fails, ALL instances fail at same time
Use Cases:
* Big Data job that needs to complete fast
* App that needs extremely low latency & high network throughput
high performance workloads
What are the pros & cons of using the Spread Placement Group strategy?
✅ PROS:
* spread across Availability Zones (AZ)
* reduced risk in simultaneous failure
* EC2 instances are on different physical hardware
⛔️ CONS:
* limited to 7 instances per AZ per placement group
Use Cases:
* App that needs to maximize high availability
* Critical Apps where each instance must be isolated from failure from each other
critical workloads
What are the pros & cons of using the Partition Placement Group strategy?
✅ PROS:
* up to 7 partitions per AZ
* can span across multiple AZs in same region
* up to 100s of EC2 instances
* instances in partition do NOT share racks with instances in other partitions
* partition failure can affect many EC2 but will NOT affect other partitions
* can access partition info as metadata
Use Cases:
* HDFS
* HBase
* Cassandra
* Kafka
distributed workloads
What is an Elastic Network Interface (ENI)?
logical component in a VPC that represents a virtual network card that contains
* Primary private IPv4, one or more secondary IPv$
* 1 Elastic IP (IPv4) per private IPv4
* 1 Public IPv4
* …
Can create ENI independently and attach them on the fly (move them) on EC2 instances for failover (bound to specific AZ)
What is the difference between Stop & Terminate of an EC2 instance?
- Stop: data on disk (EBS) is kept intact in next start
- Terminate: any EBS volumes (root) also set-up to be destroyed is lost
What are the requirements & benefits for using EC2 Hibernate?
- in-memory (RAM) state is preserved
- 🚀 instance boot is much faster! (OS is NOT stopped/restarted)
How it works:
* RAM state is wrriten to a file in the root EBS volume
* Root Volume MUST be EBS (not Instance store), Encrypted, & large
* Available for On-Demand, Reserved, & Spot instances
* instance can NOT be hibernated more than 60 days
Use Cases:
* Long-running processing
* Saving the RAM state
* Services that take time to initialize