Added network sim function.

Fixes #1.