Homer and Diameter

18 views
Skip to first unread message

graham...@spark.co.nz

unread,
Jun 5, 2024, 5:15:03 AMJun 5
to Homer Capture Server. sipcapture.org
Hi,

I am a support engineer for IMS and we use Homer for SIP capture to do call tracing and dashboarding in Grafana using the Prometheus exporter interface. I have for a long time been interested in seeing if we can also populate the Homer database with diameter as it is a key protocol for IMS. I have noticed there has been work in this area in captagent and heplify-server.

So, I have git cloned the master branch of captagent version 6.4.1 and compiled and configured it to capture diameter and can see that it is sending a HEP stream with Capture Protocol Type 56 to my designated heplify-server socket at 127.0.0.0:9072.

I then git cloned the diameter_fix bramch of heplify-server and compiled this.

I then configured this heplify-server to listen for the diameter HEP stream from captagent and for Homer7 (postgres). I then was able to run it up successfully from systemctl on the same host as captagent.

I checked in the database and I can now see that tables for diameter are being created e.g.
hep_proto_56_default_20240530_1400

When I checked in the database tables though I was not able to see any data being written to the tables.

I cam see in the heplify-server source file "database/postgres.go" is where diameter is written to the postgres database.

At line 152 it has:-
} else if pkt.ProtoType >= 2 && pkt.Payload != "" && pkt.CID != "" {

So, all of these conditions must be true for the diameter packet to be written to the database. My suspicion was one or more of these must be false and was preventing the packet from being written to the database.

Through the process of elimination I modified this line to: -
} else if pkt.ProtoType >= 2 && pkt.Payload != "" {

Recompiled heplify-server and restarted it and I can now see diameter data being written to these database tables.

So, it would seem the Correlation ID (CID) does not have a value and is preventing the diameter packet from being written to the database.

If I now query the database I can see that the correlation_id is "".
# select * from hep_proto_56_default_20240530_1400 limit 1;
-[ RECORD 1 ]---+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id              | 41126497
sid             |
create_date     | 2024-05-31 02:00:00.116155+12
protocol_header | {"dstIp": "10.xxx.xxx.xxx", "srcIp": "10.xxx.xxx.xxx", "dstPort": 3868, "srcPort": 48272, "protocol": 6, "captureId": "2001", "capturePass": "myhep", "payloadType": 56, "timeSeconds": 1717077600, "timeUseconds": 116155, "correlation_id": "", "protocolFamily": 2}
data_header     | {"node": "2001", "proto": "diameter"}
raw             | "diameter_info": {"class":"Diameter","type":"Request","command":"DW","app-ID":0}

Not sure if how and where the CID variable is populated for diameter, but while it remains unpopulated diameter is not goint to be written to the database?

So my question is how and where or should CID be populated for diameter?

Graham Brown
Reply all
Reply to author
Forward
0 new messages