The creation of a national internet infrastructure is not in itself nefarious. “Part of what motivates a country to create a national internet is [the desire] to help keep internet traffic inside the country, which in many ways is what a healthy internet infrastructure should do,” says Collin Anderson, a Washington-based cybersecurity researcher who has published analysis on Iran. “The problem in Iran is that the catalyst for developing a national internet has not been social or economic development, but rather the government’s desire to retain access to its citizens’ data instead of having that data stored outside of the country.”

The Islamic Republic has responded to these threats in various ways. As the report documents, the government’s effort to tame the internet has been centered on the creation of a government-controlled system known as the National Information Network. This system, the first phases of which launched in 2014, gives Iranian internet users preferential access to domestic websites and search engines. In practice, the NIN serves as something of a “walled internet,” in which content can be regulated and users can be monitored by state security agencies. The NIN also allows access to the “real,” or global, internet, but in a way that allows authorities to filter information, manipulate connection quality, and even cut off access when deemed appropriate.

As in much of the developing world, internet use in Iran has grown exponentially over the past decade. According to figures from the United Nations, at least 53 percent of Iran’s population of 80 million people used the internet as of last year, including 40 million mobile phone users. This increasing public access to the web is partly the fruit of government investments in telecommunications infrastructure. But Iranians’ growing ability to share information and organize online also pose obvious threats to the authoritarian ruling government.

The shutdown of Telegram and the brief closure of the internet as a whole are signs of the Islamic Republic’s increasing technical capacity to manage its citizens’ access to the global web. A new report by the Center for Human Rights in Iran, “ Guards at the Gate: The Expanding State Control Over the Internet in Iran ,” paints a grim picture of the Islamic Republic’s growing ability to control and stymie the flow of information online.

Late last month , as nationwide street protests entered their fourth day, Iran’s interior minister, Abdolreza Rahmani Fazli, issued a statement darkly warning that online social networks in the country were being used to create “violence and fear.” A day earlier, the internet as a whole had briefly flickered offline throughout Iran in what was widely interpreted as a government-engineered throttling. Following Fazli’s statement, the government blocked access to the photo-sharing site Instagram, as well as Telegram, a secure messaging app used by 40 million Iranians per month that had begun to emerge as a key organizing tool for protesters.

“The problem in Iran is that the catalyst for developing a national internet has not been social or economic development, but rather the government’s desire to retain access to its citizens’ data.”

The government has tried a number of ways to get people to use services offered on the NIN rather than the global internet. As a result of tiered pricing plans set up by state infrastructure companies, the NIN today is the much cheaper option for Iranians to go online. The government also tilts the scales in favor of the NIN by slowing down connection speeds for the global internet, a violation of net neutrality principles that can also be used during periods of crisis to make the global internet effectively useless for activists and journalists.

Thanks to its growing technical capacity, the government can even block the global internet entirely while letting the NIN continue to operate, a power it briefly demonstrated during the recent protests.

Heavy-handed suspensions of internet access may be effective in the short-term, but they put President Hassan Rouhani’s government in an awkward position. Since coming to power, Rouhani has positioned himself at times as a vocal advocate for online freedom. “We cannot close the gates of the world to our younger generation,” the president said in a televised address in 2014. But Rouhani’s embrace of a more open internet has conflicted with hard-liners in the regime, who continue to push for stricter controls. Despite his hopeful rhetoric, information filtering, hacking, and online surveillance against Iranians have all continued under his administration, while key telecommunications infrastructure remains under the control of state security organizations.

“The government really managed to curb dissent when it shut down Telegram. It was the main platform for organizing protests, and we have seen them slowly die down in the days since it was shut off,” said Hadi Ghaemi, executive director of the Center for Human Rights in Iran. “There were plans for major demonstrations last Thursday and Friday that did not really materialize since people were unable to connect with each other.”

As the pace of demonstrations has slowed in recent days, the government has removed its block on Telegram. Iranian officials had previously warned the company that the app would not go back online in Iran until “terrorist content” had been taken down. At the height of the protests, some Telegram channels in Iran were actually suspended by the company itself for encouraging acts of violence. It’s unclear how the government plans to monitor or control local usage of the app going forward.

Meanwhile, the Iranian government is looking to the Chinese model of online control for inspiration, says Ghaemi. While China’s citizens can access certain approved messaging applications and news sources, the government censors websites deemed politically or socially subversive and surveils internet users extensively.

As bad as online freedom is in China, though, the challenges facing Iranians today might be even worse. In addition to facing relatively straightforward restrictions to online access, according to the report, Iranians must also navigate government-created “fake news” planted on domestic search engines, as well as phishing, malware, and denial-of-service attacks. The government has also attempted to place restrictions on virtual private networks, or VPNs, that can help Iranians circumvent state censorship. These restrictions are particularly acute for Iranian researchers and academics, who are often unable to access online information because the government has either blocked it or deliberately slowed it down.

The report calls on the Rouhani government to remove such restrictions while asking the Iranian parliament to pass legislation preserving principles of internet freedom. Although the government’s ability to challenge the will of hard-liners in the security apparatus may be constrained, Iranian internet freedom activists hope that, as European companies begin to return to Iran, European Union officials will exert pressure for a less draconian information environment in the country.

“Due to the restrictions on using the internet locally, Iran-based offices of European companies are going to have a very hard time operating as they would in any other country,” Ghaemi says. “EU companies that have trade and business ties with Iran can do a lot by insisting on a different online infrastructure in the country that is freer and more open.”