aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.h
AgeCommit message (Collapse)AuthorFilesLines
2015-06-29llc: Add missing include directive for struct timevalJacob Erlbeck1-1/+1
While including time.h is sufficient with Ubuntu's current libc6 2.19, the correct (and portable) include file is sys/time.h. This commit modifies the include directive in llc.h accordingly. Fixes: Jenkins #600 Addresses: In file included from gprs_ms.h:28, from gprs_ms.cpp:22: llc.h:68: error: field 'recv_time' has incomplete type llc.h:69: error: field 'expire_time' has incomplete type Sponsored-by: On-Waves ehf
2015-06-22llc: Move storage of timestamps into gprs_llc_queueJacob Erlbeck1-2/+8
Currently the receive and expiry timestamps are prepended to the LLC msgb before it is passed to gprs_llc_queue::enqueue(). Since this meta information should not be counted as LLC octets, the gprs_llc_queue needs to known about this (unless the correction was done in the LLC layer). This commit moves the meta information storage code into gprs_llc_queue. The meta data is now stored in the control block (cb) area of the msgb. Note that the info pointer that is returned from the dequeue method is only valid if that method returns a (non-NULL) msgb. It must not be used after that msgb has been modified or freed. Sponsored-by: On-Waves ehf
2015-06-22llc: Make timeval arguments constJacob Erlbeck1-2/+4
Some struct timeval pointer arguments do not have the const qualifier, albeit the methods do not write to the structures. The next commit will change related pointers to const, so this commit provides the required constness. Sponsored-by: On-Waves ehf
2015-06-22llc: Keep track of the number of stored LLC octetsJacob Erlbeck1-0/+7
To get the number of LLC octets that are stored in the queue, this commit adds a m_queue_octets member along with a octets() method. This value is updated similarly to m_queue_size on each modifying method call. Sponsored-by: On-Waves ehf
2015-06-22llc: Add missing include directive to llc.hJacob Erlbeck1-0/+4
Currently struct llist_head is used without declaration which accidently did not produce an error so far. This commit adds the missing include directive. Sponsored-by: On-Waves ehf
2015-06-08llc: Add missing declarations to llc.hJacob Erlbeck1-0/+4
Currently llc.h relies on the structs BTS, timeval, and msgb being declared before the file is included. This commit adds forward declaration for these structs, because they will only be used for pointer types. Sponsored-by: On-Waves ehf
2015-06-08llc: Separate LLC queue handling from gprs_llcJacob Erlbeck1-7/+25
Currently the gprs_llc class handles both LLC queueing and the partition into smaller pieces for RLC/MAC encapsulation. This hinders the separation of TBF and MS related data, since LLC queueing belongs to the MS related code while the RLC/MAC encoding/decoding belongs to the TBF layer. This commits takes the LLC queueing related methods and members and puts them into a new class gprs_llc_queue. It puts the queueing object into gprs_rlcmac_tbf and adds accessor functions. The implementation in tbf.cpp and tbf_dl.cpp is adapted accordingly. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-04-02tbf: Use a hysteresis when discarding DL LLC framesJacob Erlbeck1-0/+1
Currently single LLC blocks are discarded when the PDU lifetime expires. If an IP packet has been fragmented either on the IP or on the LLC layer and is therefore distributed over several LLC frames, the kept fragments are transmitted and then discarded by the MS because of the missing PDU. This can cause massive IP packet loss when there are many fragmented packets (e.g. when trying 'ping -s1800' or if the GGSN chops downlink IP packets into several SNDCP packets). On the other hand, discarding too many packets might disturb the congestion handling of TCP. Dropping plain TCP ACKs might also hinder flow control and congestion avoidance. This commit adds a hysteresis algorithm to the LLC discard loop. If an LLC message's age reaches the high water mark, further message's with an age above the low water mark are discarded, too. This is aborted, if a GMM, a non-UI, or a small message is detected. In these cases, that message is kept. The following VTY commands are added (pcu config node): - queue hysteresis <1-65535> set the difference between high (lifetime) and low watermark in centiseconds - no queue hysteresis disable this feature (default) Since the SGSN will most probably send all fragments of a single N-PDU without much delay between them, a value slightly above the average transmission delay jitter between SGSN and PCU is probably a sensible value to discard all fragments of a single IP packet. This is an experimental feature that might be replaced by more advanced means of active queue management in the future. Sponsored-by: On-Waves ehf
2015-03-20llc: Add put_dummy_frame to create an LLC dummy commandJacob Erlbeck1-0/+1
The LLC dummy command is needed for RLC block stuffing, e.g. when a TBF should be kept open if no LLC data is available. The RLC block headers do not support stuffing, only the last block of a TBF can be used partially. LLC dummy commands are discarded by the receiver immediately, because the have an invalid FCS checksum. This commit adds the function put_dummy_frame, which puts a LLC dummy command into the frame buffer. The requested length is given as an argument, but the real length might be adjusted according to the specification (see GSM 44.064, 6.4.2.2). Sponsored-by: On-Waves ehf
2013-12-25llc: Calculate the average queuing delay of the LLC queuesDaniel Willmann1-0/+1
Use a formula like it is used with TCP. This can help to make decisions about if frames should be dropped or not at the time we enqueue them. This code will store two timeval structs in fron the of the actual data and compute the average at the time of the dequeue.
2013-12-18llc: Count the number of frames queued inside the LLC queueHolger Hans Peter Freyther1-0/+2
2013-11-21types: Add a simple testcase for basic types and fix the LLC codeHolger Hans Peter Freyther1-2/+2
* Make append_data, remaining_space and fits_in_current.. work on m_length and not the index. This ways things can't overflow. * The current API consumer was moving the m_index so it should have worked okay.
2013-11-13llc: Move the decision if a frame has expired into the LLCHolger Hans Peter Freyther1-0/+1
This way the generation of the expiry information and the check is at the same place. This should make reading the code more easy.
2013-11-13llc: Make the index 'private' by appending a m_ to it.Holger Hans Peter Freyther1-7/+7
At some point in the future we can start using the private/protected keywords in this struct.
2013-11-13llc: Move some more secrets from the TBF into the LLCHolger Hans Peter Freyther1-2/+29
Introduce a method to append data to a TBF and then reset the read pointer when the frame has been sent.
2013-11-13llc: Move the timeout calculation into the TBFHolger Hans Peter Freyther1-0/+2
2013-11-13llc: Remove one of the two variants to put data into the frameHolger Hans Peter Freyther1-1/+0
2013-11-07llc: Move all direct accesses to the frame into the llc structureHolger Hans Peter Freyther1-0/+15
Add some todo items where we could add assertions now that I see the constraints and invariants of this code.
2013-11-07llc: Move the llc structure to a new header fileHolger Hans Peter Freyther1-0/+45