Team LiB
Previous Section Next Section

11.1. Introduction to libnet

Designed by Mike Schiffman, libnet is a portable, open source, C-language library for creating and injecting network packets. libnet supports packet creation at all network levels with the TCP/IP network model, as demonstrated in Figure 11-1.

Figure 11-1. TCP/IP model and example of supported protocols


As of libnet version 1.1.2.1, you can create packets for the following protocols:

802.1q
FDDI
ICMP
IPSEC
Token Ring
DHCP
802.1x
ARP
IGMP
DNS
VRRP
BOOTP
802.2
TCP
IPv4
RIP
MPLS
GRE
802.2 SNAP
UDP
IPv6
RPC
NTP
BGP
802.3
CDP
ISL
STP
OSPF
Sebek
Ethernet


In addition, you can create other protocols within libnet due to its absolute control over packet data content.

11.1.1. Installing libnet

libnet is distributed in source code form. You can download the source code for the latest version of libnet from the project home page at http://www.packetfactory.net/projects/libnet/.

On Unix and Unix-like systems, installing libnet is straightforward:

tar zxvf libnet.tar.gz
cd libnet
./configure
make
make install (as root)

    Team LiB
    Previous Section Next Section