This document describes design decisions that went into implementing Open vSwitch. While we believe these to be reasonable decisions, it is impossible to predict how Open vSwitch will be used in all environments. Understanding assumptions made by Open vSwitch is critical to a successful deployment. The end of this document contains contact information that can be used to let us know how we can make Open vSwitch more generally useful.
Over time, Open vSwitch has added many knobs that control whether a given controller receives OpenFlow asynchronous messages. This section describes how all of these features interact.
First, a service controller never receives any asynchronous messages unless it changes its misssendlen from the service controller default of zero in one of the following ways:
Sending an OFPTSETCONFIG message with nonzero misssendlen.
Sending any NXTSETASYNCCONFIG message: as a side effect, this message changes the misssendlen to OFPDEFAULTMISSSEND_LEN (128) for service controllers.
Second, OFPTFLOWREMOVED and NXTFLOWREMOVED messages are generated only if the flow that was removed had the OFPFFSENDFLOW_REM flag set.
Third, OFPTPACKETIN and NXTPACKETIN messages are sent only to OpenFlow controller connections that have the correct connection ID (see "struct nxcontrollerid" and "struct nxactioncontroller"):
For packet-in messages generated by a NXAST_CONTROLLER action, the controller ID specified in the action.
For other packet-in messages, controller ID zero. (This is the default ID when an OpenFlow controller does not configure one.)
Finally, Open vSwitch consults a per-connection table indexed by the message type, reason code, and current role. The following table shows how this table is initialized by default when an OpenFlow connection is made. An entry labeled "yes" means that the message is sent, an entry labeled "---" means that the message is suppressed.
``` master/ message and reason code other slave ---------------------------------------- ------- ----- OFPTPACKETIN / NXTPACKETIN OFPRNOMATCH yes --- OFPRACTION yes --- OFPRINVALIDTTL --- --- OFPRACTIONSET (OF1.4+) yes --- OFPRGROUP (OF1.4+) yes ---
OFPTFLOWREMOVED / NXTFLOWREMOVED OFPRRIDLETIMEOUT yes --- OFPRRHARDTIMEOUT yes --- OFPRRDELETE yes --- OFPRRGROUPDELETE (OF1.4+) yes --- OFPRRMETERDELETE (OF1.4+) yes --- OFPRREVICTION (OF1.4+) yes ---
OFPTPORTSTATUS OFPPRADD yes yes OFPPRDELETE yes yes OFPPR_MODIFY yes yes
OFPTROLEREQUEST / OFPTROLEREPLY (OF1.4+) OFPCRRMASTERREQUEST --- --- OFPCRRCONFIG --- --- OFPCRREXPERIMENTER --- ---
OFPTTABLESTATUS (OF1.4+) OFPTRVACANCYDOWN --- --- OFPTRVACANCYUP --- ---
OFPTREQUESTFORWARD (OF1.4+) OFPRFRGROUPMOD --- --- OFPRFRMETER_MOD --- --- ```
The NXTSETASYNCCONFIG message directly sets all of the values in this table for the current connection. The OFPCINVALIDTTLTOCONTROLLER bit in the OFPTSETCONFIG message controls the setting for OFPRINVALID_TTL for the "master" role.
The OpenFlow 1.0 specification requires the output port of the OFPATENQUEUE action to "refer to a valid physical port (i.e. < OFPPMAX) or OFPPINPORT". Although OFPPLOCAL is not less than OFPPMAX, it is an 'internal' port which can have QoS applied to it in Linux. Since we allow the OFPATENQUEUE to apply to 'internal' ports whose port numbers are less than OFPPMAX, we interpret OFPPLOCAL as a physical port and support OFPATENQUEUE on it as well.
The OpenFlow specification for the behavior of OFPTFLOWMOD is confusing. The following tables summarize the Open vSwitch implementation of its behavior in the following categories:
"match on priority": Whether the flowmod acts only on flows whose priority matches that included in the flowmod message.
"match on outport": Whether the flowmod acts only on flows that output to the outport included in the flowmod message (if outport is not OFPPNONE). OpenFlow 1.1 and later have a similar feature (not listed separately here) for out_group.
"match on flowcookie": Whether the flowmod acts only on flows whose flow_cookie matches an optional controller-specified value and mask.
"updates flowcookie": Whether the flowmod changes the flowcookie of the flow or flows that it matches to the flowcookie included in the flow_mod message.
"updates OFPFF_ flags": Whether the flowmod changes the OFPFFSENDFLOWREM flag of the flow or flows that it matches to the setting included in the flags of the flow_mod message.
"honors OFPFFCHECKOVERLAP": Whether the OFPFFCHECKOVERLAP flag in the flow_mod is significant.
"updates idletimeout" and "updates hardtimeout": Whether the idletimeout and hardtimeout in the flowmod, respectively, have an effect on the flow or flows matched by the flowmod.
"updates idle timer": Whether the flow_mod resets the per-flow timer that measures how long a flow has been idle.
"updates hard timer": Whether the flow_mod resets the per-flow timer that measures how long it has been since a flow was modified.
"zeros counters": Whether the flow_mod resets per-flow packet and byte counters to zero.
"may add a new flow": Whether the flow_mod may add a new flow to the flow table. (Obviously this is always true for "add" commands but in some OpenFlow versions "modify" and "modify-strict" can also add new flows.)
"sends flowremoved message": Whether the flowmod generates a flow_removed message for the flow or flows that it affects.
An entry labeled "yes" means that the flow mod type does have the indicated behavior, "---" means that it does not, an empty cell means that the property is not applicable, and other values are explained below the table.
``` MODIFY DELETE ADD MODIFY STRICT DELETE STRICT === ====== ====== ====== ====== match on priority yes --- yes --- yes match on outport --- --- --- yes yes match on flowcookie --- --- --- --- --- match on tableid --- --- --- --- --- controller chooses tableid --- --- --- updates flowcookie yes yes yes updates OFPFFSENDFLOWREM yes + + honors OFPFFCHECKOVERLAP yes + + updates idletimeout yes + + updates hardtimeout yes + + resets idle timer yes + + resets hard timer yes yes yes zeros counters yes + + may add a new flow yes yes yes sends flow_removed message --- --- --- % %
(+) "modify" and "modify-strict" only take these actions when they create a new flow, not when they update an existing flow.
(%) "delete" and "deletestrict" generates a flowremoved message if the deleted flow or flows have the OFPFFSENDFLOW_REM flag set. (Each controller can separately control whether it wants to receive the generated messages.) ```
OpenFlow 1.1 makes these changes:
The controller now must specify the tableid of the flow match searched and into which a flow may be inserted. Behavior for a tableid of 255 is undefined.
A flowmod, except an "add", can now match on the flowcookie.
When a flowmod matches on the flowcookie, "modify" and "modify-strict" never insert a new flow.
``` MODIFY DELETE ADD MODIFY STRICT DELETE STRICT === ====== ====== ====== ====== match on priority yes --- yes --- yes match on outport --- --- --- yes yes match on flowcookie --- yes yes yes yes match on tableid yes yes yes yes yes controller chooses tableid yes yes yes updates flowcookie yes --- --- updates OFPFFSENDFLOWREM yes + + honors OFPFFCHECKOVERLAP yes + + updates idletimeout yes + + updates hardtimeout yes + + resets idle timer yes + + resets hard timer yes yes yes zeros counters yes + + may add a new flow yes # # sends flow_removed message --- --- --- % %
(+) "modify" and "modify-strict" only take these actions when they create a new flow, not when they update an existing flow.
(%) "delete" and "deletestrict" generates a flowremoved message if the deleted flow or flows have the OFPFFSENDFLOW_REM flag set. (Each controller can separately control whether it wants to receive the generated messages.)
(#) "modify" and "modify-strict" only add a new flow if the flow_mod does not match on any bits of the flow cookie ```
OpenFlow 1.2 makes these changes:
Only "add" commands ever add flows, "modify" and "modify-strict" never do.
A new flag OFPFFRESETCOUNTS now controls whether "modify" and "modify-strict" reset counters, whereas previously they never reset counters (except when they inserted a new flow).
``` MODIFY DELETE ADD MODIFY STRICT DELETE STRICT === ====== ====== ====== ====== match on priority yes --- yes --- yes match on outport --- --- --- yes yes match on flowcookie --- yes yes yes yes match on tableid yes yes yes yes yes controller chooses tableid yes yes yes updates flowcookie yes --- --- updates OFPFFSENDFLOWREM yes --- --- honors OFPFFCHECKOVERLAP yes --- --- updates idletimeout yes --- --- updates hardtimeout yes --- --- resets idle timer yes --- --- resets hard timer yes yes yes zeros counters yes & & may add a new flow yes --- --- sends flow_removed message --- --- --- % %
(%) "delete" and "deletestrict" generates a flowremoved message if the deleted flow or flows have the OFPFFSENDFLOW_REM flag set. (Each controller can separately control whether it wants to receive the generated messages.)
(&) "modify" and "modify-strict" reset counters if the OFPFFRESETCOUNTS flag is specified. ```
OpenFlow 1.3 makes these changes:
Behavior for a tableid of 255 is now defined, for "delete" and "delete-strict" commands, as meaning to delete from all tables. A tableid of 255 is now explicitly invalid for other commands.
New flags OFPFFNOPKTCOUNTS and OFPFFNOBYTCOUNTS for "add" operations.
The table for 1.3 is the same as the one shown above for 1.2.
OpenFlow 1.4 makes these changes:
Adds the "importance" field to flowmods, but it does not explicitly specify which kinds of flowmods set the importance. For consistency, Open vSwitch uses the same rule for importance as for idletimeout and hardtimeout, that is, only an "ADD" flow_mod sets the importance. (This issue has been filed with the ONF as EXT-496.)
Eviction Mechanism to automatically delete entries of lower importance to make space for newer entries.
Open vSwitch makes all flow table modifications atomically, i.e., any datapath packet only sees flow table configurations either before or after any change made by any flowmod. For example, if a controller removes all flows with a single OpenFlow "flowmod", no packet sees an intermediate version of the OpenFlow pipeline where only some of the flows have been deleted.
It should be noted that Open vSwitch caches datapath flows, and that the cached flows are NOT flushed immediately when a flow table changes. Instead, the datapath flows are revalidated against the new flow table as soon as possible, and usually within one second of the modification. This design amortizes the cost of datapath cache flushing across multiple flow table changes, and has a significant performance effect during simultaneous heavy flow table churn and high traffic load. This means that different cached datapath flows may have been computed based on a different flow table configurations, but each of the datapath flows is guaranteed to have been computed over a coherent view of the flow tables, as described above.
With OpenFlow 1.4 bundles this atomicity can be extended across an arbitrary set of flowmods. Bundles are supported for flowmod and portmod messages only. For flowmods, both 'atomic' and 'ordered' bundle flags are trivially supported, as all bundled messages are executed in the order they were added and all flow table modifications are now atomic to the datapath. Port mods may not appear in atomic bundles, as port status modifications are not atomic.
To support bundles, ovs-ofctl has a '--bundle' option that makes the flow mod commands ('add-flow', 'add-flows', 'mod-flows', 'del-flows', and 'replace-flows') use an OpenFlow 1.4 bundle to operate the modifications as a single atomic transaction. If any of the flow mods in a transaction fail, none of them are executed. All flow mods in a bundle appear to datapath lookups simultaneously.
Furthermore, ovs-ofctl 'add-flow' and 'add-flows' commands now accept arbitrary flow mods as an input by allowing the flow specification to start with an explicit 'add', 'modify', 'modifystrict', 'delete', or 'deletestrict' keyword. A missing keyword is treated as 'add', so this is fully backwards compatible. With the new '--bundle' option all the flow mods are executed as a single atomic transaction using an OpenFlow 1.4 bundle. Without the '--bundle' option the flow mods are executed in order up to the first failing flowmod, and in case of an error the earlier successful flowmods are not rolled back.
The OpenFlow 1.1 specification for OFPTPACKETIN is confusing. The definition in OF1.1 openflow.h is[*]:
/* Packet received on port (datapath -> controller). */
struct ofp_packet_in {
struct ofp_header header;
uint32_t buffer_id; /* ID assigned by datapath. */
uint32_t in_port; /* Port on which frame was received. */
uint32_t in_phy_port; /* Physical Port on which frame was received. */
uint16_t total_len; /* Full length of frame. */
uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */
uint8_t table_id; /* ID of the table that was looked up */
uint8_t data[0]; /* Ethernet frame, halfway through 32-bit word,
so the IP header is 32-bit aligned. The
amount of data is inferred from the length
field in the header. Because of padding,
offsetof(struct ofp_packet_in, data) ==
sizeof(struct ofp_packet_in) - 2. */
};
OFP_ASSERT(sizeof(struct ofp_packet_in) == 24);
The confusing part is the comment on the data[] member. This comment is a leftover from OF1.0 openflow.h, in which the comment was correct: sizeof(struct ofppacketin) is 20 in OF1.0 and offsetof(struct ofppacketin, data) is 18. When OF1.1 was written, the structure members were changed but the comment was carelessly not updated, and the comment became wrong: sizeof(struct ofppacketin) and offsetof(struct ofppacketin, data) are both 24 in OF1.1.
That leaves the question of how to implement ofppacketin in OF1.1. The OpenFlow reference implementation for OF1.1 does not include any padding, that is, the first byte of the encapsulated frame immediately follows the 'table_id' member without a gap. Open vSwitch therefore implements it the same way for compatibility.
For an earlier discussion, please see the thread archived at: https://mailman.stanford.edu/pipermail/openflow-discuss/2011-August/002604.html
[*] The quoted definition is directly from OF1.1. Definitions used inside OVS omit the 8-byte ofp_header members, so the sizes in this discussion are 8 bytes larger than those declared in OVS header files.
The 802.1Q VLAN header causes more trouble than any other 4 bytes in networking. More specifically, three versions of OpenFlow and Open vSwitch have among them four different ways to match the contents and presence of the VLAN header. The following table describes how each version works.
Match NXM OF1.0 OF1.1 OF1.2
----- --------- ----------- ----------- ------------
[1] 0000/0000 ????/1,??/? ????/1,??/? 0000/0000,--
[2] 0000/ffff ffff/0,??/? ffff/0,??/? 0000/ffff,--
[3] 1xxx/1fff 0xxx/0,??/1 0xxx/0,??/1 1xxx/ffff,--
[4] z000/f000 ????/1,0y/0 fffe/0,0y/0 1000/1000,0y
[5] zxxx/ffff 0xxx/0,0y/0 0xxx/0,0y/0 1xxx/ffff,0y
[6] 0000/0fff <none> <none> <none>
[7] 0000/f000 <none> <none> <none>
[8] 0000/efff <none> <none> <none>
[9] 1001/1001 <none> <none> 1001/1001,--
[10] 3000/3000 <none> <none> <none>
Each column is interpreted as follows.
Match: See the list below.
NXM: xxxx/yyyy means NXMOFVLANTCIW with value xxxx and mask yyyy. A mask of 0000 is equivalent to omitting NXMOFVLANTCI(W), a mask of ffff is equivalent to NXMOFVLAN_TCI.
OF1.0 and OF1.1: wwww/x,yy/z means dlvlan wwww, OFPFWDLVLAN x,
dlvlanpcp yy, and OFPFWDLVLANPCP z. If OFPFWDLVLAN or
OFPFWDLVLAN_PCP is 1, the corresponding field value is
wildcarded, otherwise it is matched. ? means that the given bits
are ignored (their conventional values are 0000/x,00/0 in OF1.0,
0000/x,00/1 in OF1.1; x is never ignored).
OF1.2: xxxx/yyyy,zz means OXMOFVLANVIDW with value xxxx and
mask yyyy, and OXMOFVLANPCP (which is not maskable) with
value zz. A mask of 0000 is equivalent to omitting
OXMOFVLANVID(W), a mask of ffff is equivalent to
OXMOFVLANVID. -- means that OXMOFVLAN_PCP is omitted.
The matches are:
[1] Matches any packet, that is, one without an 802.1Q header or with an 802.1Q header with any TCI value.
[2] Matches only packets without an 802.1Q header.
NXM: Any match with (vlan_tci == 0) and (vlan_tci_mask & 0x1000)
!= 0 is equivalent to the one listed in the table.
OF1.0: The spec doesn't define behavior if dl_vlan is set to
0xffff and OFPFW_DL_VLAN_PCP is not set.
OF1.1: The spec says explicitly to ignore dl_vlan_pcp when
dl_vlan is set to 0xffff.
OF1.2: The spec doesn't say what should happen if (vlan_vid == 0)
and (vlan_vid_mask & 0x1000) != 0 but (vlan_vid_mask != 0x1000),
but it would be straightforward to also interpret as [2].
[3] Matches only packets that have an 802.1Q header with VID xxx (and any PCP).
[4] Matches only packets that have an 802.1Q header with PCP y (and any VID).
NXM: z is ((y << 1) | 1).
OF1.0: The spec isn't very clear, but OVS implements it this way.
OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff)
== 0x1000 would also work, but the spec doesn't define their
behavior.
[5] Matches only packets that have an 802.1Q header with VID xxx and PCP y.
NXM: z is ((y << 1) | 1).
OF1.2: Presumably other masks such that (vlan_vid_mask & 0x1fff)
== 0x1fff would also work.
[6] Matches packets with no 802.1Q header or with an 802.1Q header with a VID of 0. Only possible with NXM.
[7] Matches packets with no 802.1Q header or with an 802.1Q header with a PCP of 0. Only possible with NXM.
[8] Matches packets with no 802.1Q header or with an 802.1Q header with both VID and PCP of 0. Only possible with NXM.
[9] Matches only packets that have an 802.1Q header with an odd-numbered VID (and any PCP). Only possible with NXM and OF1.2. (This is just an example; one can match on any desired VID bit pattern.)
[10] Matches only packets that have an 802.1Q header with an odd-numbered PCP (and any VID). Only possible with NXM. (This is just an example; one can match on any desired VID bit pattern.)
Additional notes:
OpenFlow 1.0 and later versions have the concept of a "flow cookie", which is a 64-bit integer value attached to each flow. The treatment of the flow cookie has varied greatly across OpenFlow versions, however.
In OpenFlow 1.0:
OFPFC_ADD set the cookie in the flow that it added.
OFPFCMODIFY and OFPFCMODIFY_STRICT updated the cookie for the flow or flows that it modified.
OFPST_FLOW messages included the flow cookie.
OFPTFLOWREMOVED messages reported the cookie of the flow that was removed.
OpenFlow 1.1 made the following changes:
Flow mod operations OFPFCMODIFY, OFPFCMODIFYSTRICT, OFPFCDELETE, and OFPFCDELETESTRICT, plus flow stats requests and aggregate stats requests, gained the ability to match on flow cookies with an arbitrary mask.
OFPFCMODIFY and OFPFCMODIFY_STRICT were changed to add a new flow, in the case of no match, only if the flow table modification operation did not match on the cookie field. (In OpenFlow 1.0, modify operations always added a new flow when there was no match.)
OFPFCMODIFY and OFPFCMODIFY_STRICT no longer updated flow cookies.
OpenFlow 1.2 made the following changes:
Open vSwitch support for OpenFlow 1.0 implements the OpenFlow 1.0 behavior with the following extensions:
An NXM extension field NXMNXCOOKIE(W) allows the NXM versions of OFPFCMODIFY, OFPFCMODIFYSTRICT, OFPFCDELETE, and OFPFCDELETESTRICT flowmods, plus flow stats requests and aggregate stats requests, to match on flow cookies with arbitrary masks. This is much like the equivalent OpenFlow 1.1 feature.
Like OpenFlow 1.1, OFPCMODIFY and OFPFCMODIFY_STRICT add a new flow if there is no match and the mask is zero (or not given).
The "cookie" field in OFPTFLOWMOD and NXTFLOWMOD messages is used as the cookie value for OFPFCADD commands, as described in OpenFlow 1.0. For OFPFCMODIFY and OFPFCMODIFYSTRICT commands, the "cookie" field is used as a new cookie for flows that match unless it is UINT64_MAX, in which case the flow's cookie is not updated.
NXTPACKETIN (the Nicira extended version of OFPTPACKETIN) reports the cookie of the rule that generated the packet, or all-1-bits if no rule generated the packet. (Older versions of OVS used all-0-bits instead of all-1-bits.)
The following table shows the handling of different protocols when receiving OFPFCMODIFY and OFPFCMODIFYSTRICT messages. A mask of 0 indicates either an explicit mask of zero or an implicit one by not specifying the NXMNXCOOKIE(W) field.
```
Match Update Add on miss Add on miss
cookie cookie mask!=0 mask==0
====== ====== =========== ===========
OpenFlow 1.0 no yes
OpenFlow 1.0 has only rudimentary support for multiple flow tables. Notably, OpenFlow 1.0 does not allow the controller to specify the flow table to which a flow is to be added. Open vSwitch adds an extension for this purpose, which is enabled on a per-OpenFlow connection basis using the NXTFLOWMODTABLEID message. When the extension is enabled, the upper 8 bits of the 'command' member in an OFPTFLOWMOD or NXTFLOWMOD message designates the table to which a flow is to be added.
The Open vSwitch software switch implementation offers 255 flow tables. On packet ingress, only the first flow table (table 0) is searched, and the contents of the remaining tables are not considered in any way. Tables other than table 0 only come into play when an NXASTRESUBMITTABLE action specifies another table to search.
Tables 128 and above are reserved for use by the switch itself. Controllers should use only tables 0 through 127.
This section covers the history of the OFPTC_* table configuration bits across OpenFlow versions.
OpenFlow 1.0 flow tables had fixed configurations.
OpenFlow 1.1 enabled controllers to configure behavior upon flow table miss and added the OFPTCMISS* constants for that purpose. OFPTC* did not control anything else but it was nevertheless conceptualized as a set of bit-fields instead of an enum. OF1.1 added the OFPTTABLEMOD message to set OFPTCMISS* for a flow table and added the 'config' field to the OFPSTTABLE reply to report the current setting.
OpenFlow 1.2 did not change anything in this regard.
OpenFlow 1.3 switched to another means to changing flow table miss behavior and deprecated OFPTCMISS* without adding any more OFPTC* constants. This meant that OFPTTABLEMOD now had no purpose at all, but OF1.3 kept it around "for backward compatibility with older and newer versions of the specification." At the same time, OF1.3 introduced a new message OFPMPTABLEFEATURES that included a field 'config' documented as reporting the OFPTC* values set with OFPTTABLEMOD; of course this served no real purpose because no OFPTC* values are defined. OF1.3 did remove the OFPTC* field from OFPMPTABLE (previously named OFPSTTABLE).
OpenFlow 1.4 defined two new OFPTC* constants, OFPTCEVICTION and OFPTCVACANCYEVENTS, using bits that did not overlap with OFPTCMISS* even though those bits had not been defined since OF1.2. OFPTTABLEMOD still controlled these settings. The field for OFPTC* values in OFPMPTABLEFEATURES was renamed from 'config' to 'capabilities' and documented as reporting the flags that are supported in a OFPTTABLEMOD message. The OFPMPTABLEDESC message newly added in OF1.4 reported the OFPTC* setting.
OpenFlow 1.5 did not change anything in this regard.
The following table summarizes. The columns say:
OpenFlow version(s).
The OFPTC_* flags defined in those versions.
Whether OFPTTABLEMOD can modify OFPTC_* flags.
Whether OFPSTTABLE/OFPMPTABLE reports the OFPTC_* flags.
What OFPMPTABLEFEATURES reports (if it exists): either the current configuration or the switch's capabilities.
Whether OFPMPTABLEDESC reports the current configuration.
OpenFlow OFPTC* flags TABLEMOD stats? TABLEFEATURES TABLEDESC
OF1.0 none no[][+] no[] nothing[][+] no[][+] OF1.1/1.2 MISS* yes yes nothing[+] no[+] OF1.3 none yes[*] no[*] config[*] no[*][+] OF1.4/1.5 EVICTION/VACANCYEVENTS yes no capabilities yes
[*] Nothing to report/change anyway.
[+] No such message.
Open vSwitch supports stateless handling of IPv6 packets. Flows can be written to support matching TCP, UDP, and ICMPv6 headers within an IPv6 packet. Deeper matching of some Neighbor Discovery messages is also supported.
IPv6 was not designed to interact well with middle-boxes. This, combined with Open vSwitch's stateless nature, have affected the processing of IPv6 traffic, which is detailed below.
The base IPv6 header is incredibly simple with the intention of only containing information relevant for routing packets between two endpoints. IPv6 relies heavily on the use of extension headers to provide any other functionality. Unfortunately, the extension headers were designed in such a way that it is impossible to move to the next header (including the layer-4 payload) unless the current header is understood.
Open vSwitch will process the following extension headers and continue to the next header:
When a header is encountered that is not in that list, it is considered "terminal". A terminal header's IPv6 protocol value is stored in "nw_proto" for matching purposes. If a terminal header is TCP, UDP, or ICMPv6, the packet will be further processed in an attempt to extract layer-4 information.
IPv6 requires that every link in the internet have an MTU of 1280 octets or greater (RFC 2460). As such, a terminal header (as described above in "Extension Headers") in the first fragment should generally be reachable. In this case, the terminal header's IPv6 protocol type is stored in the "nwproto" field for matching purposes. If a terminal header cannot be found in the first fragment (one with a fragment offset of zero), the "nwproto" field is set to 0. Subsequent fragments (those with a non-zero fragment offset) have the "nw_proto" field set to the IPv6 protocol type for fragments (44).
An IPv6 jumbogram (RFC 2675) is a packet containing a payload longer than 65,535 octets. A jumbogram is only relevant in subnets with a link MTU greater than 65,575 octets, and are not required to be supported on nodes that do not connect to link with such large MTUs. Currently, Open vSwitch doesn't process jumbograms.
An OpenFlow switch must establish and maintain a TCP network connection to its controller. There are two basic ways to categorize the network that this connection traverses: either it is completely separate from the one that the switch is otherwise controlling, or its path may overlap the network that the switch controls. We call the former case "out-of-band control", the latter case "in-band control".
Out-of-band control has the following benefits:
Simplicity: Out-of-band control slightly simplifies the switch implementation.
Reliability: Excessive switch traffic volume cannot interfere with control traffic.
Integrity: Machines not on the control network cannot impersonate a switch or a controller.
Confidentiality: Machines not on the control network cannot snoop on control traffic.
In-band control, on the other hand, has the following advantages:
No dedicated port: There is no need to dedicate a physical switch port to control, which is important on switches that have few ports (e.g. wireless routers, low-end embedded platforms).
No dedicated network: There is no need to build and maintain a separate control network. This is important in many environments because it reduces proliferation of switches and wiring.
Open vSwitch supports both out-of-band and in-band control. This section describes the principles behind in-band control. See the description of the Controller table in ovs-vswitchd.conf.db(5) to configure OVS for in-band control.
The fundamental principle of in-band control is that an OpenFlow switch must recognize and switch control traffic without involving the OpenFlow controller. All the details of implementing in-band control are special cases of this principle.
The rationale for this principle is simple. If the switch does not handle in-band control traffic itself, then it will be caught in a contradiction: it must contact the controller, but it cannot, because only the controller can set up the flows that are needed to contact the controller.
The following points describe important special cases of this principle.
In-band control must be implemented regardless of whether the switch is connected.
It is tempting to implement the in-band control rules only when the switch is not connected to the controller, using the reasoning that the controller should have complete control once it has established a connection with the switch.
This does not work in practice. Consider the case where the switch is connected to the controller. Occasionally it can happen that the controller forgets or otherwise needs to obtain the MAC address of the switch. To do so, the controller sends a broadcast ARP request. A switch that implements the in-band control rules only when it is disconnected will then send an OFPTPACKETIN message up to the controller. The controller will be unable to respond, because it does not know the MAC address of the switch. This is a deadlock situation that can only be resolved by the switch noticing that its connection to the controller has hung and reconnecting.
In-band control must override flows set up by the controller.
It is reasonable to assume that flows set up by the OpenFlow controller should take precedence over in-band control, on the basis that the controller should be in charge of the switch.
Again, this does not work in practice. Reasonable controller implementations may set up a "last resort" fallback rule that wildcards every field and, e.g., sends it up to the controller or discards it. If a controller does that, then it will isolate itself from the switch.
The switch must recognize all control traffic.
The fundamental principle of in-band control states, in part, that a switch must recognize control traffic without involving the OpenFlow controller. More specifically, the switch must recognize all control traffic. "False negatives", that is, packets that constitute control traffic but that the switch does not recognize as control traffic, lead to control traffic storms.
Consider an OpenFlow switch that only recognizes control packets sent to or from that switch. Now suppose that two switches of this type, named A and B, are connected to ports on an Ethernet hub (not a switch) and that an OpenFlow controller is connected to a third hub port. In this setup, control traffic sent by switch A will be seen by switch B, which will send it to the controller as part of an OFPTPACKETIN message. Switch A will then see the OFPTPACKETIN message's packet, re-encapsulate it in another OFPTPACKETIN, and send it to the controller. Switch B will then see that OFPTPACKETIN, and so on in an infinite loop.
Incidentally, the consequences of "false positives", where packets that are not control traffic are nevertheless recognized as control traffic, are much less severe. The controller will not be able to control their behavior, but the network will remain in working order. False positives do constitute a security problem.
The switch should use echo-requests to detect disconnection.
TCP will notice that a connection has hung, but this can take a considerable amount of time. For example, with default settings the Linux kernel TCP implementation will retransmit for between 13 and 30 minutes, depending on the connection's retransmission timeout, according to kernel documentation. This is far too long for a switch to be disconnected, so an OpenFlow switch should implement its own connection timeout. OpenFlow OFPTECHOREQUEST messages are the best way to do this, since they test the OpenFlow connection itself.
This section describes how Open vSwitch implements in-band control. Correctly implementing in-band control has proven difficult due to its many subtleties, and has thus gone through many iterations. Please read through and understand the reasoning behind the chosen rules before making modifications.
Open vSwitch implements in-band control as "hidden" flows, that is, flows that are not visible through OpenFlow, and at a higher priority than wildcarded flows can be set up through OpenFlow. This is done so that the OpenFlow controller cannot interfere with them and possibly break connectivity with its switches. It is possible to see all flows, including in-band ones, with the ovs-appctl "bridge/dump-flows" command.
The Open vSwitch implementation of in-band control can hide traffic to arbitrary "remotes", where each remote is one TCP port on one IP address. Currently the remotes are automatically configured as the in-band OpenFlow controllers plus the OVSDB managers, if any. (The latter is a requirement because OVSDB managers are responsible for configuring OpenFlow controllers, so if the manager cannot be reached then OpenFlow cannot be reconfigured.)
The following rules (with the OFPP_NORMAL action) are set up on any bridge that has any remotes:
(a) DHCP requests sent from the local port. (b) ARP replies to the local port's MAC address. (c) ARP requests from the local port's MAC address.
In-band also sets up the following rules for each unique next-hop MAC address for the remotes' IPs (the "next hop" is either the remote itself, if it is on a local subnet, or the gateway to reach the remote):
(d) ARP replies to the next hop's MAC address. (e) ARP requests from the next hop's MAC address.
In-band also sets up the following rules for each unique remote IP address:
(f) ARP replies containing the remote's IP address as a target. (g) ARP requests containing the remote's IP address as a source.
In-band also sets up the following rules for each unique remote (IP,port) pair:
(h) TCP traffic to the remote's IP and port. (i) TCP traffic from the remote's IP and port.
The goal of these rules is to be as narrow as possible to allow a switch to join a network and be able to communicate with the remotes. As mentioned earlier, these rules have higher priority than the controller's rules, so if they are too broad, they may prevent the controller from implementing its policy. As such, in-band actively monitors some aspects of flow and packet processing so that the rules can be made more precise.
In-band control monitors attempts to add flows into the datapath that could interfere with its duties. The datapath only allows exact match entries, so in-band control is able to be very precise about the flows it prevents. Flows that miss in the datapath are sent to userspace to be processed, so preventing these flows from being cached in the "fast path" does not affect correctness. The only type of flow that is currently prevented is one that would prevent DHCP replies from being seen by the local port. For example, a rule that forwarded all DHCP traffic to the controller would not be allowed, but one that forwarded to all ports (including the local port) would.
As mentioned earlier, packets that miss in the datapath are sent to the userspace for processing. The userspace has its own flow table, the "classifier", so in-band checks whether any special processing is needed before the classifier is consulted. If a packet is a DHCP response to a request from the local port, the packet is forwarded to the local port, regardless of the flow table. Note that this requires L7 processing of DHCP replies to determine whether the 'chaddr' field matches the MAC address of the local port.
It is interesting to note that for an L3-based in-band control mechanism, the majority of rules are devoted to ARP traffic. At first glance, some of these rules appear redundant. However, each serves an important role. First, in order to determine the MAC address of the remote side (controller or gateway) for other ARP rules, we must allow ARP traffic for our local port with rules (b) and (c). If we are between a switch and its connection to the remote, we have to allow the other switch's ARP traffic to through. This is done with rules (d) and (e), since we do not know the addresses of the other switches a priori, but do know the remote's or gateway's. Finally, if the remote is running in a local guest VM that is not reached through the local port, the switch that is connected to the VM must allow ARP traffic based on the remote's IP address, since it will not know the MAC address of the local port that is sending the traffic or the MAC address of the remote in the guest VM.
With a few notable exceptions below, in-band should work in most network setups. The following are considered "supported" in the current implementation:
Locally Connected. The switch and remote are on the same subnet. This uses rules (a), (b), (c), (h), and (i).
Reached through Gateway. The switch and remote are on different subnets and must go through a gateway. This uses rules (a), (b), (c), (h), and (i).
Between Switch and Remote. This switch is between another switch and the remote, and we want to allow the other switch's traffic through. This uses rules (d), (e), (h), and (i). It uses (b) and (c) indirectly in order to know the MAC address for rules (d) and (e). Note that DHCP for the other switch will not work unless an OpenFlow controller explicitly lets this switch pass the traffic.
Between Switch and Gateway. This switch is between another switch and the gateway, and we want to allow the other switch's traffic through. This uses the same rules and logic as the "Between Switch and Remote" configuration described earlier.
Remote on Local VM. The remote is a guest VM on the system running in-band control. This uses rules (a), (b), (c), (h), and (i).
Remote on Local VM with Different Networks. The remote is a guest VM on the system running in-band control, but the local port is not used to connect to the remote. For example, an IP address is configured on eth0 of the switch. The remote's VM is connected through eth1 of the switch, but an IP address has not been configured for that port on the switch. As such, the switch will use eth0 to connect to the remote, and eth1's rules about the local port will not work. In the example, the switch attached to eth0 would use rules (a), (b), (c), (h), and (i) on eth0. The switch attached to eth1 would use rules (f), (g), (h), and (i).
The following are explicitly not supported by in-band control:
Specify Remote by Name. Currently, the remote must be identified by IP address. A naive approach would be to permit all DNS traffic. Unfortunately, this would prevent the controller from defining any policy over DNS. Since switches that are located behind us need to connect to the remote, in-band cannot simply add a rule that allows DNS traffic from the local port. The "correct" way to support this is to parse DNS requests to allow all traffic related to a request for the remote's name through. Due to the potential security problems and amount of processing, we decided to hold off for the time-being.
Differing Remotes for Switches. All switches must know the L3 addresses for all the remotes that other switches may use, since rules need to be set up to allow traffic related to those remotes through. See rules (f), (g), (h), and (i).
Differing Routes for Switches. In order for the switch to allow other switches to connect to a remote through a gateway, it allows the gateway's traffic through with rules (d) and (e). If the routes to the remote differ for the two switches, we will not know the MAC address of the alternate gateway.
It seems likely that many controllers, at least at startup, use the OpenFlow "flow statistics" request to obtain existing flows, then compare the flows' actions against the actions that they expect to find. Before version 1.8.0, Open vSwitch always returned exact, byte-for-byte copies of the actions that had been added to the flow table. The current version of Open vSwitch does not always do this in some exceptional cases. This section lists the exceptions that controller authors must keep in mind if they compare actual actions against desired actions in a bytewise fashion:
Open vSwitch zeros padding bytes in action structures, regardless of their values when the flows were added.
Open vSwitch "normalizes" the instructions in OpenFlow 1.1 (and later) in the following way:
OVS sorts the instructions into the following order: Apply-Actions, Clear-Actions, Write-Actions, Write-Metadata, Goto-Table.
OVS drops Apply-Actions instructions that have empty action lists.
OVS drops Write-Actions instructions that have empty action sets.
Please report other discrepancies, if you notice any, so that we can fix or document them.
Suggestions to improve Open vSwitch are welcome at discuss@openvswitch.org.


| Interface | Description |
|---|---|
| OfferRecommendation |
This interface encapsulates both a recommended Mesos
Operation to be performed and an
Offer on which the Operation should be performed. |
| OfferRequirementProvider |
An OfferRequirementProvider generates OfferRequirements representing the requirements of a Container in two
scenarios: initial launch, and update of an already running container.
|
| OperationRecorder |
The OperationRecorder is an Interface required by the OfferAccepter.
|
| Class | Description |
|---|---|
| AttributeStringUtils |
Tools for converting
Attribute s into strings. |
| AttributeStringUtilsTest |
Tests for
AttributeStringUtils . |
| CreateOfferRecommendation |
This
OfferRecommendation encapsulates a Mesos CREATE Operation. |
| DefaultOfferRequirementProvider |
A default implementation of the OfferRequirementProvider interface.
|
| DefaultOfferRequirementProviderTest |
This class tests the DefaultOfferRequirementProvider.
|
| DestroyOfferRecommendation |
This
OfferRecommendation encapsulates a Mesos DESTROY Operation. |
| DynamicPortRequirement |
This class allows the expression of a desire for a random port designated by a name which will be injected into the
environment.
|
| DynamicPortRequirementTest |
This class tests DynamicPortRequirements.
|
| ExecutorRequirement |
An ExecutorRequirement encapsulates the needed resources an Executor must
have.
|
| ExecutorRequirementTest | |
| LaunchOfferRecommendation |
This
OfferRecommendation encapsulates a Mesos LAUNCH Operation. |
| LogOperationRecorder |
Used as an offer acceptor.
|
| MesosResource |
A representation of a Mesos Resources.
|
| MesosResourcePool |
A representation of the pool of resources available in a single
Offer . |
| MesosResourcePoolTest | |
| MesosTask |
A representation of a Mesos Task.
|
| OfferAccepter |
The OfferAccepter accepts OfferRecommendations.
|
| OfferAccepterTest | |
| OfferAccepterTest.TestOperationRecorder | |
| OfferEvaluator |
The OfferEvaluator processes
Offer s and produces OfferRecommendation s. |
| OfferEvaluatorTest | |
| OfferRequirement |
An OfferRequirement encapsulates the needed resources an Offer must have.
|
| OfferRequirementTest | |
| OfferUtils |
This class provides commonly used utilities for offer handling.
|
| OfferUtilsTest | |
| RequirementUtils |
Implementations for common operations on Task/Executor/Resource requirements.
|
| ReserveOfferRecommendation |
This
OfferRecommendation encapsulates a Mesos RESERVE Operation. |
| ResourceCleaner |
The Resource Cleaner provides recommended operations for cleaning up
unexpected Reserved resources and persistent volumes.
|
| ResourceCleanerScheduler |
This scheduler performs UNRESERVE and DESTROY operations on resources which are identified
as unexpected by the ResourceCleaner.
|
| ResourceCleanerSchedulerTest | |
| ResourceCleanerTest | |
| ResourceRequirement |
A ResourceRequirement encapsulate a needed Resource.
|
| ResourceRequirementTest | |
| ResourceUtils |
This class encapsulates common methods for manipulating Resources.
|
| ResourceUtilsTest | |
| TaskRequirement |
A TaskRequirement encapsulates the needed resources a Task must have.
|
| TaskRequirementTest | |
| TaskUtils |
Various utility methods for manipulating data in
TaskInfo s. |
| TaskUtilsTest |
This class tests the TaskUtils class.
|
| UnreserveOfferRecommendation |
This
OfferRecommendation encapsulates a Mesos UNRESERVE Operation. |
| ValueUtils |
Utilities for manipulating Value protobufs.
|
| VolumeRequirement |
A VolumeRequirement encapsulates the configuration required for volume creation.
|
| Enum | Description |
|---|---|
| VolumeRequirement.VolumeMode |
VolumeMode.
|
| VolumeRequirement.VolumeType |
VolumeType.
|
| Exception | Description |
|---|---|
| DynamicPortRequirement.DynamicPortException |
Exception thrown when attempting to create malformed DynamicPortRequirements.
|
| InvalidRequirementException |
An exception which describes an error in a provided set of Offer Requirements.
|
| TaskException |
This class encapsulates Exceptions associated with Tasks.
|


| 1 | package fr.sii.ogham.sms.builder; | |
| 2 | ||
| 3 | import fr.sii.ogham.core.builder.Builder; | |
| 4 | import fr.sii.ogham.core.builder.context.BuildContext; | |
| 5 | import fr.sii.ogham.core.builder.context.DefaultBuildContext; | |
| 6 | import fr.sii.ogham.core.builder.env.EnvironmentBuilder; | |
| 7 | import fr.sii.ogham.core.fluent.AbstractParent; | |
| 8 | import fr.sii.ogham.sms.message.PhoneNumber; | |
| 9 | import fr.sii.ogham.sms.message.addressing.AddressedPhoneNumber; | |
| 10 | import fr.sii.ogham.sms.message.addressing.translator.CompositePhoneNumberTranslator; | |
| 11 | import fr.sii.ogham.sms.message.addressing.translator.PhoneNumberHandler; | |
| 12 | import fr.sii.ogham.sms.message.addressing.translator.PhoneNumberTranslator; | |
| 13 | ||
| 14 | /** | |
| 15 | * Configures the recipient phone number conversion (from a {@link PhoneNumber} | |
| 16 | * to an {@link AddressedPhoneNumber}). | |
| 17 | * | |
| 18 | * The {@link PhoneNumber} is used by the developer to provide a simple phone | |
| 19 | * number without knowing how phone number works (no need to handle formats, | |
| 20 | * addressing, countries...). The {@link AddressedPhoneNumber} is used by Ogham | |
| 21 | * implementations to have a phone number that is usable by a technical system. | |
| 22 | * | |
| 23 | * @author Aurélien Baudet | |
| 24 | * | |
| 25 | */ | |
| 26 | public class RecipientNumberBuilder extends AbstractParent<PhoneNumbersBuilder> implements Builder<PhoneNumberTranslator> { | |
| 27 | private final BuildContext buildContext; | |
| 28 | private RecipientNumberFormatBuilder formatBuilder; | |
| 29 | private PhoneNumberTranslator customTranslator; | |
| 30 | ||
| 31 | /** | |
| 32 | * Default constructor used without all Ogham work. | |
| 33 | * | |
| 34 | * WARNING: use is only if you know what you are doing ! | |
| 35 | */ | |
| 36 | public RecipientNumberBuilder() { | |
| 37 | this(null, new DefaultBuildContext()); | |
| 38 | } | |
| 39 | ||
| 40 | /** | |
| 41 | * Initializes the builder with a parent builder. The parent builder is used | |
| 42 | * when calling {@link #and()} method. The {@link EnvironmentBuilder} is | |
| 43 | * used to evaluate properties when {@link #build()} method is called. | |
| 44 | * | |
| 45 | * @param parent | |
| 46 | * the parent builder | |
| 47 | * @param buildContext | |
| 48 | * for registering instances and property evaluation | |
| 49 | */ | |
| 50 | public RecipientNumberBuilder(PhoneNumbersBuilder parent, BuildContext buildContext) { | |
| 51 | super(parent); | |
| 52 | this.buildContext = buildContext; | |
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * Defines which standard conversions may be applied on the phone number to | |
| 57 | * convert it from a {@link PhoneNumber} to an {@link AddressedPhoneNumber}. | |
| 58 | * | |
| 59 | * @return the builder to configure standard phone number conversions | |
| 60 | */ | |
| 61 | public RecipientNumberFormatBuilder format() { | |
| 62 |
1
1. format : negated conditional → RUN_ERROR |
if (formatBuilder == null) { |
| 63 | formatBuilder = new RecipientNumberFormatBuilder(this, buildContext); | |
| 64 | } | |
| 65 |
1
1. format : replaced return value with null for fr/sii/ogham/sms/builder/RecipientNumberBuilder::format → RUN_ERROR |
return formatBuilder; |
| 66 | } | |
| 67 | ||
| 68 | /** | |
| 69 | * Overrides the standard phone number conversions by the provided handler. | |
| 70 | * | |
| 71 | *
 | |
| 72 | * If you call this method several times, only the last custom handler is | |
| 73 | * used. If you need to apply several conversions, you can use | |
| 74 | * {@link CompositePhoneNumberTranslator} implementation that delegates to | |
| 75 | * {@link PhoneNumberHandler}s. | |
| 76 | * | |
| 77 | * @param handler | |
| 78 | * the handler to use | |
| 79 | * @return this instance for fluent chaining | |
| 80 | */ | |
| 81 | public RecipientNumberBuilder convert(PhoneNumberTranslator handler) { | |
| 82 | this.customTranslator = handler; | |
| 83 |
1
1. convert : replaced return value with null for fr/sii/ogham/sms/builder/RecipientNumberBuilder::convert → NO_COVERAGE |
return this; |
| 84 | } | |
| 85 | ||
| 86 | @Override | |
| 87 | public PhoneNumberTranslator build() { | |
| 88 |
1
1. build : negated conditional → RUN_ERROR |
if (customTranslator != null) { |
| 89 |
1
1. build : replaced return value with null for fr/sii/ogham/sms/builder/RecipientNumberBuilder::build → NO_COVERAGE |
return customTranslator; |
| 90 | } | |
| 91 |
1
1. build : replaced return value with null for fr/sii/ogham/sms/builder/RecipientNumberBuilder::build → RUN_ERROR |
return formatBuilder.build(); |
| 92 | } | |
| 93 | } | |
Mutations | ||
| 62 |
1.1 |
|
| 65 |
1.1 |
|
| 83 |
1.1 |
|
| 88 |
1.1 |
|
| 89 |
1.1 |
|
| 91 |
1.1 |


|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use com.syncano.android.lib.modules.users | |
|---|---|
| com.syncano.android.lib |
| Classes in com.syncano.android.lib.modules.users used by com.syncano.android.lib | |
|---|---|
| ParamsUserCount
Params to count users with specified criteria. |
|
| ParamsUserDelete
Params to delete specified user |
|
| ParamsUserGet
Params to get users of specified criteria that are associated with Data Objects within specified collection. |
|
| ParamsUserGetAll
Params to get all users |
|
| ParamsUserGetOne
Params to get one user. |
|
| ParamsUserNew
Params to create new user. |
|
| ParamsUserUpdate
Params to update specified user. |
|
| ResponseUserCount
Response with count of all users |
|
| ResponseUserGet
Response with array of users that fitted Param criteria |
|
| ResponseUserGetAll
Response contains array of all users |
|
| ResponseUserGetOne
Response contains one user that fits Param criteria |
|
| ResponseUserNew
Response containing new user |
|
| ResponseUserUpdate
Response containing user after update |
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
Q
R
S
T
W
X
M
ManyToManyField
<
L
extends
Model
,
R
extends
Model
> - Class in
com.orm.androrm
ManyToManyField(Class<L>, Class<R>)
- Constructor for class com.orm.androrm.
ManyToManyField
mId
- Variable in class com.orm.androrm.
Model
mKey
- Variable in class com.orm.androrm.
Statement
Key of the statement.
mLeft
- Variable in class com.orm.androrm.
ComposedStatement
Left side of the
Statement
.
mMaxLength
- Variable in class com.orm.androrm.
DataField
Maximum length of that field.
Model
- Class in
com.orm.androrm
This is the superclass of all models, that can be stored/ read to/ from the database automatically.
Model()
- Constructor for class com.orm.androrm.
Model
Model(boolean)
- Constructor for class com.orm.androrm.
Model
mRight
- Variable in class com.orm.androrm.
ComposedStatement
Right side of the
Statement
.
mSeparator
- Variable in class com.orm.androrm.
ComposedStatement
String that separates the left side of this statement from the right side.
mType
- Variable in class com.orm.androrm.
DataField
Type descriptor of this field used for the database definition.
mValue
- Variable in class com.orm.androrm.
DataField
Value of that field.
mValue
- Variable in class com.orm.androrm.
Statement
Value of the statement.
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
Q
R
S
T
W
X


| HOME | DOWNLOAD | DOCUMENTATION | FORUM | FAQ |
> Home > Documentation > Gravity and Magnetics
CILMPLUSRHOH(1) SHTOOLS 2.7 CILMPLUSRHOH(1)
CilmPlusRhoH
CilmPlusRhoH - Calculate the gravitational potential of relief referenced to a spherical interface with laterally varying density using the finite amplitude algorithm of Wieczorek (2007).
SYNOPSIS
SUBROUTINE CilmPlusRhoH ( CILM, GRIDIN, LMAX, NMAX, MASS, D, RHO, GRIDTYPE, W, ZERO, PLX, N, DREF ) REAL*8 CILM(2, LMAX+1, LMAX+1), GRIDIN(LMAX+1, 2*LMAX+1), MASS, D, RHO(LMAX+1, 2*LMAX+1), REAL*8, OPTIONAL W(LMAX+1), ZERO(LMAX+1), PLX(LMAX+1, (LMAX+1)*(LMAX+2)/2), DREF INTEGER LMAX, NMAX, GRIDTYPE INTEGER, OPTIONAL N
DESCRIPTION
CilmPlusRhoH will calculate the spherical harmonic coefficients of the gravitational potential that correspond to relief referenced to a spherical interface with laterally varying density. This is equation 30 of Wieczorek (2007), which is based on the equation 10 of Wieczorek and Phillips (1998). The potential is strictly valid only when the coefficients are evaluated at a radius greater than the maximum radius of the relief. The relief and laterally varying density are input as a grid, whose type is specified by GRIDTYPE (1 for Gauss-Legendre quadrature grids, 2 for NxN Driscoll and Healy sampled grids, and 3 for Nx2N Driscoll and Healy sampled grids). The input relief GRIDIN must correspond to absolute radii. The parameter NMAX is the order of the Taylor series used in the algorithm to approximate the potential coefficients. By default, the relief and spherical harmonic coefficients will be referenced to the mean radius of GRIDIN. However, if the optional parameter DREF is specified, this will be used instead as the reference radius. It is important to understand that as an intermediate step, this routine calculates the spherical harmonic coefficients of the density multiplied by relief (referenced to the mean radius of GRIDIN or DREF) raised to the nth power, i.e., RHO*(GRIDIN-D)**n. As such, if the input function is bandlimited to degree L, the resulting function will be bandlimited to degree L*NMAX. This subroutine implicitly assumes that the GRIDIN has an effective spherical harmonic bandwidth greater or equal to L*NMAX. (The effective bandwidth is equal to LMAX for GRIDIN=1, and is specified by N/2-1 for GRIDIN=2 or 3.) If this is not the case, then aliasing will occur. In practice, for accurate results, it is found that the effective bandwidth needs only to be about twice the size of L, though this should be verified for each application. Thus, if the input function is considered to be bandlimited to degree L, the function should be evaluated on a grid corresponding to a maximum degree of about 2*L. Aliasing effects can be minimized by using Driscoll and Healy Nx2N grids. If the input grid is evaluated on the Gauss-Legendre points, it is necessary to specify the optional parameters W and ZERO, or W and PLX, which are calculated by a call to PreCompute. In contast, if Driscoll- Healy grids are used (NxN or Nx2N), it is necessary to specify the optional parameter N. If memory is not an issue, the algorithm can be speeded up considerably when using Gauss-Lengendre grids by inputing the optional array PLX (along with W) of precomputed associated Legendre functions on the Gauss-Legendre nodes. Both of these variables are computed by a call to PreCompute.
ARGUMENTS
CILM (output) REAL*8, DIMENSION (2, LMAX+1, LMAX+1) The real spherical harmonic coefficients (geodesy normalized) of the gravitational potential corresponding to constant density relief referenced to a spherical interface of radius D. GRIDIN (input) REAL*8, DIMENSION (LMAX+1, 2*LMAX+1) for GRIDTYPE 1, DIMENSION (N, N) for GRIDTYPE 2, DIMENSION (N, 2*N) for GRIDTYPE 3 The radii of the interface evaluated on a grid corresponding to a function of maximum spherical harmonic degree LMAX. This is calculated by a call to either MakeGridGLQ or MakeGridDH. LMAX (input) INTEGER The maximum spherical harmonic degree of the output spherical harmonic coefficients. This degree also determines the dimension of the input relief GRIDGLQ for GRIDTYPE 1. (As a general rule, this should be about twice the spherical harmonic bandwidth of the input function.) For Driscoll-Healy grids, LMAX must be less than or equal to N/2 - 1. NMAX (input) INTEGER The maximum order used in the Taylor-series expansion used in calculating the potential coefficients. As a rule, this should be about 4. MASS (input) REAL*8 The mass of the planet in kg. D (output) REAL*8 The mean radius of the relief as determined from GRIDGLQ in meters. RHO (input) REAL*8, DIMENSION (LMAX+1, 2*LMAX+1) for GRIDTYPE 1, DIMENSION (N, N) for GRIDTYPE 2, DIMENSION (N, 2*N) for GRIDTYPE 3 The density contrast of the relief in kg/m^3 expressed on a grid with the same dimensions as GRIDIN. GRIDTYPE (input) INTEGER 1 = Gauss-Legendre grids, calculated using PreCompute and MakeGridGLQ. 2 = Equally sampled Driscoll-Healy grids, NxN, calculated using MakeGridDH. 3 = Equally spaced Driscoll- Healy grids, Nx2N, calculated using MakeGridDH. W (input) REAL*8, OPTIONAL DIMENSION (LMAX+1) The weights used in the Gauss-Legendre quadrature, which are required for GRIDTYPE = 1. These are calculated from a call to PreCompute (or alternatively, PreGLQ). ZERO (input) REAL*8, OPTIONAL, DIMENSION (LMAX+1) The nodes used in the Gauss-Legendre quadrature over latitude for GRIDTYPE 1, calculated by a call to PreCompute. One of PLX or ZERO must be present when GRIDTYPE = 1, but not both. PLX (input) REAL*8, OPTIONAL, DIMENSION (LMAX+1, (LMAX+1)*(LMAX+2)/2) An array of the associated Legendre functions calculated at the nodes used in the Gauss-Legendre quadrature for GRIDTYPE 1. These are determined from a call to PreCompute. One of PLX or ZERO must be present when GRIDTYPE = 1, but not both. N (input) INTEGER, OPTIONAL The number of samples in latitude when using Driscoll-Healy grids. For a function bandlimited to LMAX, N = 2 (LMAX + 1). This is required for GRIDTYPE = 2 and 3. DREF (input) REAL*8, OPTIONAL The reference radius to be used when calculating both the relief and spherical harmonic coefficients. If this is not specified, this parameter will be set equal to the mean radius of GRIDIN.
NOTES
This routine uses geodesy 4-pi normalized spherical harmonics that exclude the Condon-Shortley phase; This can not be modified. This routine requires the fast Fourier transform library FFTW, which is available at <http://www.fftw.org>.
SEE ALSO
cilmplus(1), shexpandglq(1), makegridglq(1), precompute(1), preglq(1), glqgridcoord(1), makegriddh(1) <http://shtools.ipgp.fr/>
REFERENCES
Wieczorek, M. A. and R. J. Phillips, Potential anomalies on a sphere: applications to the thickness of the lunar crust, J. Geophys. Res., 103, 1715-1724, 1998. Wieczorek, M. A., Gravity and topography of the terrestrial planets, Treatise on Geophysics, 10, 165-206, doi:10.1016/B978-044452748-6/00156-5, 2007.
COPYRIGHT AND LICENSE
Copyright 2012 by Mark Wieczorek<EMAIL_ADDRESS>This is free software; you can distribute and modify it under the terms of the revised BSD license. SHTOOLS 2.7 2012-05-26 CILMPLUSRHOH(1)
> Home > Documentation > Gravity and Magnetics
| Institut de Physique du Globe de Paris | Sorbonne Paris Cité | © 2012 Mark Wieczorek |


CoinSpotDotNet
A .NET Standard 2.0 compatible class library for CoinSpot API. Supports API versions 1 and 2
Contents
Features
- Well documented with a full suite of examples
- .NET Standard 2.0 target
- No 3rd-party dependencies (no
Newtonsoft.Json
, this library uses theSystem.Text.Json
serialiser out of the box), onlyMicrosoft
andSystem
namespaced dependecies required - Supports both Console and ASP.NET web application scenarios, and probably loads of others.
- Modern fully
async
C# library - Currently supports CoinSpot all public and read-only API v1 and API v2 (beta) endpoints:
- Write endpoints are currently not implemented but planned for 1.3.0 release
Documentation
This source code has been documented extensively and the full API documentation is a available here.
Additionally a Demo project is included in this repo and contains Swagger/Open API documentation for all of the supported CoinSpot API endpoints that you can easily set up and try out CoinSpotDotNet
Demo
There is a Sample ASP.NET Web API project with a swagger you can use to test out the library and as a usage example.
Demo setup instructions
- Clone the project
git clone https://github.com/liamwhan/CoinSpotDotNet
- Add your CoinSpot read-only API key and secret as a user secret with the dotnet CLI
cd CoinSpotDotNet/CoinSpotDotNet.Samples dotnet user-secrets init dotnet user-secrets set "CoinSpot:ReadOnlyKey" "{YOUR_READ_ONLY_KEY}" dotnet user-secrets set "CoinSpot:ReadOnlySecret" "{YOUR_READ_ONLY_SECRET}"
- Open the solution in Visual Studio and start debugging the CoinSpotDotNet.Samples project
- Start debugging/run the project and open a browser to
http://localhost:5000/swagger/index.html
Getting Started
Installation
Nuget
Install-Package CoinSpotDotNet -Version 1.0.5
dotnet
CLI
dotnet add package CoinSpotDotNet --version 1.0.5
Usage
ASP.NET Web Application
NOTE: Both V1 and V2 clients are used side-by-side in the examples below to demonstrate usage, while this won't cause any problems, in practice you would probably only want one or the other.
If you're building an ASP.NET Web application then getting started is as simple as:
Add your CoinSpot API credentials to the applications
IConfiguration
under the sectionCoinSpot
This can be done in any way you like, (i.e. User secrets, secure storage etc.) but we recommend you read up on safe storage of secrets in ASP.NET
For example, here is what the credentials would look like in an
appsettings.json
file (which we don't recommend, but are using here to demonstrate the structure that CoinSpotDotNet expects):{ "CoinSpot": { "ReadOnlyKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "ReadOnlySecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" } }
Register CoinSpotDotNet in the .NET DI Container. Example
Startup.cs
classusing CoinSpotDotNet; namespace MyProject { public class Startup { public IConfiguration Configuration { get; set; } public Startup(IConfiguration config) { Configuration = config; } public void ConfigureServices(IServiceCollection services) { // ... Standard .NET service setup services.AddCoinSpotV1(Configuration); // Registers ICoinSpotClient for CoinSpot v1 API; services.AddCoinSpotV2(Configuration); // Registers ICoinSpotClientV2 for CoinSpot v2 API; } } }
This will register a typed
HttpClient
into the DI Container. See the CoinSpotClient DI constructor API documentation for more information.Inject
ICoinSpotClient
orICoinSpotClientV2
into your consuming services.using CoinSpotDotNet; namespace MyProject.Services { public class MyService { private readonly ICoinSpotClient clientV1; private readonly ICoinSpotClientV2 clientV2; public MyService(ICoinSpotClient clientV1, ICoinSpotClientV2 clientV2) { this.clientV1 = clientV1; this.clientV2 = clientV2; } public async Task MyMethod() { var balancesV1 = await clientV1.ListMyBalances(); var balancesV2 = await clientV2.ListMyBalances(); } } }
Console applications and other scenarios
If you're not using ASP.NET then constructing a Client is arguably even simpler:
using CoinSpotDotNet;
namespace MyConsoleApp
{
public class Program
{
public static Main(string[] args)
{
CoinSpotSettings settings = new()
{
ReadOnlyKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ReadOnlySecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
var clientV1 = new CoinSpotClient(settings);
var clientV2 = new CoinSpotClientV2(settings);
}
}
}
General Notes
API Support
The current CoinSpot API documentation and developer tools are limited and this library is not officially supported by, or affiliated with CoinSpot in any way. This makes some parts of the API very difficult to test, especially where my personal account does not have any data to test with, e.g. the affiliate and referral payments endpoints. As a result this library currently only supports:
- The read-only v1 API endpoints
- The read-only v2 API endpoints
- The public v1 API endpoints
- The public v2 API endpoints
CoinSpotClient classes
CoinSpotDotNet exposes 2 primary classes of interest to consuming applications:
ICoinSpotClient
- calls CoinSpot API v1 endpointsICoinSpotClientV2
- calls CoinSpot API v2 endpoints
They are independent classes and can be used interchangably and they expose mostly the same methods at the moment (the v2 API has more endpoints so the client has more corresponding methods).
Dependencies
The target framework is .NET Standard 2.0 and the only dependencies are Microsoft .NET libraries. There are no 3rd-party dependencies.
You can use this library in a console app (or other non-ASP environment) by using the simple constructor
License
MIT License
Copyright (c) 2021 Liam Whan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


spatialEco: Spatial Analysis and Modelling Utilities
Utilities to support spatial data manipulation, query, sampling
and modelling. Functions include models for species population density, download
utilities for climate and global deforestation spatial products, spatial
smoothing, multivariate separability, point process model for creating pseudo-
absences and sub-sampling, polygon and point-distance landscape metrics,
auto-logistic model, sampling models, cluster optimization, statistical
exploratory tools and raster-based metrics.
| Version: |
1.1-0 |
| Depends: |
R (≥ 3.3.0) |
| Imports: |
sp, sf, raster, spatstat, cluster, spdep, SDMTools, readr, RCurl, rgeos, RANN, rms, yaImpute, SpatialPack, MASS, EnvStats, maptools, methods |
| Published: |
2018-03-06 |
| Author: |
Jeffrey S. Evans [aut, cre],
Karthik Ram [ctb] |
| Maintainer: |
Jeffrey S. Evans <jeffrey_evans at tnc.org> |
| License: |
GPL-3 |
| URL: |
https://cran.r-project.org/package=spatialEco |
| NeedsCompilation: |
no |
| Citation: |
spatialEco citation info |
| Materials: |
NEWS |
| CRAN checks: |
spatialEco results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=spatialEco
to link to this page.


Dataset Title
A dataset description contains useful descriptive information about the dataset and its origins. It also describes what information is contained within the dataset so users are informed prior to donwloading the dataset. This text can get very long, so it is useful to trim the text and provide a link to expend the text.
ICT Islamabad
The Islamabad Capital Territory (ICT) Administration, generally known as Islamabad Administration, is the civil administration as well as main law and order agency of the... read more
Tags
Licenses
- Non Commercial
- Attribution
- Share Alike
Data and Resources
Additional Information
- Version
- Description
- Author
- Organisation
- Issued Date
- Description
- Last Updated
- Description
- Languages
- Description
6,574Datasets
45Organisations
24Groups
50Tags


Hangman
80's Style
Clue -
Hint
Play again
This Text will show if the Browser does NOT support HTML5 Canvas tag


The Mental Load : What do Women think about?
I have recently read ‘The Mental Load: A Feminist Comic’ By Emma and I learned a lot! As I read each chapter, I took notes and today I reflected on them. I highly recommend this book to the women and men of your life.
What is this book about?
This review by Nancy O’Toole explains it well
The mental load is an intersectional feminist comic that uses simple illustrations to convey current issues. While the content goes beyond this, the main focus here is on the domestic. We already know about the imbalance in hours spent on activities such as cooking, cleaning, and child care, and how that negatively impacts women (especially those who work full time), but what about the impact of the mental load? The strain that comes from mentally balancing the dozens of seemingly small tasks in the household that men are, too often, blind to?
Why did I read this book?
As the review says above says “small tasks in the household that men are, too often, blind to” I wanted to know more about what those things were.
With that in mind, let me tell you about 3 things that prompted me to read this book once I saw it.
First : My Mom
After I got married, my mom would tell/ask me if I was doing my part in the house.
- I was not.
- … and honestly, I thought I was.
Second : Deciding to be Equal Partners
My wife and I listened to the audio book The Moment of Lift - by Melinda Gates.
In it, Melinda talks about how she and Bill strive to be equals in their marriage and also in their foundation.
My wife and I thought this was a great idea!
We do not want one of us “wearing the pants” in our relationship.
We want to be equal partners.
Third : Understanding that which I did not even know
My wife and I take around 30 minutes every Sunday to have a marriage meeting.
The meeting name sounds very formal, but this is actually a very intimate moment of our lives where we reflect on the week that has passed.
It is composed of four sections where we get to appreciate each other, discuss chores, plan for good times, and talk about our problems and challenges.
One of the things we talked about was how to become more equal and hence how to split up chores more evenly.
There were some easy things that we could split, but there were also a couple of things that she did without really thinking about, but it nonetheless added to her Mental Load.
As we worked through these, I realized that she did so many things around the house that I was not even aware of.
I found out about marriage meetings via a podcast that my friend showed to me.
Here is the episode: Art of Manliness - Podcast #611: How a Weekly Marriage Meeting Can Strengthen Your Relationship
There is also a book about it:
Answering: Why did I want to read this book?
I want to be the best husband that I can be.
I want to be the best men that I can be.
I want to be a better ally to women.
There is too much inequality between men and women around so many parts of our society.
It is up to each and every one of us to learn and try to be better.
So what did I learn from the book?
You should read it and make your own conclusions.
The book is packed with very deep and important issues and yet it is very short.
If you are interested, here are the top five things that I want to highlight:
1 : “You Should Have Asked”
Often in a relationship, we may think that we are doing more than our partners.
That is when little fights start, one might say “why didn’t you put the dishes in the dishwasher?” … the other responds, “you should have asked”
and etc… the book goes into more examples.
So, try and understand what each of you does in the house.
Ask everyone to keep a list where they add the things they are doing around the house.
and then, once a week, review that list and start to divide them up more equally.
2 : “Oh wow, she is angry.
The second chapter of the book is called “Violence of the oppressed”.
It is about how fingers are usually pointed to the people being oppressed and not the oppressors.
For example, there was A LOT of news coverage on the destruction around BlackLivesMatter protests.
And yet, there was little talk about the inequality that black people in this country (and around the world) suffer.
There was no coverage on how black people have this gigantic mental load about what they need to do to avoid being victims of police brutality
- dress well, drive nice cards, act calmly, speak well… the list goes on and on.
Another example is women at work (in tech, but I am sure in other places too), they cannot act angry or express their opinions in a stern way.
Some men in those environments see those behaviors as unfit for women, when on the other hand it is completely okay for men to act like that.
3 : Episiotomy
This is a practice done during childbirth that is brutal and not necessary, in most cases. Read more about it here:
4 : Hijabs
Chapter 4 in the book, “Show me that Bossom”, caught me by surprise.
It uses a clever story that changed my views on hijab.
I always viewed hijabs as a tool of men to oppress and control women.
So, of course, I never liked it.
However, now, I think differently. Here is what I think about hijabs:
If a woman wants to wear a hijab. It is their right to do so.
I won’t force them to wear or not to wear them.
It is their body and their belief.
They are in control of how and how much they want to show their bodies.
5 : “How was the Holiday?”
A woman takes her paid leave to take care of her newborn.
She is welcomed back with “How was the Holiday?”
Next time I hear someone saying “holidays” instead of “maternity leave” I am going to call them out.
Taking care of a newborn is not a holiday.
Women who have just given birth go through so much.
Their body needs to heal AND they are taking care of their baby.
- I got a puppy last year and woooooooow, I hear a newborn baby is soooo much more work than puppies.
- I have since then a deeper appreciation for my parents and mad respect to single parents.
Conclusion
Go read this book. If you have men and women that you care about in your life, show them this book.


We're live on Twitch this week with Pokemon Sword and another round of chest waxing!
Tuesday night waxdown!
by Dan RoemerDreezy is live this week on the Destructoid Twitch channel with Pokémon Sword and Call of Duty: Modern Warfare! We're also gonna be giving Dreezy another round of waxing this Tuesday with special guest Nanerboots! But, what games do you wanna see? We're always in need of more community requested games for every Monday, so, feel free to let us know in the comments down below or in the Destructoid Discord channel!
We'll also be giving away copies of whatever is currently streaming to lucky viewers! To be eligible to win, you'll first need to type “!raffle” into the Twitch chat to enter and complete two simple steps:
- You need to be following the Destructoid Twitch channel.
- As well as join/be a member of the Destructoid Discord channel.
The current schedule for this week:
Monday ( November 18, 2019)
Time: 9:30pm - 1:30am
Game: Pokémon Sword & Call of Duty: Modern Warfare
Tuesday (November 19, 2019)
Time: 9:30pm - 3:30am
Game: Getting chest waxed Live on stream and then Yoga with Nanerboots!
Thursday (November 21, 2019)
Time: 9:30pm - 1:30am
Game: Pokémon Sword & Call of Duty: Modern Warfare
Saturday (November 23, 2019)
Time: 9:30pm - 3:30am
Game: Pokémon Sword & Call of Duty: Modern Warfare
So, relax, pull up your favorite chair, and listen to the sights and sounds of a man who will once again sacrifice chest hair and sanity for video games live on the internet. Just as things were always intended to be.


We're sorry but hrbv3 doesn't work properly without JavaScript enabled. Please enable it to continue.


US Sassuolo keen to keep Inter Milan target Alfred Duncan
Italian Serie A outfit US Sassuolo have spelled out their unwillingness to sell midfielder Alfred Duncan.
The Ghana midfielder has been a key cog for the Neroverdi in the ongoing campaign after registering four assists and tallying one goal in 12 games.
The 26-year-old is reported to have been a target for giants Inter and AC Milan in the forthcoming winter transfer window.
However, the Mapei Stadium outfit have no intention of losing their prized asset in mid-season.
The Neroverdi are aware that Duncan and Jeremie Boga are in the crosshairs of the great Italian and foreign clubs.
Duncan has a contract with the club until 2022 with salaries close to €1 million, between fixed and bonus, than to the half) and Sassuolo bet on both.
He was a member of Ghana's squad that recorded two wins in the 2021 Africa Cup of Nations qualifiers against South Africa and Sao Tome and Principe.


Our suite of research databases includes sources for demographics, market research and market segmentation, plus comprehensive resources for nonprofit businesses and thousands of articles from leading business publications.
Services
Our business librarians offer boutique-style service to fit your needs — market information, competitive intelligence, data on industry trends, sample business plans, and more. In addition, our libraries offer meeting rooms and study rooms that may be reserved for uninterrupted work, meetings with clients, and group presentations, with free wireless internet access.
We partner with the South Metro Small Business Development Center (SBDC) to provide free workshops on a variety of small-business topics: Startup Basics, Business Plan Basics, Cash Flow Fundamentals, and Marketing Fundamentals.
Our specially trained business librarians are here to help you with your research.


#include <connectionpolicy.hxx>
Public Types |
| typedef internal::pq::PGconn * | handle |
Member Typedef Documentation
Constructor & Destructor Documentation
| pqxx::connectionpolicy::connectionpolicy |
( |
const std::string & |
opts | ) |
|
|
explicit |
| pqxx::connectionpolicy::~connectionpolicy |
( |
| ) |
throw () |
|
virtual |
Member Function Documentation
| bool pqxx::connectionpolicy::is_ready |
( |
handle |
h | ) |
const throw () |
|
virtual |
| const std::string& pqxx::connectionpolicy::options |
( |
| ) |
const throw () |
The documentation for this class was generated from the following files:


{{ form.non_field_errors }}
{% if form.project %}
{% include "buggy/_formfield.html" with field=form.project %}
{% endif %}
{% if form.title %}
{% include "buggy/_formfield.html" with field=form.title %}
{% endif %}
{% include "buggy/_formfield.html" with field=form.comment %}
{% include "buggy/_formfield.html" with field=form.attachments %}
{% include "buggy/_formfield.html" with field=form.priority %}
{% include "buggy/_formfield.html" with field=form.assign_to %}
{% include 'buggy/_form_actions.html' %}
{% csrf_token %}


Methods should be closed (make method or class final)
class User { public function name(): string { // <-- Method should be final return ''; } }


by Bartosz Ptaszynski
Polyglot programmer and programming languages tourist
You can view this presentation here rawgithub.com/foobarto/presentations/master/erlang.html
a general-purpose programming language and runtime environment. Erlang has built-in support for concurrency, distribution and fault tolerance.
Erlang is a concurrent language which is used to develop naturally clustered large scale applications. This is one of the only languages today that has been designed to get massive.
Mickaël Rémond @ process-one.net
a functional language (no objects!)
a language designed in 1986 to solve specific telecom challenges
ideal for implementing applications that require high concurrency
ideal for implementing highly available/fault tolerant systems
great for writing distributed applications (on Erlang clusters)
has to "run forever" - hot code swapping, hot upgrades, high availability, process supervisors with failure handling and recovery policies
Hardware fails, don't depend that it does not
Failures WILL happen, design to handle them
Limit the blast radius of potential failures by design
Erlang comes with OTP framework to help you do that and more!
I'll fly thgough this part so don't worry if you don't catch everything
Periods . end everything except when
Semicolons ; end clauses
and Commas , separate expressions
~> erl
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.2 (abort with ^G)
1> A = 1. % variables must start with capital letter
1
2> B = (2 * A) + 3.
5
3> B = 3. % once assigned, they cannot change!
** exception error: no match of right hand side value 3
4>
Wot?
There are no loops (while, for, etc)
Use recursive functions instead
1> MyStr = "abcd".
"abcd"
2> MyStr = [97, 98, 99, 100]. % wait.. what?!
"abcd"
3> lists:sort("dcba"). % because they are lists we can do things like this
"abcd"
4>
Strings are just lists
Similar to Ruby symbols, used to represent non-numerical constants, ie. true, ok, blah, error
1> ok.
ok
2> error.
error
3> true.
true
4> A = false.
false
5> A.
false
6> {ok, "success"}.
{ok,"success"}
7>
Fixed length collection of items - the workhorse of Erlang
1> X = 4, Y = 5.
5
2> Point = {X,Y}.
{4,5}
3> Point = {4,5}.
{4,5}
4> {X,Y} = Point.
{4,5}
5> X.
4
6> {X,_} = Point.
{4,5}
7> {_,_} = {4,5}.
{4,5}
8> {_,_} = {4,5,6}.
** exception error: no match of right hand side value {4,5,6}
9> {point, {X,Y}}.
{point,{4,5}}
1>[ 2*N || N <- [1,2,3,4]]. % list comperhension!
[2,4,6,8]
2> [X || X <- [1,2,3,4,5,6,7,8,9,10], X rem 2 =:= 0].
[2,4,6,8,10]
3> [X+Y || X <- [1,2], Y <- [2,3]].
[3,4,4,5]
4> Weather = [{toronto, rain}, {montreal, storms}, {london, fog},
4> {paris, sun}, {boston, fog}, {vancouver, snow}].
[{toronto,rain},
{montreal,storms},
{london,fog},
{paris,sun},
{boston,fog},
{vancouver,snow}]
5> FoggyPlaces = [X || {X, fog} <- Weather]. % pattern matching in list comperhension!
[london,boston]
1> Color = 16#F09A29.
15768105
2> Pixel = << Color:24 >>.
<< 240,154,41 >>
3> << R:8, G:8, B:8 >> = << Color:24 >>.
<< 240,154,41 >>
7> R.
240
8> << R:8, Rest/binary >> = Color.
<< 240,154,41 >>
9> R.
240
10> << SourcePort:16, DestinationPort:16,
AckNumber:32,
DataOffset:4, _Reserved:4, Flags:8, WindowSize:16,
CheckSum: 16, UrgentPointer:16,
Payload/binary >> = SomePacket.
1> [ X || << X >> <= << 1,2,3,4,5 >>, X rem 2 == 0].
[2,4]
2> Pixels = << 213,45,132,64,76,32,76,0,0,234,32,15 >>.
<< 213,45,132,64,76,32,76,0,0,234,32,15 >>
3> RGB = [ {R,G,B} || << R:8,G:8,B:8 >> <= Pixels ].
[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
4> << << R:8, G:8, B:8 >> || {R,G,B} <- RGB >>.
<< 213,45,132,64,76,32,76,0,0,234,32,15 >>
calculate_area({square, Size}) ->
Size * Size;
calculate_area({rect, A, A}) ->
calculate_area({square, A});
calculate_area({rect, A, B}) when is_integer(A), is_integer(B) ->
A * B;
calculate_area({circle, Radius}) when Radius > 0, is_integer(Radius) ->
Pi = 3.14,
Pi * Radius * Radius;
calculate_area(_Unknown) ->
unknown.
lists:map(fun(X) -> X * X end, List).
% or
F = fun(X) ->
X * X
end.
lists:map(F, List).
can be passed to other functions as argument
useless.erl
-module(useless). % module declaration, has to match the name of the file
-export([add/2, hello/0, hello/1, greet_and_add_two/1]). % declare which functions to export
% this is a list of function names and their arity (number of arguments)
add(A, B) ->
A + B.
%% Shows greetings.
%% io:format/1 is the standard function used to output text.
hello() ->
io:format("Hello, world!~n"). % this is the only definition of hello/0 so we finish it with a dot
hello({name, Name}) ->
io:format("Hello there, ~n!", [Name]); % we are not finished yet with defining hello/1
hello(Other) ->
io:format("Hey, ~n whatever you are!", [Other]). % this is last definition of hello/1
greet_and_add_two(X) ->
hello(),
hello({name, "Bob"}),
hello("Thing"),
add(X, 2).
case Expression of
{run_command, Cmd} -> % Expression == {run_command, Something}
do_something(Cmd);
_ -> % anything starting with underscore means 'ignore this' or 'anything'
ok
end.
print_each([]) ->
ok;
print_each([H|T]) ->
io:format("~p~n", [H]),
print_each(T). % tail recursion is safe - does not build up stack
F = fun() ->
io:format("Hi")
end.
Pid = spawn(F).
or
Pid = spawn(io, format, ["Hi"]). % spawn(Module, Function, Args)
Pid = spawn('node1@somehost', io, format, ["Hi"]). % spawn(Node, Module, Function, Args)
Pid ! Message.
Pid ! {run_command, shutdown}.
Pid ! 42.
some_registered_name ! "hey there".
{some_name, 'othernode@otherserver'} ! "how ya doin?".
receive
{run_command, Cmd} ->
io:format("Running command ~p~n", [Cmd]);
Data when is_integer(Data) ->
io:format("Got a number ~p~n", [Data]);
Data ->
io:format("Got something ~p~n", [Data])
end.
Ready?
my_server.erl
-module(my_server).
-export([listen/2, simple_server/1, send/1]).
-define(TCP_OPTIONS, [binary, {packet, 0},
{active, false}, {reuseaddr, true}]).
start_registry() ->
register(socket_mgr, self()),
registry([]).
registry(Sockets) ->
receive
{connected, Pid, Socket} ->
erlang:monitor(process, Pid),
registry([{Pid, Socket}|Sockets]);
{'DOWN', _Ref, process, DeadPid, _Reason} ->
registry(proplists:delete(DeadPid, Sockets));
{send, Msg} ->
lists:map(
fun({_Pid, Socket}) -> gen_tcp:send(Socket, Msg) end,
Sockets
),
registry(Sockets);
_ -> registry(Sockets)
end.
send(Msg) ->
lists:map(
fun(Node) -> {socket_mgr, Node} ! {send, Msg} end,
[node() | nodes()]
).
listen(Port, Handler) ->
{ok, LSocket} = gen_tcp:listen(Port, ?TCP_OPTIONS),
spawn(fun() -> start_registry() end),
accept(LSocket, Handler).
accept(LSocket, Handler) ->
{ok, Socket} = gen_tcp:accept(LSocket),
Pid = spawn(fun() -> Handler(Socket) end),
socket_mgr ! {connected, Pid, Socket},
accept(LSocket, Handler).
simple_server(Socket) ->
case gen_tcp:recv(Socket, 0) of
{ok, Data} ->
send(Data),
simple_server(Socket);
{error, closed} -> ok
end.
% savvy?
Let's see how this works
Erlang
Shell
> erl -sname b1
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.2 (abort with ^G)
(b1@bart-mbp)1> c(my_server).
{ok,my_server}
(b1@bart-mbp)2> my_server:listen(8888,
fun(Sock) -> my_server:simple_server(Sock) end).
> telnet localhost 8888
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying <IP_ADDRESS>...
Connected to localhost.
Escape character is '^]'.
blah
blah
hey there :)
how ya doin?
how ya doin?
> erl -sname b2
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.2 (abort with ^G)
(b2@bart-mbp)1> nodes().
[]
(b2@bart-mbp)2> net_adm:ping('b1@bart-mbp').
pong
(b2@bart-mbp)3> nodes().
['b1@bart-mbp']
(b2@bart-mbp)4> my_server:listen(8887,
fun(Sock) -> my_server:simple_server(Sock) end).
> telnet localhost 8887
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying <IP_ADDRESS>...
Connected to localhost.
Escape character is '^]'.
blah
hey there :)
hey there :)
how ya doin?
Elixir is a functional meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax with macros support that leverages Erlang's abilities to build concurrent, distributed, fault-tolerant applications with hot code upgrades.
Jose Valim @ elixir-lang.com
defmodule Math do
def sum(a, b) do
do_sum(a, b)
end
defp do_sum(a, b) do
a + b
end
def zero?(0) do
true
end
def zero?(x) when is_number(x) do
false
end
end
Math.sum(1, 2) #=> 3
Math.do_sum(1, 2) #=> ** (UndefinedFunctionError)
Math.zero?(0) #=> true
Math.zero?(1) #=> false
Math.zero?([1,2,3]) #=> ** (FunctionClauseError)
iex> lc n inlist [1,2,3,4], do: n * 2
[2,4,6,8]
# or using block
iex> lc n inlist [1,2,3,4] do
...> n * 2
...> end
[2,4,6,8]
iex> lc x inlist [1,2], y inlist [2,3], do: x*y
[2,3,4,6]
iex> lc n inlist [1,2,3,4,5,6], rem(n, 2) == 0, do: n
[2,4,6]
iex> "hello" == 'hello'
false
iex> is_binary "hello"
true
iex> is_list 'hello'
true
iex> string = "é" # unicode support!
"é"
iex> size(string)
2
iex> name = "world"
iex> "hello #{name}" # string interpolation!
"hello world"
iex> if true do
...> a = 1 + 2
...> a + 10
...> end
13
iex> if true, do: (
...> a = 1 + 2
...> a + 10
...> )
13
case { 1, 2, 3 } do
{ 4, 5, 6 } ->
"This won't match"
{ 1, x, 3 } ->
"This will match and assign x to 2"
_ ->
"This will match any value"
end
unless true do
"This will never be seen"
end
if false, do: 1 + 2, else: 10 + 3
if false do
1 + 2
else
10 + 3
end
cond do
2 + 2 == 5 ->
"This will never match"
2 * 2 == 3 ->
"Nor this"
true ->
"This will always match (equivalent to else)"
end
iex> :lists.flatten [1,[2],3]
[1,2,3]
iex> :math.sin :math.pi
1.2246467991473532e-16
f = fn
x, y when x > 0 -> x + y
x, y -> x * y
end
f.(1, 3) #=> 4
f.(-1, 3) #=> -3
defprotocol Blank do
@doc "Returns true if is considered blank/empty"
def blank?(data)
end
defimpl Blank, for: BitString do
def blank?(""), do: true
def blank?(_), do: false
end
defimpl Blank, for: List do
def blank?([]), do: true
def blank?(_), do: false
end
# Just the atoms false and nil are blank
defimpl Blank, for: Atom do
def blank?(false), do: true
def blank?(nil), do: true
def blank?(_), do: false
end
# anything else is not blank
defimpl Blank, for: Any do
def blank?(_), do: false
end
Blank.blank?(0) #=> false
Blank.blank?([]) #=> true
Blank.blank?([1,2,3]) #=> false
# Get the current process id
iex> current_pid = self()
# Spawn another process that will send a message to current_pid
iex> spawn fn ->
current_pid <- { :hello, self() }
end
<0.36.0>
# Collect the message
iex> receive do
...> { :hello, pid } ->
...> IO.puts "Hello from #{inspect(pid)}"
...> after
...> 1000 -> # 1 second
...> IO.puts "Too late"
...> end
Hello from <0.36.0>
But wait, what's the point in reimplementing everything we have done in Erlang?
defmodule MyServer do
def simple_server(socket) do
case :gen_tcp.recv(socket, 0) do
{:ok, data} ->
:my_server.send(data)
simple_server(socket)
{:error, :closed} ->
:ok
end
end
def listen(port, handler) do
:my_server.listen(port, handler)
end
def simple_listen(port) do
listen(port, fn socket -> simple_server(socket) end)
end
end
Erlang
Console
> erl -sname b1
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.2 (abort with ^G)
(b1@bart-mbp)1> c(my_server).
{ok,my_server}
(b1@bart-mbp)2> my_server:listen(8888,
fun(Sock) -> my_server:simple_server(Sock) end).
> telnet localhost 8888
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying <IP_ADDRESS>...
Connected to localhost.
Escape character is '^]'.
hello from Erlang
hello from Erlang
hey there - I'm connected to Elixir :)
cool!
cool!
Elixir
Console
> iex --sname b3
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (0.10.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(b3@bart-mbp)1> :net_adm.ping(:'b1@bart-mbp')
:pong
iex(b3@bart-mbp)2> :erlang.nodes()
[:"b1@bart-mbp", :"b2@bart-mbp"]
iex(b3@bart-mbp)3> c("ex_server.ex")
[MyServer]
iex(b3@bart-mbp)4> MyServer.simple_listen(8886)
> telnet localhost 8886
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying <IP_ADDRESS>...
Connected to localhost.
Escape character is '^]'.
hello from Erlang
hey there - I'm connected to Elixir :)
hey there - I'm connected to Elixir :)
cool!
Framework that makes all the difference
formalizes structure for applications
provides behaviours - callback templates (design patterns) for your code
image from LearnYouSomeErlang.com
contains list of modules and arguments in your application
is responsible for starting and stopping supervisor(s) your application needs
image from LearnYouSomeErlang.com
responsible for starting and maintaining workers and other supervisors
defines restart strategy for processes - it's the heart of the robustness of Erlang applications!
a template for client/server application workers
you may think of it as abstract class
your code is a collection of callbacks - the process is managed by OTP
you can implement sync and async calls with handle_call and handle_cast callbacks
image from LearnYouSomeErlang.com
behaviour for defining FSM
image from LearnYouSomeErlang.com
behaviour for custom event handlers
used to implement efficient message dispatching between processes
If your server has many subscribers, it can keep going because it only needs to forward events once
You don't need to spawn processes for short lived tasks
Ericsson - AXD 301, GPRS, LCS
Erlang Financial Systems - Banking & Lottery systems
Nortel - VPN gateway + others
Facebook - Messenger chat
Google - GTalk
Amazon - SQS and SimpleDB
Microsoft - Bing search
EMC/VMWare - RabbitMQ
MochiMedia - Flash ads middleware
Del.icio.us/Yahoo - social bookmarking
AOL
ETS/DETS
Mnesia
Elixir macros
exception handling
testing
build tools (rebar, mix)
quality tools (wrangler, proper, dialyzer, etc)
examples of OTP in Erlang and Elixir (sorry!)
Thanks!
Bart Ptaszynski @foobarto |<EMAIL_ADDRESS>Presentation available at github.com/foobarto/presentations


info
Who we are?
Tours Operators Esperanza is a tour operator company receptive / emissive that is responsible for showing the charms of the
Republic Dominican; both our beaches, as well as our culture and our ecology. We develop Sustainable Tourism for
the benefit of the community, while we take care of the ecology, and this valuable culture that we have full of
color, charm, fun and flavor gastronomic. Our ancestral tradition leaves tourists who visit us fascinated with
these yearning to know it thoroughly.
work
Mision
Help our clients to have an experience unforgettable when contemplating our culture, our ecology and the attractions that
we have; and at the same time a great impression of the quality service they receive from our team and the community.
remove_red_eye
Vision
To be a leader in tourist service, guaranteeing a constant innovation to be recognized for the human quality of our people
and for our contribution to the community.
videocam
Promotional video
people
Our team
Carmen Parra De Los Santos
Ceo
Gregory Cabral De Los Santos
Web and mobile developer


Morphological Image Processing
Utilises set theoretic operations to process images with structuring elements.
Morphological Operations
1. Dilation - Square-Hole, Text-Broken
input
Loading Libraries...
output
Radius =
input
Loading Libraries...
output
Radius =
2. Erosion - Square
input
Loading Libraries...
output
Radius =
3. Opening - Squares, Cells
input
Loading Libraries...
output
Radius =
input
Loading Libraries...
output
Radius =
4. Closing - Dark Blobs
input
Loading Libraries...
output
Radius =


--- layout: post status: publish published: true title: BizTalk and Team Foundation Server? author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 214 wordpress_url: http://winterdom.com/2006/09/biztalkandteamfoundationserver date: '2006-09-12 20:18:16 +0000' date_gmt: '2006-09-12 20:18:16 +0000' categories: - ".NET" - BizTalk - Workflow tags: [] comments: [] ---
Eric Lee has a pretty interesting idea here of integrating Visual Studio Team Foundation Server with BizTalk Server to create a Virtual Kanban System. Pretty funky stuff and pretty cool.
It sounds, though, as something where possible Windows Workflow Foundation would be an even better choice than BizTalk: It's more lightweight (certainly less expensive for this case) and would offer a more expressive environment for this kind of automation (using custom activities). WF integration for TFS v2.0 process templates, anyone?
Then again, the BizTalk/WF distinction might not be needed one day :-)
Technorati: BizTalk, Team Foundation Server, TFS, Windows Workflow, WF