Embedded LAN and the internet

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi freaks,

 

I'm working on a tcp/ip stack and am trying to obtain access to the internet.  The setup is on a laptop.

 

the wifi settings are as follows:

 

192.168.1.1

255.255.255.0

192.168.1.0

 

DNS

Primary DNS: 62.6.40.178
Secondary DNS: 62.6.40.162

 

the LAN that the MCU is connected to is as follows:

192.168.1.2

255.255.255.0

192.168.1.0

 

// MCU settings

192.168.1.3

255.255.255.0

192.168.1.0

 

example question, how do I say ARP the wifi (192.168.1.1) address???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I connect it to the WIFI router to the embedded board I can ARP the router, so the question is, what's the easiest way to do something like ARP to see that I'm connected to the network?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

    Ping.

 

    Even if the device you ping has ping disabled, you should still see the ARP exchange. If you want to do this repeatedly, make sure you clear the ARP entry on your microcontroller before pinging. If you don't have Ping implemented on your stack, then just send an empty UDP packet and look for ARP entry in the table.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

when I send an ARP request to say 104.16.86.28 which is www.scan.co.uk I get no response?

 

Am I right in thinking that I do a DNS query of the name, i.e. scan.co.uk and get the address back. And then do I ARP that address for it MAC?????

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

    No. Your router would not forward any broadcast packet outside your LAN. Once you have your reply from DNS, you no need to worry about MAC address. When you send a packet out to that server, the packet leaving your microcontroller is:

Source MAC: your microcontroller MAC

Destination MAC: router MAC

Source IP: microcontroller host IP

Destination IP: www server (www.scan.co.uk) IP address you got from DNS.

 

Your router will notice that the destination IP is outside LAN, and will do NAT and port masquerading and add a routing entry to its table, and send the packet to your ISP. When a packet arrives from scan.co.uk, it will notice that there is an entry for that IP address and port, so it will let the packet in, redo reverse NAT and port masquerading and send the packet to your microcontroller. You no need to worry about all these.

 

Edit: beside NAT and port masquerading, will decrement TTL and recalculate IP checksum and UDP/TCP checksum if it is the case. If packet size is larger than allowed MTU and IP do not fragment flag is set, you will get back an ICMP message that you need to process.

Last Edited: Mon. Nov 5, 2018 - 08:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi angelu, your quite correct, however I have not olved the problem yet.  I'll try again tomorrow - it's late here in Ireland.

 

Problem probably lies with the network. Its configured to

pick the router up boost it and retransmit then receive it at the laptop and bridge it on to the LAN