File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes PPPOE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "PPPOE " Watch "PPPOE " New topic
Author

PPPOE

stevenson lee
Greenhorn

Joined: Sep 25, 2010
Posts: 11
Hi
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?

Best Regards,

Stevenson Lee


keep learning...
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Stevenson,

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.

If I'm not correct somebody may correct me!!

Marco
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

@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 :-)

Marco
stevenson lee
Greenhorn

Joined: Sep 25, 2010
Posts: 11
H guys,

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.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Stevenson,

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

Marco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PPPOE