Author | Message | Time |
---|---|---|
CupHead | I've been trying to create a raw socket example and have run across several problems in doing so. The steps I followed are: Create a raw socket (SOCK_RAW) Set the socket options to IP_HDRINCL. Create the IP and TCP headers. Use sendto() to send the packet. sendto() returns sizeof ( ipheader ) + sizeof ( tcpheader ), as it should [I think], as there is no data other than the two headers. However, in monitoring the system (I'm sending the packet back to myself), I don't ever receive it. None of the calls ever fail, so I assume there must be something else wrong. Ideas, anyone? | October 14, 2003, 5:40 PM |
St0rm.iD | Are you on windows? If so, are you administrator? | October 15, 2003, 2:04 AM |
CupHead | Yes and yes. | October 15, 2003, 2:46 AM |
St0rm.iD | In that case, I'm out of ideas :P | October 15, 2003, 3:29 AM |
Grok | Run network monitor and see what's actually happening? | October 15, 2003, 3:46 AM |
St0rm.iD | Errr....don't you have to specify the destination address in the header?? I don't think sendto will do it for you but I may be mistaken. Also...what's the deal with SOCK_RD? | October 15, 2003, 3:49 AM |
CupHead | Grok: sendto() returns success, but no monitoring tools that I've used have actually seen the packet be sent or received. | October 15, 2003, 12:23 PM |
Arta | Well, that sounds like a problem with your capture tool. | October 15, 2003, 1:30 PM |
Skywing | [quote author=CupHead link=board=5;threadid=3092;start=0#msg24240 date=1066220615] Grok: sendto() returns success, but no monitoring tools that I've used have actually seen the packet be sent or received. [/quote] Perhaps you are sending it to your own address? Most network monitoring tools don't see traffic that doesn't reach the NIC, such as purely local sockets traffic. | October 15, 2003, 1:47 PM |
CupHead | It is being sent back to localhost. I guess I could try it from a different computer. | October 15, 2003, 4:22 PM |
Grok | CupHead since you're probably on some NT variant, you might want to just add some IPs to your current adapter, or add an additional adapter. Under NT you could add an MS Loopback Adapter. I don't know if such an option is available under Win2000 or XP. However, XP supports an alternate configuration for your networking. In this way you can use DHCP for your ISP, and a fixed, local range IP for your programming. A third option would be to install an additional adapter and configure it with private range IPs. In any of those configurations, be sure to explicitly bind your client and server applications to different IPs. | October 15, 2003, 4:44 PM |
Adron | And even then you might not see anything that's not routed through the real network cards. If it goes through the loopback adapter I'm not sure you'll ever see it. Send it to an internet host! | October 15, 2003, 10:37 PM |
-Death- | What Windows are u running off of?? Win 95 Win 98 Win 2000 Win ME Win XP Home, or Proffesional. ???????? Each system has different for solving there problems. | October 16, 2003, 12:36 AM |
CupHead | Um... Windows Server 2003 Enterprise Edition, not that it matters. It's essentially XP, and I've used the most updated information I can find on the subject. | October 16, 2003, 1:33 AM |
-Death- | Hmm... You lost me. I am totally confused. Sorry, I can't help. Best of Luck. | October 16, 2003, 9:55 PM |