[jgroups-dev] FD_ICMP useability
balrog of moria <[email protected]> Wed, 26 Oct 2011 21:41:42 +0200
| Newsgroups | gmane.comp.java.javagroups.devel |
|---|---|
| Message-ID | <CACxvA2BcXxzWHoHoQ118SpJm1miD-JvpFdEvpCPAEAte2kTTHg@mail.gmail.com> |
I am playing around with my TCP protocol stack a little and I wanted to use
the FD_ICMP, since I'm on a constant quest to reduce bandwidth consumption
:)
Anyhow I noticed firstly that the magic number wasn't present so I added it
(I guess that experimental protocols are not included).
Then it didn't work since now logical addresses are used rather than
IpAddress so I needed to "patch" it as following:
In the PingMonitor, there was this:
// 1. execute ping command
InetAddress host=ping_dest instanceof IpAddress?
((IpAddress)ping_dest).getIpAddress() : null;
if(host == null)
throw new IllegalArgumentException("ping_dest is not of type IpAddress -
FD_ICMP only works with these");
I replaced it with this:
// Determine the physical address of ping_dest
InetAddress host;
PhysicalAddress physicalAddr;
if (ping_dest instanceof PhysicalAddress) physicalAddr = (PhysicalAddress)
ping_dest;
else physicalAddr = (PhysicalAddress) FD_ICMP.this.down(new
Event(Event.GET_PHYSICAL_ADDRESS, ping_dest));
if (physicalAddr == null) log.warn("Unable to determine the physical address
for " + ping_dest);
else host = ((IpAddress) physicalAddr).getIpAddress();
Now it seems to work but I was curious how safe it was to pass a down event
from a FD monitor task and how costly it was to traverse the task at each
heartbeat cycle.
Thanks again, and I'll continue playing with it ;)
Regards
Nicolas
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Javagroups-development mailing list