[Gllug] sorts of ports

Richard Cohen richard at vmlinuz.org
Mon Sep 3 10:28:18 UTC 2001


On Mon, 3 Sep 2001, Leigh Mason wrote:

>
>
> > From: David Damerell <damerell at chiark.greenend.org.uk>
> > Reply-To: gllug at linux.co.uk
> > Date: Mon, 3 Sep 2001 10:58:47 +0100 (BST)
> > To: gllug at linux.co.uk
> > Subject: [Gllug] sorts of ports
> >
> > On Saturday, 1 Sep 2001, Leigh Mason wrote:
> >> i'm having trouble visualising what's happening when people talk about
> >> entering a machine via port x or port y, with regard to network
> >> communication.
> >> i understand that any i/o device has to have  interface circuits to
> >> communicate data transfer to the cpu.
> >> and that within each interface there are registers similar to the cpu and at
> >> least one of those registers is a buffer register (for data) called a port.
> >> (please correct me if i'm wrong).
> >> when a connection is made between two computers there is only one interface
> >> in action (modem for example)  that the data is being carried across. the
> >> interface has a 16 bit data register allowing the 65535 possible port
> >> numbers, but it is still just one physical port - right?
> >
> > Er, not quite.
> >
> > Normally your Ethernet (or modem) hardware knows nothing about TCP/IP
> > at all, including IP port numbers. IP packets are entirely
> > encapsulated in packets for the lower-level transport, like this;
> >
> > /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.

When you run an app as a server, one of the first things it does is open a
port (almost always with a 'well-known' port number) and listen on it.  When
you run a client, it opens a socket and connects to a port on a server,
usually on another machine.  A client still has a port on it's own machine,
but that usually has a randomly-assigned high number, as opposed to the
known, low numbers used by server ports.  It is standard practice under
decent operating systems (i.e. Unix, Linux and probably recent versions of
Windows NT) to restrict access to ports below 1024 to users with root
(administrator) privileges, and since the well-known ports for all serious
services (excluding things like IRC) are below 1024, that means only those
with root access can run a serious server on a machine.  And that is,
generally, a good thing...

> leigh

Cheers
Richard


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list