In-kernel IP-IP tunnel driver

Home Forums Discussions General Discussion In-kernel IP-IP tunnel driver

This topic contains 4 replies, has 2 voices, and was last updated by  wheelz 11 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4953

    wheelz
    Participant

    Hi,gurus,

    I am a newbie in Windows Driver Writing. Please help me.

    I need to implement an in-kernel IP-IP tunnel driver
    for Windows 2000/XP professional.
    (I know that in 2000 server, there are such things,
    But I need it in 2000 professional 🙂

    I would like to implement it in this way:

    “virtual miniport driver” + “TDI client”

    the virtual miniport driver create a virtual net adapter device,
    when IP packets routed to this device, it will add another layer
    of IP header, and as a TDI client, build an IRP, send the packet
    to “DeviceIp” by IoCallDriver().

    Is this way OK? How to do packet receiving?

    🙂

    #5830

    Vadim Smirnov
    Moderator

    DeviceIp can’t be used for sending custom packets, in general it is used for managing TCP/IP protocol stack, not for communication (however, there is an IOCTL used for sending ICMP PING). However, I think you can use deviceRawIp. I have never tried it myself but I suppose it provides TDI transport interface for sending/receiving raw IP packets.

    Other ideas look OK.

    #5831

    wheelz
    Participant

    Huge Thanks to SerpentFly. 🙂

    I have another newbie question:

    Besides DeviceRawIp, is there any other way to inject a raw IP packet to TCP/IP protocol stack? Seems NDIS Intermediate Driver not usable, because the raw IP packet needs to be routed.

    Thanks.

    #5832

    Vadim Smirnov
    Moderator

    Besides DeviceRawIp, is there any other way to inject a raw IP packet to TCP/IP protocol stack? Seems NDIS Intermediate Driver not usable, because the raw IP packet needs to be routed.

    You can inject packet using NDIS IM or NDIS hook driver (up to the stack or down to the network interface) but you must know exactly what you are doing (to choose correct network interface and packet indication).

    #5833

    wheelz
    Participant

    @SerpentFly wrote:

    You can inject packet using NDIS IM or NDIS hook driver (up to the stack or down to the network interface) but you must know exactly what you are doing (to choose correct network interface and packet indication).

    I know that if using NDIS IM or NDIS hook driver, I have to do a lot more work(such as do routing, choose output interface, determine next hop MAC address, etc.). Of course, I donot want to do that much complexity, 🙂 that is also the reason that I would like to use “DeviceRawIp”, and I also wonder if I could simply call some functions in tcpip.sys (or something similar) to inject a raw packet to the system’s TCP/IP protocol stack. I noticed that there are some exported functions in tcpip.sys, but no documentations for them.

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.