473,507 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1566
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
2478
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
6145
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
6930
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
365
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
2380
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
6469
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
3632
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
3351
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
12101
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
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7376
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...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.