[Gllug] sorts of ports
David Damerell
damerell at chiark.greenend.org.uk
Mon Sep 3 10:29:17 UTC 2001
On Monday, 3 Sep 2001, Leigh Mason wrote:
>>/here's the stuff your Ethernet /this here is an IP packet \\
>>|card understands, that tells |that the Ethernet card will ||
>>|it this is for this machine and|pass unchanged to the OS and||
>>\not a lot else. \contains an IP port number //
>>The OS's IP stack has an idea of what ports are open and belong to
>>which processes, and passes the IP packet to the appropriate process.
>when you say 'what ports are open' is this the same as what apps are
>running? because that's my whole 'don't understand' thing.
A process can say to the OS "I would like to listen on port <such and
such>, please send me any traffic that arrives for it" - commonly
referred to as 'binding to' a port; so 'what ports are open' is based
on the OS's idea of which ports processes have asked to listen on - so
in some sense, that is a result ofwhat apps are running (but note
that process-IDs, as displayed by 'ps' and 'top', are nothing to do
with port numbers).
The only complication is that a process needs rootly powers to bind to
a port from 1-1024 [1].
[1] There may be a comedy off-by-one error here.
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list