NDN Sevres Files From MongoDB
NDN-MONGO-FILESERVER tool-bundle is part of iViSA project which includes the following tools:
Take the following steps to install this tool-bundle.
Install the mentioned version of the following packages:
$ sudo apt-get install libmongoc-1.0-0 $ sudo apt-get install libbson-1.0 $ sudo apt-get install cmake libssl-dev libsasl2-dev $ git clone https://github.com/mongodb/mongo-c-driver.git $ cd mongo-c-driver && git checkout 1.15.1 $ python build/calc_release_version.py > VERSION_CURRENT $ mkdir cmake-build $ cd cmake-build $ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. $ make $ sudo make install $ cd ~ && git clone https://github.com/mongodb/mongo-cxx-driver.git $ cd mongo-cxx-driver && git checkout r3.4.0 $ cd build $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. -DBSONCXX_POLY_USE_BOOST=1 $ make $ sudo make install
To configure, compile, and install this tool-bundle, type the following commands in the source directory:
$ ./waf configure $ ./waf $ sudo ./waf install
To make sure the tool-bundle is installed properly here is a quick test:
Run MongoDB service:
$ sudo systemctl start mongod.service
Chunk a content and populate the DB (the following command breaks down the input file into 1kB chunks with version 1 where each chunk's name looks like:
$ chunker /ndn/test -i ~/ndn-mongo-fileserver/README.md -s 1000 -e 1
Run NFD and then run fileserver to serve the available contents in the DB (the following command lets the fileserver to answer all Interests whose name start with
$ ndn-mongo-fileserver /ndn/test
Open segment-fetcher.html in browser and ask for
If no error occurred during any step you can safely quite the fileserver and be sure that the tool-bundle works properly.
To learn how to watch the published videos in modern browsers visit ndn-video-frontend.
Serve videos via NDN testbed
After setting up the NDN fileserver you might want to serve your videos via NDN testbed. To do this, take the following steps:
Get a valid certificate from NDN testbed and set it up on your server. Assume your certificate name is
Encode, package, and chunk your video(s). To do this, first update
driver.shfile to your cert (e.g.,
/ndn/my/cert/video), and then run the following command:
$ (cd ~/ndn-mongo-fileserver/scripts/video && bash driver.sh <absolute-address-of-your-video>)
This command populates the MongoDB with video chunks and at the end generate an HTML page for the video that will be used in step 4.
Connect the NFD on your server to one of the testbed hubs (you might want to choose the closest hub to your server). To do this you can run the following command:
$ bash ~/ndn-mongo-fileserver/scripts/main/run.sh /ndn/my/cert udp hobo.cs.arizona.edu with-stats
This command connects the the NFD instance on your server to
hobo.cs.arizona.eduhub via UDP tunnel and collects the statistical information of the video streaming service whenever anyone watches your videos. You can find the stats under
Set up a webserver and use ndn-video-frontend as your website resources with the following modifications:
To report any bugs or features use the project's issue tracker.
ndn-mongo-fileserver is an open source project licensed under the GPL version 3. See COPYING.md for more information.