Commit 7c3edf90 authored by Gary Wong's avatar Gary Wong

Document the geni.rspec.pnext module.

parent 473151eb
Pipeline #1550 passed with stage
#!/usr/bin/python
"""
An example of a minimal OpenEPC profile.
Instructions:
Five nodes will be instantiated by this profile: three packet core
nodes, and two emulated RAN nodes (one eNodeB and one UE). Please
refer to the OpenEPC documentation for instructions on how to
operate OpenEPC.
"""
import geni.portal
import geni.rspec.pg
import geni.rspec.pnext as PN
pc = geni.portal.Context()
rspec = geni.rspec.pg.Request()
PN.EPCNode.bindRSpec( rspec )
PN.EPClan.bindRSpec( rspec )
epcen = PN.EPCNode( "epc", PN.EPCROLES.ENABLERS )
PN.EPClan.addToLAN( PN.EPCLANS.NET_A, epcen )
pgw = PN.EPCNode( "pgw", PN.EPCROLES.PGW )
PN.EPClan.addToLAN( PN.EPCLANS.NET_A, pgw )
PN.EPClan.addToLAN( PN.EPCLANS.NET_B, pgw )
sgw = PN.EPCNode( "sgw", PN.EPCROLES.SGW_MME_SGSN )
PN.EPClan.addToLAN( PN.EPCLANS.NET_B, sgw )
PN.EPClan.addToLAN( PN.EPCLANS.NET_D, sgw )
enodeb = PN.EPCNode( "enodeb", PN.EPCROLES.ENODEB )
PN.EPClan.addToLAN( PN.EPCLANS.NET_D, enodeb )
PN.EPClan.addToLAN( PN.EPCLANS.AN_LTE, enodeb )
ue = PN.EPCNode( "ue", PN.EPCROLES.CLIENT )
PN.EPClan.addToLAN( PN.EPCLANS.AN_LTE, ue )
pc.printRequestRSpec( rspec )
......@@ -160,6 +160,69 @@ In each case, an @tt{IPv4Address} object is obtained from the appropriate
constructor (the parameters are the address and the netmask, respectively),
and then added to the corresponding interface.
@pnet-only{
@section[#:tag "geni-lib-openepc"]{OpenEPC extensions}
@tt{geni-lib} includes convenience functions to assist constructing
profiles including OpenEPC core networks. Although it is possible
to instantiate OpenEPC using @tt{geni-lib} primitives only, the
@tt{geni.rspec.pnext} module hides some of the OpenEPC details, and
allows more concise profile scripts. An example of a profile
using @tt{pnext} is given below.
@code-sample["oepc.py"]
While the @tt{geni.portal} and @tt{geni.rspec.pg} modules will seem
familiar from their use in general @tt{geni-lib} profiles, the
@tt{pnext} module is new, and provides two main classes: @tt{EPCNode}
and @tt{EPClan}. These convenience classes provide facilities for
adding OpenEPC nodes and networks, respectively. Before either one
is used, it must be @italic{bound} to the RSpec under construction,
using the @tt{EPCNode.bindRSpec} or @tt{EPClan.bindRSpec} call as
appropriate.
Once bound, OpenEPC nodes can be requested as necessary, with the
@tt{EPCNode} constructor. This call has two mandatory parameters:
the node identifier (just as seen in previous generic @tt{geni-lib}
examples), and a new @italic{role}, specific to OpenEPC nodes.
The role must be chosen from the following, each defined within
@tt{geni.rspec.pnext.EPCROLES}:
@(tabular #:style 'boxed #:sep (hspace 3) (list
(list "ENABLERS")
(list "PGW")
(list "SGW_MME_SGSN")
(list "CLIENT")
(list "ENODEB")))
Please consult the
@hyperlink["https://wiki.phantomnet.org/wiki/phantomnet/openepc-general-information"]{OpenEPC documentation}
for details about specific OpenEPC nodes.
Once nodes are assigned, they should be connected with appropriate
core network links. This is the job of the @tt{EPClan} class, and
in particular the @tt{EPClan.addToLAN} call. It requires two
parameters: the first is the network identifier (chosen from the
list below), and the second is the node object (as returned by
@tt{EPCNode}).
@(tabular #:style 'boxed #:sep (hspace 3) (list
(list "NET_A")
(list "NET_B")
(list "NET_C")
(list "NET_D")
(list "AN_LTE")))
The
@hyperlink["https://wiki.phantomnet.org/wiki/phantomnet/oepc-protected/openepc-tutorial-profile"]{OpenEPC Tutorial}
gives an overview of the purpose and topology of each network.
Please note that in addition to the above five networks, a
@tt{MGMT} network is also available; however, all nodes are automatically
connected to the management network over a dedicated interface, and
no explicit @tt{addToLAN} call is required.
}
@section[#:tag "geni-lib-example-os-install-scripts"]{Specify an operating system and set install and execute scripts}
@code-sample["geni-lib-os-install-scripts.py"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment