Cyber Security • Networking and Internet Security

Network Diagrams & Data Flows — Interpret basic network diagrams and data flows

Learn to read, construct, and analyze the visual blueprints that reveal how data traverses networks and where vulnerabilities hide.

A protected digital shield with binary code and a secure lock for cyber security
Inside this lesson 10 sections 5 questions 5 figures

SECTION 1

Historical Context & Motivation

Long before the term "cybersecurity" entered the lexicon, engineers needed systematic ways to represent the interconnection of computing devices and the movement of information between them. The earliest computer networks of the 1960s were small enough that an engineer could hold the entire topology in mind, but as the ARPANET expanded and organizations deployed their own local area networks, informal sketches gave way to formalized network diagrams — standardized visual representations of nodes, links, and the protocols binding them together. In parallel, software engineers developed data flow diagrams (DFDs) as a structured analysis technique for understanding how information enters, is processed by, and exits a system. Together, these two diagram families form the visual backbone of network security analysis, enabling practitioners to identify trust boundaries, single points of failure, and potential attack surfaces long before a single packet is sniffed.

1969 • ARPANET Topology Maps

The original ARPANET linked four nodes (UCLA, SRI, UCSB, and Utah). Hand-drawn topology maps documented each IMP (Interface Message Processor) and its host connections — arguably the first network diagrams used for operational planning.

1979 • Structured Analysis & DFDs

Tom DeMarco's "Structured Analysis and System Specification" formalized the data flow diagram notation with processes, data stores, external entities, and data flows. This notation quickly became a standard tool for systems analysts and security reviewers alike.

1993 • Cisco Iconography Standardized

Cisco Systems released its widely adopted set of network topology icons — routers, switches, firewalls, clouds — establishing a de facto visual language still in use across the industry today.

2004 • STRIDE & Threat-Modeling DFDs

Microsoft's threat-modeling methodology leveraged DFDs augmented with trust boundaries as the primary input artifact, cementing DFDs as a first-class security tool rather than just a software engineering exercise.

2020s • Infrastructure-as-Code Diagrams

Modern cloud platforms auto-generate network diagrams from IaC templates (Terraform, CloudFormation). Security teams now analyze programmatically generated topologies for misconfigured security groups, overly permissive routes, and exposed endpoints.

The central question these diagrams address is deceptively simple: What talks to what, over which path, carrying which data, and who can observe or modify that data in transit? Answering this question visually rather than textually enables faster pattern recognition, more effective communication among multidisciplinary teams, and — critically for security — the identification of trust boundary crossings where threats concentrate.

SECTION 2

Core Principles & Definitions

Before diving into specific diagram types, it is essential to internalize several foundational ideas that govern how network professionals and security analysts create and interpret these visual artifacts. A diagram is only as useful as the conventions it obeys; ambiguity in notation leads directly to ambiguity in security analysis.

1

Topology vs. Data Flow

A network topology diagram shows the physical or logical arrangement of devices and links — what is connected to what. A data flow diagram abstracts away physical infrastructure to show how data moves between processes, stores, and external entities. Security analysis requires both perspectives.
2

Nodes & Edges

Every network diagram is fundamentally a graph. Nodes represent devices or processes (routers, servers, clients, firewalls). Edges represent communication links — wired, wireless, or logical tunnels. Directed edges indicate permissible direction of data flow; undirected edges indicate bidirectional communication.
3

Trust Boundaries

A trust boundary is a dashed or colored line separating zones of different privilege or trust levels. Data crossing a trust boundary must be validated, authenticated, or encrypted. These boundaries are the single most important security annotation on any diagram.
4

Abstraction Levels

Diagrams exist at multiple abstraction levels: a context diagram (Level 0) shows the system as a single process with external entities; decomposed levels (Level 1, 2, …) reveal internal processes and data stores. Security reviews typically start at Level 0 and drill down where risk concentrates.
5

Standard Iconography

