Computing the checksum after changing the packet's fields

Nov 1, 2009 at 9:33 AM

Hi

I getting a packet from a pcap file and changing the source/destination.

Packet newpacket = PacketBuilder.EthernetIpV4(DateTime.Now, source, destination, packet.Ethernet.IpV4.TypeOfService, packet.Ethernet.IpV4.Identification, packet.Ethernet.IpV4.Fragmentation, packet.Ethernet.IpV4.Ttl, packet.Ethernet.IpV4.Protocol, new1, new2, packet.Ethernet.IpV4.Options, ethernetPayload);

 

How can I recalculate the checksum before sending  the packet?

 

Thanks

 

 

Coordinator
Nov 1, 2009 at 6:33 PM
Edited Nov 1, 2009 at 6:33 PM

Hi,

 

The IPv4 checksum is automatically calculated to be correct when you build a new packet using the PacketBuilder.EthernetIpV4() method.

 

Boaz.