Hello Everyone,
i'm reading the USB over Ethernet from the below link
http://www.keil.com/pack/doc/mw/USB/html/dev_cdc_ncm.html.
i'm trying to build the software in the similar manner with few changes. but i'm not getting the following things. 1. who is acting as server and who is acting as client ?
2. whether it is possible to change the IP address ?if YES then how to change it ?
3. whether USB over Ethernet is acting as the DHCP server and client configuration. if YES please explain how?.
CDC NCM is actually replacing the physical Ethernet cable the same way CDC ACM (Virtual COM port) is replacing the serial UART cable.
CDC NCM allows embedded device to connect to USB Host (generally PC) with USB cable instead of Ethernet cable, and nothing else.
The example that you specified http://www.keil.com/pack/doc/mw/USB/html/dev_cdc_ncm.html actually implements a bridge between USB and Ethernet, so that example uses USB to connect to the USB Host (Ubuntu driven) and it connects to a Ethernet network via Ethernet connector on embedded board, and it just transfers packets from USB to Ethernet and vice versa.
As far as that example goes you can look that board as Ethernet cable.
Thank you Milorad Cvjetkovic.
But, still my doubt is same. whether can i assign an IP address to linux machine from the embedded board, if the embedded board is connected to network. if YES how to do ?
This has more to do with your network, so in your network a DHCP server will assign an IP address to your linux computer.
In case that your board would run an DHCP server, then yes, the board would assign an IP address to your linux computer, but that mentioned example is not that, you will need to run DHCP server on your embedded board.
Hello Milorad Cvjetkovic,
Thank you for your response on this.
I got how the CDC NCM works as Ethernet over USB.
I tried the create a DHCP server for our Embedded Board following the steps given in the below link.
www.keil.com/.../network_create_app.html
i'm using the following API to GET the IP address and SET the IP address respectively
1. netIF_GetOption function to get the option. 2. netIF_SetOption function to set the option.
but i'm neither able to assign the IP address to client nor get the IP address from client.
can you please clarify or explain how these APIs works.
and also
using these APIs 1. how to set the IP address to embedded board ? 2. how to set the IP client machine(Linux machine)?
Network library does not support a DHCP server. You will have to implement the service on your own.
However a DHCP client is sufficient in most cases since it allows a dynamic IP address configuration when you connect an evaluation board to your network. Network examples are configured to use DHCP so you might want to take a look at the examples.
www.keil.com/.../_compact__web__server__example.html
Hi Franc Urbanc,
Thank you for replying,
Network library will not support DHCP server implementation correct.
whether is it possible to fixed the one IP address permanently to the board(evaluation board) using network library ?
CAN you explain how NetIF_Getoption and NETIF_SetOption works ? these two API's are taken from network library and below is the link which help you find the API's
www.keil.com/.../group__net_interfaces___common.html
The code example at the link (you specified above) changes the MAC address of the ethernet interface. That is how it works.
you told that Network library will not Support the DHCP server implementation.
1. can i know when the new patch or pack of network library with the working DHCP server implementation will be release ?
2. As you said the mac address will get changed once the NetIF_SetOption API is used(as refer in the link). actually the MAC address is not getting changed. please can i know the reason for this ?
The network library fully supports DHCP client, and that is usually all what you need. A DHCP server is in your router and handles all clients in your network.
i want our board to work as router and handle all clients in the network . whether this is possible using CMSIS network library.
if yes how can i do that ?
Unfortunatelly DHCP server and packet router are not supported in Network library.