Configuring address and ports for JGroups - infinispan

When using JGroups, with a component such as Infinispan, it is possible to configure the ports and addresses that JGroups will use.
http://www.jgroups.org/manual/html/user-advanced.html
For example:
<UDP
mcast_addr="${jgroups.udp.mcast_addr:228.6.7.8}"
mcast_port="${jgroups.udp.mcast_port:46655}"
...
But here is what is confusing me. How can all members of the cluster all use the same port, addr?
I would have thought each member would have its own port and have to know the ports (and addresses) of the other members it needs to talk to?
Thanks

Multicast is a special address that can be used by multiple nodes to send/received data - think of it like 127.0.0.1, which is also available on most boxes with network installed.

Related

Need help changing my website's name / address

this might sound a bit amateur-ish but I'm in a bit of a situation here.
So I created myself a website and managed to get it working on localhost, I tried port forwarding ports 80,443 but nothing helped, So next thing I'm googling around and I read about ngrok and it actually worked. Got it working on a long randomly generated domain but the problem is that I want to use the one that I have from no-ip.com. How can I do that please? I'm very lost here.
Software being used: Xampp (Apache,MySQL)
I've reserved a DHCP ip-address for my PC in my router's settings, hopefully that helps? I don't know. Help me internet.
There are a whole bunch of possible reasons that this might not work. Here are a few of them.
Your ISP
Even if you have port forwarding set up properly on your router, it is still possible that you cannot do what you want.
First, many ISPs block serving websites from residential internet connections. Connections to port 80/443 will never even reach your router. You might try experimenting by forwarding a different port number (such as 8000 instead of 80) to see if the traffic can get through on that port. (However, that will not work as a practical solution since your users will not know to use an alternate port and your ISP can choose to terminate your service if you are violating the terms of your agreement.)
Second, due to the exhaustion of public IPv4 addresses, some ISPs are implementing Carrier-Grade NAT (CGNAT, a.k.a. Large-Scale NAT - LSN). Instead of giving your router a public IP address, they give your router a private IP address inside their network. Once again, connections to port 80/443 (or any other port for that matter) will never reach you. You can check if you are behind CGNAT by going to your router's setting and finding the public IP address, then going to https://whatsmyip.com/ and seeing if it is the same or different. (In theory, you should be able to tell that you have CGNAT if your router's IP address is between 100.64.0.0 - 100.127.255.255, but in practice some ISPs use other private network ranges too, such as 10.0.0.0 - 10.255.255.255.)
The reason Ngrok works for you is because Ngrok opens a tunnel from your computer to their cloud servers and sends the traffic through that tunnel.
DNS
You mentioned in the comments that you have the DNS set to resolve the private IP of your computer. That certainly will not allow users on the public internet to get to your site, because they cannot connect to your address.
However, you also mentioned in the comments that if you change the DNS to point to your public IP, it doesn't work from either inside or outside. This could mean your problem is one of the ISP issues described above. It could also mean that your router does not support Hairpin-NAT (a.k.a. NAT Reflection), which is how the router would be able to redirect local traffic back to the local server instead of trying to send it out over the internet.
Firewall
Your computer's firewall can look at the source IP address of the incoming traffic, and it might be set not to allow external access to your web server. DO NOT DISABLE YOUR FIREWALL to try to get around this. Instead, you need to add a specific exception to the firewall rules to allow the incoming traffic. How you do this will depend on your operating system.

Can DDS protocol be used to communicate between devices connected to different networks?How?

I am trying to implement a publish and subscribe hello world program for communication between 2 devices using eclipse cyclone DDS protocol, I am able to do it when devices are connected in the same network but when devices are in a different network there is no communication happening. As per my understanding, it's because of the default DDS domain but how do I change it?
I followed https://github.com/eclipse-cyclonedds/cyclonedds
Here there's a mention to make use of an XML file, but I am not understanding how to use it or where to use the file.
Any suggestion would be of much help, thank you!
Cyclone DDS looks at the value of the CYCLONEDDS_URI environment variable to find its configuration file. What you can do is make an XML file somewhere on your computer and put its path in that environment variable. E.g., on Linux:
export CYCLONEDDS_URI=/path/to/cdds.xml
or on Windows (“cmd”, I don’t know how to do it in powershell):
set "CYCLONEDDS_URI=c:/path/to/cdds.xml"
Windows is a bit tricky with the quotes, this seems to work fine. Then, when you start your application, Cyclone DDS will read that file and apply the settings in it. Of course you also need to know what to put in it.
For that, it is useful to know a few things about the networks you are using. In one network, it all works without any configuration because the UDP/IP multicast works semi-magically in a single network. If there are multiple networks, there is a router in between and those routers are often configured not to route multicast traffic.
That means you basically have two options:
Configure the routers to route multicast traffic between the networks (especially the 239.255.0.1 address used by default by DDS). If that works, you’re all set, no need to configure anything in Cyclone DDS.
Disable the use of multicast and instead list the hostnames/IP addresses of the machines you want to communicate with in the configuration file. You still need a router willing to route traffic from the one network to the other, but that is usually not a problem with unicast packets. (If for example you can ping it or login to it remotely, it’s fine.)
For (2), something like:
<CycloneDDS>
<Domain>
<General>
<AllowMulticast>false</AllowMulticast>
</General>
<Discovery>
<ParticipantIndex>auto</ParticipantIndex>
<Peers>
<Peer Address="ip-of-node-1" />
<Peer Address="ip-of-node-2" />
<Peer Address="ip-of-node-3" />
/Peers>
</Discovery>
</Domain>
</CycloneDDS>
should work (obviously with the ip-of-node-1 &c. replaced with the correct addresses/hostnames). Setting “AllowMulticast” to false simply disables all use of multicast. If multicast doesn’t work reliably with all nodes, assuming it works can give a broken system. So at this stage, it is definitely easier to just not use it.
The “ParticipantIndex” has to do with the UDP port numbers it uses. With multicast, multiple processes on a single machine can all use the same UDP port number for receiving the discovery packets, and so there is this agreed-upon port number for discovery that makes everything work without any configuration (port number 7400 for domain id 0). That in turn allows it to use random port numbers for receiving unicast traffic.
With unicast, however, each process needs to have its own unique port number, and that in turn means the other processes need to know to which port numbers to send the data to. Setting the “ParticipantIndex” to auto forces it use predictable port numbers so that the processes can find each other.

