Re: Sockets, port and loop-back ?
From: Neil Horman (nhorman_at_rNeOdShPaMt.com)
Date: Mon, 05 Jan 2004 08:35:37 -0500
> After reading Tannenbaum's 'Network' book, I had the illusion
> that I understood some thing about networks !
> Apparently not ?
> Q1. Is it correct that 'ports' are sub-addresses of URLs;
> so that http://
> at the IP of <someID>, and http://
> will address the <not default number> port at the IP of <someID> ?
No. Ports are a concept which relate to the protocol you are
communicating with. In the most common case of TCP/IP, ports allow for
the identification of logical endpoints on a physical system (which has
a unique IP address on a network). The concept of ports in TCP/IP
allows for applicaitons to use multiple sockets on a system. In short,
the tuple <ip address, port> uniquely identifies a TCP/IP network
connection between two systems. As an example, a web server and an FTP
server can both service client connections on the same system, because
each service listens for connections on a different port.
> Q2. does the client insert the port number when the request is made ?
Yes. the following man pages will give you details:
> Q3 at which ISO level/layer is the port number inserted ?
the Network layer I imagine, as ports are a protocol level addressing
> Q4. Do servers have pysically different ports for eg. http & ftp, or
> is it possibly the same physical [and some higher levels], just
> behaving differently when it's talking http or ftp ?
What do you mean? Applications listen on different ports (at least in
tcp/ip) so that they don't have to recieve and interpret each others
data traffic. Its a logical construct though, so the use of the term
physical here is incorrect.
> Q5. At what level are sockets ?
Sockets are an API, not really a layer in the OSI model. If I had to
pick, I'd say they were the application layer interface to the network,
as thats where the API is used.
> Q6. Are they also just 'abstract connections', time-sharing
> and being socketX [when the data goes-to/comes-from X's
> buffers] but latter serving as socketY ?
This is a non-sensical question. what are you asking?
> Q7. How does [or not] 'loopback' fit in with all this ?
'loopback' is the mechansim by which a single system can serve as both
endpoints in a network connection. It allows port x on a system to talk
to port y on the same system. Commoly, the loopback mechansim is
implemented as a network interface for which the driver simply recieves
every frame which it is requested to transmit.
-- Neil Horman Red Hat, Inc., http://people.redhat.com/nhorman gpg keyid: 1024D / 0x92A74FA1, http://www.keyserver.net