how to analyse the contents of a give IP packet?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to analyse the contents of a give IP packet?
# 1  
Old 08-01-2008
how to analyse the contents of a give IP packet?

hi you all!
I can write a network program to send and receive some messages. I use
read() and write() functions for extracting of sending messages via a given socket. By doing so, i know only the actions performed at the application layer of the TCP/IP suite. But i want to control the actual contents of each IP packets(i.e data and ip header) sent/received.Lets say I want to write a routing application which analyses the destination address found in the IP header(TCP header) and sends the packet to its destination.
Give me some hint on how to tackle such cases or give me a reference book/site...

thank you
# 2  
Old 08-02-2008
You want to use raw sockets.

Search google for "raw sockets" or "SOCK_RAW" or "PF_PACKET"

If you're programming C in Linux, there are structs that easily let you alter the whole tcp/udp/icmp/igmp/whatever header and inject packets at will. This can also be used for communication over closed ports and other obscure stuff (if you create a listening raw socket, you'll have yourself a "sniffer", and with that you can analyze data packets that arrive even on closed tcp ports)

Last edited by Neo; 08-02-2008 at 07:10 PM.. Reason: Deleted unnecessary editorial comment
# 3  
Old 08-02-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies

2. HP-UX

How to analyse the syslog?

Hi All, When can we see these messages in the syslog. We have service guard cluster software installed on hpux 11iv3 servers. We were able to see the below error so many times in our syslog messages cmdisklockd: Unable to convert device to I/O tree node: I/O tree node does not exist. ... (2 Replies)
Discussion started by: Sachin1987
2 Replies

3. UNIX for Dummies Questions & Answers

Analyse this fdisk -l

Hi, Someone please analyse the following o/p of fdisk -l and tell me what it means for /dev/sda, /dev/sdb, /dev/sdc .... Disk /dev/sda: 53.6 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start ... (5 Replies)
Discussion started by: stunn3r
5 Replies

4. Shell Programming and Scripting

How to analyse results of grep

Hi all, I'm working with a peice of software that runs on Linux that allows planning trips in cars through maps. This software has different variations depending on the type of car, e.g. BMW, Audi, Hyundai, etc... Each variation has a dependency on common external components that are not... (1 Reply)
Discussion started by: emoshaya
1 Replies

5. Solaris

I need to analyse some vmcore files

I need to analyse some vmcore files, do you guys know how can i get a free version of the "Solaris Crash Analysis Tool " (2 Replies)
Discussion started by: feg
2 Replies

6. Solaris

analyse core file using pmap and pstack

Dear All, I am new to this forum. This is my first. I am facing customer issue. Customer has got core file while running the server. He had sent core file and details from pstack, pmap and pldd commands. I have to debug this application, please help me to fix this issue. I am using sparc 10... (4 Replies)
Discussion started by: KiranBangalore
4 Replies

7. UNIX for Advanced & Expert Users

analyse core file using pmap and pstack

Dear All, I am new to this forum. This is my first. I am facing customer issue. Customer has got core file while running the server. He had sent core file and details from pstack, pmap and pldd commands. I have to debug this application, please help me to fix this issue. I am using sparc... (1 Reply)
Discussion started by: KiranBangalore
1 Replies

8. Shell Programming and Scripting

Logfile analyse | problem with regex

Hello there, i am trying to write a shell script to analyse some of my log files. I want the script to check if there is a logfile from yesterday or today (some times the script that creates the logfile takes a bit longer and its after 00:00) and search the logfile itself if the script was... (0 Replies)
Discussion started by: Linien
0 Replies

9. Solaris

Ways to analyse root disk slice

Hi, Recently I faced with need of analyze root disk. I figured out two possible ways to do it: 1. Practical. Boot from CD and run format 2. Theoretical. Create live upgrade boot environment on another disk, activate it, reboot, unmont all root disk partitions and run format. I've already... (3 Replies)
Discussion started by: Sapfeer
3 Replies

10. UNIX for Advanced & Expert Users

Using GDB to analyse different CORE dumps

Hi, Can we modify the GDB source code so as to analyze core dumps from different targets? From my analysis, I think we need to build our section table statically for each target. i.e., including the various address boundaries in build_section_table() function. If this is the case, then the GDB... (2 Replies)
Discussion started by: nsdeeps
2 Replies
Login or Register to Ask a Question