Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20795 Discussions

Web Server: The code auto-negotiation fails with a router?

Altera_Forum
Honored Contributor II
1,638 Views

Question# 1: 

I am implementing Web server on my own design. 

The code auto-negotiate with ethernet hub and switch, but not with a router. 

 

What could be possibly wrong with my code? 

Cross over cable is need for laptop(point-to-point)? 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

Totally Separate Question# 2: 

 

I am using a CycloneIII 3c35 (80>kit) demo board.  

I am connecting it to a netgear router.  

The board seems to get ip 0.0.0.0. This happens 9 out of 10 try's. (I am checking router page to check the mac adds connected to the router. All those 9 times, it doesn't shows the Board connected to router). 

I was able to successfully get an ip (192.168.1.2) just once. And the WebServer_HTML was opened successfully. 

 

Is there some sequence I need to follow when I use the demo board, so that it acquires an ip for accessing the WebServer_HTML (3. Alera Web Server)? 

 

What about the point-to-point connection, or Ethernet hub or Ethernet switch?  

Would I never be able to connect the board using either of them and access WebServer_HTML page? (Since, the source code for the demo board is not available and the default ip is 0.0.0.0, I assume)
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
835 Views

what Ethernet speed does your design support, and what do the hub, switch and router support? Maybe it's trying to negotiate a different speed with the router, and this fails. 

 

When you get the IP 0.0.0.0, does the auto-negotiation succeed? At what speed?
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

Again, There are 2 different projects: 

1) My own design on my own board 

2) Altera Development DEMO Board (CycloneIII 3c35 kit-80) - with display screen and all... 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

The below are used for both the projects: 

1) Router: N150 Wireless Router Model WNR10000v3 

2) Switch: Netgear 10/100/1000M Switch GS605 v2 

3) Hub: Dynex Model#DX-EHB4 10BASE-T Ethernet Hub 

 

Note:  

When I connect my old laptop to the above router, it says "LAN is now connected Speed:100Mbps" 

When I connect my old laptop to the above Hub, it says "LAN is now connected Speed:10Mbps" 

When I connect my old laptop to the above Switch, it says "LAN is now connected Speed:100Mbps" 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

1) Project 1: My own design 

PHY: DP83848C 10/100 Mb/s Ethernet Physical Layer Transceiver 

 

2) Project 2: Altera Development DEMO Board (CycloneIII 3c35 kit-80) 

PHY: 10/100/1000 Ethernet 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

QUESTIONS: 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

1) Project 1: My own design 

 

Now the question is, if the laptop can connect to the router and say "LAN is now connected Speed:100Mbps", what could be the possible reason that my PHY (DP83848C) doesn't Auto-negotiation ? 

Note: The PHY successfully negotiates with hub and switch, but not with router or laptop. 

 

(Just FYI: I am using the Web server design example for this project. DHCP is enabled. The Default ip I have used in my source code (@web_server.h) is 192.168.10.234 [GWadd: 192.168.10.1] [MSKADD: 255.255.255.0]) 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

2) Project 2: Altera Development DEMO Board (CycloneIII 3c35 kit-80) 

 

With Router. the DEMO board seems to get ip 0.0.0.0. This happens 9 out of 10 try's. (I am checking router page to check the mac adds connected to the router. All those 9 times, it doesn't shows the DEMO Board connected to router). I was able to successfully get an ip (192.168.1.2) just once. And the WebServer_HTML was opened successfully. 

 

Is there some sequence I need to follow when I use the DEMO board, so that it acquires an ip for accessing the WebServer_HTML ( Altera Web Server)? 

 

What about connection the DEMO board to laptop, or Ethernet hub or Ethernet switch?  

Would I never be able to connect the DEMO board using either of them and access WebServer_HTML page?  

 

(Just FYI: The source code for the DEMO board is not available and the default ip address in their source code just be 0.0.0.0; Netmask:255.0.0.0; Gateway:0.0.0.0; 

This is what shows on Web Server Info on the display screen of the DEMO board after acquiring 0.0.0.0 ip)
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

On 1) does it say autonegotiation fail in the terminal? Do the LEDs on the router show that something is connected when you plug in the board? Maybe you could dig a bit deeper into the datasheet and check the contents of the PHY MDIO registers and find out if anything is strange there. You shouldn't need a cross-over cable as the PHY is capable of MDI-X. 

On 2) what kind of messages do you have in the terminal? Does the autonegotiation succeed? What does it say about the DHCP transaction? Are you using both precompiled hardware and software given with the kit?
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

1) Yes, it say's "Auto-Negotiation fail" @ NIOS terminal. 

Yes, the LED on router shows something is connected to it when the board is plugged in. 

I will dig deeper into the datasheet of PHY and check the contents of all the registers. I am sure there is nothing strange on STATUS and CONTROL from TSE MAC. 

MDI-X makes sense, and its also called RX-ERR right? 

 

2) Its a DEMO board, so I am using the pre-compiled hw/sw. DEMO board is only talking to router and not to laptop, switch or hub
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

No MDI-X is the mechanism that can exchange the TX and RX pairs, so that you don't need crossover cables. This is an automatic process decided during autonegatiation. 

When you connect the demo board to the laptop, switch or hub, is there a DHCP server answering the board? The router probably has a built-in one.
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

-10BASE-T, Half/Full-Duplex 

-100BASE-TX, Half/Full-Duplex 

PHY supports the above modes. 

Is there any reason it wouldn't Auto-Negotiate to the router, laptop or switch? 

I have tried to figure out things from the PHY manual, I couldn't find anything that would effect it. 

 

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 

 

No, There is no DHCP server answering the board, when I connect the demo board to the laptop, switch or hub.
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

I think the demo board needs a dhcp server, it hasn't been compiled with a static IP address. 

Does your router also has led that shows the link speed when you connect your own design? Maybe it is incorrectly assuming that your PHY can do gigabit.
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

When you use a direct connection between board and laptop with a cross over cable you need to specify ip address, subnet mask, and gateway on your laptop. You can find them in simple_socket_server.h if you use the demonstration project.

0 Kudos
Altera_Forum
Honored Contributor II
835 Views

I am using a Altera cyclone III Demo Board (kit=80). Since I don't have access to their source code, I am assuming that they have set the static ip to 0.0.0.0. 

I have used those setting, and it doesn't work with the demo board.
0 Kudos
Altera_Forum
Honored Contributor II
835 Views

As I said I don't think they compiled it with a static IP. If you connect the demo board directly to your laptop, you need to install a DHCP server on the laptop.

0 Kudos
Reply