• No results found

Class C addresses

Distributed Networks 10.1 Introduction

Chapter 13. The Arpanet

13.5. Imp-to-Imp or Network Layer Protocol

14.3.3. Class C addresses

A class C address has the three most significant bits 110. The next 21 bits contain the network number and the last eight bits the host number. There are thus more than 2000000 possible class C networks each containing 254 hosts.

14.3. IP addresses 165 0 net 1 7 24 class A: class C: class B: host host host 10 110 net net 2 14 16 3 21 8

Figure 14.2. IP address formats 14.3.4. Multicast addresses

It is often desirable to send some types of message to many different hosts simultaneously. The remaining IP addresses (i.e. those which start with 111) are used for such messages. As a special case, the address 255.255.255.255 is a broadcast address so that packets with that destination address are received by all hosts within the network. In some networks the address 0.0.0.0 is also a broadcast address.

Within a network, the address with the host number containing all 1s (or 0s) is a broadcast address within that network.

14.3.5. Subnetting

Within an IP network (i.e. that groups of hosts which have the same net number in their IP address), it is still necessary to be able to route between the hosts. For convenience, particularly in class A and class B networks, it is often needed to split the network up into smaller parts and then route between those parts much as the routing is done at a higher level between networks. Accordingly many IP networks are “subnetted”. That is, there is another partition made in the IP number in that the host number is split in two parts, a subnet number and a host number. The partition is made at a convenient point given the topology of the desired network. Effectively, the boundary between the host and net numbers is moved to the right, but only within the network. As far as hosts outside the network are concerned there is no subnetting within other networks.

14.4. Routing IP

Because an internet is a collection of networks, routing is simplified by the assumption that a host in a network can connect to any other host in the same network without leaving that network. Thus if two hosts have IP addresses with the same network number then they can communicate without leaving that network. The further assumption is made that if a host from outside that network knows how to get to any one host in a particular other network then that other host will be able to route packets to all hosts in that network. This drastically simplifies the routing problem because now all routers in the network only need to know how to get to a particular network and not to every host within each network.

Unfortunately, because the Internet is so successful, there are now a very large number of networks connected together. Because there is no extra routing information in the net number part of the IP address, all routers need to remember how to get to every one of the networks constituting the internet. Routers thus need large amounts of memory to contain these tables and a significant amount of time is spent in transmitting routing information between routers. Some changes have been made in the way in which IP numbers have been allocated in an attempt to partly alleviate this problem and IP version 6 will be arranged so that there is routing information inherent in an IPv6 address.

14.5. ARP

A major problem in networks is finding the address of the host that you want. For example, once you know the IP address of the destination machine you need to work out where to send th packet. Part of this is solved by the routing algorithms described elsewhere, but once the destination machine is known to be on your network (say a broadcast network like ethernet) you still need to find the data link layer address of the desired machine without having to maintain large translation tables.

This problem is solved by using the Address Resolution Protocol (ARP). An ARP packet is shown in figure 14.3. The particular case shown here is for an IP address to ethernet address translation, but the protocol is designed to be able to be used for any address translation required between any two protocol addresses. The packet shown here is a full ethernet packet, including the ethernet addresses and packet type field at the beginning. (The padding necessary at the end to achieve a minimum length ethernet packet is not shown). Note that this is not an IP packet. The ARP protocol is a separate protocol which does not need any routing.

When a host needs to translate an IP address to an ethernet address it constructs a packet as shown in figure 14.3. Obviously it cannot fill in all the fields or it would not need to send the request. Instead, the destination ethernet address field (the first field) contains the ethernet broadcast address (all ones) and the target hardware address field (which contains the value we are trying to find) is left blank.

This packet is transmitted and any host on the network which knows the desired ethernet address (most probably the target host) will fill in that field, change the opcode field to indicate that this is a reply, modify the destination and source ethernet addresses at the beginning and transmit the packet. The original host can then read the reply to find the desired ethernet address.

14.6. RARP

A different, but related, problem to that of finding another machines ethernet address when you know its IP address is to find you’re own IP address when all you know is your ethernet address. The ethernet address of a host is often configured into its hardware somewhere, but its IP address will be assigned by an administrator somewhere within the network. It is inconvenient to have to set up each individual computer to tell it its IP address and this procedure is also prone to error. An alternative is to maintain a central database containing the IP addresses of all hosts in a network and let them ask for their addresses. (This also allows for dynamic allocation of IP addresses when only a few hosts are likely to be using the network at the same time.) This problem is compounded by the hosts inability to send packets to other machines because it doesn’t know

14.6. RARP 167

8 bits

standard ethernet header ethernet destination address source ethernet address packet type (ARP) physical address type protocol address type

opcode (ARP or RARP)

sender hardware address

sender protocol address

target hardware address

target protocol address

hardware address length (6) protocol address length (4)

Figure 14.3. ARP/RARP packet format what to put in the source address fields.

This problem is solved by modifying the ARP protocol slightly. This alternative is the Reverse Address Resolution Protocol (RARP). A packet similar to the ARP packet is constructed, the only differences being that the sender protocol address field is left blank (as well as the target addresses) and the opcode field is changed to represent a RARP request. The packet is broadcast onto the network and the database server fills in the blank fields and sends the response.

14.7. ICMP

Within an IP internetwork there is often the need for auxiliary information to be transmitted between hosts relating to the operation of the network rather than communication between the hosts. The Internet Communication Message Protocol (ICMP) is designed for this job and it has messages which can send information through the network passing information such as the reasons why packets are dropped.