This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CPSW in a network system

Guru 20755 points

Hello,

I have a very general question about CPSW.

I understand that it is used in 2 modes: dual port and switch mode.

Dual port seems very simple to understand. It mean that we have 2 seperate ethernet ports, each can have its own network subsystem.

What I don't understand is the switch. Do we understand only one physical port for the switch (the second is not used for anything) ? So What does the switch actually do ? (I am familiar with network switch with several ports, so I don't understand how such switch is actually used)

=========

switch        |   -------------

=========

Thank you!

Ran

  • Hi Ran,

    In switch mode the CPSW Ethernet Switch can be configured in various different combinations of Ethernet Packet forwarding and blocking. Check this wiki for a more detailed description of capabilities: http://processors.wiki.ti.com/index.php/Linux_Core_CPSW_User's_Guide

  • Hi Biser,

    Thank you about that link, I've already read it several times, yet I don't understand how the switch function:
    Do we use only one physical port for the switch (the second is not used for anything) ? If yes - What does the switch actually do ? (I am familiar with network switch with several ports, so I don't understand how such switch is actually used)

    Thank you for the time,
    Ran
  • I will ask an Ethernet expert to give a better description.

  • The cpsw switch is like a traffic director between the ports. It allows the forwarding of packets not meant for the host without bothering the host. One example would a daisy chain or serial topology, the switch will examine the dest MAC address of packets received. If the dest MAC is not the host port or the device then the packet is forwarded to the other external port. This is a very simplistic overview, is there a particular use case you have in mind?

    As mentioned earlier the switch and dual mac mode are mutually exclusive.
  • Hello Schuyler,

    Thank you bery much for the information.

    I have some more questions on the switch:

    1. Are all ports (including host) using the same network subnet ?

    2. "If the dest MAC is not the host port or the device then the packet is forwarded to the other external port." . What do you mean by "or the device" ? Do you mean that the switch also have its own ip address ?

    3. Do we see from host 2 external ports, each with its own ip address (when doing ifconfing in Linux for example) ?

    4. Is VLAN supported only in switch mode, or also in dual port mode ?

    Thank you!

    Ran

  • In switch mode there is only one IP address and therefore only one subnet.

    The Dest MAC address in the ethernet frame is used by the switch as a means of routing between the ports of the switch. The ports themselves do not have addresses but based on internal tables will know which port to direct the packet. If the destination MAC address matches the am335x device then the packet will be sent to that port.

    In switch mode there is only 1 ethernet port, the external ports are not going to be visble with ifconfig. In dual mac mode you will see two ethernet ports with ifconfig.

    The short answer is yes. But, the cpsw switch will require a user app to set up VLANs in the switch. In dual port mode the existing VLAN commands will work.
  • Thank you very much !

    Just last one more question, to be sure I understood it all:

    There are actually 3 MAC addresses that can be configured with the switch:

    1. 2 external ports

    2. 1 host port

    Is that correct ?

    Thank you very much for making it all much more clear now ,

    Ran

  • Yes there are 3 MAC addresses, but in dual port mode there are 2 network interfaces and only 2 MAC addresses will be used for ethernet.

    This can be confusing since ports and interfaces terms are used in an interchangeable manner. The switch is configured to be either a single network interface or a dual interface.
  • Thank you very much !