Skip to main content
IoT
PSUT Engineering StudioPrincess Sumaya University for Technology
Student Edition
Cyber Defense StudioIoT Security and PrivacyExperimentsWorkspaces
IoT Security and Privacy / NS01
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
ESSENTIAL LABORATORY · NS01 · IoT SECURITY AND PRIVACY
IoT Security and Privacy

tcpdump — packet capture and protocol filtering

Capture controlled local traffic and interpret headers, flags and packet counts.

Design experiment & verify evidence →
NS01 · Laboratory mentorAsk about the current experiment, its algorithms or Python notebook.
Ask Dr. MohammadAdaptive practice

Related course access: Networking and Communication — same laboratory, notebook and completion record.

NS01 · Academic orientation

Scope and objectives

Scope of the experiment

Capture controlled local traffic and interpret headers, flags and packet counts.

The focus of this experiment is to interpret local packet capture fields and protocol filters. Students then compare matching and excluded packets from the authorized fixture, and verify filter behavior without collecting unrelated traffic. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.

Learning objectives

  • Interpret local packet capture fields and protocol filters.
  • Compare matching and excluded packets from the authorized fixture.
  • Verify filter behavior without collecting unrelated traffic.
  • Record the relevant inputs, intermediate states and final verification result before changing the reference configuration.
  • Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.

Expected learning outcomes

On completion, students can interpret local packet capture fields and protocol filters, compare matching and excluded packets from the authorized fixture, and verify filter behavior without collecting unrelated traffic.

Required deliverables

Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing verify filter behavior without collecting unrelated traffic. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the foundational terminology in Concepts and confirm readiness using the existing setup instructions. After completion, continue to Nmap — authorized local service inventory.

Environment and experimental methodology

The specified isolated laboratory environment, with local synthetic inputs and authorized services only. Use the experiment-specific setup and verification instructions.

Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.

Scientific concepts and engineering principles

Scientific architecture · NS01 · tcpdump — packet capture and protocol filtering

Local packet capture — Local HTTP client; Loopback server; tcpdump capture; TCP SYN / 0>1; SYN-ACK / 1>0; HTTP request / 0>1; Filter matching packet / 1>2; Save PCAP / 2>2
Scientific concept map: Local client — Generate HTTP traffic; Loopback interface — lo; Capture filter — BPF predicate; Packet record — Flags and length; PCAP — Offline inspection.

Scientific foundations and analytical reasoning

Packet capture observes traffic matching a chosen interface and filter; TCP flags describe connection state, not application success.

Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.

Scientific theory · Capture boundaries and packet interpretation

Packet capture observes packets visible on the selected interface during the capture window. A capture filter selects frames before recording; display filters can further select stored packets. TCP flags describe connection establishment and termination; UDP and ICMP have different semantics. Capture loss and encryption limit conclusions.

Worked example and engineering interpretation

For the controlled loopback HTTP server, record the selected interface and port filter, then identify the TCP SYN, SYN-ACK and ACK. If no packets match, verify that traffic actually occurred during the capture. A TCP handshake does not establish HTTP success.

Engineering principles · additional worked teaching example

Packet capture observes traffic on selected interface/filter. A capture filter limits recorded packets; a display filter selects after capture. If a local test emits five packets but capture starts after two, at most three matching packets appear.

From theory to experiment

Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.

How to investigate tcpdump — packet capture and protocol filtering

Capture controlled local traffic and interpret headers, flags and packet counts.

Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.

Experiment-specific guided practice

Objective: Capture controlled local traffic and interpret headers, flags and packet counts.

  1. Capture and filtering — complete its numbered steps and record the requested evidence.
  2. Header and payload evidence — complete its numbered steps and record the requested evidence.
  3. Compare observations with the reference checks and submit the required evidence.
  4. Start a local HTTP server bound to 127.0.0.1:8080 using the command. Open a second terminal, list capture interfaces and select loopback.

