Seven layers of OSI
In 1977 a model called Open Systems Interconnection (OSI) was proposed, with the aim to establish an interoperability standard for different vendor products. This model defines several layers related to data transfer, from the lowest (physical) to the highest (application) layer. They have a strong dependence upon one another and headers are usually added when traversing from a lower layer to a higher one.
The seven layers are:
Layer 1 - Physical layer: handles the communication (and control) across the network channel.
Layer 2 - Data Link layer: establishes methods for delivering data blocks.
Layer 3 - Network layer: responsible for routing of data packets.
Layer 4 - Transport layer: responsible for reliable transmission of data
(without errors).
Layer 5 - Session layer: allows control of dialogue between applications.
Layer 6 - Presentation layer: helps to establish a data format amongst application, making presentation ordered.
Layer 7 - Application layer: establishes methods allowing the applications to access the OSI model (the network).
The Yersinia tool
In order to perform described Data Link layer attacks, we'll be using a tool called
Yersinia, written by the authors of this article. Yersinia is portable - written in C
(using libpcap and libnet), multithreaded (supports multiple users and multiple concurrent attacks). It can be used to analyse, edit and watch network packets and even save the traffic in pcap format.
Latest Yersinia version (0.5.5.2) supports the following protocols:
Spanning Tree Protocol (STP),
Cisco Discovery Protocol (CDP),
Dynamic Trunking Protocol (DTP),
Dynamic Host Configuration Protocol (DHCP),
Hot Standby Router Protocol (HSRP),
IEEE 802.1Q,
Inter-Switch Link Protocol (ISL),
VLAN Trunking Protocol (VTP).
Yersinia operates in one of three main modes:
command line: can be used for performing ad-hoc attacks - this mode was implemented to help