chibiip icon indicating copy to clipboard operation
chibiip copied to clipboard

How to use arp to communicate in a cross-LAN scenario?

Open iamazy opened this issue 2 years ago • 2 comments

First of all, This repo make sense to help us to understand internal of tcp/ip stack, Thanks a lot!!!

I have some problems when reading this repo's code.

  1. The arp demo can only communicate in LAN, how to communicate in a cross-LAN scenario?
  2. When payload of icmp packet is greater than 4096,how to receive icmp reply with many packet segments?I have tried to set MsgFlags::WAIT_ALL in recvfrom but got error.

I am very appreciate if you answer these questions or give me some train of thoughts.

iamazy avatar Jun 29 '23 09:06 iamazy

@iamazy Thank you for the issue.

The arp demo can only communicate in LAN, how to communicate in a cross-LAN scenario?

I think ARP only works between devices in the same IP subnet, but I don't have a clear understanding of the details either because I am learning it.

When payload of icmp packet is greater than 4096,how to receive icmp reply with many packet segments?I have tried to set MsgFlags::WAIT_ALL in recvfrom but got error.

You can extend the capacity of a vector here.

https://github.com/TaKO8Ki/chibiip/blob/e20dbdf201561035109abf881487866647331c90/src/socket.rs#L82

TaKO8Ki avatar Jul 01 '23 13:07 TaKO8Ki

I think set fixed size is not final solution, I will try another linux recv api, thanks again!!!

iamazy avatar Jul 03 '23 10:07 iamazy