Juniper/JP4Agent

Name: JP4Agent

Owner: Juniper Networks

Description: Juniper's P4 Runtime server implementation.

Created: 2017-11-18 02:14:15.0

Updated: 2018-05-19 12:21:02.0

Pushed: 2018-05-04 23:48:49.0

Homepage:

Size: 12795

Language: C++

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Note: Use of this software is governed by an Apache 2.0 license, and can be found in the ?LICENSE? file.

JP4Agent (Juniper P4 Agent)

Juniper's P4 Runtime server implementation.




JP4Agent GitHub Repository

This repository provides:

Repository Directory Structure
JP4Agent
|-- LICENSE              License 
|-- README.md            This README file
|-- AFI                  AFI data model
|-- build                Build scripts
|-- cli                  Command line
|-- config               JP4Agent Configurations
|-- docs                 Documentation
|-- src
|   |-- afi              AFI HAL
|   |-- jp4agent         JP4Agent
|   |-- pi               PI layer
|   |-- targets
|   |   |-- aft          AFT target HALP
|   |   |-- brcm         Broadcom target HALP
|   |   `-- null         Null target HALP
|   `-- utils            Utils
|-- test
|   |-- controller       Test controller
|   `-- gtest            GTests for JP4agent
`-- tools
    |-- config           Setup configuration
    |-- docker           Dockerfile(s), configuration and scripts for Docker
    `-- scripts          Setup and regression scripts

Requirements

Juniper Networks Software

VMX tarball provided by Juniper

P4vmx.tgz    : Contains all the images/packages needed to run VMX in a container

Note: Please contact Juniper to get 'jnprP4vmx.tgz'.
Contacts are listed at the bottom of this page.

System Requirements
ware requirements
=================
essor: 
Any x86 processor (Intel or AMD) with VT-d capability
er of Cores: 
4 (1 for VCP and 3 for VFP)
ry:
Minimum:
8 GB (2 GB for VCP, 6 GB for VFP)
Additional
2 GB recommended for host OS
age: 
Local or NAS. Minimum 100 GB is recommended.

ware requirements
=================
ating system
Ubuntu 14.04 LTS or 16.04 LTS
er
Community Edition (CE) or Enterprise Edition (EE)





STEP 1. Install Docker engine on Linux host server

Please refer to instructions provided on the following page to install Docker engine on the host server
https://docs.docker.com/engine/installation/linux/ubuntu/

STEP 2. Pull p4-vmx Docker image

Note: Docker ID (https://hub.docker.com) is needed for this step.
Please create, if you do not already have one.
Contact Juniper to get access to the Docker image repo.
Contact is listed at the bottom of this page.

er login
nter username and password when prompted
o] docker pull juniper/p4-vmx:latest
STEP 3. Get VMX tarball from Juniper and extract it
'jnprP4vmx.tgz' tarball from Juniper and extract it to any preferred location on the host.
,
rt HOST_VMX_LOC=/home/sandesh/VMX
r $HOST_VMX_LOC
nprP4vmx.tgz $HOST_VMX_LOC
HOST_VMX_LOC
xf jnprP4vmx.tgz
STEP 4. Clone JP4Agent repo
e JP4Agent to any preferred folder on the host. 
,
HOME
clone git@github.com:Juniper/JP4Agent.git
STEP 5. Set env variable JP4AGENT_REPO to JP4Agent repo location
rt JP4AGENT_REPO=$HOME/JP4Agent
STEP 6. Update VMX setup configuration
te the configuration in file $JP4AGENT_REPO/tools/config/vmx-cfg.xml
odify the following:
 The 2 host interfaces to use for traffic : by default eth1 & eth2
 The management interface to use: by default eth0
 Console ports for vCP & vFP: by default 8601 & 8602
 Management IPs for vCP & vFP to ssh into it
 Location where 'jnprP4vmx.tgz' tarball was extracted.
STEP 7. Install required packages on host server
JP4AGENT_REPO/tools/scripts
o] ./install_packages.sh
STEP 8. Setup VMX

NOTE:

  1. vMX instance runs on the Host.
  2. This step runs Docker with networking mode 'host' (–network=host),
    to make all host interfaces availabe inside docker.
    Please note this mode disables network isolation of the Docker container i.e.
    container shares the networking namespace of the host.
JP4AGENT_REPO/tools/scripts
tup-vmx

Please wait for the following message to appear before proceeding with next step.
“VMX Setup Complete!”
Please login to the vCP using ssh and verify that interfaces xe-0/0/0:1 and xe-0/0/0:2 are up

Note: Please go through “Working with VMX” section of 'docs/README.md' to learn
how to work with VMX setup, viz., how to login to VCP and VFP, run Junos CLI commands etc.

STEP 9. Run regression
JP4AGENT_REPO/tools/scripts
n-regression

Please observe the output. When the output shows 'GTEST RESULT: PASS', you are good to go. You can open url http://<host ip>:9000 in browser to see the regression results visually.

STEP 10. Connect external tester and send unidirectional traffic
ect the 2 interfaces specified in vmx-cfg.xml with an external tester
igure Port 1: IP 103.30.120.3/24 and external gateway 103.30.120.2/24
igure Port 2: IP 103.30.130.3/24 and external gateway 103.30.130.2/24

he example below,
eth2
eth3





STEP 11. Before stopping docker container, shutdown vmx gracefully
root/VMX
P4Agent/tools/docker/scripts/stop_vmx.sh

ase docker is stopped accidentally without graceful vmx shutdown, clean up from the host
JP4AGENT_REPO/tools/scripts
o] ./bridge_cleanup.sh

Contact

Sandesh Kumar Sodhi
sksodhi at juniper.net


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.