Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Deploy and Manage cJunosEvolved on Docker

Read this topic to understand how to deploy and manage the cJunosEvolved instance after you install it on Docker.

This topic describes:

Overview

Docker Compose is used to start a topology of cJunosEvolved routers that are configured and connected according to the specifications in a YAML file. The YAML file greatly simplifies deployment, as it is a recipe that allows the containers in it to be configured and connected to each other accordingly.

This section describes the key features of Docker Compose as it pertains to cJunosEvolved deployment.

A sample layout of a Docker Compose file is shown below. For complete example files refer to the vJunos Labs download page on Juniper’s website.

Docker Compose Lay Out Description

This section provides a high-level overview of the Docker Compose YAML file. The details are described in the deployment section.

The services section of the file contains the following fields for each container being deployed:

  • The cJunosEvolved Docker image
  • The container name
  • The optional hostname
  • A mandatory field indicating that privileged mode is used
  • The environmental variables that can be passed into the container are shown in a subsequent table.
  • An ordered and prioritized list of the Docker networks for each container, including the single management Ethernet port and whatever WAN (data) Ethernet ports Docker needs to supply to the container.

There is also an overall networks section in the YAML file. The IP subnet address for each Ethernet port is specified here. This allows Docker to connect the interfaces between the containers properly so that traffic can be carried between them. The management port subnet for the containers in the topology should be specified in the same section.

Environmental Variables

The environmental variables that can be specified for each container in the Docker Compose YAML file are specified below:

Table 1: Environmental Variables
Env Variable Value

Description

CPTX_COSIM

BT

“CPTX_COSIM: BT” emulates the PTX10001-36MR platform which uses the BT chipset. This is the default setting.

CPTX_COSIM

BX

“CPTX_COSIM: BX” emulates the PTX10002-36QDD platform which uses the BX chipset.

CPTX_CHANNELIZED (optional)

1

“CPTX_CHANNELIZED: 1” places the interfaces for either the BT or BX types into channelized mode. If this environmental variable is not specified, the interfaces will be in unchannelized mode, which is the default mode.

CPTX_EVOVM_CPU (optional)

Number of cores for EVOVM

A minimum of 4 cores is required. There is no CPU pinning.

CPTX_EVOVM_MEM_MB (optional)

MB of memory to EVO VM

A minimum of 6292 MB is required.

Note: A minimum of 8GB of memory is required for the entire cJunosEvolved container. Which also includes COSIM and QEMU in the container outside the EVO VM.

CPTX_AUTO_CONFIG (optional)

1

Set to “1” to enable auto provisioning configuration. Auto configuration takes precedence over passing in the configuration via a disk specified in Docker Compose.

WAN Interfaces Mapping

This topic provides the details of interface mapping between the Linux style “eth” WAN ports and the CLI interface naming convention for each type of cJunosEvolved.

cJunosEvolved-BT Unchannelized Interface Mapping

There are 12 unchannelized interfaces supported by the BT version of cJunosEvolved. These interfaces are numbered from et-0/0/0 to et-0/0/11 and are nominally rated at 400 G.

The Docker Compose Linux eth4 – eth15 interfaces correspond to the et-0/0/0 – et-0/0/11 interfaces in the CLI configuration.

cJunosEvolved-BT Channelized WAN Interface Mapping

By using channelization, the 12 unchannelized BT interfaces can be multiplexed into 72 channelized interfaces. The nominal speed for each channelized port is 8x25G. Some physical ports are shut down and not used as per this table once channelization is turned on.

Table 2: cJunosEvolved-BT Channelized WAN Interface Mapping
Channelized port in CLI Notation Ports Docker Compose (i.e., Linux) notation Speed

et-0/0/0:0 to et-0/0/0:7

8

eth4 – eth11

8x25G

et-0/0/1:0 to et-0/0/1:7

8

eth12- eth19

8x25G

et-0/0/2:0 to et-0/0/2:7

8

eth20-eth27

8x25G

et-0/0/3:0 to et-0/0/3:7

8

eth28-eth35

8x25G

et-0/0/4:0 to et-0/0/4:3 (retimer)

4

eth36-eth39

4x25G

et-0/0/5

0

-

shutdown

et-0/0/6:0 to et-0/0/6:3 (retimer)

4

eth40 – eth43

4x25G

et-0/0/7

0

-

shutdown

et-0/0/8:0 to et-0/0/8:7

8

