Internet Addresses and Routing

 

The goal is to have a universal network so that anybody can communicate with anybody.No single network type is appropriate for all users; so different networks have to be interconnected.

 

The Internet is an interconnection of networks.

 

Computers on the Internet are referred to as hosts.Each host as at least three identifiers:

        An Internet name for humans to use (i.e. Garfield.ncat.edu)

        An Internet address, a 32 bit binary number written in decimal as four bytes (i.e.152.8.240.16)

        A hardware address, such as an Ethernet address (i.e. 00-e0-63-03-76-c0 for Garfield)

 

Internet names are hierarchical starting from the right.edu, com, gov, org and mil indicate the type of network owner.Sometimes the last item indicates a geographical location, such as ca for Canada.Just to the left of the organization type is the domain name.For www.ncat.edu, the domain name is ncat. The left most portion of an Internet name is the host name or the name of the computer.†† WWW is a popular host name for web servers, but there is nothing special about this name.

 

Each host has a unique 32 bit internet address.Network Information Center (NIC) assigns netids.

 

Class A

0††† netid

†††††††††††††††††††††††††††††††††††††† hostid

Class B

10†††††††††††††††††††† netid

††††††††† ††††††††hostid

Class C

110††††††††††††††††††††††††††††††† netid

†††††† hostid

Class D

1110

††††††† multicast address

Class E

11110

Reserved for future use

 

Binary values appear in IP packets in Big Endian style (most significant byte first).

 

Because an IP address encodes both network and host, a machine that connects to two networks will have to have two IP addresses.

 

Special IP addresses:

††††††††††††††††††††††† all 1s†††††††††††††††††† broadcast on the local network

††††††††††††††††††††††† hostid = all 1s††††† directed broadcast on a network

††††††††††††††††††††††† netid = all 0s††††††† this network

††††††††††††††††††††††† all 0s†††††††††††††††††† this host

††††††††††††††††††††††† hostid = all 0x††††† the network (not a particular host)

††††††††††††††††††††††† hostid = 127††††††† loop back (never appears on net)

 

Because the IP address encodes the network, the IP address must change if the host moves to another network.Packets to a host with two net connections (and two IP addresses) will follow different paths depending upon the address used.

 

Domain name servers map names to IP addresses.IP names are hierarchical, right to left.

†††† host.group.site.type†††††††† dots have no relation to IP addresses

resolution of names is hierarchical.If a name server cannot resolve a name, it can forward the request to another server or respond to the client returning the name of another server.

 

Internet packets are encapsulated within the MAC layer frames.The MAC frame must have the proper MAC address to get to the destination.An Ethernet card knows nothing about Internet addresses.If a user wants to send Internet Protocol (IP) packet to another user on the same network, the sending machine must know the MAC address of the destination in addition to the IP address of the destination.

Address Resolution Protocol (ARP) maps IP addresses to physical addresses

When host A wants to communicate with host B, and only knows the IP address of B bit not the physical address, host A broadcasts an ARP packet on the net.The host with the IP address of B responds with its physical address.(Note that all Ethernet packets contain both the source and destination physical addresses.)Once A knows Bís physical address, it uses that and no longer broadcasts.Because Aís ARP packet contains Aís IP and physical address, all hosts on the net (in particular B who will probably respond to Aís messages) can learn Aís physical address from the broadcast.[note: ARP packet is a datagram.]

 

Hosts have an ARP cache that keeps a mapping of IP to physical addresses to avoid having to use ARP.

 

Routing IP datagrams - IP routing determines how to send a datagram across multiple physical networks.The physical network is responsible for routing to a particular host within the network.Routing is based on the netid only.If the destination computerís IP address has the same netid as the source, then the packet can be sent locally.If the netids are different, the packet must be sent to a gateway or router.The routers will forward the packet to other routers until it arrives at a router connected to the destination network.Note that IP routing does not alter the IP datagram.It always contains the original source and destination.The IP packet is encapsulated in a data link layer protocol packet.For example, if the IP packet is being sent over an Ethernet, the IP datagram will appear in the ďdataĒ portion of an Ethernet frame.The appropriate Ethernet address must be used in the Ethernet frame to get the IP packet to its appropriate destination on the local network.If the IP packet is destined for another network, the IP packet (with the IP address of the final remote destination) will be encapsulatedin an Ethernet frame that contains the Ethernet address of the gateway or router.

 

IP Routing Procedure Ė Assume computer A wants to send one frame to computer B.The sender initially knows only the IP name of the destination

 

1.                  A sends a DNS request to the local Domain Name Server asking for the IP address of B.

2.                  The DNS sends the IP address of B to A.

3.                  The netid portion of Bís IP address is extracted by ANDing Bís IP address with the subnet mask of A.

4.                  If the netid of the sender and receiver are the same, then the destination is on the same network.A can send the packet directly to B.

5.                  If the netids are different, A must send the packet to the gateway.

6.                  The gateway will forward the packet to another gateway that is closer to the destinationís domain.

7.                  The gateway at the destinationís domain will send the frame to B.

 

Note that before any of the above messages can be sent, the sending computer must have the MAC address of the next computer or router to receive the message.If it doesnít have the MAC or data link address, it will have to use the ARP protocol to find the MAC address.

 

An example of the messages sent to accomplish routing over the Internet can be found at http://williams.comp.ncat.edu/IProuting.htm