A link layer security protocol and simulation written in Java