A shipmate is literally a mate on one's own ship, ie. a member of the same ship.
Typically the term 'shipmate' is used amongst sailors as a generic name for those who are not on a name-to-name basis with each other. Because many ships have hundreds, if not thousands, of crew members aboard; shipmate is a universally acceptable name for all crew members. Within the United States Navy it serves as a convenient and respectful way to address other crew members when rank or naval rating is not immediately obvious. It also serves as a more professional expression in lieu of vernacular words such as 'dude', 'man', and 'bro'.
In the United States Navy, one earns the name of a shipmate when he or she graduates from Recruit Training Command (or 'boot camp'). Prior to graduation from boot camp, only the term 'recruit' is used - a term that is considered for the most part derogatory. Earning the term 'shipmate' is a great honor for all new sailors in the U.S. Navy.
When getting the attention of a fellow sailor, one might simply call out "Shipmate!" or "Hey, shipmate!"
When speaking to a group or crowd of sailors, i.e. "My fellow shipmates..."