TTechclick All lessons
Palo Alto · Troubleshooting · Session InternalsInteractive · L2 / L3

Session Table & Flow — Watch a Session Live, Decode Every Field

Every Palo Alto firewall is, at heart, a giant session table. Master it and troubleshooting stops being magic — every "stuck" flow, every "aged-out" log line, every "session created but no return traffic" makes sense. 13 minutes from INIT to CLOSED.

📅 2026-05-25 · ⏱ 13 min · 3 interactive widgets · 🏷 10-Q assessment + AI Tutor inline

Pick where to start

1

State Machine

INIT → OPENING → ACTIVE → CLOSING → CLOSED, animated.

2

Hardware Offload

Why some sessions fly & others stay on the dataplane.

3

Predict Sessions

FTP, SIP, RTSP — how ALG opens pinholes without policy.

4

Show Session ID

Every field decoded — tracker stage is gold.

The 6-tuple — not 5

Every networking textbook teaches you the "5-tuple": source IP, source port, destination IP, destination port, protocol. Palo Alto adds a sixth — ingress zone. This is why the same source / destination IPs entering via two different zones get two separate sessions, and why flow_fwd_zonechange (from Blog 15) fires on asymmetric routing — an existing session sees a packet arriving via a different zone and panics.

Sneha at Infosys learns this the hard way during an A/A HA cutover: the firewall sees zone trust for the SYN, zone trust-b (peer interface) for the SYN-ACK. Two sessions get created; one of them ages out lonely; the user sees an intermittent app. The 6-tuple is the firewall trying to protect you from stateful-inspection confusion.

The session-ID is just a slot number

When a packet's 6-tuple doesn't match any existing session, the firewall slowpaths it: zone lookup, FIB lookup, NAT match, policy match, App-ID start. Then it allocates a session-ID (a slot in the hardware session table) and stamps the c2s + s2c sub-flows. Every later packet for the same 6-tuple takes the fastpath — straight into hardware, no policy lookup.

① The session state machine — animated

PAN-OS sessions cycle through up to 7 states. Pick a scenario, press Play, watch how each state transitions.

▶ Session state machine — TCP happy path

Rahul at TCS opens an SSH session. Watch the firewall create, sustain, and clean up the state.

① INIT state: INIT — Session slot allocated by the dataplane. No packets exchanged yet. Stable for milliseconds while the firewall waits for the first real payload.
② OPENING state: OPENING — TCP SYN seen. Aggressive half-open timer (typically 5 s) protects against SYN-floods. If SYN-ACK doesn't arrive in time, slot is freed.
③ ACTIVE state: ACTIVE — TCP 3-way handshake complete. Bidirectional traffic flowing. App-ID identifies the app over the first few packets. Most sessions live here for their entire life.
④ CLOSING state: CLOSING — FIN/RST seen, or TCP idle timer hit. The 15-second time-wait timer starts; new packets matching the 6-tuple in this window may still match the session.
⑤ CLOSED → FREE state: CLOSED — Removed from the active session lookup table. Slot returned to the pool. Session-end-reason recorded in the Traffic log.
Press Play. Each press of Next advances one state.

The DISCARD branch — what happens when policy denies

When a packet's first SYN matches a deny rule, the firewall still creates a session — but in state DISCARD. The dataplane drops the packet AND remembers the 6-tuple so subsequent packets get dropped at fastpath instead of slowpath (saving CPU). The DISCARD session keeps refreshing its timer as long as packets keep arriving. If a noisy app retries 50 times a minute, the DISCARD session lives forever.

SIP DISCARD that won't die

A common production puzzle: SIP traffic gets denied at policy. The DISCARD session stays alive for hours because the SIP client retries continuously. Fix: clear session id <N> manually, OR set set deviceconfig setting session no-refresh-on-discard yes (PAN-OS 10.2+, requires commit + reboot). "Rematch Sessions" doesn't help — it only rematches ALLOW state.

Quick check · Q1 of 10

Priya at HCL sees a long-running TCP session in state ACTIVE with c2s bytes = 0 and s2c bytes = 0 for the last 200 seconds. The session is still in ACTIVE, not CLOSING. Why?

Correct: c. PAN-OS default TCP idle is 3600 s (1 hr). A 200-second idle gap is well within tolerance for legitimate long-lived TCP. Many real apps use TCP keepalives (every 15-60 s) to make sure the firewall doesn't age them out. If you see idle sessions getting aged out too aggressively, check the per-app timeout in Objects → Applications → <app> → Timeouts. Bump it if needed (e.g. ssh default 3600 s often raised to 28800 s).

② Hardware offload — why some sessions fly

PAN-OS uses Single Pass Parallel Processing (SP3). After App-ID + Content-ID finish on the first few packets of a session, the firewall can offload the rest of the flow to dedicated hardware (the FE-card or Flow Engine on PA-series). Offloaded flows skip the Dataplane entirely on subsequent packets. That's how a PA-5450 can do 100+ Gbps.

But offload has rules. If the firewall has to keep inspecting payload (decryption ON, threat-profile actively scanning, decompress), it CAN'T offload. Karthik at Flipkart hit 95% Dataplane CPU during a backup window — root cause was SSL decryption on a 12 Gbps flow preventing offload.

▶ Will this session offload?

Pick a scenario. Press Play to walk through the decision tree.

① SCENARIO Pick a scenario above, then press Play.
② APP-ID / CONTENT-ID
③ DECRYPTION / PROFILE CHECK
④ OFFLOAD ELIGIBILITY
⑤ VERIFY ON FW
Pick a scenario, then press Play.
Never disable offload in production

set session offload no disables hardware offload globally. It's a debug-only command — without offload, every packet hits the Dataplane and your throughput craters. Use it only when you NEED packet-diag to capture every packet in a flow (offloaded packets don't get captured at every stage). Always re-enable: set session offload yes immediately after the capture.

Quick check · Q2 of 10

Aditya at Wipro runs show session id 84219 and sees layer7 processing: completed, offloaded: yes. He's tuning a problem with this session. He enables set session offload no. What happens next?

Correct: b. Offload is a global setting. Disable it and every existing offloaded session is pulled back to Dataplane immediately, plus all future sessions stay there. On a busy firewall this can push CPU to 100% and start dropping legitimate traffic. Use only briefly during a targeted packet-diag capture, then re-enable. Schedule maintenance for off-hours if you need it for > 30 seconds.

③ Predict sessions — how ALG opens pinholes without writing rules

Some protocols negotiate a data channel separately from the control channel. Active-mode FTP is the canonical example: client tells server "I'm listening on port 5099", server connects BACK to client:5099. The firewall can't know to allow port 5099 from a policy lookup — it has to PEEK at the FTP control channel, learn the dynamic port, and pre-install a predict session.

▶ FTP active-mode — predict session walkthrough

Sneha downloads via FTP. Watch the firewall watch the control channel, then pre-install a session for the data channel.

① CONTROL SETUP 10.10.10.5:51234203.0.113.50:21 · App-ID = ftp · session 84219, state ACTIVE
② ALG INSPECTS FTP ALG parses the PORT command: client says "data channel on 10.10.10.5:5099". ALG records the dynamic port from the parent session's payload.
③ PREDICT INSTALLED Firewall pre-installs predict session: type: PREDICT, 5-tuple = 203.0.113.50:20 → 10.10.10.5:5099. Visible in show session all filter type predict.
④ DATA CONNECTS Server SYNs to 10.10.10.5:5099. Firewall finds matching predict, promotes it to FLOW session. Data flow starts — without ANY new security-policy lookup.
⑤ DATA COMPLETES File transfer ends. Data session closes. Parent control session stays open for more PORT commands or QUIT.
Press Play to walk through ALG + predict.
📂
FTP active
tap

Server → client data channel. Predict opens server:20 → client:high-port. Most common case where ALG is needed because no policy could anticipate the port.

📁
FTP passive
tap

Client → server:high-port. ALG learns from PASV response, predicts client → server-port pair. Modern firewalls handle this transparently.

📞
SIP / RTP
tap

SIP signalling on 5060. RTP/RTCP media negotiated via SDP. ALG opens UDP pinholes for the RTP port pair. Predict ages out fast if call doesn't connect.

📹
RTSP / H.323
tap

Streaming media + H.323 video. ALG parses the setup, opens UDP media pinholes. CCTV systems commonly hit this — needs ALG enabled or video breaks.

Quick check · Q3 of 10

Rahul allows FTP through a strict policy and blocks all TCP >1024. Active-mode FTP works perfectly. How?

Correct: a. Predict sessions bypass the policy lookup because they inherit the parent FTP App-ID's permission. The firewall trusts that if the user was allowed FTP, the ALG-detected data port is part of that legitimate flow. This is a security trade-off — most environments accept it. If you don't want ALG behavior, you can disable specific ALGs per-app under Objects → Applications.

show session id <N> — every field decoded

The single most important troubleshooting command on the firewall. Run it on the session in question and it tells you everything. Below is annotated output for a real allowed HTTPS session.

CLI
show session id 84219
Annotated output (every field explained)
Session         84219            ← session-id (slot in hardware table)

        c2s flow:
                source:      10.10.10.5 [trust-lan]    ← original client (pre-NAT)
                dst:         142.250.182.46            ← original destination (pre-NAT)
                proto:       6                          ← TCP
                sport:       51234   dport:    443      ← original ports
                state:       ACTIVE  type:    FLOW
                src user:    rahul.tcs                  ← User-ID mapping
                dst user:    unknown

        s2c flow:
                source:      142.250.182.46 [untrust]
                dst:         203.0.113.5                ← post-NAT (firewall's public IP)
                proto:       6
                sport:       443     dport:    62117    ← post-NAT translated port
                state:       ACTIVE  type:    FLOW
                src user:    unknown
                dst user:    rahul.tcs

        start time              : Mon May 25 11:47:22 2026
        timeout                 : 3600 sec              ← idle timer
        time to live            : 1842 sec              ← seconds until ageout
        total byte count(c2s)   : 14,328                ← bytes client → server
        total byte count(s2c)   : 188,420               ← bytes server → client (healthy 2-way flow)
        layer7 packet count(c2s): 18
        layer7 packet count(s2c): 142
        vsys                    : vsys1
        application             : ssl                    ← App-ID identified
        rule                    : Allow-Web-Out          ← matched security rule
        session to be logged at end: True
        layer7 processing       : completed              ← App-ID done; eligible for offload
        URL category            : computer-and-internet-info
        session in session ager : True
        offloaded               : yes                    ← hardware offload active
        address/port translation: source                  ← Source NAT applied
        nat-rule                : SNAT-Outbound (vsys1)
        layer7 processing       : completed
        URL filtering           : disabled
        session synced from HA peer: False
        end-reason              : (live, no end yet)
        tracker stage l7proc    : appid-completed

Reading the output: healthy two-way byte counts, App-ID identified, offloaded, NAT applied as expected, matched the right rule. Time to live is 1842s of 3600s — half the timeout remaining. If you saw total byte count(s2c) = 0 with non-zero c2s, you'd immediately suspect a return-path issue (Blog 15 territory).

Protocol / ApplicationDefault Timeout (PAN-OS 11.x)Where to change
TCP (generic established)3600 sDevice → Setup → Session → Session Timeouts
TCP half-closed120 sSame
TCP time-wait15 sSame
UDP30 sSame
ICMP6 sSame
DISCARD-TCP90 sSame
DISCARD-UDP60 sSame
Per-app (ssh, ftp, citrix-ica, sap, etc.)Overrides globalObjects → Applications → <app> → Timeouts
Tracker stage = the smoking gun

tracker stage l7proc is the field most engineers ignore. It tells you the precise reason a session is what it is. Values like appid-policy-lookup-deny (policy denied during app-id), tcp-rst-from-client (client RST'd), aged-out, tcp-reuse (client reused the 4-tuple before old session closed), or l7-processing-aged-out (App-ID never completed). When in doubt, read tracker stage first.

Quick check · Q4 of 10

Karthik at Flipkart runs show session id 7423 and sees layer7 processing: enabled, offloaded: no, App-ID = ssl-decrypt. He's wondering why his PA-3220 CPU is high. What's the most likely connection?

Correct: c. SSL decryption is one of the largest CPU consumers on PAN-OS, and decrypted sessions cannot offload to hardware. Common fix paths: (1) carve out a No-Decrypt list (banking, video, large-file CDNs) — frees CPU on the heaviest flows; (2) move to a higher-end appliance (PA-5450 has way more dataplane capacity); (3) enable SSL session caching to reduce re-handshake load.

Debug flow basic — the deepest tool

When show session id isn't enough, drop into debug dataplane packet-diag set log feature flow basic. It writes detailed per-packet decisions to mp-log pan_packet_diag.log. Three stages of interest: slowpath (zone/route/policy/NAT lookup), firewall (session install + App-ID gating), forward (egress + ARP).

debug flow basic — full workflow
debug dataplane packet-diag set filter match source 10.10.10.5
debug dataplane packet-diag set filter on
debug dataplane packet-diag set log feature flow basic
debug dataplane packet-diag set log on

! ... reproduce the issue (one or two attempts) ...

debug dataplane packet-diag set log off
less mp-log pan_packet_diag.log
Always filter first

An unfiltered flow basic on a busy firewall fills mp-log within seconds and can stall the management plane. Set a tight filter (source + dest) BEFORE enabling the log. Also: turn it off promptly. Schedule a reminder.

🤖 Ask the AI Tutor

Tap any question — instant answer.

Answers drawn from PAN-OS docs + Live Community real threads.

📝 Wrap-up — six more

4 inline done. 6 left. 70% (7/10) marks the lesson complete.

Q5 · Apply

Sneha runs show session id 12000, sees state: DISCARD, tracker stage l7proc: appid-policy-lookup-deny. What does this mean?

Correct: b. appid-policy-lookup-deny = App-ID identified the app, then re-evaluation of policy with the resolved app matched a deny rule. The session remains in DISCARD state to short-circuit future packets. If the client retries persistently, the DISCARD session can live indefinitely. Either let it age out, or clear it manually with clear session id <N>.
Q6 · Analyze

Aditya looks at Traffic logs and sees a flood of session-end-reason: tcp-reuse entries for the same client IP. What does that mean?

Correct: a. tcp-reuse happens when a client recycles a 4-tuple aggressively (often connection-pooled clients, HTTP/1.1 with short keep-alives, or some database drivers). The fix is rarely on the firewall — tune the client-side pool. If you must compensate, lower the per-app TCP time-wait on the firewall (Objects → Applications → <app> → Timeouts).
Q7 · Analyze

Priya configures FTP through the firewall with a strict policy. Active-mode FTP control connects (port 21 sees data), but no data transfer happens. show session all filter type predict shows 0 predict sessions. What's wrong?

Correct: c. Predict sessions for FTP only exist if the FTP ALG runs. Check Objects → Applications → ftp → Options → Application Level Gateway is enabled. Also confirm the security rule uses application = ftp (not any) so App-ID kicks in and triggers the ALG. If you're using SSL-encrypted FTPS, plain FTP ALG won't see inside — you need FTPS-aware decryption + ALG.
Q8 · Analyze

Rahul sees a Traffic log line: action=allow, application=ssh, session-end-reason=aged-out, session duration = 3600 seconds exactly. Is this normal?

Correct: a. The 3600s exact duration screams "default TCP timeout". SSH idle for an hour gets aged out — normal. If the user complains they were active the whole time, two paths: (1) enable TCP keepalive on the client (~30s intervals keeps the session "active" from firewall POV), (2) bump SSH per-app timeout on the firewall to a larger value like 28800s for long-running shells.
Q9 · Evaluate

Karthik at Flipkart needs to capture every single packet of a specific flow for a vendor TAC case. The session is currently offloaded. Best approach?

Correct: a. Offloaded sessions skip the Dataplane on subsequent packets — packet-diag won't capture every packet of a fully-offloaded flow. You have to disable offload briefly. ALWAYS schedule this for low-traffic windows because the impact is global. Have the re-enable command ready in your command history. Auto-stop after 5 minutes is a good safety habit.
Q10 · Evaluate

A senior dev says: "let's increase the global TCP timeout from 3600s to 86400s (24 hours) to stop our database sessions aging out." Is this a good idea?

Correct: b. Global TCP timeout sets the ceiling for ALL TCP sessions across the firewall. Bumping it 24x means session-table residency grows ~24x for short-lived TCP flows that never properly FIN-closed. On busy firewalls this leads to session-table exhaustion and increased memory pressure. Always make timeout tweaks at the App-ID level — surgical, targeted, low blast radius.
Lesson complete — saved to your profile.
Almost! You need 70% (7 of 10) — re-read the section that tripped you up and tap "Try again".

📚 Sources

  1. Palo Alto KB — Session Overview. knowledgebase.paloaltonetworks.com
  2. Palo Alto KB — How to View Active Session Information Using the CLI. knowledgebase.paloaltonetworks.com
  3. Palo Alto KB — Session Tracker Feature. knowledgebase.paloaltonetworks.com
  4. PAN-OS 11.1 Admin Guide — Disable Hardware Offload. docs.paloaltonetworks.com
  5. PAN-OS Networking — Configure Session Timeouts. docs.paloaltonetworks.com
  6. PAN-OS Admin — Application Level Gateways (ALG). docs.paloaltonetworks.com
  7. LIVECommunity — Packet flow for Hardware Offload (thread 132273). live.paloaltonetworks.com
  8. LIVECommunity — Tips & Tricks: Flow Basic Debugging. live.paloaltonetworks.com

What's next?

You can now read sessions like a native speaker. Next blog teaches the deepest debug surface: PCAP across packet-diag stages (RX / DROP / FW / TX) — the visual proof of which exact dataplane layer killed a packet.