{"id":20074218,"url":"https://github.com/juniper/jp4agent","last_synced_at":"2025-08-17T10:39:51.028Z","repository":{"id":69230278,"uuid":"111169095","full_name":"Juniper/JP4Agent","owner":"Juniper","description":"Juniper's P4 Runtime server implementation.","archived":false,"fork":false,"pushed_at":"2018-09-24T10:18:13.000Z","size":12940,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-21T17:33:19.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Juniper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-18T02:14:15.000Z","updated_at":"2023-07-25T08:28:25.000Z","dependencies_parsed_at":"2023-03-05T23:45:25.749Z","dependency_job_id":null,"html_url":"https://github.com/Juniper/JP4Agent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Juniper/JP4Agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2FJP4Agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2FJP4Agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2FJP4Agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2FJP4Agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Juniper","download_url":"https://codeload.github.com/Juniper/JP4Agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2FJP4Agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837411,"owners_count":24654378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T14:49:55.802Z","updated_at":"2025-08-17T10:39:51.001Z","avatar_url":"https://github.com/Juniper.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Juniper/JP4Agent.svg?branch=master)](https://travis-ci.org/Juniper/JP4Agent)\n\n##### Note: Use of this software is governed by an Apache 2.0 license, and can be found in the “LICENSE” file.\n\nJP4Agent (Juniper P4 Agent)\n==========================\nJuniper's P4 Runtime server implementation.\n\n\u003cbr\u003e\n\u003cdiv style=\"text-align:center\" align=\"center\"\u003e\u003cimg src =\"docs/resources/JP4Agent.png\" width=\"150\"/\u003e\u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n\nJP4Agent GitHub Repository\n=====================\nThis repository provides:\n* JP4Agent source code\n* Setup configuration and scripts\n* Test controller and gtest code\n* Dockerfile(s), configuration and scripts for Docker container where VMX and JP4Agent run\n* Regression scripts\n\n#### Repository Directory Structure\n```\n -- JP4Agent\n    |-- LICENSE              License \n    |-- README.md            This README file\n\t|-- AFI                  AFI data model\n\t|-- build                Build scripts\n\t|-- cli                  Command line\n\t|-- config               JP4Agent Configurations\n\t|-- docs                 Documentation\n\t|-- src\n\t|   |-- afi              AFI HAL\n\t|   |-- jp4agent         JP4Agent\n\t|   |-- pi               PI layer\n\t|   |-- targets\n\t|   |   |-- aft          AFT target HALP\n\t|   |   |-- brcm         Broadcom target HALP\n\t|   |   `-- null         Null target HALP\n\t|   `-- utils            Utils\n\t|-- test\n\t|   |-- controller       Test controller\n\t|   `-- gtest            GTests for JP4agent\n\t`-- tools\n\t\t|-- config           Setup configuration\n\t\t|-- docker           Dockerfile(s), configuration and scripts for Docker\n\t\t`-- scripts          Setup and regression scripts\n```\n\nRequirements\n=====================\n#### Juniper Networks Software\nVMX tarball provided by Juniper\n```\njnprP4vmx.tgz    : Contains all the images/packages needed to run VMX in a container\n```\nNote: Please contact Juniper to get 'jnprP4vmx.tgz'. \u003cbr\u003e\nContacts are listed at the bottom of this page.\n\n#### System Requirements\n```\nHardware requirements\n=====================\nProcessor: \n    Any x86 processor (Intel or AMD) with VT-d capability\nNumber of Cores: \n    4 (1 for VCP and 3 for VFP)\nMemory:\n    Minimum:\n    8 GB (2 GB for VCP, 6 GB for VFP)\n    Additional\n    2 GB recommended for host OS\nStorage: \n    Local or NAS. Minimum 100 GB is recommended.\n       \nSoftware requirements\n=====================\nOperating system\n    Ubuntu 14.04 LTS or 16.04 LTS\nDocker\n    Community Edition (CE) or Enterprise Edition (EE)\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cdiv style=\"text-align:center\" align=\"center\"\u003e \u003cimg src=\"docs/resources/docker-setup.png\" width=\"600\"\u003e \u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n### STEP 1. Install Docker engine on Linux host server\nPlease refer to instructions provided on the following page to install Docker engine on the host server  \n[https://docs.docker.com/engine/installation/linux/ubuntu/](https://docs.docker.com/engine/installation/linux/ubuntu/)\n\n\n### STEP 2. Pull p4-vmx Docker image\nNote: Docker ID (https://hub.docker.com) is needed for this step. \u003cbr\u003e\nPlease create, if you do not already have one. \u003cbr\u003e\nContact Juniper to get access to the Docker image repo. \u003cbr\u003e\nContact is listed at the bottom of this page.\n```\ndocker login\n\u003c\u003c Enter username and password when prompted\n[sudo] docker pull juniper/p4-vmx:latest\n```\n\n### STEP 3. Get VMX tarball from Juniper and extract it\n```\nGet 'jnprP4vmx.tgz' tarball from Juniper and extract it to any preferred location on the host.\nE.g.,\nexport HOST_VMX_LOC=/home/sandesh/VMX\nmkdir $HOST_VMX_LOC\nmv jnprP4vmx.tgz $HOST_VMX_LOC\ncd $HOST_VMX_LOC\ntar xf jnprP4vmx.tgz\n```\n\n### STEP 4. Clone JP4Agent repo\n```\nClone JP4Agent to any preferred folder on the host. \nE.g.,\ncd $HOME\ngit clone git@github.com:Juniper/JP4Agent.git\n```\n\n### STEP 5. Set env variable JP4AGENT_REPO to JP4Agent repo location\n```\nexport JP4AGENT_REPO=$HOME/JP4Agent\n```\n\n### STEP 6. Update VMX setup configuration\n```\nUpdate the configuration in file $JP4AGENT_REPO/tools/config/vmx-cfg.xml\nto modify the following:\n  1. The 2 host interfaces to use for traffic : by default eth1 \u0026 eth2\n  2. The management interface to use: by default eth0\n  3. Console ports for vCP \u0026 vFP: by default 8601 \u0026 8602\n  4. Management IPs for vCP \u0026 vFP to ssh into it\n  5. Location where 'jnprP4vmx.tgz' tarball was extracted.\n\n```\n\n### STEP 7. Install required packages on host server\n```\ncd $JP4AGENT_REPO/tools/scripts\n[sudo] ./install_packages.sh\n```\n\n### STEP 8. Setup VMX\n\nNOTE:\n1. vMX instance runs on the Host.\n2. This step runs Docker with networking mode 'host' (--network=host), \u003cbr\u003e\nto make all host interfaces availabe inside docker. \u003cbr\u003e\nPlease note this mode disables network isolation of the Docker container i.e. \u003cbr\u003e\ncontainer shares the networking namespace of the host.\n\n```\ncd $JP4AGENT_REPO/tools/scripts\n./setup-vmx\n```\nPlease wait for the following message to appear before proceeding with next step. \u003cbr\u003e\n\"VMX Setup Complete!\" \u003cbr\u003e\nPlease login to the vCP using ssh and verify that interfaces xe-0/0/0:1 and xe-0/0/0:2 are up \u003cbr\u003e\n\u003cbr\u003e\nNote: Please go through \"Working with VMX\" section of '[**docs/README.md**](./docs/README.md)' to learn \u003cbr\u003e\nhow to work with VMX setup, viz.,  how to login to VCP and VFP, run Junos CLI commands etc.\n\u003cbr\u003e\n\n### STEP 9. Run regression\n```\ncd $JP4AGENT_REPO/tools/scripts\n./run-regression\n\n```\nPlease observe the output. When the output shows 'GTEST RESULT: PASS', you are good to go.\nYou can open url `http://\u003chost ip\u003e:9000` in browser to see the regression results visually.\n\n### STEP 10. Connect external tester and send unidirectional traffic\n```\nConnect the 2 interfaces specified in vmx-cfg.xml with an external tester\nConfigure Port 1: IP 103.30.120.3/24 and external gateway 103.30.120.2/24\nConfigure Port 2: IP 103.30.130.3/24 and external gateway 103.30.130.2/24\n\nIn the example below,\nif1=eth2\nif2=eth3\n\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cdiv style=\"text-align:center\" align=\"center\"\u003e \u003cimg src=\"docs/resources/vmx_with_tester.png\" width=\"400\"\u003e \u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n### STEP 11. Before stopping docker container, shutdown vmx gracefully\n```\ncd /root/VMX\n../JP4Agent/tools/docker/scripts/stop_vmx.sh\n\nIn case docker is stopped accidentally without graceful vmx shutdown, clean up from the host\ncd $JP4AGENT_REPO/tools/scripts\n[sudo] ./bridge_cleanup.sh\n\n```\n\nContact\n=======\n\u003cb\u003eSandesh Kumar Sodhi\u003c/b\u003e \u003cbr\u003e\nsksodhi at juniper.net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fjp4agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniper%2Fjp4agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fjp4agent/lists"}