2
votes

Introduction:

As part of my college research I have to find out how much physical memory is being overtaken when abusing the TCP Three Way Handshake. To be more precise: when the client does not reply with an ACK, thus leaving the server hanging with memory that is reserved for them.

I had a look through the available software out there, but I didn't manage to find anything that would allow me to simulate the TCP Three Way Handshake.

Then I found Java Sockets. I had a look through a number of tutorials, but I find them very unclear. Also, they seem to have a high-level view, which would not allow me to manipulate the SYN, SYN-ACK, ACK sequence.

Therefore, I stepped down into the actual java.net with a decompiler tool. I had a look at various classes, but I can't find any references to the actual SYN messages being sent. Some methods sound like they do the thing, but I can find only method calls and their interface definitions. I can't find the actual method code!

Actual questions:

  • Could someone please tell me which classes / methods in java.net deal with sending SYN, SYN-ACK and ACK messages for TCP Three Way Handshake?

  • If someone knows any good tutorials on Java Sockets, please refer them here? The ones I found are confusing me(and some of them are made by Oracle!).

  • If someone knows any programs that allow to simulate TCP Three Way Handshake, please refer them here.

Any one of the above three is probably enough to get me where I want. Any help at all would be greatly appreciated! The longer I research, the more it feels like looking for a niddle in a hay stack.

2

2 Answers

5
votes

Java does not implement TCP/IP. Java calls the operating system to do it. So the code you want to read is in an operating system kernel, not in Java anywhere. You might consider reading linux kernel source.

-1
votes

Could someone please tell me which classes / methods in java.net deal with sending SYN, SYN-ACK and ACK messages for TCP Three Way Handshake?

None of them.

If someone knows any good tutorials on Java Sockets, please refer them here? The ones I found are confusing me(and some of them are made by Oracle!).

The Custom Networking trail of the Java tutorial, but it doesn't deal with aspects of TCP such as the handshake that aren't implemented by Java.

If someone knows any programs that allow to simulate TCP Three Way Handshake, please refer them here.

There aren't any in pure Java.