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.

Can I send UDP from Port1 to Port2 in Gbe ?



Can I send UDP from Port1 to Port2 in Gbe ?

  • Hi xi,

    What exact device did you mention?

    Best Regards,
    Atsushi

  • sorry , i mean C6678.

  • Hi xi,

    As mentioned in the different thread, two external Ethernet ports of C6678 are connected to the internal Ethernet switch.  In addition, the switch has one internal port and totally 3 port.  By default, the Ethernet switch exchanges any packets among 3 ports.

    As a result, any Ethernet frames (includes TCP, UDP and other IP datagram packets) coming from the port 1 is transferred to port 2 and also into C6678, and vice versa.

    To be precise, the internal switch has MAC address learning capability (or ALE) but the above is basic philosophy.

    Best Regards,
    Atsushi

  • Thank you ! 

    Now my C6678 connect two differnt PC by each  port (Port1 and Port2) ,  if i send a udp to one of  the PC , as you mentioned , both  of  the PC  will receive the  UDP . is it right? And when one of the PC send a UDP to the C6678 ,the pther PC will receive th UDP too? 

  • Hi xi,

    > if i send a udp to one of  the PC , as you mentioned , both  of  the PC  will receive the  UDP . is it right?

    From the internal Ethernet switch standpoint, it is "yes" when the switch has no knowledge which port has the Ethernet node which has the MAC destination address the UDP datagram has.  (Please note that any UDP packet on the Ethernet is encapsulated by Ethernet frame.)

    However, from general TCP/IP standpoint (except for multicast or broadcast), any UDP datagram has a unique destination IP address.  For example, PC at the port 1 has IP address IP_1 and PC at the port 2 has IP_2.  IP_1 and IP_2 should be different from TCP/IP standpoint.  When C6678 transmit a UDP datagram which has destination address IP_1, only PC at the port 1 will receive it and PC at the port 2 will discard it by nature.

    In addition, the internal Ethernet switch has address learning capability.  Once the switch received an Ethernet frame from a PC at a port, now the switch has the knowledge where the PC is connected by reading the source address of the Ethernet frame.  After that, the Ethernet switch forward a packet to the required port only to avoid unnecessary traffic.

    > And when one of the PC send a UDP to the C6678 ,the pther PC will receive th UDP too?

    This is as same as the above.  Prior learning address, the internal Ethernet switch will transfer the UDP datagram to the PC at the different port.  But we also need to take care of the TCP/IP philosophy and also address learning capability of the Ethernet switch as same as the above example.

    If you are new to the TCP/IP and underlying network technology e.g. Ethernet, my recommendation is the following reference.  The internal Ethernet switch of C6678 acts a "learning bridge" which the book explains but C6678 internal Ethernet switch has three ports.

    Regards,
    Atsushi

  • But When the dsp send a UDP  to  a PC first time ,  how does the internal Ethernet switch know which port is connect to PC ? Thank you!

  • Hi xi,

    Sorry for my not complete answer.

    When sending a packet from C6678 to PC, the switch has no way to know which port is connected to PC.  However, whenever received a packet from PC, now the switch learns which port is connected.  In other words, the switch learns address by source MAC address only.  (Not by destination address.)

    In general, first communication between two TCP/IP nodes are, ARP (Address Resolution Protocol) exchange.  By the ARP exchange, the switch has a chance to learn addresses.

    Regards,
    Atsushi

  • OH. i forget it ,  the  Arp   give the switch  the first chance to learn , Thank you very much !

  • Dear guys,

    I want to receive packet from outside using RJ45 connected port (emac port-2) with this basic MAC config from pa_emacExample:

    port-0 (cppi port) = 00:01:02:03:04:05

    port-1 (sgmii-0) = 10:11:12:13:14:15

    port-2 (sgmii-1) = 20:21:22:23:24:25

    the packet is unicasted UDP from packeth (packet generator app), with the packet is basically same with the packet sent from EVM to my PC:

    mac destination = 10:11:12:13:14:15

    mac source = 00:01:02:03:04:05

    and for ipv4

    ip dest = 192.168.1.10

    ip source = 192.168.1.1

    and for the rest, is same with the default packet created on pa_emacExample.

    The result is quite different from what I expected. The interrupt which processes the verification (CPSW_RxISR) still not triggered yet, but the MAC source (00:01:02:03:04:05) seems to successfully added to ALE Table, because it printed on console. 

    Anyone know about the solution or workaround on this? Already spent much time on this case, starting to get some insight about the problem, which in my case I suppose it will be on ALE or PASS/PDSP routing.

    Regards,

    Aditya

  • Hi,

    Could you elaborate your question much in detail?

    • What destination MAC address of Ethernet frames should EVM receive?  Is it 00:01:02:03:04:05?
    • Do you transmit an Ethernet frame which has source = 00:01:02:03:04:05 and destination = 10:11:12:13:14:15 from packETH running on a Linux box to the EVM?

    If CPPI port wants to receive frames which has destination address 00:01:02:03:04:05, you should transmit frames by packETH which has destination address 00:01:02:03:04:05.

    I think I could help if you elaborate your question in detail.

    Regards,
    Atsushi

  • Dear,

    yes. After understanding the concept of CPSW, I understand that packet forwarding only available on Tx side, while on Rx side, the corresponding port which takes charge on the packet, need to look up the packet's MAC destination address and match it with the ALE table initialized before.

    This problem already fixed, with change on several lines of code, because set the cpswLpbkMode to CPSW_LOOPBACK_NONE only enable user to transmit packet to PC, but can't receive any packet sent from PC. Since, I know about the Rx flow of CPSW, I just check the ALE programming section at cpsw_mgmt::Switch_update_addr and found out that the MAC address of each port only added to ALE table if cpswSimTest is '1' or 'using a simulator'. So, I added an 'OR' condition to if (cpswSimTest || (cpswLpbkMode == CPSW_LOOPBACK_NONE)) instead of only if (cpswSimTest) and Rx now ran successfully.

    Anyway, thank you very much for the insight.

    Regards,

  • Hi Yanuar,

    It's good to hear that the problem has been fixed.  Thank you for your update.

    Please let us know when you have additional questions.

    Best Regards,
    Atsushi

  • Hi,

    i am coming with further question about EVM to EVM using ethernet.

    So, I got two EVMs (C6670), connected using ethernet on RJ45 port (SGMII-1). The scenario is, I want to enable UDP transfer between EVMs using PA_emacExample. Each EVM already succeed on communicating with my laptop (Tx and Rx), now I want to send exactly same packet from one EVM to other. 

    Do you think I need to do specific configuration because the initial result was not good. The interrupt won't triggered, so it means that the data never filled the accumulator.

    Regards,

    Aditya

  • Now reading Gigabit Ethernet (GbE) module (sprugv9b.pdf) and it seems that there are two options which describe SGMII-to-SGMII connection. Autonegotiation and Forced-Link. I think I will use the latter.

    Will come with the update ASAP.

  • Already configured both EVM with:

    - Master-to-Master (Forced Link) w/o autonegotiation == fail

    - Master-to-Slave (Autonegotiaton) == fail

    There were chances I got a wrong configuration though. Still trying to get this done.

    Regards,

    Aditya

  • Yanuar,

    Sorry for my late reply.

    Are you connecting two EVM by an Ethernet cable?  I mean

    EVM [RJ45] <-- Ethernet cable --> [RJ45] EVM

    In the case, SGMII connection is located inside the EVM (between C6678 and PHY on the EVM).  You don't need to change SGMII configuration, I think.

    Regards,
    Atsushi

  • Dear Yanuar,

        I have did what you write,but the EVM still cant receive the packet. Can you explain more detail about the Switch_update_addr. My pc mac address is 00238bbe3c11d,and connect the EVM and pc through the RJ45,what should  i change the Init_Cpsw function,to realize the communication between pc and EVM