Ensign

An ensign is the national flag which is flown on a vessel that indicates citizenry. This ensign is the largest flag and generally flown at the ship rear when in port. This naval ensign is used on warships that differ from that of the civil ensign or yatch ensign.
Naval ensigns of Large versions are used while a warship goes towards a battle. These are known as battle ensigns. This ensign differs from that of the jack that is flown from jackstaff near the bow of the vessel.
Ensign is usually a national flag and is usually referred to the flag that is flown at the stern by the naval vessels or by the merchant vessels. These display the insignia of a particular community, sovereign state, an armed force, an organization, an individual or an office.
It attaches alongside a flag on one edge. Although most countries do not come with a separate ensign of state, however United Kingdom is an exception, with a red, white and blue ensign for civil use, naval use and non-military use respectively.
These are required to be flown while entering and also leaving harbour. It also does so while sailing through the foreign waters and while the ship is signalled to perform so by a warship.