Difference between official and unofficial ports

Here we can see list of some Well-known ports and Registered ports in TCP/UDP, When we look at the port number 2086 it is assigned for two different services, one is official for GNUnet and other is unofficial for WHM.
Exactly this port number duplication cause any issues when we install both services having same port number in our server?
What does it mean, these same port number is assigned, one for official and other for unofficial purpose ?
You have to distinguish between port numbers registered by IANA (Internet Assigned Number Authority) and commonly used port numbers. Port 2086 is only registered for GNUNet (see https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt), but is commonly used also for WebHostManager.
In practice you could use any ports you like inside an application, i.e. it is not forbidden to use registered ports for other purposes or use unregistered ports. But it might cause conflicts with other software using the same ports, so it is better to respect registered ports and register your own ports if your application is of some importance.
Apart from that, more and more applications just move to a protocol on top of HTTP, because this is the only port open on most firewalls :(

Windows NLB not balanced

I set up a NLB cluster given two servers (WS 2008 R2). Each server has one NIC card which I set up for a static ip address. I assigned the cluster an internet name (MyCluster), and assigned it a static ip address. The third box is acting as a client sending TCP data (over WCF) to the cluster's IP I configured (static IP). I am observing the NLB cluster from the NLB manager at one of the nodes - both nodes are green, say started. However, I am only able to see traffic coming in to one of the NLB servers. When I suspend it, I see traffic going to the other NLB server, and so on. I was expecting traffic to be split equally between them. I can't figure out what I missed, any tips please?
If you need more detailed information please ask, not sure how much detail to put in here.
Thanks/.
By default, a port rule created with a Filtering mode of multiple host will use single affinity. In other words, multiple requests from the same client will get directed to the same host. To see traffic going to both hosts try accessing the cluster from multiple clients. You could also set the affinity to "none", but this can lead to other problems.
There's good information on the affinity parameter and how to use it in the NLB help file.

192.168.0.71... What is this special address used for?

I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be?
Edit:
I didn't tell you, typing 192.168.0.71 brings me straight to my site, just as 127.0.0.1 would. I just wonder how this is different, then from 127.0.0.1.
RFC 1918 reserves addresses starting with 192.168 for private networks. This most likely means that some computer on your local network is accessing the server.
I didn't tell you, typing 192.168.0.71 brings me straight to my site, just as 127.0.0.1 >would. I just wonder how this is different, then from 127.0.0.1.
That means that 192.168.0.71 is the assigned internal IP to your machine.
127.0.0.1 is just a local loopback redirect. 192.168.0.71 is actually directly connecting to your machine.
192.168.???.??? is a special, reserved range of addresses private IP addresses. So it's probably a computer from your local network.
Read: http://en.wikipedia.org/wiki/Classful_network
EDIT:
You've edited your post.
It seems, it's your address in the local network.
127.0.0.1 is the loopback address.
Difference between them is if somebody else from your network types 192.168.0.71, they go to your site, 127.0.0.1 is for their computer.
192.168.0.71 (Well the entire range 192.168.0.0 – 192.168.255.255) are for private (read. not internet accessible) network IP addresses, so that is from something inside your private network.
I believe it is reserved for any private intranet, as per this document.
The 192.168.x.y block is typically used for non-Internet connected devices. It's most likely from one of your own machines. If you have a router of some sort, go into its configuration tool and see if you can find the block of addresses it uses to assign to internal machines. It should be 192.168.x.y.
Judging from your edit, it sounds like 192.168.0.71 is your computer's IP address on your internal network.
As to why it's showing up in your logs instead of 127.0.0.1... well, I can only assume that, for whatever reason, one of the programs on your computer is contacting the computer by its network IP rather than the localhost IP.
The 192.168.0.0 network is defined as being one of the "private" networks.
As Krzysiek Goj has said, check this link for further details.
There are 3 ranges that have been designated as private ip addresses.
- 10.0.0.0/8 (meaning 10.0.0.0 to 10.255.255.255)
- 172.16.0.0/12 (meaning 172.16.0.0 - 172.31.255.255)
- 192.168.0.0/16 (meaning 192.168.0.0 to 192.168.255.255)
Typically a DHCP server on your network (of which most network switches are examples) are configured to dynamically hand out ip addresses in one of the private ranges. The 192.168.0.0/16 range is probably the most popular. Alternatively you may have been statically allocated one of these addresses by your network administrator.
To check the address that you've been allocated you can use one of the following:
- (windows) ipconfig /all
- (unix) ifconfig
By default your machine will also have a loopback interface enabled using the address 127.0.0.1. This can be used to access your own machine.
There is not enough information here to completely answer the question. The most likely answer is:
The web server is also your desktop system. Your browser is running on that system as well, so the the 127.0.0.1 traffic is from your surfing of your own site.
The 192.168.0.71 is the actual IP address of your desktop, which is connected to some kind of NAT'ing device which connects you to the internet. Almost every broadband WiFi device uses this subnet by default.
The reason some traffic comes from that address is that on occasion, for various web reasons, some of the traffic is directly addressing your 192.168.0.71 address rather than the 127.0.0.1 address.