This is what is known as a "Triple Hornpipe," or an "Old Hornpipe," very common in the 18th century, but probably extant since Elizabethan times. It was first published in 1713 in Daniel Wright's Extraordinary Collection of Pleasant and Merry Humours.