Outcome
By the end of this lesson, you will be able to explain which kinds of data movement cost money and name the network items that charge by the hour.
| Prerequisites | L2 |
| Time | 8 minutes |
1. Concept
The network is the roads between your machines, your storage and the outside world. Every time a customer loads a page, a file travels from the cloud to their screen. Every time one machine asks another for data, something travels between them.
Some of that travel is free. Some is charged by the gigabyte. And a few pieces of network equipment charge by the hour just for existing.
Moving data: which direction matters
Think of the cloud as a city with toll roads.
- Data coming in from the internet, such as a customer uploading a photo, is usually free. Providers want your data to arrive.
- Data going out to the internet, such as a customer downloading that photo, is charged per GB. This outbound traffic is called egress.
- Data moving between regions (a region is one of the provider’s locations, covered in I.1 L4) is charged too, for example when you copy a backup to another country.
- Data moving inside one location is often free, but not always. Some providers charge for traffic between zones in the same region.
The meter here counts gigabytes moved, in the directions the provider charges for. You will look at this more closely in I.3 L3.
Network items that charge by the hour
Some network pieces are rented like machines, with a meter that runs per hour whether or not traffic flows.
- Load balancer. A traffic controller that spreads visitors across several machines so no single one is overloaded. It charges per hour, plus a usage charge for the traffic it handles.
- NAT gateway. A shared exit door that lets private machines reach the internet (to download updates, say) without being reachable from it. It charges per hour, plus a fee for each GB that passes through it. All three providers charge for theirs.
- Public IP address. The internet address that lets the outside world find a machine. Providers may charge for public addresses by the hour, including ones you have reserved but are not using.
CDN: a shortcut for busy content
A CDN (content delivery network) keeps copies of popular files, like images and videos, in many places close to users. Visitors get files faster, and the CDN has its own per-GB price, often lower than sending everything straight from one region. AWS calls its CDN CloudFront.
2. Worked example
A website’s network costs for one month. Prices are illustrative.
| Item | Amount | Illustrative rate | Monthly cost |
|---|---|---|---|
| Data uploaded by customers (in) | 200 GB | Free | $0 |
| Data downloaded by customers (egress) | 1,000 GB | $0.09 per GB | $90 |
| Load balancer, on all month | 730 hours | $0.025 per hour | about $18 |
| NAT gateway, on all month | 730 hours | $0.045 per hour | about $33 |
| Data through the NAT gateway | 100 GB | $0.045 per GB | about $5 |
The biggest item is egress, which grows with every visitor. The second biggest is the NAT gateway, which most of the team has never heard of. It charges every hour of the month even on days when almost nothing passes through it.
3. Hands-on (5 min: no account needed)
1. Open the Amazon EC2 on-demand pricing page: aws.amazon.com/ec2/pricing/on-demand2. Scroll to the "Data Transfer" section.3. Find the price for data transferred IN to Amazon EC2 from the internet.4. Find the price for data transferred OUT to the internet, for the first band of usage.5. Find the price for transfer to another AWS region.6. Work out the cost of 500 GB out to the internet at the price you found.You should see “in” priced at zero, and “out” and “between regions” priced per GB. Google Cloud (network pricing) and Azure (bandwidth pricing) publish similar tables.
4. Knowledge check
Q1
Which data movement is usually free?
A. Data sent out from the cloud to customers on the internet
B. Data copied from one region to another region
C. Data processed by a NAT gateway on its way out
D. Data uploaded into the cloud from the internet
Show answer
Correct: D. Inbound data is usually free. Outbound data (egress), traffic between regions and traffic through a NAT gateway are all charged per GB.
Q2
What is egress?
A. Data leaving the cloud, usually charged per GB
B. A tool that blocks unwanted traffic from the internet
C. The monthly fee for owning a public internet address
D. Data arriving in the cloud, usually free of charge
Show answer
Correct: A. Egress is outbound traffic, and it is the network charge that grows with every customer download. D describes the opposite direction.
Q3
A load balancer handled almost no traffic last month. What does it cost?
A. Nothing, because it handled no traffic
B. A one-off setup fee and nothing else
C. Its hourly charge for every hour it existed
D. Only the cost of the data it handled
Show answer
Correct: C. Load balancers and NAT gateways have an hourly meter that runs whether or not traffic flows, plus a usage charge on top. Little traffic means a small usage charge, not a zero bill.
5. Apply
When you see a network line on a bill, split it in two. Is it charged per GB moved, or per hour of existing? A per-GB line grows with customers and copies. A per-hour line, like a NAT gateway or a load balancer, charges the same on a quiet weekend as on a busy launch day, and is worth checking whenever an environment is no longer used.
Related lessons
- L2, Storage: space you rent by the gigabyte
- L4, Databases: storage with a manager attached (next)
- I.3 L3, Moving data: in is usually free, out is not