Arp관련 질문있습니다
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Arp관련 질문있습니다
by melody3741 ·
pc 네트웍 정보는
ip 192.168.0.10
subnet 255.255.255.0
gateway 설정 x
w5100
ip 192.168.0.2 subnet 255.255.255.0 gateway 192.168.0.1 port 5000 로 설정되어 있구요…
예를들어서…
volatile unsigned long dest_ip2; // global var
volatile unsigned int dest_port2; // global var
len = recvfrom (nSocket2, data_buf, len, (unsigned char *)&dest_ip, &dest_port);
recv_from (); 함수로 획득한 destination ip와 port를
dest_ip2 = dest_ip;
dest_port2 = dest_port; 전역변수에 저장한후에…
장비측으로 232 데이터를 전송하고… (w5100 → serial → 장비);
장비측에서의 보낸 ack를 w5100에서 수신하면 바로… (장비 → serial → w5100)
sendto (nSocket2, rx0_buf, rx0_bCnt, (unsigned char *)&dest_ip2, port2); 전송…
recv_from (); 에서 획득한 destination ip와 port로 전송을 하는거 밖에 없습니다…
또 이게… 될때가 있고… 저렇게 arp 뜰때가 있고요…
RE: Arp관련 질문있습니다
by jameskim ·
ARP request를 192.168.0.1로 보내는 경우는 두가지가 있습니다.
Subnet mask를 255.255.255.0 으로 설정했다면 1번의 경우는 해당 사항이 없어 보입니다.
2번의 경우도 수신한 dest_ip, dest_port 값을 전역변수 dest_ip2, dest_port2에 저장했다가 사용하셨다고 하는데, 전역변수에 저장하기 전, sendto() 함수를 호출하기 전에 dest_ip, dest_port 값과 dest_ip2, dest_port2의 실제값을 debug로 출력해서 확인해 볼 필요가 있다고 봅니다.
RE: Arp관련 질문있습니다
by melody3741 ·
ip를 확인해 보니 제대로 192.168.0.10으로 되어 있군요…
흠…
혹시 처음에 udp를 브로드 캐스팅 으로 (255.255.255.255)로 사용하다가 일반 udp로 사용하자나요…
이때 pc에서 연결을 끊고 다시 연결해서 사용해야 하는건가요?? udp라 별 상관 없을거 같은데요…ㅠ
흠…
RE: Arp관련 질문있습니다
by melody3741 ·
그건 저도 알고 있습니다…
디버그 모드로 해서 동작을 실행 시켜보앗습니다… 한번 보시죠…
UDP msg arrived
source Port : 1820
source IP : 192.168.0.10
sendto(OK
.168.0.2,258)
[ch0][255.255.255.255, 1820, 3]
UDP msg arrived
[color=#FF0000]source Port : 1820
source IP : 192.168.0.10
/U?
sendto(/B
)
[ch0][192.168.000.010, 1820, 3]
send fail.[/color]
보시면…
브로드 캐스팅으로 받고 수신후 제가 거기에 대한 응답후
그후 udp로 “/U?” 이걸 보내면 w5100으로 보내면 저는 “/B” 이걸 보냅니다…
그밑에 보면 dest_ip 와, port, len을 알수 있고요…
전송 실패가 뜨고요…
이게 전송이 잘될때가 있고 안될때가 있어서 문제라는 거구요…
RE: Arp관련 질문있습니다
by jameskim ·
W5100 드라이브 코드를 공유하실 수 있나요?
RE: Arp관련 질문있습니다
by melody3741 ·
전체 소스를 말하는건가요?? 아니면
w5100 드라이버 소스만 말씀하시는건가요??
메일 주소를 알려주시면 그쪽으로 보내드리겠습니다…
RE: Arp관련 질문있습니다
by jameskim ·
드라이브 소스를 “Code” 기능을 이용해서 여기 포럼에 올려주세요.
최소한 sendto() 함수와 recvfrom() 함수.
다른 분 중에도 코멘트하실 분들이 있을 수 있으니…
RE: Arp관련 질문있습니다
by melody3741 ·
sendto , recvfrom () 함수는 라이브러리 그대로 쓴거고요…
자체 프로토콜에서 브로드캐스팅하다가 “” 커맨드 받으면 일반 udp로 사용하는거 밖에 없습니다…
udp_sel = 1 이면 destination ip를 UDP_dIP에 저장한다음 232 데이터를 전체 수신한후 1ms 지나서 전송
통신속도가 38400 bps이기때문에 충분하고요…1ms면…