Lab exercise
The steps to capture the normal TCP connection flow (a sample program is provided as part of this book) are as follows:
- Open Wireshark, start capturing the packets, and choose display filter
tcp.port==8082
. - Compile the Java program
TCPServer01.java
using thejavac
command:bash$ ~ javac TCPServer01.java
- Run
TCPServer01
using thejava
command:bash$ ~ java TCPServer01
- Verify the server is listening on port
8082
:bash$ ~ netstat -an | grep 8082 tcp46 0 0 *.8082 *.* LISTEN
- Compile the client program
Client0301.java
using thejavac
command:bash$ ~ javac Client0301.java
- Run the client program:
bash$ ~ java Client0301
- View and analyze the packet in Wireshark.
Get Packet Analysis with Wireshark now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.