Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
9806a4d
Merge PR #548 (packetblaster perf fix) into fixes
lukego Jul 7, 2015
aa579dc
snabbswitch.c: Compile error on non-64bit platforms
lukego Feb 11, 2016
6da7093
documentation-guide: Update according to #743.
eugeneia Feb 11, 2016
96a2931
documentation-guide: Add general style guide.
eugeneia Feb 11, 2016
3b9233c
documentation-guide: Be concise in “General Considerations” primer.
eugeneia Feb 11, 2016
3734760
Add minimal CONTRIBUTING.md.
eugeneia Feb 22, 2016
940c741
CONTRIBUTING.md: explain motivation for wip/sketch PRs.
eugeneia Feb 22, 2016
e5b0d07
CONTRIBUTING.md: Remove paragraph on cross referencing.
eugeneia Feb 22, 2016
2815ba4
CONTRIBUTING.md: Do not implicitly encourage copyright notices.
eugeneia Feb 23, 2016
b950fba
Merge master (v2016.02) into fixes
lukego Feb 23, 2016
6ea4fef
Merge PR #737 (#!/usr/bin/env bash) into fixes
lukego Feb 23, 2016
329315e
core/snabbswitch.c: Require 64-bit word size at compile time
lukego Feb 23, 2016
f473f75
Added kbara-next to branches.md
Feb 24, 2016
e91d1bf
Merge remote-tracking branch 'lukego/wordsize-compile-check' into kba…
Feb 24, 2016
5306f25
Add packet.shiftright
wingo Feb 25, 2016
4e4bb28
Merge remote-tracking branch 'max/contributing' into kbara-next
Feb 25, 2016
6abdfc4
Merge remote-tracking branch 'max/documentation-guide-v2' into kbara-…
Feb 25, 2016
e483d6b
Return from VirtioNet:pull if link is nil
dpino Feb 26, 2016
f27adf3
Merge PR #781 (Add packet.shiftright) into max-next
eugeneia Feb 26, 2016
d5d107e
tests require root access
domenkozar Feb 29, 2016
27bce96
Merge PR #791 (tests require root access) into max-next
eugeneia Feb 29, 2016
2cc5ed6
Merge PR #787 (Exit from VirtioNet:pull if link is nil) into max-next
eugeneia Feb 29, 2016
9fe397e
Replace shm.map with separate create() and open()
wingo Mar 1, 2016
42e9286
shm.open does not truncate file
wingo Mar 1, 2016
7c6255f
Fix spelling of "hierarchical".
wingo Mar 1, 2016
b027b02
Fix permissions when opening writable shm files
wingo Mar 1, 2016
aff2b83
Measure latency of app.breathe()
wingo Feb 23, 2016
9e79a1f
Express histogram:summarize, :report in terms of :iterate
wingo Mar 2, 2016
f9abfd5
Move histogram:summarize to snabb top
wingo Mar 2, 2016
1fe832c
Updated histogram documentation.
wingo Mar 2, 2016
89b0c5b
Rename histogram.count to histogram.total.
wingo Mar 2, 2016
05b87f7
Adapt to feedback regarding iterate() return vals
wingo Mar 2, 2016
396a132
More named constants, fewer magical numbers.
wingo Mar 2, 2016
192fbf7
doc/style.css: Put ToC into a left column.
eugeneia Mar 3, 2016
82df345
Merge branch 'master' into max-next
eugeneia Mar 3, 2016
ffee768
Merge PR #794 (core.shm: replace map with create/open) into max-next
eugeneia Mar 3, 2016
88bc0e7
Merge PR #795 (measure latency of app.breathe) into max-next
eugeneia Mar 3, 2016
da65030
Print out error message in case PCAP could open file
dpino Mar 4, 2016
854af02
branches.md: Added mellanox and multiproc branches
lukego Mar 4, 2016
8364729
Import lightweight 4-over-6 AFTR
Jul 7, 2015
b22e287
Add configurable parameter 'overwrite'
dpino Mar 4, 2016
5c337d0
Add lwaftr branch.
wingo Mar 4, 2016
8bd3ae4
Merge branch max-next (uvilla 1) into next
lukego Mar 6, 2016
76dc489
Merge PR #803 (lwaftr branch) into next
lukego Mar 7, 2016
616110d
Merge PR #800 (mellanox and multiproc branches) into next
lukego Mar 7, 2016
ebe29f5
branches.md: Fix URL for mellanox and multiproc
lukego Mar 7, 2016
0faf70d
Re-Merge PR #800 (mellanox and multiproc branches) into next
lukego Mar 7, 2016
352f944
Merge PR #802 (Import lightweight 4-over-6 AFTR) into max-next
eugeneia Mar 7, 2016
a823e2c
Merge PR #799 (Improve error handling in PcapWriter) into max-next
eugeneia Mar 7, 2016
ea89065
Add scripts/snabb_doc.sh.
eugeneia Mar 7, 2016
a4b9275
snabb_doc: fetch PR head.
eugeneia Mar 7, 2016
d194467
added mention to lisper branch in branches.md
capr Mar 7, 2016
a8789b3
Merge PR #810 (add lisper to branches.md) into next
lukego Mar 9, 2016
11cc9e4
branches.md: Add kbara-next
lukego Mar 9, 2016
7a42127
Merge PR #811 (add kbara-next to branches.md) into next
lukego Mar 9, 2016
3484f54
Merge remote-tracking branch 'upstream/master' into kbara-next
Mar 9, 2016
309f881
Merge remote-tracking branch 'origin/kbara-next' into next
lukego Mar 11, 2016
95ac5b5
branches.md: Remove duplicate entry for kbara-next
lukego Mar 11, 2016
bfaa718
doc/in-a-nutshell.md: High-level overview
lukego Mar 11, 2016
203badc
increase timeout for link_up to 1 second (from 250ms)
Mar 11, 2016
b68d515
Merge PR #819 (intel10g: increase timeout for link_up) into max-next
eugeneia Mar 11, 2016
105ac9a
Merge PR #818 (Add doc/in-a-nutshell.md) into max-next
eugeneia Mar 11, 2016
e8f4c8c
Merge PR #806 (doc/style.css: Put ToC into a left column) into max-next
eugeneia Mar 11, 2016
0c1415a
Merge PR #805 (Add scripts/snabb_doc.sh) into max-next
eugeneia Mar 11, 2016
28a42d6
Merge #821 remote-tracking branch 'max/max-v2016.04-2' into next
lukego Mar 13, 2016
16ab7fb
branches.md: Add branch pdf-manual
lukego Mar 15, 2016
b067b5a
Merge #826 remote-tracking branch 'lukego/pdf-manual-branch' into next
lukego Mar 15, 2016
0ea56fd
Add ipsec branch.
eugeneia Mar 15, 2016
71ecfea
Merge #828 remote-tracking branch 'max/add-esp-branch' into next
lukego Mar 16, 2016
c7b776b
branches.md: Fix url for pdf-manual
lukego Mar 16, 2016
7a5c2f2
Merge branch 'pdf-manual-branch' into next
lukego Mar 16, 2016
7f62f8f
Documentation: Remove build artifacts from repo
lukego Mar 17, 2016
073d5d4
Makefile, genbook.sh: Output processed markdown in obj/
lukego Mar 17, 2016
86734c8
src/Makefile: Build manual in obj/doc/
lukego Mar 17, 2016
35a2422
.gitignore: Add .images directories
lukego Mar 17, 2016
3507e16
doc/template.latex: Updated to suit recent pandoc
lukego Mar 17, 2016
0a6bca8
FIX snabbnfv getting-started.md
yu-kasuya Mar 17, 2016
fbe95a0
Merge PR #829 (Markdown on demand) into max-next
eugeneia Mar 17, 2016
47cbf75
Merge PR #830 (doc/template.latex update for recent pandoc) into max-…
eugeneia Mar 17, 2016
bb8a21d
Merge PR #833 (FIX snabbnfv getting-started.md) into max-next
eugeneia Mar 17, 2016
5e350a9
scripts/snabb_doc.sh: Update for #829.
eugeneia Mar 17, 2016
22d653f
snabb_doc: Add proper parentheses.
eugeneia Mar 17, 2016
64ee8af
scripts/process-markdown: New takes output file arg
lukego Mar 18, 2016
75604d3
add nix maintainer branch
domenkozar Mar 18, 2016
8769973
Merge fix for PR #829 (Markdown on demand) into max-next
eugeneia Mar 18, 2016
6cdf894
Merge branch 'max-next' into update_snabbdoc
eugeneia Mar 18, 2016
19ffe84
scripts/process-markdown: Fix usage of readlink
lukego Mar 20, 2016
b388a63
Merge #831 remote-tracking branch 'domenkozar/nix' into next
lukego Mar 21, 2016
676a085
Merge fix(2) for PR #829 (Markdown on demand) into max-next
eugeneia Mar 21, 2016
123e700
Merge branch 'max-next' into update_snabbdoc
eugeneia Mar 21, 2016
9e5437f
Merge PR #834 (Update scripts/snabb_doc.sh for #829) into max-next
eugeneia Mar 21, 2016
a785135
Merge #840 branch 'max/max-v2016.04-3' into next
lukego Mar 22, 2016
06c27c6
branches.md: 'documentation' replaces 'documentation-fixups'
lukego Mar 23, 2016
a599210
Everywhere: Shorten "Snabb Switch" to "Snabb"
lukego Mar 31, 2016
15f3eff
Removed src/scripts/sysv
lukego Mar 31, 2016
fbbe1dc
src/Makefile: Drop symlink snabbswitch->snabb
lukego Mar 31, 2016
bee3627
src/Makefile: Rename documentation snabbswitch.* to snabb.*
lukego Mar 31, 2016
82f73f4
neutron_sync_agent.sh: s/snabbswitch/snabb/ in default dirs
lukego Mar 31, 2016
d654230
lwaftr: Shorten "snabbswitch" to "snabb"
lukego Mar 31, 2016
5254016
Replace 'snabbswitch' with 'snabb'
lukego Mar 31, 2016
d8af9b9
Merge #852 remote-tracking branch 'lukego/rename-to-snabb2' into next
lukego Apr 1, 2016
5534b88
[snabb_doc] Fix for #855.
eugeneia Apr 4, 2016
2ddc8b3
Merge #856 remote-tracking branch 'eugeneia/update_snabbdoc' into next
lukego Apr 5, 2016
03f5958
Merge PR #855 (v2016.04 release) onto master
eugeneia Apr 5, 2016
e399381
Top-level README: Rename "Snabb Switch" to "Snabb"
lukego Apr 6, 2016
b81cbb5
engine: Add timeline events for the breathe cycle
lukego Apr 18, 2016
0d8eea4
genbook.sh: Fix bug where image artifacts were linked in doc/.images.
eugeneia Apr 19, 2016
02bb9de
snabb_doc: make clean before each build.
eugeneia Apr 19, 2016
5a16abd
src/README.md: fix architecture diagram.
eugeneia Apr 19, 2016
6898d6a
engine: More timeline events for breathe cycle
lukego Apr 20, 2016
ed63a79
nfv: Save timeline at end of benchmark-mode
lukego Apr 20, 2016
1e82e0d
Merge branch 'master' into fixes
lukego Apr 20, 2016
26b119c
Merge #885 branch 'eugeneia/fix-genbook' into fixes
lukego Apr 20, 2016
ed2e399
Merge #858 branch 'lukego/rename-in-readme' into fixes
lukego Apr 20, 2016
38d4585
Merge PR #887 (v2016.04.1 bugfix release) into master
eugeneia Apr 20, 2016
388bbfe
Merge branch 'master' into timeline-engine
lukego May 10, 2016
7629b0f
core.timeline: Update for new core.shm API
lukego May 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ obj
/src/syscall
/deps/*.vsn
/src/programs.inc
.images
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Whenever you create a Pull Request (PR), a maintainer will self-assign
themselves as the *upstream*. The upstream decides if your PR is accepted and
might require you to amend additional changes before merging. You can expect
the upstream to communicate clearly if there are any issues preventing your PR
from being merged, and how they can be fixed. Once merged, the upstream will
add the `merged` label to your PR.

You are also welcome to submit PRs you would like to receive feedback on, but
which are not ready to be merged: include the labels `[wip]` in the title of
PRs that require further work, and `[sketch]` for PRs that are not meant to be
merged at all.

Our [Documentation Guide](https://github.com/SnabbCo/snabbswitch/blob/master/src/doc/documentation-guide.md)
gives pointers on how to contribute to the project's documentation.

If you wish to record a copyright notice with your contribution then you can
optionally do this in the file `src/COPYRIGHT`; copyright notices in other
files will be rejected.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Snabb Switch
# Snabb

Snabb Switch is a simple and fast packet networking toolkit.
Snabb (formerly "Snabb Switch") is a simple and fast packet networking toolkit.

We are also a grassroots community of programmers and network
engineers who help each other to build and deploy new network
elements. We care about practical applications and finding simpler
ways to do things.

The Snabb Switch community are active in
The Snabb community are active in
[applying modern programming techniques](http://blog.ipspace.net/2014/09/snabb-switch-deep-dive-on-software-gone.html),
[do-it-yourself operator networking](http://blog.ipspace.net/2014/12/l2vpn-over-ipv6-with-snabb-switch-on.html),
[high-level device drivers](https://github.com/SnabbCo/snabbswitch/blob/master/src/apps/intel/intel10g.lua),
Expand All @@ -24,21 +24,21 @@ on.

## How does it work?

Snabb Switch is written using these main techniques:
Snabb is written using these main techniques:

- Lua, a high-level programming language that is easy to learn.
- LuaJIT, a just-in-time compiler that is competitive with C.
- Ethernet I/O with no kernel overhead ("kernel bypass" mode).

Snabb Switch compiles into a stand-alone executable called
Snabb compiles into a stand-alone executable called
`snabb`. This single binary includes multiple applications and runs on
any modern Linux distribution. (You could think of it as a
[busybox](http://en.wikipedia.org/wiki/BusyBox#Single_binary) for
networking.)

## How is it being used?

The first generation of Snabb Switch applications include:
The first generation of Snabb applications include:

### snabbnfv

Expand All @@ -53,6 +53,17 @@ network.
You can deploy Snabb NFV stand-alone with QEMU or you can integrate it
with a cloud computing platform such as OpenStack.

### lwAFTR

[Snabb lwAFTR](src/program/lwaftr/) is the internet-facing component of
"lightweight 4-over-6" (lw4o6), an IPv6 transition technology. An ISP
can use lwAFTR functions to provide its users with access to the IPv4
internet while maintaining a simple IPv6-only internal network. An ISP
deploying Snabb lwAFTR can also configure lw4o6 to share IPv4 addresses
between multiple different customers, ameliorating the IPv4 address
space exhaustion problem and lowering costs. See the [lwAFTR
documentation](src/program/lwaftr/doc/) for more details.

### VPWS

VPWS (Virtual Private Wire Service) is a Layer-2 VPN application being
Expand All @@ -73,13 +84,13 @@ or even directly on a Device Under Test.
### snsh

[snsh](src/program/snsh/) (Snabb Shell) is a tool for interactively
experimenting with Snabb Switch. It provides direct access to all APIs
experimenting with Snabb. It provides direct access to all APIs
using a Lua shell. You can operate snsh either from script files or
from an interactive shell.

## How do I get started?

Setting up a Snabb Switch development environment takes around one
Setting up a Snabb development environment takes around one
minute:

```
Expand All @@ -103,7 +114,7 @@ $ sudo snabb packetblaster replay capture.pcap 01:00.0

Here are the ways you can get involved:

- Use the Snabb Switch applications in your network.
- Use the Snabb applications in your network.
- Join the [snabb-devel mailing list](https://groups.google.com/forum/#!forum/snabb-devel).
- Send a mail to [introduce yourself](https://groups.google.com/forum/#!searchin/snabb-devel/introduce/snabb-devel/d8t6hGClnQY/flztyLiIGzoJ) to the community (don't be shy!).
- Create your very own application: [Getting Started](src/doc/getting-started.md).
Expand Down
Binary file removed src/.images/Architecture.png
Binary file not shown.
Binary file removed src/.images/Network.png
Binary file not shown.
30 changes: 14 additions & 16 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CSRC = $(shell find . -regex '[^\#]*\.c' -not -regex './arch/.*' -printf '%P '
CHDR = $(shell find . -regex '[^\#]*\.h' -printf '%P ')
ASM = $(shell find . -regex '[^\#]*\.dasl' -printf '%P ')
ARCHSRC= $(shell find . -regex '^./arch/[^\#]*\.c' -printf '%P ')
RMSRC = $(shell find . -name README.src.md -printf '%P ')
RMSRC = $(shell find . -name '*.md' -not -regex './obj.*' -printf '%P ')
# regexp is to include program/foo but not program/foo/bar
PROGRAM = $(shell find program -regex '^[^/]+/[^/]+' -type d -printf '%P ')
# sort to eliminate potential duplicate of programs.inc
Expand All @@ -30,7 +30,7 @@ ARCHOBJ:= $(patsubst %.c,obj/%_c.o, $(ARCHSRC))
ASMOBJ := $(patsubst %.dasl,obj/%_dasl.o, $(ASM))
JITOBJS:= $(patsubst %,obj/jit_%.o,$(JITSRC))
EXTRAOBJS := obj/jit_tprof.o obj/jit_vmprof.o obj/strict.o
RMOBJS := $(patsubst %.src.md,%.md,$(RMSRC))
RMOBJS := $(patsubst %,obj/%,$(RMSRC))
INCOBJ := $(patsubst %.inc,obj/%_inc.o, $(INCSRC))
EXE := bin/snabb $(patsubst %,bin/%,$(PROGRAM))

Expand All @@ -54,7 +54,6 @@ snabb: $(LUAOBJ) $(PFLUAOBJ) $(HOBJ) $(COBJ) $(ARCHOBJ) $(ASMOBJ) $(INCOBJ) $(LU
../lib/luajit/src/libluajit.a \
-lrt -lc -ldl -lm -lpthread
@echo -n "BINARY "
@ln -fs snabb snabbswitch
@ls -sh snabb

all: $(EXE)
Expand Down Expand Up @@ -110,7 +109,7 @@ $(TESTSCRIPTS): testlog snabb
) \
)

$(OBJDIR) bin testlog:
$(OBJDIR) bin testlog $(OBJDIR/doc):
$(E) "DIR $@"
$(Q) mkdir -p $@

Expand Down Expand Up @@ -151,10 +150,9 @@ $(JITOBJS): obj/jit_%.o: ../lib/luajit/src/jit/%.lua $(OBJDIR)
$(E) "LUA $@"
$(Q) luajit -bg -n $(patsubst obj/jit_%.o, jit.%, $@) $< $@


$(RMOBJS): %.md: %.src.md
$(RMOBJS): obj/%: %
$(E) "MARKDOWN $@"
$(Q) scripts/process-markdown $< > $@
$(Q) scripts/process-markdown $< $@

$(INCOBJ): obj/%_inc.o: %.inc Makefile | $(OBJDIR)
$(E) "INC $@"
Expand Down Expand Up @@ -182,24 +180,24 @@ obj/jit_vmprof.o: extra/vmprof.c | $(OBJDIR)
$(E) "C $@"
$(Q) gcc $(DEBUG) -Wl,-E -O2 -I ../lib/luajit/src -c -Wall -Werror -o $@ $<

book: doc/snabbswitch.pdf doc/snabbswitch.html doc/snabbswitch.epub
book: obj/doc/snabb.pdf obj/doc/snabb.html obj/doc/snabb.epub

doc/snabbswitch.md: markdown Makefile doc/genbook.sh
obj/doc/snabb.markdown: markdown Makefile doc/genbook.sh
(cd doc; ./genbook.sh) > $@

doc/snabbswitch.pdf: doc/snabbswitch.md
obj/doc/snabb.pdf: obj/doc/snabb.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --template=template.latex --latex-engine=lualatex -V fontsize=10pt -V monofont=droidsansmono -V monoscale=.70 -V verbatimspacing=.85 -V mainfont=droidserif -V sansfont=droidsans -V documentclass:book -V geometry:top=1.0in -V geometry:bottom=0.75in -S --toc --chapters -o snabbswitch.pdf snabbswitch.md)
$(Q) (cd obj/doc; pandoc --template=template.latex --latex-engine=lualatex -V fontsize=10pt -V monofont=droidsansmono -V monoscale=.70 -V verbatimspacing=.85 -V mainfont=droidserif -V sansfont=droidsans -V documentclass:book -V geometry:top=1.0in -V geometry:bottom=0.75in -S --toc --chapters -o ../../$@ ../../$<)

doc/snabbswitch.html: doc/snabbswitch.md
obj/doc/snabb.html: obj/doc/snabb.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o snabbswitch.html snabbswitch.md)
$(Q) (cd obj/doc; pandoc --self-contained --css="../../doc/style.css" -S -s --toc --chapters -o ../../$@ ../../$<)

doc/snabbswitch.epub: doc/snabbswitch.md
obj/doc/snabb.epub: obj/doc/snabb.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o snabbswitch.epub snabbswitch.md)
$(Q) (cd obj/doc; pandoc --self-contained --css="../../doc/style.css" -S -s --toc --chapters -o ../../$@ ../../$<)

CLEAN = snabb snabbswitch obj bin doc/snabbswitch.* doc/.images/* testlog programs.inc
CLEAN = snabb obj bin testlog programs.inc

clean:
$(E) "RM $(CLEAN)"
Expand Down
71 changes: 51 additions & 20 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,65 @@
# Introduction

*Snabb Switch* is an extensible, virtualized, Ethernet networking
toolkit. With Snabb Switch you can implement networking applications
using the *Lua language*. Snabb Switch includes all the tools you need to
*Snabb* is an extensible, virtualized, Ethernet networking
toolkit. With Snabb you can implement networking applications
using the *Lua language*. Snabb includes all the tools you need to
quickly realize your network designs and its really fast too!
Furthermore, Snabb Switch is extensible and encourages you to grow the
Furthermore, Snabb is extensible and encourages you to grow the
ecosystem to match your requirements.

![Architecture](.images/Architecture.png)

The Snabb Switch Core forms a runtime environment (*engine*) which
DIAGRAM: Architecture
+---------------------+
| Your Network Design |
+----*-----*-----*----+
| | |

(Built in and custom Apps and Libraries)

| | |
+-----*-----*-----*-----+
| Snabb Core |
+-----------------------+

The Snabb Core forms a runtime environment (*engine*) which
executes your *design*. A design is simply a Lua script used to drive the
Snabb Switch stack, you can think of it as your top-level "main" routine.
Snabb stack, you can think of it as your top-level "main" routine.

In order to add functionality to the Snabb Switch stack you can load
modules into the Snabb Switch engine. These can be Lua modules as well as
In order to add functionality to the Snabb stack you can load
modules into the Snabb engine. These can be Lua modules as well as
native code objects. We differentiate between two classes of modules,
namely libraries and *Apps*. Libraries are simple collections of program
utilities to be used in your designs, apps or other libraries, just as
you might expect. Apps, on the other hand, are code objects that
implement a specific interface, which is used by the Snabb Switch engine
implement a specific interface, which is used by the Snabb engine
to organize an *App Network*.

![Network](.images/Network.png)

Usually, a Snabb Switch design will create a series of apps, interconnect
DIAGRAM: Network
+---------+
| |
+->* Filter0 *--+
| | | |
| +---------+ |
+---+----+ | | +----+---+
| *--+ +->* |
| NIC0 | | NIC1 |
| *<-+ +--* |
+---+----+ | | +----+---+
| +---------+ |
| | | |
+--* Filter1 *<-+
| |
+---------+

Usually, a Snabb design will create a series of apps, interconnect
these in a desired way using *links* and finally pass the resulting app
network on to the Snabb Switch engine. The engine's job is to:
network on to the Snabb engine. The engine's job is to:

* Pump traffic through the app network
* Keep the app network running (e.g. restart failed apps)
* Report on the network status


# Snabb Switch API
# Snabb API

The core modules defined below can be loaded using Lua's `require`. For
example:
Expand Down Expand Up @@ -184,7 +210,7 @@ network. The engine updates the app network as follows:

— Function **engine.main** *options*

Run the Snabb Switch engine. *Options* is a table of key/value pairs. The
Run the Snabb engine. *Options* is a table of key/value pairs. The
following keys are recognized:

* `duration` - Duration in seconds to run the engine for (as a floating
Expand All @@ -198,6 +224,11 @@ following keys are recognized:
set to boolean values to force or suppress link and app reporting
individually. By default `engine.main()' will report on links but not
on apps.
* `measure_latency` - By default, the `breathe()` loop is instrumented
to record the latency distribution of running the app graph. This
information can be processed by the `snabb top` program. Passing
`measure_latency=false` in the *options* will disable this
instrumentation.
* `no_report` - A boolean value. If `true` no final report will be
printed.

Expand Down Expand Up @@ -333,7 +364,7 @@ Allocate packet and fill it with the contents of *string*.

## Memory (core.memory)

Snabb Switch allocates special
Snabb allocates special
[DMA](https://en.wikipedia.org/wiki/Direct_memory_access) memory that
can be accessed directly by network cards. The important
characteristic of DMA memory is being located in contiguous physical
Expand Down Expand Up @@ -582,7 +613,7 @@ integers *n* respectively.

## Main

Snabb Switch designs can be run either with:
Snabb designs can be run either with:

snabb <snabb-arg>* <design> <design-arg>*

Expand All @@ -591,7 +622,7 @@ or
#!/usr/bin/env snabb <snabb-arg>*
...

The *main* module provides an interface for running Snabb Switch scripts.
The *main* module provides an interface for running Snabb scripts.
It exposes various operating system functions to scripts.

— Field **main.parameters**
Expand Down
Loading