People at Mitre Corp. do most of their worrying about nuclear war during the day, at their desks and computer terminals.

They worry, in the event of an attack, whether U.S. radar will spot it in time, whether the message will be relayed to military commanders and ultimately to the president, and whether our missiles can be launched in retaliation, even if bombs have already fallen here.

For its worrying and its proposed solutions, Mitre has been rewarded with a steadily increasing flow of defense dollars. The company has seen its sales double in the past five years (1984 sales: $287 million) and its work force reach 5,000 people. In this suburb of Boston, where 3,000 of its employes are, Mitre has outgrown its buildings and has had to lease several others.

Mitre's success is part of a broad shift in defense spending toward high tech and electronics, the brains rather than the brawn of weaponry. It is also part of distinctly Massachusetts phenomenon: the rise of the nonprofit defense establishment.

Five nonprofit institutions in the country last year received more than $225 million in Pentagon business. Three of the five were in Massachusetts. They were Massachusetts Institute of Technology and two MIT spinoffs, Charles Stark Draper Labs of Cambridge and Mitre.

Mitre broke away from MIT's Lincoln Laboratories in 1958 to develop the country's first modern air defense system. Lincoln did the pioneering work on the system, but MIT thought it was inapproriate for the school to be involved in putting the system into place.

Mitre's speciality is C3I -- or c-cubed, I -- an arcane but increasingly important part of the defense picture. The three Cs stand for command, control and communication, the I for intelligence. The whole network is frequently referred to as the brains or the nervous system of weaponry.

It consists of command centers on the ground and in planes, the radar and satellites that scan the battlefield and the communications equipment that ties them together. The network serves both conventional and nuclear forces, but it is the latter that is seeing the greatest buildup.

In October 1981, President Reagan made improving command and control one of his top five defense priorities. "The system must be foolproof in case of any foreign attack," Reagan declared. Since then, the budget for command and control has increased dramatically. For fiscal 1986, the administration has asked for $22 billion, almost triple the amount spent in 1980.

The money is being widely distributed among the country's top defense contractors, GTE Corp.'s operation in Westborough, Mass., has already received $500 million to develop the command system for the MX missile. Raytheon Co. of Lincoln is competing to build part of MILSTAR, a large new communications satellite.

Wolfgang Demisch, a defense analyst with First Boston Corp., explains the buildup in simple terms: "If we do have a nuclear attack, it would be nice to get the word out," he said.

There is some doubt, at the moment, whether the word really would get out. Over the last 15 years, there have been a number of well-publicized breakdowns in the communications system -- blips on the radar screen that turned out to be geese, not missiles, or the wrong tapes put into the computer.

Recently, Dan Ford, a writer for the New Yorker Magazine, visited the headquarters of NORAD, the North American Aerospace Defense Command, which is buried deep in a mountain in Colorado. While there, Ford asked a general to demonstrate one of the telephone linkups to the Pentagon that would be used during an attack.

The general tried the phone several times but got no response. Later, he admitted to Ford, "I didn't know that I had to dial 'O' to get the operator."

Jack Ruina, an MIT professor and a long-time member of Mitre's board of directors, thinks such horror stories have been blown out of proportion. Still, he agrees that command and control must be improved. "The system has been shortchanged in the past," said Ruina.

Some Pentagon critics say the command buildup is an example of budgetary overkill. Retired Admiral Eugene Carroll of Washington's Center for Defense Information says the United States will not get much of a return on its investment in command and control.

"It is unrealistic to assume all this equipment will work under war conditions," Carroll said.