Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

about simple_socket_server

Altera_Forum
Honored Contributor II
1,799 Views

Hello, 

 

I am using project template "simple_socket_server" to test my 1s10 board according to tt_nios2_lwip_tutorial.pdf,but I can't get the result. the console view: 

 

Simple Socket Server starting up 

 

Simple Socket Server starting up 

Can't read the MAC address from your board (this probably means 

that your flash was erased). We will assign you a MAC address and 

static network settings 

 

Please enter your 9-digit serial number. This is printed on a  

label under your Nios dev. board. The first 3 digits of the  

label are ASJ and the serial number follows this. 

--> 

 

I have seted Ip and MAC address in the "simple_socket_server.h" 

 

why input 9-digit serial number? what is it? 

 

thanks
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
744 Views

You need to modify network_utilities.c to provide a unique MAC address for your system. (The altera dev. boards use the serial number to form the low bytes of the mac address, hence the request for a serual number) 

 

The MAC address (which you can NOT set in "simple_socket_server.h") is the physical address of the ethernet interface, which determines the network packets that are actually received by your board. 

 

Have a look at "get_mac_addr" in network_utilties.c in your project. For a start, you could simply use six random bytes to get you going, but for production systems you should use MAC addresses allocated to your company by IEEE.  

 

Think of IP addresses as "logical" addresses for network packets, while the MAC address is the "physical" address. That's what allows IP packet routing to work. 

 

Hope that helps. 

 

- Roddy
0 Kudos
Altera_Forum
Honored Contributor II
744 Views

The least significant bit of the first address byte of an Ethernet address (network byte order) is set for Ethernet group addresses, and is zero for individual station addresses, so the first byte of your address must be even. The next least significant bit is the global/local bit. It is zero for globally unique addresses assigned through the IEEE, and 1 for addresses which are locally assigned (in which case it is up to the local network manager to ensure uniqueness within a given network). 

 

So, for testing purposes, it is perfectly kosher to use an individual address with the local bit set. In conventional notation (network byte order), these addresses are xY:xx:xx:xx:xx:xx where x is any hex digit, and Y is one of (2, 6, A, or E). These local addresses will never conflict with a globally unique address such as those on virtually all commercial Ethernet equipment. You only have to worry about conflicts with other prototype equipment on your local Ethernet segment using a local address. Since you still have 44 bits of address that you are completely free to choose, you should be able to avoid these.  

 

Of course, if you ever intend to sell your product commercially, you'll want to acquire a block of globally unique addresses from the IEEE and use these.
0 Kudos
Altera_Forum
Honored Contributor II
744 Views

Thanks for that info - I'd forgotten about ethernet group addresses, and the local/global thing is very handy to know! 

 

- Roddy
0 Kudos
Altera_Forum
Honored Contributor II
744 Views

thank you for all. But is there any rule to set MAC address? I only input some digits,and the system give me a mac address:00:07:ed:ff:94:9b. Obviously it's not inputing value. scs says:"these addresses are xY:xx:xx:xx:xx:xx where x is any hex digit, and Y is one of (2, 6, A, or E)." 

 

why 00:07:ed:ff:94:9b isn't include one of 2, 6, A, or E? 

 

ffone
0 Kudos
Altera_Forum
Honored Contributor II
744 Views

The prefix 00:07:ED does indeed indicate a globally unique individual address, rather than a local address. This particular prefix is assigned to Altera (you can look up address prefix assignments at ieee oui and company id assignments (http://standards.ieee.org/regauth/oui/index.shtml)). Presumably, their example code uses the development board's serial number to generate a unique 3 byte value for the rest of the address.  

 

If you're building your own hardware (so it doesn't come with an address assigned from Altera's block loke the development boards), you need to provide your own: a local address is a good solution for testing until you can get a block of globally unique addresses from the IEEE (see previous link).
0 Kudos
Altera_Forum
Honored Contributor II
744 Views

Thank u. 

 

I know , may be i need acquainted with MAC more.
0 Kudos
Reply