• Post Reply Bookmark Topic Watch Topic
  • New Topic

Broadcast vs Subnet

 
Wagner Danda Da Silva Filho
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to write a IPAddress validation code, but now I'm not sure about the broadcast reserved ip concept. Can I have more than one broadcast in the same network? (Attention: I'm not saying "subnet").

For example:

Is it valid the following scenario?

Network Address: 10.0.0.0
Subnet Mask: 255.255.255.0

Valid IP Address Range:
from 10.0.0.1 to 10.0.0.254

Reserved ips:
Network Address: 10.0.0.0
Brodcast: 10.0.0.255

Thanks,
Wagner Danda
[ September 12, 2006: Message edited by: Wagner Danda ]
 
Dan Howard
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a google search and found this at:

http://www.velocityreviews.com/forums/t142994-ip-address-validation.html

Maybe it will help.

Ross Bamford

"The following might work:



import java.net.InetAddress;

/* ... etc ... */

int myTimeout = 2000;
byte[] address = { 127, 0, 0, 1 };

/* ... etc ... */

InetAddress addr = InetAddress.getByAddress(address);
boolean validAddress = (addr.isReachable( myTimeout ));


You should obviously adjust the timeout to suit. This will use ICMP if
available, or the Echo service (port 7) if not.

Hope this helps,
Ross
"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!