aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Security in Datagrams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Security in Datagrams" Watch "Security in Datagrams" New topic
Author

Security in Datagrams

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Hello, its been ages

I'm in the process of understanding Datagrams, and i understand that it is connectionless protocol...
so my question is, if i send some data to a server, and leave that socket open for continuous listening, can an unauthorized host spam my socket?

In Java will it though any kind of exception to reject data from the unauthorized host?

hope the questions are clear
thanks
HannaH
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
No, a Socket isn't vulnerable to that. A ServerSocket is open for listening to anyone who wants to connect, but a Socket is used only for connections to a particular port on a particular host. No other host can connect to it.


Ping & DNS - updated with new look and Ping home screen widget
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Thanks Ulf very much

I particularly meant, DatagramSocket

is that the same as ServerSocket?

and when you say a "ServerSocket is open for anyone to connect" doesn't that mean an unauthorized one can connect to my host?
[ February 20, 2008: Message edited by: H Melua ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
I particularly meant, DatagramSocket

is that the same as ServerSocket?

No. A ServerSocket uses TCP, not UDP like DatagramSocket.

and when you say a "ServerSocket is open for anyone to connect" doesn't that mean an unauthorized one can connect to my host?

That's exactly what it means. You need to implement authentication and authorization yourself if you use raw sockets.
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
cheers very much for the info, it sounds very interesting

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security in Datagrams
 
Similar Threads
Socket connections
Sending data to an applet.
JDK 1.5_0_5 PrinterWriter.readLine() is splitting data?
how to decide whether to go with socket or web service
Urgent! Last character is lost in datagrams