> if I'm understanding correctly... not sure I am because is not > working...... I have a local network.... on it are a laptop... a > desktop.... the PIC card I am developing code for.... and a router > connected to a cable modem to the internet... the PIC card address is > 192.168.0.20 ... desktop 192.168.0.2 ... laptop 192.168.0.10 ... > router 192.168.0.1 ..... and the mailserver IP is 32.x.x.x .... > because the mailserver is outside the 255.255.255.0 mask > (ie 32.x.x.x compared to 192.x.x), By definition, if the netmask is 255.255.255.0 (it's a bit mask) then the local network is 192.168.0.0, not 192.x.x.x. The mailer server's network number would be 32.x.x.0 using your netmask. To compute a network number you bit-wise AND the IP address with the netmask. > so I ARP request and get a respone... > > then send SYN through TCP client..... > > and should get back an ACK flag.... but instead I get back > RST (reset) flag.... You don't specifically state it, but from the hints in your questions, I'm assuming you are layering SMTP/POP3 on top of TCP on top of IP on top of an Ethernet physical layer. Where did you get the TCP/IP & Ethernet layers running on your PIC? Do they work? Do you trust them to work? I don't think you have a clear understanding of how the TCP, IP, and Ethernet layers work. Your first question implies you are implementing the IP layer and interfacing directly to the Ethernet layer (ARP). Yet later questions imply you are working at the TCP layer. I think you need to spend some time studying up on IP, TCP, Ethernet encapsulation of IP, etc. All these subjects are well covered by various RFCs. And then provide a clear description of how your application is trying to hook into the layer(s) of whatever network stack you are using. > the LAN router address is used ? to ARP? to send SYN If the destination IP address is not on the local network, then you need to use your routing table to determine what gateway IP address is most appropriate for traffic destined for any specific remote IP network. Decision is usually made based on IP address but may include link cost metrics or other factors. The easiest & most common case for end nodes is a single default gateway. It is normally the IP address of the router, DSL box, etc on your local network and appears to be 192.168.0.1 from your above description. In this case, all traffic that isn't destined for the local IP network is sent to the gateway router's IP address. Lee Jones -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics