Tech Support > Microsoft Windows > Drivers > Retransmiting the packets to another IP in NDIS IM Driver
Retransmiting the packets to another IP in NDIS IM Driver
Posted by Rajesh Gupta on April 15th, 2004


Hi, i want to send all the packets i received from one IP to another IP.
Say, if i receive the packets from IP .13 i want to send them back to the IP
..15. What will i have to do to achieve this. What i think is

1. i will have to take care of IP address, change the Destination IP
address.
2. Change the Checksum in the IP header.

I am not sure, if i need to manipulate the MAC address or ARP table. I am
little new to NDIS driver development, i am little confused where does my IM
driver fit in the Networking layer. When i was debugging the IM driver i saw
the Ethernet header, with source and destinatin MAC address while sending
the packets in sendpacket. I was under the impression, i am just below the
TCP/IP and which will only add the TCP and IP header to the packet. and when
i will forward the packet to NDIS from IM, NIC driver below will take care
of Ethernet header and updating the MAC addresses. I am not sure, what i m
missing here.

It would be really hekpful, if someone can help me with the same.

Thanks and Regards
Rajesh
Rajesh_gupta_99@yahoo.com


Posted by Maxim S. Shatskih on April 15th, 2004


You need to write a NAT. This is an NDIS IM driver which will patch the IP
headers and their checksums.

Note that some app protocols (FTP) pass the IP addresses in the data stream.
They will require special and VERY complex handling.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Posted by Rajesh Gupta on April 15th, 2004


Thanks a lot for your response,

Where can i find more information about NAT. What i beleive is, i will have
to change the IP address and update the checksum in the IM driver.
Is there anything else i will need to worry about.

I am not worry about FTP right now, i am just trying to work on TCP/IP NAT
right now

Thanks
Rajesh

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:%23n46yexIEHA.2524@TK2MSFTNGP11.phx.gbl...


Posted by Stephan Wolf on April 15th, 2004


On Thu, 15 Apr 2004 11:59:03 -0700, "Rajesh Gupta"
<rajesh_gupta_99@yahoo.com> wrote:

RFC 3022
"Traditional IP Network Address Translator (Traditional NAT)"
http://www.ietf.org/rfc/rfc3022.txt

There are more RFCs on NAT, check the RFC index

http://www.ietf.org/iesg/1rfc_index.txt

Stephan

Posted by Maxim S. Shatskih on April 15th, 2004


FreeBSD/Linux sources can be good.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"Rajesh Gupta" <rajesh_gupta_99@yahoo.com> wrote in message
news:ud8h5txIEHA.2524@TK2MSFTNGP11.phx.gbl...