You are on page 1of 14

RL-2000/MSSR-1

Data diagnostics
Diagnostic Applications

• Standard UNIX/Linux:
• tcpdump
• cat, od/hexdump
• Ps

• Provided by ELDIS:
• recv
• ast2text
• CMSIpSwitch
Command tcpdump

• Powerful command-line packet analyzer


• Prints out description of the contents of packets
(including protocol headers)
• Many options, complex expression syntax, low level

• Usage: tcpdump options expression


• tcpdump –nXs0 src smp1 and port 0x6010

• Options:
• -X print out packet data (protocol headers + payload)
• -s0 print the whole packet (not only first 96 B)
• -ttt time difference between packets
• -w write captured data to a file
Command tcpdump

• Output example:

08:17:05.422390 IP SMP1.57573 > 239.255.0.150.24592: UDP, length 69


08:17:05.422669 IP SMP1.57573 > 239.255.0.150.24592: UDP, length 16
08:17:05.603922 IP SMP1.57573 > 239.255.0.150.24592: UDP, length 17

08:18:03.668188 IP SMP2.36592 > 239.255.0.150.24592: UDP, length 16


0x0000: 4500 002c 0000 4000 2011 a46b c0a8 0518 E..,..@....k....
0x0010: efff 0096 8ef0 6010 0018 f955 2200 10f4 ......`....U"...
0x0020: 1e33 023a 5cfb 3094 4020 4000 0000 .3.:\.0.@.@...
Command cat

• Concatenates files and print on the standard output


(terminal window)

• Usage: cat options FILE


• cat /etc/resolv.conf

• Using I/O redirection, we can print the file(s) into a new file
• cat /etc/resolv.conf > newfile.txt
• cat /etc/resolv.conf >> newfile.txt
Command od/hexdump

• Displays the specified files in user specified format (octal, decimal, hexadecimal)

• Usage: od options FILE


• od -x /etc/resolv.conf

• Usage: hexdump options FILE


• hexdump /etc/resolv.conf

• I/O redirection
• od -x /etc/resolv.conf > newfile.txt
Command TCP/IP and cat/od/hexdump

• Using I/O redirection and /dev/tcp virtual files, cat/od/hexdump can be used for
listening to TCP/IP server and printing data it is sending

• Usage: cat < /dev/tcp/<ip address/hostname>/port

• Usage: od < /dev/tcp/<ip address/hostname>/port

• Usage: hexdump < /dev/tcp/<ip address/hostname>/port

• Examples:
• od -x < /dev/tcp/192.168.5.101/$((0x4000))
• cat < /dev/tcp/127.0.0.1/$((0x2402))
• hexdump < /dev/tcp/smp1/$((0x6010))
Command ps (process status)

• Displays the currently running processes

• Usage: ps options
• ps -e lists all processes in the system
• ps auxww lists complete info about all processes

• I/O redirection
• ps aux > /tmp/test
Command recv

• recv is an ELDIS application for printing the data from IP descriptor (ELDIS’ abstraction
layer)

• Operates on application level (payload only, no header)

• Several formatting options

• Usage: recv options IPdescriptor


• recv client:192.168.5.101:0x4000:10

• Options:
• -o output saves data into binary file ‘output’
• -t diff print time as a difference between packets
• -S no data output, measure throughput only
Command recv

• Output example:

on 24.11.2013 at 10:31:44.466 UTC +1.00


received 28 bytes from client:192.168.5.101:0x4000:10
--------------------------------------------------------
Address 0 1 2 3 4 5 6 7 8 9 A B C D E F
--------------------------------------------------------
000000 : d5 fd 00 87 0f ff fc ff f7 11 73 3b 1e 3c 64 01 | ..........s;.<d. |
000010 : 03 1e 47 18 01 51 01 51 64 64 03 04 | ..G..Q.Qdd.. |
Command ast2text

• ast2text is an ELDIS application for ASTERIX data format analysis

• Supports categories 001, 002, 003, 004, 008, 009, 010, 020, 021, 023, 034, 048, 062, 065
and 247

• Decoded data are print out to the standard output

• Usage: ast2text options input


• ast2text –n client:192.168.5.23:0x6010:10 -c 48

• Options:
• -n input is IP-descriptor (assumed to be a file if not
specified)
• -c CAT decode only ASTERIX category CAT
Command ast2text

• Output example:

Category: 34 Data block size: 16


010 [sac=30 sic=51]
000 [type=sector_crossing]
030 [time=38422 sec (84/128) 10:40:22.656]
020 [sector 14 (azimuth 157.500 deg)]
050 [Present: com psr mds]
[COM: released RDPC-2 - - - CONN VAL]
[PSR: ant=1 cha=B - CONN]
[MDS: ant=1 cha=B - CONN scf=A dlf=A - -]

f4 1e 33 02 4b 0b 54 70 94 40
40 40 00
Command CMSIpSwitch

• CMSIpSwitch is and ELDIS application which sends data from input to specified output

• Usage: CMSIpSwitch options input output


• CMSIpSwitch -daemon udp:0.0.0.0:0x1234:: server:0.0.0.0:3410:10
• Both input and output are IP descriptors (or lists of them)

• Options:
• -daemon run on background
• -twoway send also data from output to input
• -cut B E cut B bytes from beginning and E from end
Command CMSIpSwitch examples

• Send data received from UDP port 0x3210 to port 0x3620 (act as a TCP server)
• CMSIpSwitch udp:0.0.0.0:0x3210:: server:0.0.0.0:0x3620:10

• Send merged data received from two TCP servers (on ports 0x3610 and 0x3420) via UDP
unicast. Note the use of quotes
• CMSIpSwitch “client:127.0.0.1:0x3610:10 client:127.0.0.1:0x3420:10”
udp:::192.168.5.1:13840

You might also like