Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000355 [Yate - Yet Another Telephony Engine] module minor always 2013-08-14 12:39 2013-08-14 14:08
Reporter blobby View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version SVN
Summary 0000355: MTP2 issues: FIB/BIB, retransmissions and MTP2 links aborted
Description Yate is really great, I am using the camel_map plug in which is awesome. Thank you for the hard work!

After testing SS7 yate to yate in a lab, I found the following changes helped me improve the stability of MTP2 and prevent MTP2 link disconnections:




1. switch the m_bib to !m_bib

My tests showed that switching m_bib to !m_bib creates instabilities in MTP2 in case yate loses packets fast and ends up switching multiple times before the receiver has the time to ackowledge the first m_bib switch.
Changing to m_bib = !fib -> stops flip flopping of m_bib in case of slow retransmission

bool SS7MTP2::receivedPacket(const DataBlock& packet) {
    ....
    //m_bib = !m_bib;
    m_bib = (fib ? 0x00: 0x80);
    ....
}


2. Yate ignores the FISU BIB

This can lead to lost packets if the last MSU (for example FSN=5) received is lost by Yate, followed by a FISU that indicates FSN=5 was sent. Currently yate ignores this FISU and does not realized it missed a MSU, which leads the sender to timeout on acknowledge of MSU (FSN=5) -> MTP2 links are invalidated and realigned.

The following code will check the FSN of the FISU and ask for retransmission if previous MSU was lost.

bool SS7MTP2::receivedPacket(const DataBlock& packet)
    ....
    //if (diff > 1) {
    if ( diff > 1 || (diff==1 && len==0) ) {

}



3. FISU to ackowledge a MSU

Yate ackowledges received MSUs using the MSU it needs to send. If there is no MSU to send, Yate does not acknowledge the received MSUs, leading to an ackownledge timeout on the other side and links being aborted and restarted.

Force Yate to send a FISU for ACK using transmitFISU() when yate receives a MSU and just before yate hands it to the MTP3 layer:


bool SS7MTP2::receivedPacket(const DataBlock& packet) {
    ....
    DDebug(this,DebugInfo,"New local bsn=%u/%d fsn=%u/%d [%p]",m_bsn,m_bib,m_fsn,m_fib,this);
+ transmitFISU(); //FS: to acknowledge reception to the sending side
    SS7MSU msu((void*)(buf+3),len,false);

}

4. Yate proactive retransmission

Upon transmission of a MSU, yate schedules a retransmission timer that kicks in if the MSU is not acknowledged in time. I don't think this is mandated by MTP2 standard. In addition, the retransmission mechanism in Yate inverts the FIB which I think is illegal (the FIB is a copy of the BIB and only the BIB can be inverted). In my lab, this proactive retransmission ended up creating too much traffic for no gain, possibly leading to links realigning under load. I suggest the following:

bool SS7MTP2::transmitMSU(const SS7MSU& msu) {
    ...
    /*if (!m_resend)
        m_resend = Time::now() + (1000 * m_resendMs);*/

}


Francois Struman
Additional Information I hope to hear from you and that the above helps making yate better. If you need more information, please let me know.

Thank you!
Tags No tags attached.
Attached Files ? file icon yate-svn-layer2.cpp.patch [^] (1,405 bytes) 2013-08-14 14:08

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-08-14 12:39 blobby New Issue
2013-08-14 14:08 blobby File Added: yate-svn-layer2.cpp.patch


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker