Thursday, May 6, 2010

Packets Generated In Click router Improper

If on sniffing packets generated by click, you notice something like that shown in the trace below, a clear inference is that the IP packets are not being generated correctly:

03:08:38.841420 IP0 [|ip]
03:08:38.842393 IP0 [|ip]
03:08:38.842398 IP0 [|ip]
03:08:38.843370 IP0 [|ip]
03:08:38.843375 IP0 [|ip]
03:08:38.844345 IP0 [|ip]
03:08:38.844350 IP0 [|ip]
03:08:38.845322 IP0 [|ip]
03:08:38.845327 IP0 [|ip]
03:08:38.846299 IP0 [|ip]
03:08:38.846304 IP0 [|ip]
03:08:38.847277 IP0 [|ip]
This trace actually implies that you used IPEncap to generate and ipip packet instead of a plain ip packet.

Instead, if you see a trace like the one below:
03:11:46.080628 IP5 bad-hlen 8
03:11:46.080634 IP5 bad-hlen 8
03:11:46.080639 IP5 bad-hlen 8
03:11:46.080645 IP5 bad-hlen 8
03:11:46.080650 IP5 bad-hlen 8
03:11:46.080656 IP5 bad-hlen 8
03:11:46.080661 IP5 bad-hlen 8
It means that you are not appropriately generating an IP header. The standard IP header is 20 bytes, where as your packets have an IP header of 8 bytes only. The solution to this problem is to ensure that you generate a proper IP header by using the UDPIPEncap element.