> On Thu, Oct 26, 2023 at 3:10 PM Gregory Nutt <spudan...@gmail.com> wrote:
>
> >
> > On 10/25/2023 10:41 PM, Zhe Weng 翁�� wrote:
> > > But I do have another idea:
> > > Maybe you can try to register two network devices even if you only have
> > a single GMAC, just dup all the rx packets to both interfaces, and let all
> > tx packets go out.  Since the IP addresses are different on each interface,
> > the stack may drop packets on the incorrect interface and accept the
> > correct one.  It may have some problems in some situations like broadcast I
> > guess, but I think it may have a chance to work.
> >
> > I think there might be a couple of minor issues with that. First, the
> > MAC should not know anything about IP address.  The OSI Seven Layer
> > Model prescribes that architecture and we really should make some effort
> > to conform to it: https://en.wikipedia.org/wiki/OSI_model
> >
> > Without getting involved with IP routing, a single MAC driver could not
> > handle multiple IP address.  It would have to parse the incoming
> > packets, look up the IP address in the packet, match it with a device
> > driver, then forward the the correct driver structure with the packet.
> >
> > Replies to the IP message could be awkward as well.  We could not reply
> > using the same device.  The network would always have to notify the
> > driver of data availability using that IP address to identify the
> > correct device structure to use.
> >
> > What about non-IP packets, they would probably have to use the same
> > device structure?
> >
> > This would not be a systematic solution; it would apply to only a single
> > MCU type.  A better solution would be generalized to the MAC of all
> > current and future MCUs.  The solution should be generalized and common.
> >
> > I think the lack of architectural modularity, generality, and overall
> > complexity would make this approach undesirable.
>
>
>
> I wonder if this hasn't been solved already in some industry-accepted
> manner. For example (not saying this is the solution, just thinking out
> loud) there is a redundancy mechanism that makes two network interfaces
> look like one, with automatic failover. What the OP wants looks like the
> reverse of that: make one network interface look like two. It just feels
> like a problem that might have been solved already.
>
> Nathan

On Linux, a bridge or a bonded interface may do the former, and macvlan for the 
latter. Macvlan adds additional interfaces by adding additional MAC addresses 
on a single NIC. But macvlan normally depends on promiscuous mode, which tells 
the NIC to receive packets not targeting the NIC's MAC address instead of 
ignoring them.

Zhe
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
 This e-mail and its attachments contain confidential information from XIAOMI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!******/#

Reply via email to