UCD agent relay hierarchy - ucd

Considering the following case: one server, one agent and two relays. I would like to know if is possible to create an agent relay hierarchy to connect to the UCD server? Something like: Agent connects to Relay1 connects to Relay2 connects to UCD Server.

You can't really have a relay connect to another relay. What you can do is make sure the agent connects to different relays in case one is not reachable. This can be done by changing 3 properties in the agent's installed.properties file.
Append your server and relays to the locked/agent.brokerUrl=failover\: property, don't forget to add ?randomize=false
Append the hostnames to the agent.jms.remote.host property
Append the ports to the agent.jms.remote.port property
For more detail, see https://www.ibm.com/support/knowledgecenter/en/SS4GSP_6.2.3/com.ibm.udeploy.install.doc/topics/configure_agent_failover.html?view=kc
Hope that helps.

Related

Why do outgoing sockets need port numbers?

I understand why a server would need sockets for incoming data, but I do not understand why it is necessary that a socket connecting to another computer needs a source port.
While others have mentioned the exact reason why, let me illustrate the point by giving you an example:
Say you want to ssh to your server. OK, you ssh in and do some stuff. Then you tail a log file. So now you don't have access to the console anymore. No problem you think, I'll ssh again...
With one port number, if you ssh again that second connection will be a mirror of the first since the server won't know that there are two connections (no source port number to tell the difference) so you're out of luck.
With two port numbers you can ssh a second time to get a second console.
Say you browse a website, say Stackoverflow. You're reading a question but you think you've seen it before. You open a new tab in your browser to stackoverflow to do a search.
With only one port number the server have no way of knowing which packet belongs to which socket on the client so opening a second page will not be possible (or worse, both pages receive mixed data from each other).
With two port numbers the server will see two different connections from the client and send the correct data to the correct tab.
So you need two port numbers for client to tell what data is coming from what server and for the server to tell what data is coming from which socket from the client.
A TCP connection is defined in terms of the source and destination IP addresses and port numbers.
Otherwise for example you could never distinguish between two connections to the same server from the same client host.
Check out this link:
http://compnetworking.about.com/od/basiccomputerarchitecture/g/computer-ports.htm
Ultimately, they allow different applications and services to share the same networking resources. For example, your browser probably uses port 80, but your email application may use port 25.
TCP communication is two-way. A segment being sent from the server, even if it is in response to a segment from the client, is an incoming segment as seen from the client. If a client opens multiple connections to the same port on the server (such as when you load multiple StackOverflow pages at once), both the server and the client need to be able to tell the TCP segments from the different connections apart; this is done by looking at the combination of source port and destination port.

Kamailio and a connection to the PSTN via SIP

I think about the following setup, but I do not know how to connect the main parts.
One the one side there is a Kamailio SIP server. This server provides VoIP connectivity within a certain network (non public intranet).
On the other side there is a SIP provider. This provider provides a single telephone number from the PSTN. Let's say the number is 0034-443322.
Both components are working fine so far.
I want to use that number as a dial-in to my private network. A user with number 8282 in my network should be reachable via 0034-443322-8282 from the outside world. Outgoing calls aren't necessary.
How to reach my goal? I don't know what to look for :/ Any ideas are very welcome :)
kind regards
K.A.
If your PSTN gateway can be reached by dialing the full number (including the extension), simply let the gateway forward every incoming call to your Kamailio instance which will forward the call to the appropriate user. For that, you need to create your users (known as subscribers in Kamailio) and they need to register to your Kamailio instance so that they can receive incoming calls. Regarding mapping extensions to users, you can simply let the extension be the username; or you can add extensions as aliases of the subscribers.

Is it possible to configure QuickFIX to server from one port for multiple session?

I have a FIX server implemented using QuickFIX. I create FIX sessions for each client currently.So, there's a 1-1 relation between Sessions and Connections. Is it possible to serve for all clients from a particular port? I mean 1-Many relation between Connection and Sessions.
Thanks
You can do that, but make sure you have failover ports/hosts in your config. There maybe scenarios when one port can get overwhelmed, so you can seamlessly swap over to a different port.
Sessions only need your beginString, senderCompID, targetCompID and sessionQualifier. So if you have an unique session(s) it willn't matter if all connect to the same port.
It depends what you mean by "FIX sessions for each client". That sounds to me like you serve different clients according to different sessions. But if all sessions are bound to a particular port then all clients will receive all the messages written on the port. It's therefore insecure because one client sees another client's messages. Right?
I am not sure why you'd need more than one session to bind to a particular port. What's the reason?

Server to server communication over NAT/router

I have two servers that need to be able to send requests to each other, and I need them to be able to communicate over a NAT or router. One server has a registered domain, and it is always waiting for connections. The other server sends the first request (the login request) to the first server when it starts. What is the best way to allow the two server to continue to communicate?
Huh? This shouldn't be a problem. If the first server, the one with the registered name, is always contacted by the other one.
As long as the second machine has general Internet connectivity, all it needs to do is e.g. open a TCP/IP connection to firstserver.example.com or whatever, and they should be able to continue to communicate over that connection indefinitely.
This is no different from general surfing using NAT.

Multiple TCP/IP servers and sharing the same "well known port" ... somehow?

I apologize for the weird question wording... here's the design problem:
I am developing a server (on Linux using C++, FWIW) that provides a service to many instances of a client application running on consumer PCs.
I want the following:
1) All clients first identify themselves to a "gatekeeper" server application. Consider this a login procedure, with credentials like a user name and password being passed in. Call the gatekeeper program "gserver". (for gatekeeper.)
2) Once each client has been validated, it is then placed into a long term connection with one of several instances of a different server application running on the same physical server box bound to the same server address. Call any of these instances "wserver" (for "working" server.)
So, what the client sees is that a "gatekeeper" application gives it passworded access to one of several "working" servers running on the same box.
Here is the "real" challenge: we want to exclusively use a "well known" port number for the inbound server connections (like port 80 or 443, say.) Or, our own "well known" port.
We would prefer not to have to make the client talk to a second port on the server for the long term connection phase with wserver(n). The problem with this, of course, is that only one server process at a time can be bound to the same port and server address.
This implies that a connection made by the client with gserver must also fill the role of the long term connection. The only way I see to accomplish this is that gserver must, after login, act like a proxy and copy traffic between itself and the client to the particular wserver(n) that the client is bound to logically.
It would be ideal if a TCP/IP connection first made between client(n) and gserver could be somehow "transported" to another application on the same server, intact, and could then be sustained by one of the wserver(n) instances for the long term connection.
I know that web servers do something like this for spreading out server loads. "Load balancing". The main difference here is that the "balancing" is the allocation of a particular user to a particular wserver(n) instance. But I also have the impression that load balancing is a kind of proxying - which I am trying to avoid (since it complicates the architecture and adds overhead as well as a single point of failure.)
This is a conceptual and design question. Don't worry about source code examples, unless they are absolutely essential to get the ideas across. If we pin down an approach, I can code it up.
Thanks!
What you are looking for is file descriptor passing. See UNP 15.7. One well-known heavy user of this facility is postfix.
I developed such an application long time ago. Since multiple servers can't listen on the same port. What you need is to have gserver listening on the well-known port. Once connection is established, pass the connection to the other servers via an Unix socket. Once the connection is passed to other server, gserver is out of picture. It can die and the other server will be still serving the connection.
I dont' know if this applies to your design, but the usual solution (as implemmented by the xinetd daemon) is to fork() and then exec() the process. For example, xinetd may serve services like rlogin, rsh, tftp, telnet, etc. which are actually served by different programs. This will not be useful to you if your wservers are processes already running in the system.