Port numbers uniquely identify connection endpoints and direct data to services. Port numbers are 16-bit unsigned integers for TCP and UDP. Port numbers are always associated with network addresses and protocols
Well-known ports (0-1023) are used by system processes requiring superuser privileges. Registered ports (1024-49151) are assigned by IANA for specific services. Dynamic ports (49152-65535) are private and cannot be registered
Virtual ports manage network traffic and serve as dedicated lanes for specific applications. TCP and UDP are two main types of virtual ports based on IP protocol. Ports range from 0 to 65535 and are used for various protocols like FTP, SSH, and DNS
SocketException is a checked exception subclass of IOException. Occurs when client terminates socket connection before response. TCP RST packets indicate unacknowledged connection
Demonstrates TCP-based instant messaging between client and server. Server listens for up to 5 client connections simultaneously. Messages are sent back and forth through a buffer. Program terminates when either client or server disconnects
Sockets enable network communication between different devices in Python. Socket API originated with ARPANET in 1971 and evolved with Internet in 1990s. Python's socket module provides interface to Berkeley sockets API