Reference check: TCP, UDP and ICMP appear. Only matching events captured. Observe actual TCP flags and captured packets; exact count may vary. Only matching TCP traffic displayed.

Model boundary: tcpdump is a packet capture tool. BPF capture filters select which packets reach the capture output. A loopback interface observes local traffic, not remote physical Ethernet. Captured packet count is not application message count; segmentation and offloading can alter observations. Restrict all captures to your own isolated lab traffic.

Independent task and submission evidence

2. Header and payload evidence — complete its numbered steps and record the requested evidence. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.

Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.

TrialChanged settingFixed settingsPredicted resultActual observation / unitsEvidence / uncertainty
A: baselineReferenceRecordPredictRecordRecord
B: one changeRecordSame as APredictRecordRecord
A: repeatRestoreSame as APredictRecordRecord

Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.

Packet observation

A capture interface provides packet observations to tcpdump. Capture filters select traffic before it is recorded. A PCAP file retains the captured headers and payload bytes within the configured snap length; a printed line is a summary rather than a complete packet.

TCP, UDP and ICMP

TCP establishes a connection using SYN, SYN-ACK and ACK; its segments contain ports, sequence numbers and flags. UDP is connectionless and uses ports; ICMP carries network-control messages. Numeric output avoids name-resolution ambiguity.

Controlled measurement

Generate your own localhost traffic. Compare a matching capture filter with one that excludes the service. Packet absence may be caused by the interface, filter, capture timing or drops, so it does not establish that no traffic existed.

Prerequisites: Basic TCP/IP and WSL Setup

NS01 engineering diagram
Algorithm structure and data flow. Use the simulation to inspect the corresponding numerical transformations.

Worked engineering reasoning and boundary conditions

Packet capture is passive observation on an authorized local interface. A capture filter limits collected frames; a decoded packet's length and payload visibility depend on protocol and snap length. TLS payload encryption does not conceal all metadata.

Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.

Concept animation · operation pathway

Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.

tcpdump — packet capture and protocol filtering: operation pathwayAuthorizedinterfaceloopback fixtureCapture100 original bytesSnap length64 bytes storedInterpret36 omitted,original length mayremainRead the active operation, then inspect the accumulated state.

Step 1 of 4 · Authorized interface

Authorized interface

Authorized interface
loopback fixture

Teaching example only; inspect live calculations or real practical evidence separately.

Interactive flashcards

Self-rated study progress is stored locally, not used for official grades.

Browse all explanations
What does tcpdump capture?

Packets visible on the selected interface matching its filter.

Why use -nn?

Avoid name and service resolution.

What does a PCAP retain?

Captured packet records for offline analysis.

What can TLS conceal?

Application payload, not all traffic metadata.

What does -i lo select?

The Linux loopback interface.

What does -nn suppress?

Host and service-name resolution.

What does -w do?

Writes captured packets to a file.

What does -r do?

Reads a saved capture file.

What is BPF used for?

Selecting packets matching an expression.

Why start a local HTTP server?

To generate known authorized traffic for the experiment.

What does a SYN flag indicate?

An attempt to synchronize TCP sequence numbers.

What completes a normal TCP handshake?

SYN, SYN-ACK, ACK.

Why might an excluded filter produce zero packets?

It discards events outside the selected conditions.

Why avoid capturing real credentials?

Captures can contain sensitive application data.

A capture filter excludes port 8080. Will the HTTP packets necessarily appear in the PCAP?

No. A capture filter discards nonmatching packets before writing them.

A local HTTP request is absent from an Ethernet capture. What should be checked?

Check whether traffic uses loopback, the interface choice, filter, timing and capture drops.

Why use -nn in a packet summary?

To show numeric addresses and port numbers rather than resolve names, avoiding ambiguous labels.

Shared research workbenches · network designer & advanced studies
Concurrent-device simulation & Monte Carlo research
Distributed digital twin · topology, protocol & battery research