Interview Prep/Networking/Network Models, TCP, UDP & Ports

What is a port, and what are well-known, registered and ephemeral ranges?

BeginnerConceptNetwork Models, TCP, UDP & Ports
Answer

A port is a 16-bit number that lets the OS demultiplex traffic to a process. 0–1023 are well-known (80, 443, 22, 53), 1024–49151 are registered, and 49152–65535 are the IANA dynamic range. Linux defaults ephemeral ports to 32768–60999.

sysctl net.ipv4.ip_local_port_range

A connection is identified by the 5-tuple: protocol, source IP, source port, destination IP, destination port.

All Networking questions Roadmap: Networking for DevOps

More on Network Models, TCP, UDP & Ports