File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NetMask,IPAddress clarification

 
Vignesh C Kottaiveedu
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Iam developing a web-service which has the given functionality.
a) Any client registers to a web-service and that is given back a client-identity-key which comprises of ip and a secret key.
b) The second time the client comes with the idetity-key to the service and the service authenticates the client through the service.
Here is the issue , during resgistation i can get the IP address of the client , but i need to get the netmask of the ipaddress coming through http. so that i combine the ip+netmask and give back to the client. During authentication i verify the client comes from the same IP if not atleast from the same netmask. (for VB clients there is a new IP given everytime the machine is rebooted ,and also the service is within the firewall)
Here are the list of questions :
1) How do i get a netmask from a given IP address ?
2) How do i get to find that a given IP falls inside the same network when given a netmask ?
This is a very urgent requirement , please help me out.
Thanks
Vignesh
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The subnet mask is a number used in interpreting an address. You can't derive a subnet mask from the address -- if you could, then what good would it be? It wouldn't add any information, right?
On top of this, these days, the notion of an address is very flexible. A NAT box can be used to hide thousands of machines behind a single IP address (which would obviously spell doom for your authentication scheme!)
So I think your whole scheme needs to be rethought.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic