NDIS 6.x以太网桥驱动程序 [英] NDIS 6.x ethernet bridge driver

查看:503
本文介绍了NDIS 6.x以太网桥驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道使用NDIS 6.x构建以太网桥的最佳选择和方法是什么.我应该从哪里开始,并且应该为此使用Miniport,IM,协议或筛选器驱动程序?

I was wondering what would be the best choice and way to build an ethernet bridge using NDIS 6.x. Where should I start and which one should I use for this, Miniport, IM, protocol or filter driver?

试图自定义WDK中可用的协议驱动程序样本,并成功将其连接到以太网适配器.接下来是什么?

Tried to customize the protocol driver sample available in WDK and successfully got attached to the ethernet adapters. What next?

非常感谢您的帮助.

使用Windows 7x64

Using Windows 7x64

推荐答案

让我们看一下可用的NDIS驱动程序类型:微型端口,轻量级过滤器和协议.

Let's look at the NDIS driver types that are available: miniports, lightweight filters, and protocols.

NDIS微型端口不能解决此问题,因为微型端口从主机OS接收 数据包.您需要能够接收来自网络的数据包的东西.

An NDIS miniport alone cannot solve this problem, since miniports receive packets from the host OS. You want something that receives packets from the network.

一个 NDIS轻型过滤器可以解决这个问题,但是解决方案有点笨拙.您必须手动在两个不相关的微型端口堆栈之间进行同步.这比看起来要难.其他以前尝试过此方法的人在最初的几次尝试中都犯了这个错误.

An NDIS lightweight filter could solve this problem, but the solution would be a little klunky. You'd have to manually synchronize between two unrelated miniport stacks. This is harder than it seems; others who have tried this before have gotten this wrong on the first few attempts.

NDIS协议驱动程序是解决此问题的最佳方法.协议驱动程序被设计为可连接到多个微型端口,并且该协议驱动程序具有将数据包从一个微型端口堆栈路由到另一个微型端口的能力.

An NDIS protocol driver is the best way to solve this problem. A protocol driver is designed to attach to multiple miniports, and the protocol driver has the ability to route packets from one miniport stack to the other.

但是协议驱动程序缺少一项功能.如果您只是编写协议驱动程序,则驱动程序的排列方式如下:

But protocol drivers are missing one feature. If you just write a protocol driver, then this is how the drivers line up:

[TCPIP]  [YourProtocol]
    | \  / |
    |  \/  |
    |  /\  |
    | /  \ |
 [NIC0] [NIC1]

也就是说,主机的TCPIP堆栈将两个NIC都视为独立的NIC. (@Aczire,您在上一个问题中指出,这对您来说是可以的.但出于说明目的,这里是故事的其余部分.)

That is, the host's TCPIP stack sees both NICs as separate NICs. (@Aczire, you indicated in a previous question that this is ok for you. But for expository purposes, here's the rest of the story.)

NDIS允许您使用 MUX-IM驱动程序解决此类问题. IM驱动程序基本上只是一个粘贴在另一个微型端口上的协议.这使您可以精确控制主机操作系统看到的内容:

NDIS allows you to solve this sort of problem with a MUX-IM driver. An IM driver is basically just a protocol glued onto another miniport. This allows you to control exactly what the host OS sees:

    [TCPIP]
       |
       |
       |
       |
 [YourMiniport]
 [YourProtocol]
    |      |
    |      |
    |      |
    |      |
 [NIC0] [NIC1]

使用这种体系结构,您可以欺骗主机OS,使他们认为这两个网络是相同的. (例如,面向用户的GUI将显示单个网络适配器,而不是两个.)但是,IM驱动程序的复杂性成本很高:它们很难编写,甚至很难正确使用.我不建议您使用IM驱动程序,除非您有丰富的经验和时间.

With this architecture, you can trick the host OS into thinking that these two networks are the same. (For example, user-facing GUIs will show a single network adapter, instead of two.) However, IM drivers come at a substantial complexity cost: they're hard to write, and even harder to get right. I do not recommend that you tackle an IM driver unless you have substantial experience and time.

这篇关于NDIS 6.x以太网桥驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