You will need to learn about the differences between the different network protocols and the different layers at which these protocols live. The ISO network layers are the most common way to speak about the different layers.

In your list, you named three kinds of protocols that live on three different layers:

IP packets live at the Network Layer (layer 3). Those are the most basic building blocks you will need and what Net::RawIP provides. As these are really low level, anything is possible, but everything will be hard, as you will basically have to reimplement your whole TCP stack yourself.

ARP, ICMP/PING, TCP, UDP: These protocols live on the ISO network layer 4, the transport layer. The packets here consist of one or more IP packets. You will have to learn about the structure of the packets for each protocol and then construct these packets yourself. I recommend starting with the ICMP ("PING") packets, as these are part of a very simple and easy to manage protocol with one ICMP packet corresponding to one IP packet in most cases, so you don't have to deal with fragmentation and reassembly.

On top of UDP and TCP, there are other protocols which then live at the application layer. DHCP and HTTP live here. If you want to start with the easiest things first, you should start here as well, and learn about the structure of the protocols and requests and answers. Communications at this level do not happen in terms of packets anymore, as you can continouusly read and write data over the connection and you won't notice that there are TCP/IP packets underneath.

Personally, I can only recommend to you to start with HTTP capturing as this is the most easy thing to test.

For sniffing and manipulating, there is libpcap and Net::PCap plus Net::PCapUtils, but these require you to know a lot about the protocols to be manipulated and sniffed. This is not easy.


In reply to Re^3: how to send one http request packet over ethernet by Corion
in thread how to send one http request packet over ethernet by munu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.