[W5300] Destination device의 MAC address를 알아내는 방법
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: [W5300] Destination device의 MAC address를 알아내는 방법
by justinkim ·
FPGA로 어떻게 제어하시는지는 모르겠습니다만.
mcu처럼 쓰고 계시는 건지요?
ARP request packet을 data로 만든 후 send 명령을 W5300에 보내시면 됩니다.
ARP request packet은 wireshark 프로그램을 이용하여 패킷캡쳐를 통해 보실 수 있습니다.
그런형태의 data를 send 하시면 arp reply packet이 오게 됩니다.
해당 Data를 recv하신 다음 data를 parsing 하시면 destination의 Mac address를 알 수 있게 됩니다.
아래 S/W코드를 참고 하시기 바랍니다. (W5300이 아닌 다른 칩의 firmware니 그대로 쓰시면 안됩니다.)
uint32_t arp_request_send(uint8_t * target_ip)
{
int32_t ret;
uint8_t i;
uint8_t smac[6] = {0,0,0,0,0,0};
uint8_t sip[4] = {0,0,0,0};
uint8_t arp_packet[42] = {0,};
}
int32_t arp_reply_recv(uint8_t * target_ip)
{
int32_t ret;
uint8_t i;
uint8_t dst_mac[6]; // request source mac
uint8_t src_mac[6]; // request target mac
//uint16_t ether_type = 0;
//uint16_t hardware_type;
//uint16_t protocol_type;
//uint8_t hardware_size;
//uint8_t Protocol_size;
uint16_t size, opcode;
uint8_t source_ip[4] = {0,0,0,0}; // request target ip
//uint8_t target_ip[4] = {0,0,0,0}; // request source ip
}
main(){
//MACRAW ARP scenario
setSn_MR2(0, Sn_MR2_BBLOCK|Sn_MR2_MBLOCK|Sn_MR2_6BLOCK);
printf(“Sn_MR2 register value : %x \r\n”,getSn_MR2(0));
while(1)
{
switch(getSn_SR(0))
{
case SOCK_MACRAW :
arp_reply_recv(WIZ_Dest_IP);
break;
}
감사합니다.
RE: [W5300] Destination device의 MAC address를 알아내는 방법
by limhchan ·
감사합니다. 많은 도움이 될 것 같습니다.
FPGA를 이용하여 W5300을 제어하는데
MCU가 W5300을 제어하는 것과 비슷하기는 합니다만(W5300 제어라는 것이 레지스터 세팅이니깐요.)
MCU에서는 library를 이용할 수 있는데 FPGA에서는 일일히 전부 구현을 해 주어야 한다는 점이 다를 것 같습니다.
감사합니다.
RE: [W5300] Destination device의 MAC address를 알아내는 방법
by justinkim ·
네 어려움이 있으시면 또 질문 주시기바랍니다