On Thu, 2003-09-04 at 13:43, Michael Ryan Byrd wrote:
> 1-my computer must first resolve www.google.com into an IP address. Some sort of
> nslookup command is called which sends a nslookup command inside a TCP? packet
> to the name server. Another TCP packet is received my computer with the result:
> A.B.C.D

It's called DNS and it's UDP rather than TCP, but that's basically
right.

> 2-my computer looks at my subnet address and realizes that I am not on the same
> network as google's A.B.C.D, so my computer sends out a HTTP GET request (again
> encapsulated inside a TCP packet, which is encapsulated inside an IP packet,
> which gets an Ethernet header and trailer which goes out ethernet card to the
> local area network, through a switch to a router (gateway) to it's destination.
> 
> 3-If I *was* on the same subnet as A.B.C.D my computer would have send out an
> ARP packet asking for the MAC address of the host with IP address A.B.C.D. that
> server would have replied with it's MAC address, AA:BB:CC:DD:EE:FF and then my
> computer would have sent out a HTTP GET request inside a TCP inside a IP inside
> an Ethernet packet addressed to AA:BB:CC:DD:EE:FF.

These really are the same scenario. The application talks HTTP to the
remote end over IP. It doesn't handle the IP details and it doesn't
care. Just write these bytes to the other side.

IP then just takes whatever data is given to it and routes it to its
destination. IP can use complicated routes to accomplish that, or it can
be the most common case of send it directly if the destination is on the
same subnet, otherwise send it to the gateway and let him do it.

Once IP makes a decision on where to send the packet, it hands that off
to the lower lever, in this case Ethernet. If IP doesn't know the
ethernet address for the destination, it uses ARP to find it. Once
that's done, it sends the data down to ethernet and that's it.

Just remember that everything is done in layers and as much as possible,
it's all compartmentalized.

> Questions:
> Is ARP used in scenerio #2? 

Yes. Your computer must know the ethernet address of the gateway in
order for it to send IP packets to it. It uses ARP for that purpose.

> When is the RARP protocol used?

Rarely

> Why do we have both IP and MAC addresses? Wouldn't just one of the two do
> nicely? (I guess routers would have to route based on MAC address...)

If you look at how IPv6 is designed it can use the MAC address as the
bottom 48 bits of the address. But the reason we have separate addresses
is because not everybody who uses IP also uses ethernet. There's ATM and
Token Ring for instance. And not everybody who uses ethernet uses IP,
such as NetBEUI and IPX.

Corey



____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to