Skip to content

Recording the traffic between your systems

A capture point sits between two of your systems, such as your acquirer host and your switch in a test environment. The first connects to the capture point instead of the second, and the capture point forwards everything to it, unchanged, in both directions. When you start a capture, it records the messages as they pass, complete, so they can be sent again later.

On the Captures page, an editor adds a capture point:

  • Name, and the port it listens on, from 8700 to 8719;
  • where it forwards to: the host and port of the system that should receive the traffic;
  • the link’s framing and layout, as for a simulated host: the length header, the wire format, the ISO 8583 version, and a TPDU if the link has one.

It starts forwarding at once. Point the first system at the capture point’s address and port instead of the second system’s. Each connection it takes gets one of its own to the second system; if that system can’t be reached, the connection is closed, as that system’s own refusal would close it. The page shows how many connections are open and how many messages have passed each way.

A capture point is one service of the Platform, with no standby. While the Platform restarts or upgrades, or the capture point is changed or disabled, it takes no new connections and closes the ones it has, so the two systems can’t reach each other through it until it’s back. Before closing, it drains: it stops forwarding new requests, passes on the answers owed for up to 10 seconds (PROXY_DRAIN_SECONDS), then closes each connection, as the second system closing a quiet link would. Your first system then reconnects as it does after any dropped link.

So route a link through a capture point for the time you record, in a test environment, and keep the direct route to switch back to. Don’t leave a link that others depend on running through it between recordings, and schedule Platform upgrades outside recording windows.

TLS can be added on either side through the API: a certificate from the vault toward the systems that connect (and client certificates, as a simulated host takes them), and TLS toward the system it forwards to (as a scenario’s target connects).

Choose Record…, name the capture, and start it. The capture point keeps forwarding exactly as before, and records every message from then on, with its time to the microsecond, its connection and its direction. Stop recording when you have what you need. Connections aren’t interrupted by starting or stopping a capture.

A capture also stops on its own at the install’s limits, on its number of messages and its duration, and when all captures together reach the install’s size limit. The capture says which.

Open a capture from the list. It shows how many messages it holds, over how many connections, and its size, then the messages in order: when each passed, on which connection, which way, its MTI, STAN and response code, and for an answer, the request it answers. Open a message to see its fields.

The console shows captured messages masked, as the message log does. The capture itself keeps them complete, for replay (section 6).

A capture keeps complete messages, so it must only ever hold test data. Every message is checked by the test-data guard, both ways, and a capture never keeps a card number that might be real, whatever the guard’s mode.

Set your test ranges first. The guard knows a card number is test data when it’s a published test card or in one of your test ranges (Settings). If your test cards come from your own ranges, as a bank’s often do, add those ranges before you record: the record form says which card numbers would end the capture, and warns when no ranges are set.

  • With the guard on block (the default), the first card number that might be real ends the capture. That message isn’t kept, and everything recorded before it is: each of those passed the guard. The capture says why, with the card number masked; if it’s one of your test cards, add its range and record again. The capture point goes on forwarding: it’s in the path of your traffic, and stopping it would stop your systems talking.
  • With the guard on warn or off, that message is kept with its card data masked, and marked: it can’t be sent again. The capture counts them.

A message the capture point’s layout can’t read can’t be checked, so it isn’t kept; the capture counts those too.

Traffic you already have in a file becomes a capture too: a pcap or pcapng file from tcpdump or Wireshark. Under Import a packet capture, choose the file, name the capture, and give the server port (where the requests went, which tells the two directions apart) and the link’s framing and layout.

The file’s TCP streams to and from that port are rebuilt in order (retransmitted bytes are dropped, and packets that arrived out of order are put back in place), then cut into messages with the length header given. It reads Ethernet captures (with VLAN tags), Linux cooked captures, raw IP and loopback captures, over IPv4 or IPv6. Each connection in the file becomes a connection of the capture, and each message keeps the time of the packet that completed it.

Every message goes through the same checks as a recording, so on block the import ends at the first card number that might be real, keeping what came before it. The capture’s note says what the file held: its packets and connections, and what had to be left out, such as streams cut off where the file missed packets. The file itself isn’t kept. Files up to 256 MB are imported, as CAPTURE_IMPORT_MAX_BYTES sets.

