On Monday 07 April 2003 19:38, Ken Schneider wrote:
On Mon, 2003-04-07 at 13:11, Anders Johansson wrote:
On Monday 07 April 2003 18:36, Ken Schneider wrote:
Maybe some simple networking lessons are in order.
A "dotted quad address" is always treated as an "IP address" NOT some random text string URL.
argv is a pointer to an array of zero terminated character strings. How they are treated is not written in stone.
We are talking about the telnet command NOT c source.
telnet is written in C.
When you type the "IP address" as the destination, (whether telnet, ftp, http) it eliminates having to go through DNS to resolve a "name" to an "IP address".
only if you use getaddrinfo and pass it the flag AI_NUMERICHOST
We are talking about the telnet command NOT c source. I don't know if I have ever typed getaddrinfo at the command line but I have used telnet.
telnet is written in C. My comment above was poorly phrased. What I meant to say was that if you use getaddrinfo you pass the AI_NUMERICHOST flag to tell it to treat it as a numerical address and avoid a name lookup. It's explained in the man page. Obviously if you don't use getaddrinfo and you know you have a numeric address, you can create the struct needed manually. telnet uses getaddrinfo. telnet does not use AI_NUMERICHOST.
Once the "IP address" has been determined another query is sent on its way to the routers looking for the "MAC address" that belongs to the "IP address".
arp queries are broadcast, not routed. They may be handled by a switch, rarely by a router.
Yes but the query is sent as an "IP address" first which IS routed.
no
EVERY request will resolve to a "MAC address" or fail.
Are you suggesting that every machine queries every other machine on the entire internet for its hardware address?
The request sent is (I may not be quoting correctly) "Who has x.x.x.x" and listens for an answer. First the request is sent to your default router and so on and so on until one replies with that is has the "MAC address" for the requested "IP address".
Yes, the request is sent on the local lan. The TCP packet is then sent to the router for routing, so there's an arp lookup for the router ip (possibly cached). The router then does an arp lookup for the next routing hop and so on. The final router on the path does a lookup for the receiving machine, so it can send it on the recipient's local lan. The sending computer does not wait for, nor receive the other side's hardware address, except possibly as part of the ACK packets in the tcp protocol. arp is a LAN protocol. It is not used on the internet, nor is there a reason to use it on the internet.