Information Warrior 17 will involve Artificial Intelligence (AI) and test the protection of warships and submarines against cyber attacks.
The training will be held during Joint Warrior, a major Nato exercise taking place in and around Scotland from 26 March to 6 April.
This exercise, which is held twice a year, involves thousands of army, navy and air force personnel.
The Royal Navy said Information Warrior 17 would "set the foundations" for cyber warfare in the future "because, as our enemies become more technologically advanced, so must we to combat these threats".
The exercise will involve:
Exercise Joint Warrior is held twice a year - in spring and autumn.
During the second of last year's exercises the Royal Navy staged Unmanned Warrior - its first major training exercise using drones.
It featured more than 50 vehicles, sensors and systems on the surface of the sea, underwater and in the air.
Military ranges and sites in Benbecula, Kyle of Lochalsh and off Applecross were used for Unmanned Warrior.
This spring's Joint Warrior will involve naval units from Denmark, Belgium, Estonia, France, Germany, Netherlands, Norway, Spain, Sweden and the US.
Military air crews will also be flying out of RAF Lossiemouth in Moray and HMS Gannet at Prestwick in Ayrshire.
Live firing exercises are also be conducted a range at Cape Wrath in Sutherland.
The Royal Navy is to hold its first large scale cyber war games.