in reply to Re^2: how to send one http request packet over ethernet
in thread how to send one http request packet over ethernet
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.
|
|---|