sony / sonyflake

A distributed unique ID generator inspired by Twitter's Snowflake
MIT License
3.89k stars 304 forks source link

So if each EC2 instance has a unique private IP address in AWS VPC, the lower 16 bits of the address is also unique #30

Closed rush24 closed 2 years ago

rush24 commented 2 years ago

So if each EC2 instance has a unique private IP address in AWS VPC, the lower 16 bits of the address is also unique

why?

YoshiyukiMineo commented 2 years ago

See https://docs.aws.amazon.com/vpc/latest/userguide/configure-your-vpc.html#vpc-sizing

When you create a VPC, you must specify an IPv4 CIDR block for the VPC. The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses).

The above is applicable to VPC with IPv4. Previously AWS VPC supported only IPv4. But recently it also supports IPv6.