How do you configure the "Port Mirroring" function in the Industrial Ethernet switch SCALANCE X in order to monitor data transfer at a SCALANCE X port?
In this example we monitor the data transfer at Port 3 of an IE switch. Using a network protocol recording you can monitor the messages sent and received by an S7-1200 CPU connected to Port 3. You can use the Wireshark tool installed on a SIMATIC Field PG to do the network protocol recordings. In order to be able to analyze the data traffic at Port 3 of the IE switch using network protocol recording, you connect the SIMATIC Field PG also to the IE switch, at Port 8, for example, and mirror the data traffic from Port 3 to Port 8 (Port Mirroring).
Instructions for SCALANCE X-200, X-200IRT, X-300 and X-400
To set the "Port Mirroring" function you open the "Switch" menu in the Web Based Management of the IE switch:
- Enable the "Monitoring Enable" function.
- For "Mirrored Port" you specify the port to be monitored:
Port 3, for example, to which the S7-1200 CPU is connected.
- For "Mirrored Port" you specify the port
at which data traffic of the "Mirrored Port" is to be mirrored:
Port 8, for example, to which the SIMATIC Field PG is connected.
Instruction for SCALANCE XB-200, XC-200, XF-200BA, XP-200, XR-300WG, XM-400 und XR-500
To set the "Port Mirroring" function you open the "Layer 2 > Mirroring" menu in the Web Based Management of the IE switch.
In the "General" tab you create a Mirroring Session:
- Enable Mirroring.
- Click the "Create" button to create an entry in the table. The session ID is assigned automatically.
- Select "Port Based" (port-based mirroring) for the Session Type.
- Click the "Set Values" button.
- Select the Monitor Port, "P0.8", for example.
- Click the "Set Values" button to save and enable the selected settings.
- Switch to the "Port" tab to make more detailed settings for the session ID.
In the "Port" tab you configure the Mirrored Port:
- With SCALANCE XM-400, for example, you can create multiple sessions. In this case, you must first select the session ID in order to make the table visible in the "Port" tab. In the "Session ID" drop-down list box you select the session that you created previously in the "General" tab.
- In the table you click in the options of the line behind the port to be mirrored, "P0.3", for example. Here you can choose whether you want to monitor ingressing or egressing packets. To monitor all the data traffic of a port you have to select both options.
- Click the "Set Values" button.
- A ring port cannot be used as Monitor Port.
- After setting the "Port Mirroring" function in the SCALANCE X you can use the Wireshark tool to do network protocol recording.
- "Port Mirroring" does not mirror discarded messages. For complete diagnostics you need a SCALANCE TAP, SCALANCE TAP104, for example.
- If multicast and broadcast message are displayed double in the trace, you must go to "Layer 2 > VLAN > General" and change the Monitor Port from "U" to "-". In this way the port is not operated by the switch and only the messages of the "Port Mirroring" arrive. Otherwise the message is delivered via the port and "Port Mirroring".
Detailed information about Industrial Ethernet switches is available in the following manuals.
|SCALANCE X-200 Configuration Manual||63203259|
|SCALANCE XB-200 / XC-200 / XF-200BA / XP-200 / XR-300WG Web Based Management Configuration Manual||109762837|
|SCALANCE X-300/X-400 Configuration Manual||109757297|
|SCALANCE XM-400/XR-500 Web Based Management Configuration Manual||109760840|
|SCALANCE X-500 Web Based Management Configuration Manual||67428305|