Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

TCP protocol in Java

Thread view: 
Bala Shanmuga Priyan - 06 Mar 2007 17:23 GMT
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
Christian - 06 Mar 2007 18:07 GMT
Bala Shanmuga Priyan schrieb:
> 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.

> Also is there any detailed
> explanation for source code of java.net package.
>
> Thanks in advance
Chris Uppal - 06 Mar 2007 18:47 GMT
>      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
Arne Vajhøj - 12 Mar 2007 04:12 GMT
>      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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.