3

Yesterday I had a discussion about running the same service, for example SMTP, on the same port on a server. I think this is possible by assigning multiple ip addresses to the server and bind the service to each ip/port combination. However we ended up in a discussion and came to the conclusion that we missed the theoretical background.

We got stuck at the metaphor that the server is the house, reachable by multiple (ip) addresses and ports are the rooms. The rooms have numbers, but there is only one room per number. This would mean that whatever address is used to reach the house, you will always end up in the same room.

I think it does not work that way, the combination of the ip/port port of the request makes the request unique. The OS can handle multiple services on the same port number as long as the service is binded to an ip address.

It is not a question on how to run two type X web servers on port 80 on OS type Y. I would like to know how this works on a conceptual level so I can understand and it explain this to somebody else

[EDIT]

Maybe my question is a bit woolly. The question is: Is it possible to have multiple ip addresses on a server and split the traffic per ip address, hence having multiple ports 25 on one server.

And if so, how do I explain that to somebody who does not believe that. A good metaphor maybe?

2

2 Answers 2

2

I think the metaphor 'every server is a house' needs to be corrected as 'every IP Address is a house'. e.g. So lets say your server has 2 IP addresses in that way theoretically you have 2 * (2^16) unique combinations of 131072 Server sockets available to you.

Since you have different IP:Port combination available you can configure Sendmail (IP_Address_1:25) and Postfix on same server (IP_Address_2:25)

4

Every IP address on a system will have all ports available for use.

Many services can be configured to listen on one or more IP:Port pairs. If a service is listening on all IP:25 then the load could be split across each.

However what you're missing is how does the connecting device know where to connect ? It may be possible to use DNS round-robin to provide different IP addresses or in the case of SMTP (port 25) equally weighted MX records.

Actually the more I try and answer your question the more I realise that your lack of understanding needs to be improved so I'll again refer you to the excellent TCP/IP guide

1
  • I agree on my lack of understanding on TCP/IP. Reading the answers I understand that each IP address has its own set of ports. I understand how a device ends up at an ip through MX records or DNS. It was not about load balancing, just about the concept of an ip address/port combination. For now "Every IP address on a system will have all ports available for use." is good enough for me." I accepted the other answer because of the reference to the metaphor. Your answer and the reference to the guide is very much appreciated. Dec 7, 2013 at 12:23

Not the answer you're looking for? Browse other questions tagged .