heimiricmr / bromelia Goto Github PK
View Code? Open in Web Editor NEWA Python micro framework for building Diameter protocol applications.
License: MIT License
A Python micro framework for building Diameter protocol applications.
License: MIT License
In the diameter-app1, diameter_mme.py, I tried adding addtional AVPs like AuthApplicationIdAVP, AuthSessionStateAVP. But these AVPs are not getting passed. Please let me know how to get these avp passed.
Specifying an application with an ID other than those defined in bromelia/constants/app_ids.py will result in an error.
The same occurs if overwritten in the DiameterHeader application_id attribute.
When a large number of Diameter messages are being exchanged between the client and the server, the incoming stream might be divided into multiple batches, where each batch does not necessarily consist of an integral number of messages. The following 5-message scenario explains the issue.
5 messages are being sent in two batches:
Batch 1:
-----Message1---------|-------Message2---------|------------Message3-------------|--------Message 4 part1
Batch 2
-----Message 4 part 2------|------------------Message5-------|
The current implementation does not take into account this case; it considers data streams as independent of each other.
When the TCP connection is terminated either gracefully via DPR/DPA messages or abruptly if the connection is lost, the underlying processes and threads started within the framework will be stuck in infinite loops and Deadlocks. Thus, the client of the Bromelia library will also hang and has no way to proceed or re-initialize the library again.
Also, if the above issues were fixed, there is no way to notify the user of the Bromeilia instance that an interruption in the connection or the flow has occurred
Related Infinite loops:
Deadlock:
For example, I have an answer object of type CreditControlAnswer, which has an AVP of type ResultCodeAVP.
I need to check what is the value of that AVP. The data attribute of the ResultCodeAVP returns only the serialized (encoded) data, and there are no methods available to deserialize (decode) that data.
The same applies to all AVP classes of all types.
Currently, there is no way to terminate a Bromelia app instance gracefully, the main loop will be kept executing forever until the parent process is terminated.
Also, if the connection to the peer is lost, no functionality is implemented to restore the connection or terminate the worker process. Thus, this is a reliability issue that limits the usefulness of the library in a production environment.
If DiameterAVP is initialized with data = 0, an UnboundLocalError (local variable 'length' referenced before assignment) is raised whenever DiameterAVP.length attribute is called, for example in DiameterAVP.dump method.
The error stems from the if condition at line 379 in base.py
Values of zero should be considered as valid integers and represent a meaningful value.
When a large amount of data is sent from the Diameter server, such as a long message or multiple messages together, the first 256KBs are only read. Any other data beyond this limit will be ignored.
Ref: TcpConnection._read
method.
Tried to connect multiple diameter clients to the Bromelia server but only one peer is coming up and other one is getting rejected
The server is not responding back to the CEA received from the second peer.
This case occurs when the AVP value should be a 64-bit integer per the Diameter standards.
So, constructing an AVP using the DiameterAVP class will serialize the data as a 32-bit integer.
avp = DiameterAVP(code=439, data=1)
Checking the avp.data
attribute, you will see only 4 bytes where they should be 8 bytes.
Ref: https://github.com/heimiricmr/bromelia/blob/master/docs/avps.md#constructor
Per the documentation https://docs.python.org/3.8/library/queue.html#module-Queue, Queue class instances are already synchronized. So locks around instances of type Queue are redundant.
The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics.
Are there any plans for implementation SCTP transport for Bromelia?
Hi @heimiricmr ,
I am trying to add multiple specific_action AVP in AAR Rx Message, could not add it.
please help to fix this issue
Thanks
Ganesh
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.