Skip to content
Adam edited this page Feb 27, 2013 · 1 revision

Table of Contents

PTP-Enabled Router

This project enhances the reference IPv4 router and SCONE with a simplification of the Precision Time Protocol IEEE-1588. This allows two NetFPGAs to be synchronized down to a few 10s of nanoseconds.The NetFPGAs act as routers running a modified version of SCONE.

Project summary

Status

 Released. 

Known Issues

The hardware implementation can only timestamp a single incoming packet at once. This can cause race conditions if two PTP packets arrive without an intervening read of the timestamp. This problem should get fixed in the future, but for now we wait 50 ms between sending PTP packets on the same port.

There probably are issues that we don't know about.

Version

1.0

Authors

Sara Bolouki, Peter Pawlowski, Jad Naous.

Download

Make sure you are using the NetFPGA 2.0 base package. You will also need a beta account to be able to download. You can download the tarball here.

Regression Tests

Same tests as the reference router and scone. Currently, no PTP-specific tests are defined. However, you can connect two NetFPGAs together and check that they get synchronized using a probe :) Usage below shows how to configure and run the system.

Usage

The following describes how to build, install, and run the project.

Installing

  1. Download the project tarball
  2. Untar the tarball on top of your installed NF2 tree

Building the software

  1. cd NF2/projects/ptp_router/sw
  2. make install
  3. cd scone-ptp
  4. make

Configuration

First you will need to set the MAC addresses and IP addresses of the router ports. This is done by modifying the sw/scone-ptp/cpuhw file. This is file is similar to the one used by SCONE (see the Guide). An example follows:

eth0 192.168.0.9 255.255.255.0 00:00:00:00:09:01
eth1 192.168.1.9 255.255.255.0 00:00:00:00:09:02
eth2 192.168.2.9 255.255.255.0 00:00:00:00:09:03
eth3 192.168.3.9 255.255.255.0 00:00:00:00:09:04
The file is space separated. The first column specifies the NetFPGA port number. Don't get confused between eth0 and nf2c0, they are the same thing in this file. Use the ethX notation for the configuration files. The second column is the IP address, the third is the network mask, and the third is the MAC address.

For PTP, each port of the NetFPGA can be:

  • passive so that it does not consume PTP messages and just passes them along. That is, the port behaves like a regular router port.
  • master so that it is the source for time synchronization and slave ports synchronize to it
  • slave so that the port needs a master clock to synchronize to
If 8 NetFPGAs are connected in a tree, with the NetFPGA that has the master clock on top, then the top NetFPGA will have all its ports set to master mode. All other NetFPGAs will have 1 slave port that connects "up" to a master and 3 master ports that connect "down" to slaves.

The configuration of each port is stored in sw/scone-ptp/ptp.conf. Following is an example file:

eth1 master

eth2 master

eth3 passive

If the above line are in ptp.conf, then the router will synchronize to a master on port 0 and will send synchronize two other NetFPGAs to it on ports 1 and 2. Since port 3 is passive, it does not participate in the synchronization.

debug_data pins 0-4 are connected to toggling signals from the FPGA. These pins go out to the logic analyzer connection pins. You can connect an oscilloscope to observe these signals and be able to look at the synchronization between two boards.

Running

just type "./scone_ptp" as root in sw/scone-ptp.

Experimental Results

We connected 3 NetFPGA nodes in a chain and measured the time differences Clock delta time are calculated between the grand master node, the first and second slaves. Different experiments show the different sampling methods. When an experiment says redundancy filtered, it means that for every pair of equal samples consecutive, we only use one sample.

Setup 1

Sampling every 500 ms, 1200 samples, redundancy filtered

Master and first slave: Master and second slave: First and second slave:

Setup 2

Sampling every 100 ms, 1200 samples, redundancy not filtered

Master and first slave: Master and second slave: First and second slave:

Setup 3

Sampling every 100 ms, 1200 samples, redundancy filtered

Master and first slave: Master and second slave: First and second slave:

Clone this wiki locally