Re: Ports and Protocols

From: Moe Trin (ibuprofin_at_painkiller.example.tld)
Date: 11/18/04


Date: Thu, 18 Nov 2004 15:09:51 -0600

In article <10pnv4de8f68l4b@corp.supernews.com>, Lam Duk wrote:

>Let's assume I have a DNS server which uses the normal port 53 and UDP
>protocol.

Minor problem - DNS uses both UDP (normally) and TCP (for longer replies).

>Let us also assume I have a HTTP server, which uses the TCP protocol. I
>know I can set the server to respond on any port I want, not just the
>normal port 80.

Correct

>My question is, is it possible to set the HTTP server in this hypothetical
>setup to port 53/TCP, sharing the port 53 assignment with the DNS server,
>which uses a different protocol?

In this singular case - no, only because DNS uses both protocols. See the
RFCs (1034 and 1035). On the OTHER hand, had you chosen a different port
number, the answer is probably yes. UNIX has been doing so for years.

>My instincts tell me no, that only one service can serve a given port at
>the same time, regardless of protocol, but I've never seen that written
>down anywhere. I don't have any real life requirement for such a setup. I
>just want to fill in the blanks in my education.

Assuming the network stack was written correctly, there would be no
problem. Protocol is the tenth octet in the IP header (see RFC0791), and
the 'cargo' of an IP packet may be one of 130 different defined protocols
(http://www.iana.org/assignments/protocol-numbers) in addition to the very
common TCP or UDP or ICMP, etc. Port numbers are defined in TCP and UDP
headers (see RFC0768 and 0793) in the first four octets (two source, two
destination). Other protocols do not have port numbers (example ICMP from
RFC0792), or use a completely different concept (IGMP from RFC2236).

        Old guy



Relevant Pages

  • Re: nmap and icmp-replies
    ... Since UDP is stateless, it's the only way a stack can "tell" a port is closed/filtered. ... Even if you send a packet to an open UDP Port, depending on the protocol your scanner has to send a valid payload to get an answer. ... If your target sends ICMP Dest-Unrecheachables, ... You have an option to go with a managed service or an enterprise software. ...
    (Pen-Test)
  • abort at the end of data transfer
    ... data chunk is i.e 6. ... int init_client(int port, char *ip) { ... Protocol Info ... Stream Control Transmission Protocol, Src Port: 1031, Dst Port: ...
    (comp.lang.c)
  • abort at the end of data transfer
    ... data chunk is i.e 6. ... int init_client(int port, char *ip) { ... Protocol Info ... Stream Control Transmission Protocol, Src Port: 1031, Dst Port: ...
    (comp.unix.programmer)
  • abort at the end of data transfer
    ... data chunk is i.e 6. ... int init_client(int port, char *ip) { ... Protocol Info ... Stream Control Transmission Protocol, Src Port: 1031, Dst Port: ...
    (comp.unix.internals)
  • Re: Client certificate private key prompt
    ... Windows Server 2003 server without the Header manually added to the request. ... Frame 34 will be closing the connection. ... Protocol: TCP ... Transmission Control Protocol, Src Port: 2954, Dst Port: https, ...
    (microsoft.public.dotnet.framework)