eth44- eth51

8x25G

et-0/0/9:0 to et-0/0/9:7

8

eth52 – eth59

8x25G

et-0/0/10:0 to et-0/0/10:7

8

eth60 – eth67

8x25G

et-0/0/11:0 to et-0/0/11:7

8

eth68 – eth75

8x25G

cJunosEvolved-BX Unchannelized WAN Interface Mapping

This mode supports a total of 36 WAN interfaces. The nominal port speed for each interface is 800 G.

The Docker Compose Linux eth4-eth39 ports correspond to the CLI et-0/0/0- et-0/0/35 interfaces, respectively.

cJunosEvolved-BX Channelized WAN Interface Mapping

Each BX ASIC simulator supports 72 channelized interfaces at 100 G. This yields 144 total channelized interfaces.

Use a CLI command like below to channelize each unchannelized interface, et-0/0/0 is just an example and set the speed to 100 G.

The following tables show the channelization WAN port mapping. The channelization factor is 4x100G, as each “physical” WAN port is divided into 4 channels.

Table 3: BX Channelization WAN Port Mapping
Channelized Port in CLI Notation (Lower 72) Docker Compose Linux interface
et-0/0/0:0 to et-0/0/0:3

eth4 – eth7

et-0/0/1:0 to et-0/0/1:3

eth8- eth11

et-0/0/2:0 to et-0/0/2:3

eth12-eth15

et-0/0/3:0 to et-0/0/3:3

eth16-eth19

et-0/0/4:0 to et-0/0/4:3

eth20-eth23

et-0/0/5:0 to et-0/0/5:3

eth24-eth27

et-0/0/6:0 to et-0/0/6:3

eth28-eth31

et-0/0/7:0 to et-0/0/7:3

eth32-eth35

et-0/0/8:0 to et-0/0/8:3

eth36-eth39

et-0/0/9:0 to et-0/0/9:3

eth40-eth43

et-0/0/10:0 to et-0/0/10:3

eth44-eth47

et-0/0/11:0 to et-0/0/11:3

eth48-eth51

et-0/0/12:0 to et-0/0/12:3

eth52-eth55

et-0/0/13:0 to et-0/0/13:3

eth56-eth59

et-0/0/14:0 to et-0/0/14:3

eth60-eth63

et-0/0/15:0 to et-0/0/15:3

eth64-eth67

et-0/0/16:0 to et-0/0/16:3

eth68-eth71

et-0/0/17:0 to et-0/0/17:3

eth72-eth75

Channelized Port (Upper 72) Docker Compose Linux Notation

et-0/0/18:0 to et-0/0/18:3

eth76-eth79

et-0/0/19:0 to et-0/0/19:3

eth80-eth83

et-0/0/20:0 to et-0/0/20:3

eth84- eth87

et-0/0/21:0 to et-0/0/21:3

eth88-eth91

et-0/0/22:0 to et-0/0/22:3

eth92-eth95

et-0/0/23:0 to et-0/0/23:3

eth96-eth99

et-0/0/24:0 to et-0/0/24:3

eth100-eth103

et-0/0/25:0 to et-0/0/25:3

eth104-eth107

et-0/0/26:0 to eth-0/0/26:3

eth108-eth111

et-0/0/27:0 to et-0/0/27:3

eth112-eth115

et-0/0/28:0 to et-0/0/28:3

eth116-eth119

et-0/0/29:0 to et-0/0/29:3

eth120-eth123

et-0/0/30:0 to et-0/0/30:3

eth124-eth127

et-0/0/31:0 to et-0/0/31:3

eth128-eth131

et-0/0/32:0 to et-0/0/32:3

eth132-eth135

et-0/0/33:0 to et-0/0/33:3

eth136-eth139

et-0/0/34:0 to et-0/0/34:3

eth140-eth143

et-0/0/35:0 to et-0/0/35:3

eth144-eth147

Deploy cJunosEvolved

Docker Compose and its associated YAML file is used for deployment.

Note:

