UDP Ping-no-Pong

Barusan sedang menunggu giliran untuk eksekusi hotfix installation mesin OneNDS, buka email kantor ada reply ticket salah satu problem untuk mesin AAA (Authentication, Authorization, Accounting). Reply-nya berupa jawaban untuk melakukan troubleshooting suatu masalah koneksi.

Can you please check if TCP traffic is also affected? Then this might be an issue with the IP stack itself. For debugging I suggest to write a simple UDP based perl ping-pong script sending packets on the same network interface from one FE to the other.
Snoop this traffic and check if any packets are missing. If so it is clear that neither JVM nor AAA are responsible for this behavior.

Mumpung nungguin kerja malam daripada ngantuk-ngantuk dan ntar gak konsen ketika eksekusi, instruksi dari technical support menarik juga. Buat simple script untuk ping-pong via UDP. Berikut hasil akhirnya berupa one-liner, tanpa “PONG” sih, tapi setidaknya bisa melihat apakah ada paket UDP yang hilang ditengah jalan tanpa harus di-snoop dengan wireshark.

bagian client:

XXXXXXXXXX# # export TERM=vt100
XXXXXXXXXX# perl -e 'use IO::Socket::INET; $socket = new IO::Socket::INET(PeerAddr => "10.16.x.x:5000", Proto => 'udp') or die "ERROR in Socket Creation: $!\n"; $i=0; while(1) { $data = "PING: $i"; $socket->send($data); $i++; $|=1; sleep(1);} $socket->close();'
bagian server:

YYYYYYYYYY# # export TERM=vt100
YYYYYYYYYY# perl -e 'use IO::Socket::INET; $socket = new IO::Socket::INET(LocalPort => '5000', Proto => 'udp') or die "ERROR in Socket Creation: $!\n"; while (1) { $socket->recv($received_data, 1024); $peer_address = $socket->peerhost(); $peer_port = $socket->peerport(); print "$received_data from $peer_address:$peer_port\n"; } $socket-close();'

PING: 1 from 10.1.x.x:33669
PING: 2 from 10.1.x.x:33669
PING: 3 from 10.1.x.x:33669
PING: 4 from 10.1.x.x:33669
PING: 5 from 10.1.x.x:33669
PING: 6 from 10.1.x.x:33669
PING: 7 from 10.1.x.x:33669
PING: 8 from 10.1.x.x:33669
PING: 9 from 10.1.x.x:33669
PING: 10 from 10.1.x.x:33669
PING: 11 from 10.1.x.x:33669
PING: 12 from 10.1.x.x:33669
PING: 13 from 10.1.x.x:33669
PING: 14 from 10.1.x.x:33669
PING: 15 from 10.1.x.x:33669
PING: 16 from 10.1.x.x:33669
PING: 17 from 10.1.x.x:33669
PING: 18 from 10.1.x.x:33669
PING: 19 from 10.1.x.x:33669
PING: 20 from 10.1.x.x:33669
...

not bad for spending past 15 minutes.

*yaaawn*. masih 30 menit lagi, enaknya ngapain yak T_T…*facebookan deh*

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s