Master the fundamental concepts of network stack fundamentals through this focused micro-challenge.
TCP and UDP each give every host 65536 ports numbered 0 through 65535. IANA divides them into three ranges. For example, port 22 is well-known (SSH), port 5432 is registered (PostgreSQL), and port 49152 falls in the dynamic range the kernel assigns to outgoing connections.
The three ranges are:
80, HTTPS on 443, DNS on 53. Binding these requires root on Unix.6379, MySQL on 3306. Anyone can bind these.connect().When you later write raw-socket tools and TCP servers in this track, you will constantly reason about these ranges: why your server needs privileges for port 443, why the kernel's ephemeral range shows up in netstat output, and why firewall rules treat low ports differently.
This task requires you to read a single port number and classify it. You will use this same mental model every time you read a packet capture and wonder whether a destination port like 8080 is a registered service or an ephemeral client port. nmap labels scan results by these same IANA ranges, and the Linux ip_local_port_range sysctl controls which dynamic ports the kernel hands out.
Read one integer port number (0-65535) from stdin.
Print exactly one of:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github