I've read the pppoe post 3 years ago. I wonder if things have changed?
I wish to write a custom dialer and server. I absolutely don't know where to start since most of my experience is in writing webservices. I wish to ask for assistance in the form of sample codes or links to where I can learn and get started with writing a PPPOE dialer.
I know basic socket programming but I don't know how protocols are implemented or used.
I can't prove that it is possible, but I believe java is powerful enough for this task. Can anyone help me?
to my knowledge it is NOT possible to handle the PPPoE protocol directly in Java. At least not without native code.
PPPoE is too low-level for Java. At least it's possible to get some information about the network interface(s) of your machine like your MAC address. You can check if a network interface uses a PPP connection, too. But that's basically the lowest end of Java's networking capabilities (most probably because the lower network protocols like Ethernet or PPP are too platform-specific?!?). Java doesn't even allow you to use ICMP commands like "ping" which is in the network layer above PPPoE.
Usually networking applications in Java use protocols above the IP layer, i.e. socket based protocols etc.
Nope, Marco, you're completely correct. PPPoE is very low-level indeed, and you'd actually be programming down at the level of the device driver -- very OS-specific and (I think, actually) fairly hardware-specific. Java is wholly inappropriate for the actual dialer part -- although if you need to have a GUI of some kind, you could do that part in Java and connect it to the rest of the code via JNI.
@Ernest: Thanks for confirming my thoughts on this
Anyway, I'd like to know what you are trying to do with a Java based PPPoE dialer/server, Stevenson. Just out of curiousity. My low-budget router here is working perfectly with PPPoE and connects me reliably to the internet. I can hardly imagine any use cases for which there would be a need for PPPoE support in a higher-level application. I'd like to hear about your ideas and what you "really" want to achieve :-)
Joined: Sep 25, 2010
Here's a quick background:
It's a request by a local bed-spacer; because he wanted to let people log into his wifi for free but to make up for the internet costs. He ask clubs or organizations pay a small fee for some ads. It works with the same principle of how charges them for posting on his bulletin board. It's just petty cash but it's a good idea; and it will give a lot of people free net and he could speed up his internet speed base on how much he makes. I've been leeching on his wifi, so I owe him.
Basically I need to control who gets access and show them these things. I figure I should start with a dialer and place ads there. I imagine something running by the toolbar to show some ads. I wanted to use java since I am more familiar with it. Is there a better way of doing this? I thought there would be softwares out there for this but I could find any FREE customizable dialers out there.
I'm not sure if dialers are the answer either. So please correct me if I'm wrong. Thanks.
your idea sounds very "adventurous" I understand what you are trying to achieve but I guess this would become more complex than you might think.To summarize: You need some piece of application which someone has to use in order to login to your friend's wi-fi access point, correct?
I must admit, I've never thought of implementing this by myself but I would say that the network layer for PPPoE is more low-level than necessary. You probably could get away with a VPN client which is at least one network layer above. But even this won't be possible in pure Java for the reasons we discussed above. Java was simply never designed for system programming task on the OS level. Nevertheless you could surely create some kind of GUI part with Java and implement the missing parts (the low-level details) via JNI in native code with C or something like this. Then again it would be very, very, very complex to provide any new secure VPN technology. You will have to rely on existing technologies like IPSec. Then again if you use standard protocols your "customers" won't be forced to use your VPN client as any compatible client software will do.
Another completely different idea would be to implement something like a proxy server. But I don't have any really good ideas how it should work to show some ads and don't annoy the users. And as it is on a higher level (and probably could be done in plain Java) it doesn't work as transparently as the ideas with a VPN or PPPoE. Probably you would have to implement a proxy for every application protocol you want to support like HTTP, SMTP etc.
Sorry, but these were the best ideas which come to mind at the moment. Also no really mature ideas. There would still be a lot to do for any of these thoughts, I guess. And implementing any network protocol correctly, perhaps with cryptography in mind, is surely not a trivial task.
Hopefully someone other can come up with better and more detailed ideas. Anyway, good luck and let us hear if you've found a working solution