update:
i am by no means a master or yet to fully understand the workings of ethernet; so i'm just sharing my experiences in the hope it may make life easier for someone else. so give me some rep and lets try get these forums a place where people help, rather than just an "un-answered questions site" that many topics seem to be atm. thoughts Ethernet is difficult for a new person, it has quite a steep initial learning curve.
There is no magic "put code here, push button and it sends" for a noob, but once you get an understanding it pretty much is that; trick is you have to understand first before you can use it at all. So i recommend reading the sources i'll give later.
whats helping me to learn All sockets in most operating systems are based on Berkely Sockets. This is including the Niche Stack that altera uses. An excellent article on wikipedia simplfies it greatly.
http://en.wikipedia.org/wiki/bsd_socket (
http://en.wikipedia.org/wiki/bsd_socket)
A faily good article pointed out by somone on these forums.
This is for a UNIX system but its based on the berkely sockets so it can help you get the picture.
The link posted by someone else in a seperate topic.
http://www.abc.se/~m6695/udp.html (
http://www.abc.se/~m6695/udp.html)
A great source for the details is the book
"tcp/ip sockets in c" by donahoo and calvert. details Go to this link where i explain how i got the simple socket server (SSS) example from altera to work on the DE2-115.
http://alteraforums.com/forum/showthread.php?t=28837 hardware: Get an example program for your particular board. I use the DE2-115 at this stage. Although the Nios part is bugged I used the Quartus files for the DE2-115 RGMII webserver example.
software: See the link above for more detail. Note its best to hard code a MAC address as wiping your flash to do other examples must also wipe your MAC address (or i accidenlty did it somehow).
Basically the niche stack auto recieves the data and puts it into the
rx_buffer of the Socket structure. You need to play with the pointers and read off that buffer in bytes at a time (chars), remember to adjust your read and write pointers as you do so.
where i'm up to I've mamaged to hack up the SSS example and using the learning sources i've managed to trim it to make a UDP server and a TCP server (crap ones but i've proven the concept). I wrote some code to recieve simple telnet message store and into a buffer on the FPGA.
Currently i have them each with their own MicroCOS task, one for TCP and another for UDP. Which i just replaced the SSS example task with them instead.
where to for me? now i'm moving onto video until i understand what kind of data i'm dealing with before making a more advanced ethernet app to send the video.