Antisubmarine nets were used during World War 2 to protect ports. The nets were suspended off these hollow iron floats, which laid redundant in stock piles after the war.
The purpose of the antisubmarine net was to block submarine attacks, or, if a submarine did break through, to reveal its presence to patrol craft. A harbor entrance net had one detachable panel, called a gate, which was swung open by a gate vessel to allow passage of friendly ships.
Learn more on the different types of nets used here