Most engineers think…
Most people assume the SRX runs every packet through a full policy lookup and NAT evaluation. That model leads you wrong in every troubleshooting scenario.
The SRX flow engine has two distinct paths. The first path is the expensive one: only the session-opening packet gets zone checks, route lookup, policy match, NAT evaluation and ALG processing. Once a session entry exists, every subsequent packet uses the fast path and skips all of that. Understanding this split tells you exactly where to look — session table for established flows, traceoptions for the first packet that gets dropped before a session is ever created.
① First path vs fast path — how the SRX decides how hard to work
When a packet arrives on an SRX, the flow daemon checks the session table by matching the 5-tuple. If no entry exists, the packet is on the first path — the SRX performs zone resolution, route lookup, security policy match, NAT rule evaluation, ALG detection and screen checks, then creates a session entry with the result. All subsequent packets in the same connection hit the fast path: the session entry is found, headers are rewritten per the stored NAT info, and the packet is forwarded — no policy re-evaluation.
Why does this matter for troubleshooting? A policy deny, a NAT mismatch, or a screen hit only shows up on the first path. If traffic worked yesterday and fails today, check whether the session was torn down (timeout, RST, asymmetric routing) and a new first-path attempt is now being blocked. Conversely, a session stuck in the table long after traffic stopped means a timeout is not firing — look at the timeout counter in the session output.
Which SRX processing path performs the full security policy lookup, NAT evaluation and screen checks?
② Reading the session table — show security flow session
The primary diagnostic command is show security flow session. Each session entry shows the session ID, the matched security policy by name, the ingress and egress interfaces, source and destination with ports, protocol, NAT translations, bytes and packets in each direction, and the remaining timeout in seconds.
Useful filters
Add filters to avoid thousands of lines of output: show security flow session destination-prefix 10.1.1.1/32 to narrow to a specific host; show security flow session protocol tcp destination-port 443 for HTTPS flows. The show security flow session summary gives total active sessions versus the platform maximum — a near-full session table is a silent killer that drops new first-path connections without any explicit policy deny log.
The primary session table command. Shows session ID, matched policy name, interfaces, 5-tuple, NAT translations, bytes/packets, and remaining timeout. Add destination-prefix or protocol filters to narrow output.
Reveals policy utility: zero hits = shadowed or dead rule; huge hits = possibly too broad. Reset counters with clear security policies statistics after tuning to start a fresh baseline.
X-rays the first-path journey. Always set a packet filter (source + destination IP) before enabling. Read with show log. Disable and commit immediately after — traceoptions can degrade SPU performance at scale.
After the session entry is created by the first path, all subsequent packets in the same flow skip policy lookup, NAT evaluation and most checks — they just rewrite headers per the stored entry and forward. The fast path is why the SRX scales.
Always run show security flow session summary first. If active sessions are near the platform maximum, new first-path connections are being silently dropped — no policy deny log, no traceoptions output. Fix the table exhaustion before any other troubleshooting step.
▶ Watch a TCP SYN get permitted and a session created
A first-path packet traversing the SRX flow engine end-to-end. Press Play for the healthy path, then Break it to see the classic silent drop.
You want to check active sessions for destination IP 192.168.10.5 only. Which command is best?
③ Traceoptions — pinpoint exactly where a packet is dropped
When a session never appears in the table — meaning the first-path packet was dropped before a session could be created — security-flow traceoptions is your X-ray. Configure it under set security flow traceoptions file <name> with a flag (basic-datapath is the go-to) and critically a packet filter to limit tracing to a specific source and destination IP pair. Without the packet filter, traceoptions generates enormous log volume and degrades the SPU.
Read the trace file with show log <filename>. Look for the verdict line: RT:<deny> indicates a policy deny, RT:<drop> followed by a reason (e.g. no-reverse-route, screen hit) pinpoints the exact drop cause, and the policy name in the output confirms which rule (or the implicit deny) is matching. Always disable traceoptions immediately after collecting output: delete security flow traceoptions and commit. Since Junos 24.2R1, the local-debug-buf option lets you tune the in-memory trace buffer up to 40,000 lines.
Enabling security-flow traceoptions with the basic-datapath flag but no packet filter on a busy SRX traces every single first-path packet and can degrade forwarding performance or crash the SPU under high load. Always scope it to a specific source/destination IP pair and disable immediately after collecting the log.
A traceoptions file shows 'RT:
④ Security policy hit-counts & common fixes
show security policies hit-count lists every configured policy sorted by the number of times it has matched traffic since the last reset. This instantly reveals shadowed rules (hit-count zero for a rule that should be firing — something above it is catching the traffic first), overly broad permit rules (enormous counts that should be multiple narrower rules), and dead rules you can safely remove.
Common fixes
The five issues you will see most often: (1) Policy deny — policy name in the session or trace log does not match what you expected; check zone pair and address book. (2) Asymmetric routing drop — SRX sees the return packet on a different SPU or interface; enable set security flow allow-dns-reply or fix the routing. (3) NAT mismatch — source or destination NAT rule did not apply because zone or address match failed; verify with show security nat source rule all. (4) Session table full — add show security flow session summary and compare active vs maximum; reduce timeouts or upgrade platform. (5) ALG interference — SIP/FTP control channel opens fine but data channel fails; check show security alg status.
Arjun at a Mumbai fintech company faces this
Application team says HTTPS to the payment gateway (10.20.5.10) worked yesterday but drops silently today. show security flow session shows no active session for the destination.
A routing change moved the return path through a different interface, causing asymmetric routing — the SRX receives the TCP SYN reply on an interface that has no matching session entry and drops it silently.
show security flow session destination-prefix 10.20.5.10/32 — no session. Enable traceoptions with a packet filter for 10.20.5.10 and look for 'no-reverse-route' or 'asymmetric' in the drop reason.
Operational mode ▸ show security flow session + set security flow traceoptionsRestore symmetric routing so both directions traverse the same SRX path. If asymmetric routing is unavoidable, enable flow-based asymmetric routing support on the affected zone, or consider using a stateless filter instead.
Disable traceoptions, retest HTTPS to 10.20.5.10 — show security flow session now shows an active session with the correct policy name and both byte counters incrementing.
A ping passing proves ICMP is working, not that TCP port 443 is working. After any SRX fix, verify with show security flow session filtered to the exact destination and port, confirm the correct policy name appears in the session, and check that byte counters in both directions are incrementing.
A security policy shows zero hit-count after a week of production traffic. What is the most likely cause?
🤖 Ask the AI Tutor
Tap any question — instant, scoped to this lesson. No login, no waiting.
Pre-curated from vendor docs + community Q&A, scoped to this lesson. For a live prod issue, paste your export into chat.techclick.in.
📝 Wrap-up assessment — six more
You've answered 4 inline. Six left. 70% (7 of 10) marks the lesson complete on your profile. Tap Submit all answers at the end.
🧠 In your own words
Type one line: what is the difference between a first-path drop and a fast-path drop on an SRX, and how do you find each one? Then compare with the expert version.
🗣 Teach a friend
Best way to lock it in — explain it in one line to a teammate. Tap to generate a paste-ready summary.
📖 Glossary
- First path
- SRX processing path for the session-opening packet: zone check, policy lookup, NAT evaluation, ALG detection and screen checks. Creates the session entry.
- Fast path
- SRX processing path for established-flow packets: looks up the existing session entry, rewrites headers per stored NAT info, and forwards. No policy re-evaluation.
- Session table
- In-memory table of active connections, keyed on 5-tuple. Each entry stores the matched policy, NAT translations and timeout. show security flow session reads it.
- security-flow traceoptions
- Junos diagnostic feature that logs the first-path journey of matching packets to a file. Must be scoped with a packet filter to avoid SPU performance impact.
- Packet filter (traceoptions)
- A source/destination IP filter applied to traceoptions that limits logging to packets matching those criteria, preventing trace output from flooding the SPU.
- show security policies hit-count
- Command that lists every security policy rule with the number of times it has matched traffic. Zero hits = shadowed or dead rule.
- Asymmetric routing
- Condition where forward and return packets traverse different SRX interfaces or nodes. The return packet finds no session entry and is silently dropped (no-reverse-route).
- ALG (Application Layer Gateway)
- SRX feature that inspects control-channel protocols (SIP, FTP, H.323) to dynamically open pinholes for their data channels. Detected and configured on the first path.
- Session table exhaustion
- Condition where active sessions reach the platform maximum. New first-path connections are silently dropped — no policy log. Detected with show security flow session summary.
- RT:
- Token that appears in security-flow traceoptions output indicating the packet was dropped by a security policy deny action at first-path processing.
📚 Sources
- Juniper Networks — Traffic Processing on SRX Series Firewalls Overview (first path, fast path, session table). juniper.net/documentation/us/en/software/junos/flow-packet-processing/topics/topic-map/security-srx-devices-processing-overview.html
- Juniper Networks — Monitoring Security Flow Sessions — show security flow session reference. juniper.net/documentation/us/en/software/junos/flow-packet-processing/topics/topic-map/security-flow-session-and-error-handling.html
- Juniper Networks — traceoptions (Security Flow) — configuration reference. juniper.net/documentation/us/en/software/junos/flow-packet-processing/topics/ref/statement/security-edit-traceoptions-flow.html
- Juniper Networks — Monitoring and Troubleshooting Security Policies — show security policies hit-count. juniper.net/documentation/us/en/software/junos/security-policies/topics/topic-map/monitoring-troubleshooting-security-policy.html
- Juniper Networks — Flow-Based Sessions on SRX Series Devices. juniper.net/documentation/us/en/software/junos/flow-packet-processing/topics/topic-map/security-flow-based-session-for-srx-series-devices.html
- Juniper Networks — Express Path Overview (fast-path acceleration). juniper.net/documentation/us/en/software/junos/flow-packet-processing/topics/topic-map/security-express-path.html
What's next?
Mastered the flow engine? Next, go deep on Juniper SRX security zones, address books and policy hierarchy — why zone ordering matters and how to build a clean policy set without shadow rules.