Industry-standard icons (Cisco, AWS architecture icons, UML component symbols) provide a shared vocabulary. Routers, switches, firewalls, load balancers, databases, and cloud services each have recognizable symbols, preventing misinterpretation across teams.
✦

KEY TAKEAWAY

Think of a network diagram like an architectural blueprint and a data flow diagram like a plumbing schematic for the same building. The blueprint tells you where the rooms and walls are (topology), while the plumbing schematic tells you how water enters, flows through pipes, and exits (data flow). A security analyst is the building inspector who checks both: Are the walls load-bearing where they should be? Does any pipe cross from the sewer line into the drinking water without a backflow preventer? Trust boundaries are those backflow preventers — wherever data crosses one, you must verify it is safe.

SECTION 3

Visual Explanation — Network Topology Diagram

Enterprise Network Topology — Security ZonesUNTRUSTED ZONE (Internet)☁ Internet / ISPDMZ (Semi-Trusted)Web ServerMail ServerDNS ServerTRUSTED ZONE (Internal LAN)WorkstationsApp ServerDatabaseAdmin ConsoleIDS / SIEMFirewall 1Firewall 2Dashed borders = trust boundary zones · Arrows = permitted data flow direction
This enterprise topology diagram illustrates three security zones: the untrusted Internet (red), a DMZ housing publicly accessible servers (amber), and the trusted internal LAN (green). Two firewalls enforce traffic rules at each trust boundary crossing. The IDS/SIEM (violet) monitors the internal zone for anomalous behavior.

