Messages in this thread | | | Date | Mon, 16 Aug 1999 11:10:40 +0200 (CEST) | From | Piotr Kwapulinski <> | Subject | SOCK_PACKET problem |
| |
SOCK_PACKET problem
Hello. My name is Piotr Kwapulinski. A I've got a problem with sending the packets using SOCK_PACKET.
I wrote an short (linux) program which sent UDP packet, using standard SOCK_DGRAM way. This UDP packet was seen by iptraf as UDP packet (correct). tcpdump showes this UDP packet lookes like: (I added comments)
Preamble D4 C3 B2 A1 02 00 04 00 00 00 00 00 00 00 00 00 44 00 00 00 01 00 00 00 6B 70 A8 37 5D A2 0C 00 2E 00 00 00 2E 00 00 00
ETH header: 00 00 B4 5B 8E 9C 00 00 B4 5B 8A 7F 08 00
IP header: 45 00 00 20 18 00 00 00 40 11 03 0F -ip checksum 99 13 16 D1 99 13 16 C7
UDP header 04 0C 20 00 00 0C DB 6A -udp checksum
UDP data (just "PPPP") 50 50 50 50
IPtraf showed the following message: UDP (32 bytes) from 153.19.22.209:1029 to 153.19.22.199:8192 on eth0 (everything is OK)
but... I decided to prepare the same packet using SOCK_PACKET. The same means containing exactly the same fields starting from ETH header (as shown below). I put that packet on the network and received it by tcpdump (like above). This packet looked like: (I added some comments)
Preamble D4 C3 B2 A1 02 00 04 00 00 00 00 00 00 00 00 00 44 00 00 00 01 00 00 00 D6 -changed 73 -changed A8 37 5E -changed 95 -chenged 05 -changed 00 2E 00 00 00 2E 00 00 00
ETH header: 00 00 B4 5B 8E 9C 00 00 B4 5B 8A 7F 08 00
IP header: 45 00 00 20 18 00 00 00 40 11 03 0F -ip checksum(the same) 99 13 16 D1 99 13 16 C7
UDP header 04 0C 20 00 00 0C DB 6A -udp checksum(the same)
UDP data (just "PPPP") 50 50 50 50
This time IPtraf showed the following message: Non-IP (0x0) (46 bytes) from 0000b45b8a7f to 0000b45b8e9c on eth0
My question is: Why the second IP[UDP] packet wasn't seen by IP module - ?
The checksum is right (I think) because I just put it from the first packet. The only difference between two packets was 5 bytes in PREAMBLE (marked by changed in my example). The IP chechsum (as I read in RFC791) is counted only from IP header wich is the same in two My packets - that's why I suppose the copied checksum is right in the second packet.
I can send two programs which generated that packets if necessary
I'm very interested in solving this problem
by
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |