473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

packet anlayzing

Hello everyone
am trying to analyze the packet i got through a simple peer to peer
masseges and i wont to view the informations of the layer 3 and layer 2
frame like (IP address and MAC address)if anyone can help ASAP cindly
Thx

Jul 8 '06 #1
2 1562
amany wrote:
Hello everyone
am trying to analyze the packet i got through a simple peer to peer
masseges and i wont to view the informations of the layer 3 and layer 2
frame like (IP address and MAC address)if anyone can help ASAP cindly
Thx
Hi amany,

The MAC address appears in the Ethernet header, and you cannot easily read
that. However, if you have an instance of a Socket object, and are
receiving the packet through the Socket, then you can adjust the parameters
of the Socket's IP layer to include the IP header.

You need to take a look at the SetSocketOption method of the Socket class,
and you need to set the option HeaderIncluded on the IP layer. MSDN has an
example about using SetSocketOption, on their website. Here is the URL:

http://msdn2.microsoft.com/en-us/library/1011kecd.aspx#

A quick Google, with the right keywords, turns up some relevant examples.
Remember: If you turn on HeaderIncluded, you also have to format your own
IP header.

--
Hope this helps,
Tom Spink
Jul 8 '06 #2
Amany,
Download yourself a copy of Ethereal. It's free.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"amany" wrote:
Hello everyone
am trying to analyze the packet i got through a simple peer to peer
masseges and i wont to view the informations of the layer 3 and layer 2
frame like (IP address and MAC address)if anyone can help ASAP cindly
Thx

Jul 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: QQ | last post by:
Hello I am a newbie on network programming. I am trying to receive a packet if((numbytes = recvfrom(udp_fd1, buf, MAXLEN-1, 0,(struct sockaddr*)&register_addr, &addr_len))==-1){ fprintf(stderr,...
2
by: bobrics | last post by:
Hi, I would like to create a packet for a RAW socket transfer. Please let me know if this is the right approach. 1. First, I am creating a header structure where I store all the information I...
10
by: PH | last post by:
Hi guys! I need to get the remote EndPoint from when I receive packets when listening in a local port in my computer. I'm using UDP (connection-less) so I only bind the socket to my...
2
by: amany | last post by:
Hello everyone am trying to analyze the packet i got through a simple peer to peer masseges and i wont to view the informations of the layer 3 and layer 2 frame like (IP address and MAC address)if...
7
by: owolablo | last post by:
Hi, I'm writing a program that sends 1500 bytes of data at once, from the client to the server. However, the packet is broken down into 3 different segments of 500 each before getting to the...
1
by: visal | last post by:
hi Please help me.i am developing a java pgm to capture network packets using jpcap.i downloded jpcap and wpcap dll files. My pgm is: import jpcap.JpcapHandler; import jpcap.Jpcap; import...
3
by: nexus024 | last post by:
I am trying to write a program that will continuously sniff eth0 for a specific UDP packet thats being sent to a specific destination IP, alter the data of the packet, and finally transmit it to the...
1
by: sangith | last post by:
Hi, I tried the packet capture module program. I did a file transfer using ftp from this host to another server. But when I ran the program, it was just hanging off and it did not print the...
1
by: AngreGanon | last post by:
Hi all~ I've written a network program in C. This program catputures ARP request packet and reply wrong ARP packet. Hi. I've written a small program to learn to write in C. But unfortunately...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.