The diagram above follows a layered layout convention widely used in security architecture reviews. Traffic originating from the Internet must pass through Firewall 1 before reaching any DMZ service. If a DMZ server needs to query the internal database, that request must traverse Firewall 2 — which enforces a far more restrictive policy (e.g., only TCP 3306 from the web server's IP to the database). Notice that the directed arrows make it immediately clear which direction initiation of connections is allowed; an analyst can spot, at a glance, that the database should never initiate outbound connections to the Internet.

Reading a topology diagram for security purposes involves scanning every edge and asking: Is this connection necessary? Is the data encrypted in transit? Could an attacker who compromises one node use this link to pivot laterally? These questions are far easier to answer visually than by combing through router ACLs or firewall rule tables.

SECTION 4

How Data Flow Diagrams Work

While a network topology diagram answers "what physical or logical connections exist," a data flow diagram (DFD) answers "what data moves where, processed by whom, and stored how." DFDs use a deliberately minimal set of four symbol types, making them straightforward to draw and to analyze for threat modeling. The notation most commonly used in security contexts derives from the Yourdon–DeMarco convention, though the Gane–Sarson variant (rectangles with rounded corners for processes) is also common.

The Four DFD Elements

ElementSymbolDescriptionSecurity Significance
External EntityRectangleA source or sink of data outside the system boundary — users, third-party APIs, partner systems.All input from external entities is untrusted and must be validated at the system boundary.
ProcessCircle (Yourdon) or Rounded Rect (Gane–Sarson)A transformation applied to data — authentication logic, encryption, data parsing, business rules.Each process is a potential point of code vulnerability: injection, logic flaws, buffer overflows.
Data StoreOpen-ended rectangle (two parallel lines)A repository where data is persisted — databases, log files, configuration stores, caches.Data at rest must be encrypted; access must be authenticated and authorized; backups must be secured.
Data FlowLabeled arrowA directed arrow showing data moving between elements, labeled with the data type (e.g., "HTTP request", "SQL query").Each flow crossing a trust boundary is a candidate for encryption, authentication, and input validation checks.

The four canonical DFD elements and their security implications

Decomposition Levels

DFDs are hierarchical. A Level 0 (context) diagram depicts the entire system as a single process, surrounded by external entities and the data flows connecting them. This provides the highest-level view, ideal for executive briefings and initial threat modeling. A Level 1 diagram decomposes that single process into its major sub-processes and internal data stores, revealing how data is routed internally. Further decomposition into Level 2 and beyond is performed selectively, typically only for high-risk sub-processes. The rule of thumb in security analysis is to decompose until every trust boundary crossing is visible and every process handling sensitive data is explicitly represented.

⚠

Trust Boundary Annotation

In security-oriented DFDs, a fifth element is added: a trust boundary drawn as a dashed line enclosing elements that share the same privilege level. Every data flow that crosses this boundary is a potential attack surface and must be documented as such in a threat model. Microsoft's STRIDE framework, for example, systematically analyzes each boundary-crossing flow for Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege threats.

SECTION 5

Detailed Breakdown — Anatomy of a Data Flow Diagram

Level 1 Data Flow Diagram — Web Application LoginUser(External Entity)Admin(External Entity)TRUST BOUNDARY — ServerP1: AuthHandlerP2: SessionManagerP3: AuditLoggerD1: User DBD2: Session StoreD3: Audit Logcredentialsauth resulthash lookupuser IDsession tokenevent datalog entrylog querylog resultsRectangles = External Entities · Circles = Processes · Parallel lines = Data Stores · Arrows = Data Flows
This Level 1 DFD decomposes a web application's login subsystem into three processes: P1 (Auth Handler) validates credentials against the User DB, P2 (Session Manager) creates and stores session tokens, and P3 (Audit Logger) records events. The red dashed line represents the server trust boundary — note that the User and Admin external entities sit outside this boundary, meaning all incoming data flows must be treated as untrusted.

Examining this DFD from a security perspective reveals several critical analysis points. First, the "credentials" flow from User to P1 crosses the trust boundary — this flow must use TLS encryption (HTTPS) to prevent eavesdropping. Second, P1's lookup to D1 (User DB) should use parameterized queries to prevent SQL injection. Third, the session token stored in D2 is a high-value target; if an attacker gains access to the Session Store, they can hijack any active session. Fourth, P3's audit log provides a detective control — but only if the log itself is tamper-resistant and stored with appropriate access controls. Each of these observations emerges naturally from reading the diagram's flows and boundary crossings.

Reading Strategy for DFDs

  1. Enumerate all external entities — these are the entry and exit points of the system and the primary sources of untrusted input.
  2. Trace each data flow — follow every arrow from source to destination. Ask: What type of data does this carry? Is it sensitive (PII, credentials, tokens)?
  3. Identify trust boundary crossings — every arrow that crosses a dashed boundary is a candidate for authentication, authorization, encryption, and input validation.
  4. Examine data stores — for each store, determine what data it holds, who can read from it, who can write to it, and whether the data is encrypted at rest.
  5. Apply threat categories — use a framework like STRIDE to systematically assess each element and flow for relevant threats.

SECTION 6

Worked Example — Threat Identification via DFD Analysis

Consider the Level 1 DFD from Section 5. A security analyst is asked to enumerate threats for the login subsystem using the STRIDE framework. Below is a systematic walkthrough of how to interpret the diagram and produce actionable security findings.

Threat Analysis of the Login DFD

  1. 1

    Step 1 — Identify External Entities & Entry Points

    From the diagram, two external entities interact with the system: User and Admin. The User sends credentials to P1 (Auth Handler) and receives an auth result. The Admin sends log queries to P3 (Audit Logger) and receives log results. These four data flows cross the server trust boundary.
    4 boundary-crossing data flows identified
  2. 2

    Step 2 — Analyze Trust Boundary Crossings for STRIDE Threats

    For the "credentials" flow (User → P1), apply each STRIDE category. Spoofing: An attacker could impersonate a legitimate user with stolen credentials — mitigate with multi-factor authentication. Tampering: Credentials could be modified in transit — mitigate with TLS. Information Disclosure: Credentials could be intercepted — mitigate with TLS. Denial of Service: Brute-force login attempts could overwhelm P1 — mitigate with rate limiting.
    4 threats identified for a single boundary-crossing flow
  3. 3

    Step 3 — Analyze Data Stores

    D1 (User DB) stores password hashes. Threats include: unauthorized access leading to credential theft (Information Disclosure), injection attacks via the hash lookup flow (Tampering), and deletion of user records (Denial of Service). Mitigations include encrypting data at rest, using parameterized queries, applying principle of least privilege for DB account permissions, and maintaining regular backups.
    3 additional threats identified for D1 alone
  4. 4

    Step 4 — Analyze Internal Flows

    The internal flow from P1 to P2 ("user ID") does not cross the trust boundary, so it inherits the trust level of the server zone. However, if P1 and P2 run as separate microservices, an internal trust boundary may exist — the DFD should be updated to reflect this. The flow from P2 to D2 ("session token") stores a high-value artifact; if the session store is in-memory (e.g., Redis without authentication), an attacker with network access to the server segment could steal tokens.
    Potential missing trust boundary identified → DFD revision needed
  5. 5

    Step 5 — Compile Threat Register

    Aggregating all findings, the analyst produces a threat register: 4 threats for the credentials flow, 4 for the auth result flow, 3 for D1, 2 for D2, 2 for D3, and additional threats for each process and remaining flows. The total for this simple three-process DFD typically reaches 15–25 distinct threats, each paired with a mitigation recommendation. This demonstrates why DFD-driven analysis is systematic and auditable — the diagram ensures nothing is overlooked.
    15–25 threats documented with corresponding mitigations

SECTION 7

Strengths, Limitations & Diagram Comparisons

No single diagram type provides a complete security picture. Understanding the strengths and limitations of network topology diagrams versus data flow diagrams — and when to use each — is essential for effective security analysis.

CriterionNetwork Topology DiagramData Flow Diagram
Primary focusPhysical or logical device interconnections, IP addressing, network segmentsData movement between processes, stores, and external entities
Best forInfrastructure review, firewall rule validation, network segmentation analysisApplication-layer threat modeling, privacy impact assessments, compliance reviews
Shows trust boundariesImplicitly via VLANs, subnets, and firewall placementExplicitly via dashed boundary lines — a first-class element
Abstraction levelTypically a single flat view; may use layered diagrams (L1/L2/L3)Hierarchical decomposition (Level 0 → Level 1 → Level 2 …)
LimitationDoes not show application-level data semantics (what data is carried, how it is transformed)Does not show physical device details, IP addresses, or link media types
Staleness riskHigh — infrastructure changes rapidly; auto-discovery tools helpModerate — changes with application redesigns, but data semantics evolve more slowly

Network topology vs. data flow diagrams for security analysis

✦

KEY TAKEAWAY

Topology diagrams and DFDs are complementary, not competing. In a thorough security assessment, the topology diagram reveals network-layer attack surfaces (misconfigured firewalls, exposed management ports, lack of segmentation), while the DFD reveals application-layer attack surfaces (injection points, unencrypted data flows, overprivileged data stores). Think of them as two orthogonal cross-sections through the same system: one cuts along the infrastructure axis, the other along the data axis. A robust security review uses both.

SECTION 8

Connection to Advanced Theory — Threat Modeling & Zero Trust

The network diagrams and DFDs covered in this lesson form the input artifacts for more sophisticated security methodologies. Understanding these diagrams is a prerequisite for advanced frameworks used in industry and research.

Concept in This LessonAdvanced Extension
Trust boundaries on DFDsSTRIDE threat modeling — systematically applies six threat categories to each DFD element and boundary crossing
Firewall placement in topology diagramsZero Trust Architecture (ZTA) — eliminates implicit trust zones; every flow requires authentication regardless of network location
DFD decomposition levelsAttack trees & attack graphs — formal graph models that enumerate all paths an attacker can take to reach an asset, often derived from DFD analysis
Network segmentation zonesSoftware-defined networking (SDN) / microsegmentation — programmatic, fine-grained network control that dynamically enforces segmentation policies
Manual diagram creationAutomated topology discovery — tools like Nmap, cloud provider APIs, and network management platforms automatically generate and continuously update network diagrams

From foundational diagrams to advanced security frameworks

The shift toward Zero Trust Architecture is particularly noteworthy because it fundamentally challenges the perimeter-based trust model depicted in traditional three-zone topology diagrams. In a zero-trust paradigm, every data flow — whether it crosses a traditional trust boundary or not — is treated as potentially hostile. This means the DFD becomes even more critical, since the analyst must annotate every flow with its authentication mechanism, encryption status, and authorization policy, not just those at the perimeter. Future coursework in this area will build directly on the diagramming skills developed in this lesson.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain the difference between a network topology diagram and a data flow diagram. In what specific scenario would a security analyst prefer a DFD over a topology diagram, and why?
Show answer
A network topology diagram depicts the physical or logical arrangement of devices and links (routers, switches, firewalls, subnets), while a data flow diagram shows how data moves between processes, data stores, and external entities, abstracting away infrastructure details. A security analyst would prefer a DFD when conducting application-layer threat modeling — for example, assessing a web application for injection vulnerabilities, insecure data storage, or missing input validation. In this scenario, the DFD explicitly shows what data enters each process and where it is stored, making it straightforward to apply frameworks like STRIDE to each element. A topology diagram would show that the web server connects to a database server, but not what specific data flows between them or how that data is transformed.

Question 2: BASIC APPLICATION

Given a simple network with: (1) an external user on the Internet, (2) a firewall, (3) a web server in a DMZ, (4) an internal database server, and (5) a second firewall between the DMZ and internal LAN — list all the trust boundaries and identify each data flow that crosses a trust boundary.
Show answer
There are two trust boundaries in this network. Trust Boundary 1 is between the Internet (untrusted zone) and the DMZ (semi-trusted zone), enforced by the first firewall. Trust Boundary 2 is between the DMZ and the internal LAN (trusted zone), enforced by the second firewall. The data flows crossing Trust Boundary 1 are: (a) HTTP/HTTPS requests from the external user to the web server, and (b) HTTP/HTTPS responses from the web server back to the user. The data flows crossing Trust Boundary 2 are: (c) database queries from the web server to the database server (e.g., SQL over TCP 3306), and (d) query results from the database server back to the web server. Each of these four flows requires appropriate security controls — TLS for (a) and (b), parameterized queries and encrypted connections for (c) and (d), and strict firewall rules limiting allowed ports and source IPs at each boundary.

Question 3: INTERMEDIATE

An organization's Level 1 DFD shows a process labeled "P2: Payment Processor" that receives credit card numbers from an external entity (Customer), queries a data store (D1: Transaction Log), and sends an authorization request to another external entity (Payment Gateway). The trust boundary encloses P2 and D1 but excludes both external entities. Identify at least four distinct threats using the STRIDE model, specifying which DFD element or flow each threat applies to.
Show answer
Four STRIDE threats for this DFD include: (1) Spoofing on the Customer → P2 flow: an attacker could impersonate a legitimate customer by submitting stolen credit card numbers, mitigated by strong authentication (e.g., 3-D Secure). (2) Tampering on the P2 → Payment Gateway flow: if this flow is not encrypted (TLS), an attacker performing a man-in-the-middle attack could alter the authorization amount, mitigated by using TLS and message signing. (3) Information Disclosure on D1 (Transaction Log): if credit card numbers are stored in plaintext, a database breach exposes cardholder data, violating PCI-DSS requirements — mitigate by tokenizing or encrypting card numbers at rest. (4) Repudiation on P2: without adequate logging, a customer could deny making a transaction; P2 should log all transactions with timestamps and customer identifiers in a tamper-evident log. An additional threat could be Denial of Service on the Customer → P2 flow via high-volume fraudulent transaction attempts, mitigated by rate limiting and CAPTCHA mechanisms.

Question 4: APPLIED

You are a security consultant reviewing a startup's cloud architecture. They provide you with a network topology diagram showing: a single VPC with no subnets, all services (web app, API, database, admin panel) running as containers on the same host, exposed to the Internet via a single public IP with no WAF or firewall rules beyond the default "allow all outbound." Describe at least three specific security issues you would identify from this diagram and propose corresponding architectural changes, sketching how the revised topology would look.
Show answer
Three critical issues are apparent from this topology: (1) No network segmentation — all services share a single flat network with no subnets or security groups, meaning a compromise of any container (e.g., the public web app) gives the attacker direct network access to the database and admin panel. The fix is to create separate subnets (public subnet for the web app behind a load balancer, private subnet for the API and database, management subnet for the admin panel) with security groups restricting traffic between them. (2) No web application firewall (WAF) — the web app is directly exposed, making it vulnerable to OWASP Top 10 attacks. The revised topology should place a WAF (e.g., AWS WAF, Cloudflare) in front of the load balancer. (3) Unrestricted outbound traffic — the default 'allow all outbound' policy means a compromised container can exfiltrate data or communicate with a command-and-control server without restriction. The revised topology should enforce egress filtering, allowing only specific outbound ports (443 to known API endpoints, 53 for DNS) and logging all other outbound connection attempts. The revised diagram would show three subnets within the VPC, security groups as logical firewalls between them, a WAF/load balancer in the public subnet, and a NAT gateway for controlled outbound traffic from private subnets.

Question 5: CRITICAL THINKING

A colleague argues that in a Zero Trust Architecture, traditional network topology diagrams with perimeter-based trust zones are obsolete and that only DFDs with per-flow authentication annotations matter. Critically evaluate this claim. Are there aspects of security analysis for which topology diagrams remain indispensable even in a zero-trust environment? Under what conditions might the two diagram types need to be unified into a single representation?
Show answer
The colleague's claim captures an important insight — Zero Trust Architecture (ZTA) does indeed render the traditional notion of "trusted" and "untrusted" network zones less meaningful, since every flow requires explicit verification regardless of origin. In this sense, DFDs with per-flow authentication and encryption annotations become the primary artifact for verifying that ZTA policies are correctly applied. However, topology diagrams remain indispensable for several reasons. First, physical and logical topology still determines latency, bandwidth, and failure domains — all of which affect availability, a core security property. Second, even in ZTA, network-layer controls like microsegmentation, DDoS mitigation, and traffic rate limiting are configured at the infrastructure level and require topology awareness. Third, compliance frameworks (PCI-DSS, HIPAA) often mandate network segmentation as a control, requiring topology documentation regardless of ZTA adoption. Fourth, incident response and forensic analysis require understanding the physical path a packet traversed, which only topology diagrams provide. The two representations might be unified in environments using Infrastructure-as-Code and software-defined networking, where a single declarative specification (e.g., a Terraform configuration) simultaneously defines both the network topology and the per-flow security policies. In such cases, auto-generated diagrams could overlay DFD semantics (data types, authentication mechanisms) onto topology views (subnets, security groups, routes), creating a hybrid representation that satisfies both network engineers and application security analysts.

SUMMARY

Lesson Summary

Summary

This lesson introduced two foundational visual tools for security analysis. Network topology diagrams depict the physical and logical arrangement of devices, links, and security zones — organizing infrastructure into untrusted, DMZ, and trusted zones separated by firewalls. Data flow diagrams (DFDs) abstract away infrastructure to show how data moves between external entities, processes, and data stores, using hierarchical decomposition from Level 0 (context) through Level 1 and beyond. The most critical element in security-oriented diagrams is the trust boundary — every data flow crossing a trust boundary represents a potential attack surface requiring authentication, encryption, and input validation.

Together, these diagram types enable systematic threat modeling using frameworks like STRIDE, where each DFD element and boundary crossing is analyzed for spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege threats. Looking forward, these skills connect directly to Zero Trust Architecture, attack graph analysis, and automated topology discovery — advanced topics that all build upon the ability to read, construct, and critically interpret network diagrams and data flows.

Varsity Tutors • Cyber Security • Network Diagrams & Data Flows