Tonkin

Tonkin, also spelled "Tongkin", "Tonquin" or "Tongking", is an exonym referring to the northern region of Vietnam. During the 17th and 18th centuries, this term referred to the domain Đàng Ngoài under Trịnh lords' control, including both the Northern and Thanh-Nghệ regions, north of the Gianh River. From 1884 to early 1945, this term was used for the French protectorate of Tonkin, composed of only the Northern region.
Names.
"Tonkin" is a spelling of 東京 "Đông Kinh", meaning 'Eastern Capital'. This was the name of the capital of the Lê dynasty (present-day Hanoi). Locally, Tonkin is nowadays known as "miền Bắc", or "Bắc Bộ" (北部), meaning 'Northern Region'.
The name was used from 1883 to 1945 for the French protectorate of Tonkin (Vietnamese: "Bắc Kỳ" 北圻), a constituent territory of French Indochina.
Geography.
It is south of Yunnan (Vân Nam) and Guangxi (Quảng Tây) Provinces of China; east of northern Laos and west of the Gulf of Tonkin.
Having the fertile delta area of the Red River, Tonkin is rich in rice production.
History.
The area was called Văn Lang from around 2000−200 BCE. Evidence of the earliest established society in northern Vietnam, along with the Đông Sơn culture, was discovered in the Cổ Loa Citadel area, located near present-day Hanoi, the capital city of Vietnam.
According to Vietnamese myths the first Vietnamese peoples descended from the Dragon Lord Lạc Long Quân and the Immortal Fairy Âu Cơ. Lạc Long Quân and Âu Cơ had 100 sons before they decided to part ways. 50 of the children went with their mother to the mountains, and the other 50 went with their father to the sea. The eldest son became the first in a line of earliest Vietnamese kings, collectively known as the Hùng kings of the Hồng Bàng dynasty. The country was called Văn Lang and its people were referred to as the Lạc Việt.
By the 3rd century BC, another Viet group, the Âu Việt, emigrated to the Red River delta and mixed with the indigenous population. A new kingdom, Âu Lạc, emerged as the union of the Âu Việt and the Lạc Việt, with Thục Phán proclaiming himself An Dương Vương.
Âu Lạc was annexed into Nam Việt kingdom of Triệu Đà. After the Triệu dynasty, this region started to be officially under Chinese rule. In pre-Tang times Tonkin was the port of call for ships on the South China Sea, though the center of commerce later moved north to Guangdong.
The victory of Ngô Quyền at the Battle of Bạch Đằng in 938 ushered a new era of independence of Vietnam. The Ngô dynasty was followed by the Đinh, Early Lê, Lý, Trần, and Hồ. 
15th and 16th centuries.
Lê Lợi (reigned 1428–1433), a notable land owner in the Lam Sơn region, had a following of more than 1,000 people before rising up against the Chinese Ming dynasty. Following his victory he mounted the throne and established himself in the city of Thăng Long ('Ascending Dragon'), present Hà Nội. Thăng Long was also called "Đông Kinh" 東京, meaning 'Eastern Capital' (東京 is identical in meaning and written form in Chinese characters to that of Tokyo).
17th and 18th centuries.
During the 17th and 18th centuries, Westerners commonly used the name Tonkin (from "Đông Kinh") to refer to "Đàng Ngoài" in the North, ruled by the Trịnh lords. "Đàng Ngoài", or "Bắc Hà", included not only the delta of the Red River, but also the deltas of the Mã River and Cả River. Meanwhile, Cochinchina or Quinan was used to refer to "Đàng Trong" in the South, ruled by the Nguyễn lords; and Annam, from the name of the former Chinese province, was used to refer to Vietnam as a whole.
19th and 20th centuries.
After French assistance to Nguyễn Ánh to unify Vietnam under the Nguyễn dynasty, the French Navy began its heavy presence in Lower Cochinchina, including Saigon, and later colonized the whole of this southern third of Vietnam in 1867.
During the Sino-French War (1884–1885), Tonkin, then considered a crucial foothold in Southeast Asia and a key to the Chinese market, was invaded by the French in the Tonkin Campaign. It was colonized as the French protectorate of Tonkin, and was gradually separated from the French protectorate of Annam, with Vietnam being effectively separated into three parts.
During French colonial rule within French Indochina, Hanoi was the capital of Tonkin protectorate, and in 1901 became the capital of all French Indochina (Cambodia, Laos, & Vietnam). French colonial administration ruled until 9 March 1945, with 1941-1945 during the World War II Japanese occupation of Vietnam. French administration was allowed by the Japanese as a puppet government. Japan briefly took full control of Vietnam in March 1945, as the Empire of Vietnam. Tonkin became a site of the Vietnamese famine of 1945 during this period.
After the end of World War II, French rule returned over French Indochina. The Northern part of Vietnam became a stronghold for the communist Viet Minh. Hanoi was later reoccupied by the French and conflict between the Viet Minh and France broke out into the First Indochina War. In 1949 it came under the authority of the State of Vietnam, a new associated state of the French Union.
After the French defeat at the Battle of Dien Bien Phu in western Tonkin in 1954, the communist nation of North Vietnam was formed, consisting of Tonkin and northern Annam. The State of Vietnam's territory was reduced to the southern half of the country, becoming South Vietnam.