Page 289 - DCAP403_Operating System
P. 289
Operating System
Notes 13.9 Network Structure
Networking and Linux are terms that are almost synonymous. In a very real sense Linux is
a product of the Internet or World Wide Web (WWW). Its developers and users use the web
to exchange information ideas, code, and Linux itself is often used to support the networking
needs of organizations. This unit describes how Linux supports the network protocols known
collectively as TCP/IP.
The TCP/IP protocols were designed to support communications between computers connected
to the ARPANET, an American research network funded by the US government. The ARPANET
pioneered networking concepts such as packet switching and protocol layering where one
protocol uses the services of another. ARPANET was retired in 1988 but its successors (NSF NET
and the Internet) have grown even larger. What is now known as the World Wide Web grew from
the ARPANET and is itself supported by the TCP/IP protocols. Unix TM was extensively used
on the ARPANET and the first released networking version of Unix TM was 4.3 BSD. Linux’s
networking implementation is modeled on 4.3 BSD in that it supports BSD sockets (with some
extensions) and the full range of TCP/IP networking. This programming interface was chosen
because of its popularity and to help applications be portable between Linux and other Unix TM
platforms.
13.9.1 An Overview of TCP/IP Networking
In an IP network every machine is assigned an IP address, this is a 32 bit number that uniquely
identifies the machine. The WWW is a very large, and growing, IP network and every machine
that is connected to it has to have a unique IP address assigned to it. IP addresses are represented
by four numbers separated by dots, for example, 16.42.0.9. This IP address is actually in two
parts, the network address and the host address. The sizes of these parts may vary (there are
several classes of IP addresses) but using 16.42.0.9 as an example, the network address would
be 16.42 and the host address 0.9. The host address is further subdivided into a subnetwork
and a host address. Again, using 16.42.0.9 as an example, the subnetwork address would be
16.42.0 and the host address 16.42.0.9. This subdivision of the IP address allows organizations
to subdivide their networks. For example, 16.42 could be the network address of the ACME
Computer Company; 16.42.0 would be subnet 0 and 16.42.1 would be subnet 1. These subnets
might be in separate buildings, perhaps connected by leased telephone lines or even microwave
links. IP addresses are assigned by the network administrator and having IP subnetworks is a
good way of distributing the administration of the network. IP subnet administrators are free to
allocate IP addresses within their IP subnetworks.
Generally though, IP addresses are somewhat hard to remember. Names are much easier. linux.
acme.com is much easier to remember than 16.42.0.9 but there must be some mechanism to
convert the network names into an IP address. These names can be statically specifi ed in the /
etc/hosts file or Linux can ask a Distributed Name Server (DNS server) to resolve the name for
it. In this case the local host must know the IP address of one or more DNS servers and these are
specified in /etc/resolv.conf.
Whenever you connect to another machine, say when reading a web page, its IP address is used
to exchange data with that machine. This data is contained in IP packets each of which have an
IP header containing the IP addresses of the source and destination machine’s IP addresses, a
checksum and other useful information. The checksum is derived from the data in the IP packet
and allows the receiver of IP packets to tell if the IP packet was corrupted during transmission,
perhaps by a noisy telephone line. The data transmitted by an application may have been broken
down into smaller packets which are easier to handle. The size of the IP data packets varies
depending on the connection media; ethernet packets are generally bigger than PPP packets.
The destination host must reassemble the data packets before giving the data to the receiving
application. You can see this fragmentation and reassembly of data graphically if you access a
web page containing a lot of graphical images via a moderately slow serial link.
282 LOVELY PROFESSIONAL UNIVERSITY