The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using GDB to analyse different CORE dumps nsdeeps UNIX for Advanced & Expert Users 2 04-16-2008 12:10 AM
end-end packet delay? yogesh_powar IP Networking 4 12-13-2005 01:21 PM
sendto in packet socket Rakesh Ranjan High Level Programming 5 09-02-2005 07:32 AM
Getting an ACK for RAW SYN packet zampya High Level Programming 17 05-24-2004 09:15 PM
Seeing IP packet manjunath IP Networking 4 09-15-2002 11:46 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-01-2008
solomonml solomonml is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 4
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 (permalink)  
Old 08-02-2008
redoubtable redoubtable is offline
Registered User
  
 

Join Date: Aug 2008
Location: Portugal
Posts: 242
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 06:10 PM.. Reason: Deleted unnecessary editorial comment
  #3 (permalink)  
Old 08-02-2008
ramen_noodle ramen_noodle is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 251
libnet: The Million Packet March
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0