Code execution enters into application before/without link establishment in tcpip 2.00 stack

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Code execution enters into application before/without link establishment in tcpip 2.00 stack

1,186件の閲覧回数
ssattva1
Contributor III

Hi , I am working on ethernet implementation with eval board S32K3X8EVB . My objective is to connect two eval boards and establish ethernet communication between them. Initially I was working with TCPIP 1.0.4 version. Later I updated to TCPIP 2.0.0 stack.

In version 1.0.4 , I observed this particular part of code in device_init() function

ssattva1_0-1735883108187.png

I take it that this while loop waits until link is established. 

However , I dont find any such loop in the code in TCPIP 2.0.0 stack.

I observed that , even after switching off one the boards and debugging the other one, I could see the code entering into my application part , but technically it should not because the other board is switched off and there is no link.

It is not supposed to enter into my application part until link is established. Please someone explain this behaviour and give me clarity with respect to link startup and modifications in TCPIP 2.0.0

タグ(3)
3 返答(返信)

1,128件の閲覧回数
PavelL
NXP Employee
NXP Employee

Hello @ssattva1 ,

from a general ethernet point of view, checking link up/down status is not necessary. Having link up needn't mean that ethernet frame has been receive successfully by your link partner. With a huge network, you never know through how many hops your frame goes - it's impossible to track all links up of all PHYs, non-priority frames could be dropped during huge traffic time, frames could be multiplied due to redundancy, ... . From that reasons, the higher levels of TCP/IP are responsible for frame's acknowledge.

So, the link up waiting loop is not necessary. Naturally, you may use link up status at your will.

Best regards,

Pavel

0 件の賞賛
返信

1,119件の閲覧回数
ssattva1
Contributor III

Hello @PavelL ,

Thank you for your reply . However , I still could not understand one thing. First of all this is a simple setup, I only have 2 boards connected and I am just trying to send an UDP packet to one of the boards from the other one. 

My doubt here ,is that I observed that while debugging , the code entered the udp sending part when the other board was switched off. Yes , I particularly switched off the other board to make sure no packet is sent when link is not up.

In TCPIP 1.0.4 , device_init() function has the while loop for waiting till link established, hence without link establishment code would not move to start_example(). But in TCPIP 2.0.0 I didnt find such a loop . This is my doubt . 

If such a loop is not necessary how do I know if link is up? Please clarify my doubt. Please mention if there are any differences in the implementation of version 1.0.4 and 2.0.0 of the tcpip stack

0 件の賞賛
返信

1,115件の閲覧回数
PavelL
NXP Employee
NXP Employee

Hello @ssattva1 ,

the situation is independent on the network complexity.

Your UDP routine shall be responsible for frame acknowledge: if your link partner didn't send UDP response/acknowledge in a given timeout, your UDP routine shall rise some error. Naturally, you may also check the link up before UDP frame is send, and rise an error immediately. Despite of TCP/IP stack version, I would modify the device_init() to not wait for link up. That's the way I would use.

Best regards,

Pavel

0 件の賞賛
返信