Realistically, there are not 216 machines on a class B network
(the physical wire cannot support that many machines)
But, using subnet masks, the class B network can be configured as a
class C network.
If your IP address is 184.108.40.206 (that's a class B), you
can tell IP to use 169.124.21 as the network number instead of 169.124.
You do that by specifying a mask of 255.255.255.0. The 1's tell
the network number. The 0's tell the host number.
So, the subnet mask is used to inform the IP software as to which bits
represent the network number and which bits represent the host number.
In a network, all machines must have the same subnet mask. If not, the
definition of the network number would vary from one machine to the next,
and that would cause the IP software to malfunction.
Note that subnet masks do not have to be contiguous. The subnet
mask can be used to have any bits in the host number act as the network
Some more notes on the TCP/IP suite:
The Internet Protocol
The Address Resolution Protocol
IP is the heart of the protocol suite.
The higher-level protocols and the lower-level device drivers interact
only with IP.
Given a packet from a higher-level protocol, IP examines the destination
address, looks at the network number of the address, figures out the network
to which the packet should be delivered, passes it to the corresponding
device driver, and routes packets from one network to another.
Because IP relays and routes packets, it corresponds to the network layer
of the OSI model.
If the recipient is not on a directly accessible network, IP sends the
packet to an appropriate host that can deliver the packet to its final
IP keeps information about routers to which to send packets if the destination
host is on a network that is not directly attached to your machine.
IP does not retransmit lost packets, does no error checking of data consistency,
and does not ensure that packets arrive in sequence (the TCP layer provides
IP ensures that a packet does not loop continuously through the network
trying by maintaining a ``Time to Live'' counter.
The Transmission Control Protocol
ARP implements a ``dynamic discovery'' procedure of mapping IP addresses
into hardware addresses, and it is usually used on Ethernet and Token Ring
local area networks.
Before IP sends a packet to that network, ARP consults a local table to
see if a mapping exists between the destination IP address and the destination
Ethernet address. If it doesn't, ARP sends a broadcast packet requesting
the Ethernet address of the machine with the given IP address. Because
it is a broadcast packet, every machine in the network receives it.
The host with the requested IP address sends a reply, stating its Ethernet
address. The originating machine receives the reply, adds an entry into
its mapping table that associates the IP address with the Ethernet address,
and sends the packet to its destination.
There are several aspects of TCP that applications must be aware:
TCP provides virtual-circuit service.
It handles flow control by ensuring packets are received intact and in
order, checks for errors in received packets, and retransmits packets that
are lost or damaged.
The destination TCP module sends an acknowledgment for every packet received.
If the TCP module on the originating machine does not receive the acknowledgment,
it retransmits the packet.
If the acknowledgment is not received after several retransmissions, TCP
assumes the data cannot be delivered and passes an error indication to
There are no ``negative acknowledgments'' in TCP/IP the TCP module on the
destination machine does not send a message if it detects an error in the
packet. If the TCP module on the originating machine does not get an acknowledgment,
it assumes the original packet was never received, the packet was corrupt,
or the acknowledgment was lost. In all cases, the TCP module on the originating
machine resends the packet.
The User Datagram Protocol
TCP provides virtual-circuit service. The client must establish a connection
with the server before any communication can take place.
TCP connections are full-duplex. Data may be transmitted simultaneously
in both directions.
TCP maintains no record markers and transmits no information about how
many bytes were written. So, an application may have to do several read
requests to obtain all the data sent with a single write request.
There are several aspects to UDP that applications must be aware:
UDP only provides datagram service. It does not do any error correction
The UDP module on the destination machine can check for errors in packets,
but it only delivers error-free packets to the application. Erroneous packets
The application must specify the recipient address on every message. Connection
establishment is not necessary.
UDP is datagram-based, so every message is a discrete unit.
Data sent may be lost If your application sends a message to a service
and expects a response, it must be coded to time out and resend the request
if it does not receive the response.
Data may arrive out of sequence. If your application sends two messages
to a service, the service may not receive them in the order sent.
The Internet Control Message Protocol
The Internet Control Message Protocol (ICMP) is responsible for generating
Advisory messages (slow down, better route, etc).
If desired, applications can interface with ICMP directly.
For example, the ping command is a TCP/IP application. It sends
an ``echo'' packet to a specified server machine via the ICMP protocol.
Although applications can interface with ICMP directly, it is not a transport-layer
protocol. It does not provide a consistent interface for end-to-end communication.
The TCP/IP protocol suite has several routing protocols. the Gateway-to-Gateway
Protocol (GGP), the Exterior Gateway Protocol (EGP), the Routing Information
They are used between router machines to pass and establish routing information,
and they are generally of little concern to applications.