Using this code, we can run a TTCN3 test using NS_Emulation in
IP-SNS mode. It only covers the most basic cases but works for simple
scenarios.
Change-Id: Id1fb0fcb7a497a9614e82beb8a2c64b5af88150d
We used to have no distinction between endpoints and NSVCs, meaning
that we could not have more than one NSVC per endpoint, which in turn
meant it was ok to iterate the list of NSVCs for generating the
endpoint lists in the SNS-CONFIG payload.
With Change-Id I05a50b966b8ce93497372ca403d40fd383dd35f7 we remove that
constraint and introduce an actual local IP endpoint list. Let's use
that one for SNS-CONFIG.
Change-Id: Ifa91510430a017fa29592a3d5fa2a3697d29c9da
Thew newly-introduced "endpoint" mode of NS_Provider_IPL4 allows us
to have multiple NS-VC within one endpoint. NS_CT takes care of
creating the NS_Provider_IPL4 components on-the-fly, and then
associating the per-NSVC components with it.
For the user nothing changes, other than that he can now configure
multiple NSVCs with identical local IP + port, which was not possible
before.
Change-Id: Id7360f17e528706e8145d33a14550789d50cded9
We need to modify the state of each NS-VC within a NS-VCG/NSE once
we receive the final SNS-CONFIG-ACK PDU. However, sometimes the
IUT sends its first NS-PDU _before_ we even have communicated the
state-change locally to all our NS-VCs.
In order to avoid the problem, let's mark the NS-VCs as alive before
sending the the SNS-CONFIG. This means we have one RTT more time
to locally propagate the state change to all NS-VCs.
Change-Id: Idac522a81f01553df52dc012cbab15e1c73c0862
Closes: OS#5023
This is a new altstep which groups all handling of NsStatusInd.
Right now it's only used from one place, but upcoming patches
will re-use it elsewhere.
Change-Id: I4e8e7d19c764cc977beb84a6859c9ce73518b653
Sometimes we run into situations where the g_unblocked_nsvcs_* is
exceeding the number of NSVCs we have in g_nsvcs. This can only happen
as we blindly append integers to the ro_integer fields, rather than
checking if they are already contained.
Let's factor out the add_unique and del functions (in Osmocom_Types)
and use them from NS_Emulation.
Change-Id: Ib3273d6ce9b80f700c964d578fdb0f268eac6a14
We don't need several re-definitions of a "record of integer" type,
plus associated helper functions. Let's move that to the shared
Osmocom_Types.ttcn
Change-Id: I6a68ab8180a40b93c540db9cb80941c39c2fb549
This happens e.g. if FrameRelay detects a "service affecting condition",
i.e. the link is considered dead.
Change-Id: I7409079f5e2b77cc08ccc93d1b0baa72720cefb8
This feature is useful in simulating intermittent or permanent transport network
outage by simply halting processing of all rx+tx in the specified NS-VC
until it is administratively re-enabled.
Change-Id: I742ecf01de15e3edbf0719371f0217a5739b7c8e
RelateD: OS#4521
* allow configuration of signalling + data weight for each NS-VC
* advertise per-NSVC signalling/data weight in SNS-CONFIG
* keep track of unblocked NS-VCS separately for data / signalling
* transmit BVCI=0 traffic only over signalling NS-VC
* transmit BVCI>0 traffic only over data NS-VC
* accept incoming BVCI=0 traffic only if signalling_weight > 0
* accept incoming BVCI>0 traffic only if data_weight > 0
Related: OS#4953
Change-Id: I9798e639b4bc8658482945970775b012b5840779
We need to move the IP-SNS handling up one layer, as only the NS-VCG
knows all the other NS-VCs, and after the SNS-CONFIG-ACK, we must
mark all of our NS-VCs as alive and start the alive procedure.
Related: OS#4953
Change-Id: Ie0f4342a0346952d7c50ac36900148e311d4c782
The emulation of an SGSN with SNS was incomplete. The SNS
procedure was completed. However the NSVCs didn't moved
into an unblocked state.
Also sending a NS_ALIVE at the beginning is wrong.
Change-Id: I54c2d9d5b34d791be354298171d04180a9b263c3
Particularly in case both sides initiate a BLOCK or UNBLOCK procedure
at almost the same time, it can happen thet we're already in BLOCKED
state and receive a late BLOCK-ACK or in UNBLOCKED state and receive a
late UNBLOCK-ACK.
Let's just silently discard them instaed of generating NS-STATUS which
may confuse the peer.
Change-Id: I2e5b934e1cf6c6cf982d5ab1dbb32e8920b91071
The primitive normally only contains NSE + BVCI, but in a tester
we actually want to verify which NS-VC a given message has arrived on,
and hence it makes sense to add the NSVCI, too.
Change-Id: I9402bf0be47e5b93c9cfb081eb8f9fa6734c9227
This took me quite some time: Tried to use NS_PROVIDER_FR, but the
code was compiled without support for it. It just failed silently
without printing any error or ever sending any message on the FR link.
Change-Id: I96475127a2079830b3456a8e288adf4c6c908887
The Load Sharing Function distributes traffic among all unblocked NS-VC
within a NS-VCG. The sharing is done based on a LSP (Link Selector
Parameter) which is passed with the NS-UNITDATA.req primitive from BSSGP
to NS. Details are implementation specific, but NS must ensure that all
traffic of one LSP is always sent through the same NS-VC, as long as
that NS-VC is alive/unblocked.
We use the LSP as follows:
* Signaling BVC always only uses lsp 0
* PTP BVC messages unrelated to user straffic use a per-BVC static LSP,
which is the BVCI
* User traffic can set whatever LSP it wants
* NS keeps an array of NSVCs currently unblocked and uses the LSP modulo
the array size as an index into it
Change-Id: I8b960ec4d729f50cadca353bb52685311cd45eed
Related: SYS#5084
In case of a NS-VCG with multiple NS-VC, we must BVC-RESET only when the
first NS-VC becomes unblocked, i.e. as soon as we have any connection
to the peer at all. Whether we have further additional links doesn't
matter, at least not in the sense that all state should be reset.
Change-Id: I69b2e9bd919fc981f189b6671b4234c3642e2449
This is something we need to simulate more complex scenarios,
particularly in the context of frame relay.
Change-Id: If1220852785853f8a5d8de183d5053ddd6ccb958
If IP-SNS is not used we should wait for the RESET procedure to finish
before sending NS-ALIVE.
For IP-SNS start NS-ALIVE in both roles (sgsn and bss) and don't handle
NS-RESET.
Also unified the log messages a bit (received -> Rx).
Related: SYS#5002
Change-Id: Ie01fee70297255b3d9c091bc2cec75b0f915c588
We want to see useful identification for components in the log, and
hence must be giving every component a name at create() time.
Change-Id: I0fe650243953e4d85161684865acd0354b2e465f
This makes for much more readable code, and we can even do without
activating any default altsteps.
Change-Id: I4c38dd55b7c27899735f5730851d36c1410d96a8
This allows NS_Emulation to react to changes of the underlying
transport layer (e.g. Frame Relay Link/DLCI up).
Change-Id: If00e9c50dc664ce62b6c0cbde99d741e8173169b
This adds a NS_Provider_FR which interfaces between FrameRelay_Emulation
and NS_Emulation. Include support for it only if enabled at compile
time to avoid pulling in a dependency on the FrameRelay stack for every
user of NS_Emulation.
Change-Id: I42ca811d23e383e362d2527c8ff2c916a62a5b42