Re: packet anlayzing

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Question on SOCK_RAW, implement a bpf->other host tee
    ... layer header. ... but i don't see a packet anywhere. ... re-injecting the packet at the IP forwarding layer, ... > static int verbose; ...
    (freebsd-net)
  • Re: How do I get the destination IP of a received UDP packet?
    ... I wonder if there's a way to recieve the packet, with layer 3(IP header) ...
    (comp.lang.ruby)
  • Re: ARP - IP but why?
    ... The Network layer keeps track of logical addresses, and Ethernet handles delivery to a specific device. ... Since an IP address can be assigned to any ethernet device, it is utilized to associate an IP address to a real-world computer, printer, whatever. ... Once the network layer builds the TCP packet with a destination IP address, it hands it down to the link layer. ...
    (comp.os.linux.networking)
  • Re: packet vs frame
    ... I.e., a data frame becomes ... a packet by tacking on some control bits fore and aft. ... OSI, and a frame is layer 2 of the OSI. ...
    (alt.internet.wireless)
  • RE: DoS/DDoS Attack
    ... We are now looking into a HA/LB setup of the IPS 5500. ... The attack lasted about ... my favorite rate-based IPS box is Top Layer. ... >header to the packet you're sending, then the kernel just place the packet ...
    (Pen-Test)