Chapter 1: Networking Fundamentals
Practice Questions and Lab Exercises
- Differentiate between an IP address and a port with a real-life analogy.
- List the default ports for SSH, HTTP, HTTPS, MySQL, MongoDB and a Flask development server.
- Identify the class and default mask of:
10.4.5.6,172.20.1.1,200.1.2.3,230.0.0.5. - A network
172.16.0.0/22must be split into 8 equal subnets. Find the new prefix, block size and the range of the 3rd subnet. - Shorten
2406:da1a:0000:0000:0e00:0000:0000:0010correctly. Why can::be used only once? - Which of these are private:
10.10.10.10,172.32.1.1,192.168.100.1,100.64.1.1,8.8.8.8? - Lab: On any Linux machine run
ip addr,hostname -Iandcurl -s https://checkip.amazonaws.com. Explain why the two IPs differ (hint: NAT). - Explain the difference between an auto-assigned public IP and an Elastic IP on AWS. What happens to each when you stop the instance?
Quick Revision
- IP = which host; port = which service. Socket = IP:port.
- Must-know ports: 22 SSH, 80 HTTP, 443 HTTPS, 3306 MySQL, 27017 MongoDB, 3000 Node, 5000 Flask, 8080 alt-HTTP.
- IPv4 = 32 bits, 4 octets; classes A/B/C/D/E; CIDR
/n→ 2^(32−n) addresses; AWS reserves 5 per subnet. - IPv6 = 128 bits, 8 hex groups; drop leading zeros;
::only once. - Private (RFC 1918):
10/8,172.16/12,192.168/16. Default VPC =172.31.0.0/16. - NAT lets private hosts share a public IP. AWS: IGW (1:1), NAT Gateway (many:1).
- Auto public IP changes on stop/start; Elastic IP is static.