This topic highlights only a few sections of the YAML file for deploying cJunosEvolved through Docker Compose. Some sample cJunosEvolved Compose files are available for download along with the required container image and associated documentation from the lab download page.

  1. Load the cJunosEvolved Docker Compose image onto Ubuntu host.
  2. Run the command in this step to see the image name and its Docker tag.

    This is only an example image. The repository and tag names need to be provided in the Docker Compose YAML file.

  3. Edit the services section of the YAML file as described in the following steps. Do this for each container in your topology.
  4. Set the image field in the YAML file, to <repository:tag> as shown below. Also, choose your container name and hostname. By convention, the hostname should be what you want to set as hostname in the CLI configuration. The container_name identifies the container to the host server and to the various Docker commands, such as docker container ls, docker logs <container_name and so on.
    Note:

    Ensure that the privileged mode must be set to true for each container in the YAML file.

    The image is tagged at build time. You can use that tag as shown below or retag it through Docker.

  5. Set the environmental variables in the YAML file. This is under the services section as well. Refer to the “Environmental Variables” section above.
    • Note:

      For BT set it to " CPTX_COSIM: BT"

      This only needs to be set if you want to assign more CPUs to EVOVM. 4 is the default (and minimum) value and hence is optional. Specify this only if you want to assign more MB of memory to the EVOVM. 6292 MB is the default value and hence does not need to be specified.

    • Specify this only if you want to assign more MB of memory to the EVOVM. 6292 MB is the default value and hence does not need to be specified.

    • Optional way to configure cJunosEvolved. Refer to the configuration section.
  6. Edit the management Ethernet port to configure the IP address. This is under the services section for the specific container in the YAML file. eth0_mgmt designates the management port in the YAML file. The actual interface in the container is “eth0” and must be called in the driver_opts.
    CAUTION:
    To ensure proper connectivity of networks to interfaces, you must use the driver_opts stanza mentioned above for every interface of the container, including WAN (data) interfaces. For more information see https://github.com/docker/compose/issues/12776
    • If you have not set the CPTX_AUTO_CONFIG environment option for the containers in the YAML file, do not specify any WAN interface IP in the YAML file as it will be ignored. Once the container is up and running, you need to pass in a CLI configuration using the volume command or manually configure the IP through CLI.
    • Always set the IP address for the management interface in the YAML file and also specify its subnet IP in the overall network section of the file. This is so you have control over what IP address is assigned to the management interface. This is true whether CPTX_AUTO_CONFIG is used or not.
    • If you are passing the EVO CLI configuration using the volumes command in the YAML file, configure the same management IP address and subnet in the passed in “juniper.conf” as you have in the YAML file.
  7. Similarly, edit the other interfaces in the YAML file, under the networks subsection of the services clause for each container. These first 3 are reserved for internal cJunosEvolved use and should be left as is for proper operation.

    The WAN (data) interfaces start from eth4 on Linux side. There will be multiple of these as per your needs. Only set the IP address for WAN ports if you are using CPTX_AUTO_CONFIG.

  8. You can pass in an entire JunosEvolved hierarchical CLI configuration through the following stanza in the Docker Compose file.
    The hierarchical configuration format is what is shown when the you type the show configuration command in the CLI mode. This is the most comprehensive way to configure cJunosEvolved at startup. If you choose this option, then do not specify WAN IP addresses and subnets in the Docker Compose file. cJunosEvolved will only use IP address/subnets specified in the YAML file when CPTX_AUTO_CONFIG is configured. Otherwise, you can use the Disk Configuration mode or login to the container and configure them manually.
  9. Alternatively, you can use the “CPTX_AUTO_CONFIG: 1” environmental variable, as specified in the “Configure cJunosEvolved on Docker, Automatic Configuration” section.
  10. You must also specify the overall “networks” section of the YAML file.

    This section is common for all the containers in the YAML file, which is common to all the containers. The networks section is listed after the services section for the various containers. This section lists all the WAN interfaces as well as the management interface for the topology. If you specified the IP addresses for interfaces in the matching network section of the YAML file for each container, specify the corresponding subnet IP for the same network in the overall networks section. This allows the interfaces in the individual containers to exchange IP traffic between each other. For example, in previous step one of the containers had this stanza:

    So, in the overall networks section common to the containers in the YAML file, you must specify a valid subnet IP for the same interface as:

  11. Create the cJunosEvolved containers specified in the YAML file using the following command from the host server.

    The -d option runs the containers in the background. This means control is returned to the terminal you run this command from, and you can use the terminal for other purposes.

  12. Run the docker network ls command from the host server to verify that the order of the network interfaces matches the order specified in the YAML file. Otherwise, the connection between the containers specified in the YAML file may be “crossed up”.
  13. Run the docker container ls command from the host server to verify that the containers specified in the Docker Compose file have been created: