A link layer protocol for quantum networks