TCP protocol in Java

  • Thread starter Bala Shanmuga Priyan
  • Start date
B

Bala Shanmuga Priyan

Hi all,
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own. Also is there any detailed
explanation for source code of java.net package.

Thanks in advance
 
C

Christian

Bala said:
Hi all,
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own.

You can implement your own transport protocol by utilizing UDP .. UDP
gives you basically the Network layer and has nearly no data on
Transportlayer. Forming your own packets directly may not be allowed
based on what OS and what userrights you have, so there is no
implementation in java.
 
C

Chris Uppal

Bala said:
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own. Also is there any detailed
explanation for source code of java.net package.

If you don't want to layer over UDP (as Christian has already suggested) then
you should be able to do it using a Java wrapper for the pcap library (pcaplib
or WinPcap).

I don't know whether pcap has Java wrappings available yet for sending packets
yet. I not then you'd have to write your own -- but in comparison to
designing, implementing, and testing, a transport-layer protocol, that should
be a doddle ;-)

-- chris
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Bala said:
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own. Also is there any detailed
explanation for source code of java.net package.

Java does not support raw sockets so you would need
to do something in C++ and use JNI.

Maybe look at http://www.savarese.org/software/rocksaw/ !

If it is for a real world problem: forget it and
focus on the higher level problems.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top