4.2.3. Configuring ethernet in the model

There are three ethernet component parameters. When you configure these parameters prior to starting the EB RTSM, you can specify which host interface to use, set the MAC address, and define whether promiscuous mode is enabled. These parameters are:

Configuration file syntax for the ethernet component is given elsewhere in this document. See Ethernet parameters.

interface

The interface parameter setting in the EB RTSM ethernet component sets what host interface to use. When enabled, the ethernet component can use one of two transports, host or pipe.

A block diagram showing the host transport is shown in Figure 4.2.

Figure 4.2. Host transport block diagram


In the Figure, the Virtual Machine is your EB RTSM, and the SMSC91C111 block represents the configurable ethernet component. When using the host transport, the ethernet component communicates directly using TCP/IP with the packet capture component, Pcap. This means that your model must have sufficient permissions to access Pcap directly. This is normally not an issue on Windows if you have administrator rights. On Linux, you might find that you cannot use the host transport unless you have root privileges. This is not recommended for standard user applications. An alternative for Linux is to instead use the pipe transport.

Once data reaches the Ethernet component block, it can be handled in the same way as any other ethernet data. For example, you could connect to a nicserver session running on another host.

A block diagram, showing the situation if you use the pipe transport, is shown in Figure 4.3.

Figure 4.3. Pipe transport block diagram


The Virtual Machine represents your EB RTSM, with the SMSC91C111 block as the ethernet component interface to the world outside of the model. The pipe block provides a TCP/IP address and port with which the nicserver application communicates. This lets you disregard the specifics of the network hardware on your host system, and instead rely on nicserver to route communications appropriately. The nicserver application here acts as a proxy between you and the real network hardware, and removes the need to have direct permission to use network resources. This might be particularly useful on Linux platforms, where nicserver can be given root permissions but still be run by a user. The pipe block can communicate with a nicserver application running on a completely different computer from that on which the EB RTSM is running, as the connection is made over TCP/IP.

The EB RTSM ethernet interface parameter must be configured with one of the three following values:

disabled

Implement the ethernet component as though no cable were connected. This means you can send packets to the component but they are not sent elsewhere. This is the default state.

host:controller

The controller is the first host ethernet controller that matches the string specified. On Linux, you can normally use the name of a specific adapter, such as eth0. On Windows, matters are more complex because you might have two network adaptors with similar names.

If controller is set to “NetworkCardInc”, the first match in the nicserver list is used, if there is more than one device with that string in the name. If you want to use a different controller, you must specify as much of the name as necessary for a unique match. Alternatively you could use the device ID supplied by nicserver.

Use the host:controller setting if you want the EB RTSM ethernet component to connect directly to an ethernet adaptor on the host computer.

pipe:address:port

The numeric address and port values are those of the nicserver application, if used on the host. See nicserver. Use this setting if you want the EB RTSM ethernet component to connect to a virtual network interface card running on the host computer.

mac_address

You must define whether the MAC address of the ethernet component is to be either a fixed or a random value.

Specifying the MAC address in a format analogous to the default value of 00:01:02:03:04:05 defines a static MAC address that does not change from one model invocation to the next.

Specifying the MAC address as auto generates a random local MAC address, with bit 1 set and bit 0 clear. A different IP address is allocated each time the simulator is reset. The chances of the address clashing with an existing MAC address are small but you are discouraged from using this method if IP addresses are being allocated automatically by a DHCP server.

promiscuous

The ethernet component starts in promiscuous mode by default. This means that it receives all network traffic, even that which is not specifically addressed to the device. You must use this mode when you are using a single network device for multiple MAC addresses, for example if you are sharing the same network card between your host OS and the EB RTSM ethernet component.

An example ethernet configuration

As an example, consider that you are using the nicserver application and have set it up to listen on port 7010 and have an IP address of 192.168.0.42. You want the ethernet device on the EB RTSM to have a static MAC address of 0012AB9CE830, and start in promiscuous mode. The syntax to use in a configuration file would be:

baseboard.smsc_91c111_0.interface=pipe:192.168.0.42:7010 baseboard.smsc_91c111_0.mac_address=00:12:AB:9C:E8:30 baseboard.smsc_91c111_0.promiscuous=T

If instead you are using a GUI configuration interface, you need to modify the parameters corresponding to those given in the configuration file syntax example.

Copyright © 2008 ARM Limited. All rights reserved.ARM DUI0424B
Non-ConfidentialUnrestricted Access