A replay sends a capture’s requests to a system again, such as a new build of the one that answered them, and compares each answer with the one recorded. It’s a run like any other: listed with the others, judged pass or fail, and run from CI.

Under Replay, choose where to send the requests: a host and port, read and written as on the capture point, or a simulated host. Then choose the timing, and Start replay. The form shows the scenario it runs, ready to copy into CI.

A scenario’s replay: block takes the place of steps:

name: Replay of the UAT cycle
target: {host: switch.uat.example.com, port: 8583, timeout_ms: 5000}
replay:
capture: UAT cycle # by name (the newest with it) or id
timing: recorded # or fastest
speed: 2 # with recorded timing: twice as fast
only: {mti: ["0100", "0420"], from_ms: 0, to_ms: 600000}
rewrite:
amount_scale: 0.5
terminals: {TERM0001: TERM0042}
cards: {"4111111111111111": "4000056655665556"}
ignore: [44, 48]
thresholds: {different: 0.01, missing: 0}
  • Timing: recorded sends each request at its time in the capture, scaled by speed; fastest sends each connection’s next request as soon as its last is answered, over the recorded connections or connections of them, up to the install’s load limit.
  • Part of a capture: only picks MTIs, connections, or a window of time from the capture’s start.
  • Only requests are sent: the client’s requests, advices and notifications. The upstream’s own requests, such as echoes, aren’t replayed, since the system you replay to sends its own.

So the system takes each request as new:

  • STANs and RRNs are renumbered, consistently: the same recorded STAN from the same terminal on the same day always gets the same new one, so a reversal or an advice still names its original in field 90, with the time the original was sent. A new RRN is made as acquirers make them (the year’s last digit, the day of the year, the hour, then the new STAN), so one replay doesn’t repeat another’s.
  • Fields 7, 12 and 13 are the time each request is sent.
  • What rewrite asks for: amounts scaled (field 4), terminal and merchant IDs mapped (fields 41 and 42), and card numbers mapped to other test cards of the same length, in field 2, the track data and the card numbers in field 55. A request with a PIN block keeps its card number, since the PIN block depends on it; the report counts them. The cards you map to are checked by the test-data guard like any card in a scenario.
  • A request recorded with a MAC is signed again through the HSM with the target’s MAC key (target.mac, or the simulated host’s MAC settings). Without one, it goes with the recorded MAC, which no longer matches, and the report counts them.

Each request is checked by the test-data guard again before it’s sent: one it refuses now isn’t sent.

Each answer is compared field by field with the recorded one, after the same changes are made to the recorded answer (a mapped terminal, a scaled amount). Fields every run changes are left out: 7, 11, 12, 13, 15, 37, 38 and the MACs; ignore leaves out more. Each request ends up:

  • same, or different, with the fields and their values then and now;
  • no answer within the target’s timeout, or not sent, with why.

Messages the system sent that answered nothing are counted too.

A replay passes when every answer is the same, or within its thresholds: the share of answers that may differ, and the share of requests that may go unanswered. Its page shows its seconds live, then its outcomes by MTI, the response codes that changed (00 to 05, say), the fields that differed, and the first 50 exchanges that didn’t match, masked. From CI, iso8583sim-run.py reports the thresholds and one test case per MTI.

Replays are for editors. One load generator runs each replay, so the recorded order holds. A capture still recording can’t be replayed. With recorded timing, the capture’s busiest second at the replay’s speed must be within the install’s load limit.

The demo runs this for you every day. Its reference gateway pays through a capture point, Gateway to switch, on its way to the reference switch. After the day’s own runs, the demo records ten minutes of those payments as Demo payments and replays them twice:

  • Replay: the demo’s payments sends them to the same switch. Nothing has changed, so every answer is the same and the replay passes.
  • Replay catches a bad switch release (fails on purpose) sends them to a second switch running the next release’s configuration, which adds a route for cards starting 4012 to an issuer whose link isn’t up yet. The switch stands in for those payments, so the ones over its floor limit move from 00 to 91, and the replay fails and shows them: by MTI, how the codes moved, and the first exchanges that differ.

Open them under Runs, and the recording under Captures. examples/scenarios/replay-new-build.yaml is the second one, to point at your own new build.

A capture’s exchanges can also become a scenario file: each request a step that sends it, expecting the answer recorded for it. Unlike a replay, which reads the capture each time it runs, the scenario holds the messages themselves, so you can edit it, add steps of your own and keep it with your other scenarios.

Under Make a scenario, name it, choose where it sends (a host and port, read and written as on the capture point, or a simulated host), and Write the scenario. The form shows the file and what it left out; Save as a scenario saves it, and nothing is saved until then.

  • The steps: one for each request the capture kept complete, in the order they came, up to a scenario’s 500 steps. Choose MTIs to take part of a longer capture. Messages kept masked can’t be sent, so they’re left out, and the form says how many.
  • What each step checks: the answer’s MTI and response code, and any other fields you name, against the recorded answer. A field the recorded answer didn’t have must be absent. A request that went unanswered expects no answer.
  • What each run renews: field 11 is each step’s own STAN, fields 7, 12 and 13 the time it’s sent ({{transmission_time}}, {{local_time}}, {{local_date}}, in UTC), and field 37 an RRN made from its STAN ({{rrn}}), so a system that checks for stale dates or repeated RRNs takes every run as new traffic. A reversal’s or advice’s field 90 names its original as that step sent it: the original saves its STAN and time from its request (save: {stan_1: request.11, sent_1: request.7}), and field 90 uses them. Everything else is as recorded.
  • MACs: a request that carried a MAC is sent with mac: true, signed again with the key a simulated host has, or for an address the MAC key you name.

The file holds complete messages, as every scenario does, so making one is for editors. Its card numbers passed the guard when they were recorded, and are checked again when the scenario is saved and run.

A load’s mix can name a capture, so the load looks like the traffic you recorded: its MTIs, amounts, terminals and fields in their recorded proportions, beside any samples. The entry takes its share of the load’s rate and sends the capture’s requests in their recorded order, round and round, for as long as the load lasts.

load:
rate: 500
duration_seconds: 600
mix:
- {capture: UAT cycle, weight: 80, rewrite: {amount_scale: 1.5}}
- {sample: auth, weight: 20, amount: 2500}
  • Each pass is new traffic. STANs and RRNs are renumbered afresh every time round, the STANs from the load’s own count so they never clash with the mix’s other messages, and a reversal or an advice still names its original’s new STAN. Dates are the time each request goes.
  • Rewrites and part of a capture work as in a replay: rewrite maps terminals, merchants and cards and scales amounts, and only takes some MTIs, connections or a time window. A capture by name is the newest of that name.
  • Before the load starts, the Platform checks that each capture can be sent, and every load generator reads it once (its first 50,000 requests) and checks each request with the test-data guard as it will be sent. On block, one it refuses stops the load before anything is sent.
  • MACs: a request that carried a MAC is signed again with the target’s key (its target.mac, or a simulated host’s own) when there is one, and otherwise goes with the recorded MAC.

The load is judged like any other: its thresholds, second by second. Unlike a replay, its answers aren’t compared with the recorded ones.

Captures are kept until they’re deleted, and they’re in the backups. The install sets the limits:

Setting Default
CAPTURE_MAX_FRAMES 10,000,000 messages per capture
CAPTURE_MAX_SECONDS 7 days per capture
CAPTURES_MAX_BYTES 10 GiB of messages for all captures together

A request and its answer are two messages. At 2,000 requests a second, a capture reaches 10 million messages in about 40 minutes. To record longer at that rate, raise CAPTURE_MAX_FRAMES in .env and restart the proxy.

In the database, a message takes about 240 bytes, about 2.6 times its own size, with its time, connection, pairing and indexes. So 10 million messages take about 2.4 GB, and captures at the 10 GiB limit take about 26 GB of disk.

Recording never slows forwarding. If messages arrive faster than they can be stored, the extra ones are forwarded but not kept, and the capture says how many.