Tcpip Notes2016
Tcpip Notes2016
CONTENTS
Teaching Plan
Unit – I
Unit – II
Chapter 5 IP routing Principles and Routing of IP Datagram
5.1 The IPV4 Datagram
5.2 Datagram format
5.3 Direct and Indirect delivery
5.4 Datagram delivery over a single Network
5.5 Indirect Delivery
5.6 Table – Driven IP forwarding
5.7 Next-Hop forwarding
5.8 Default Routers and 7.7 Host specific Rout
5.9 Routing information Protocol (RIP)
5.9.1 History of RIP
5.9.2 RIP operation
5.10 Delay metric (HELLO)
5.11 The open SPF Protocol (OSPF)
5.12 Static Vs Dynamic Interior Routers (BGP)
5.13 Assignment Questions
Chapter 6 CIDRSubnetting
6.1 Introduction
6.2 Proxy ARP
6.3 Subnet Addressing
6.4 Variable – Length Subnets
6.5 Implementation of subnets with masks
Chapter 8 TCP
8.1 Introduction
8.2 The need for stream Delivery
8.3 Properties of the reliable Delivery Service
8.4 The idea behind sliding windows
8.5 The transmission control Protocol
8.6 Passive and active opens
8.7 Establishing a TCP connection
8.8 Closing a TCP connection
8.9 Assignment Questions.
Chapter 9 IP Multicasting
9.1 Introduction
9.2 Hardware Broadcast
9.3 Hardware origins of Multicast
9.4 IP- Multicast
9.5 IP- Multicast Addresses
9.6 Internet Group Management Protocol
9.7 Assignment Questions.
Chapter 10 DNS
10.1 Introduction The Domain Name System (DNS)
10.2 Names for machines
Unit – IV
Chapter 11 Various Internet protocols
11.1 Sharing by File Transfer
11.2 The major TCP/IP File Transfer Protocol
11.3 FTP Features
11.4 FTP Process Model
11.5 TFTP
11.6 NFS
11.7 Simple mail Transfer Protocol (SMTP)
11.8 Mail Retrieval and mail box Manipulation Protocols
11.9 Post Office Protocol
11.10 Internet Message Access Protocol
11.11 The MIME Extensions for Non – ASCII Data
11.12 Assignment Questions
TEACHING PLAN
Unit 1
12 Hours
Unit 2
12 Hours
Unit 3
12 Hours
Unit 4
12 Hours
Session 3: TFTP.
Session 4: NFS.
Session 5: SMTP.
Session 6: POP.
Session 7: IMAP.
Session 8: MIME.
Text Book:
1. Douglas E Comer, Internetworking with TCP/IP Principles, Protocols and ArchitectureVol- I, 5th
Edition, PHI Learning 2010.
Reference Books
Scheme of Examination:
***********
CHAPTER 1
guide the design of the protocols and architecture of the emerging Internet. Called the
Internet Control and Configuration Board (ICCB), the group met regularly until 1983, when
it was reorganized.
The global Internet began around 1980 when DARPA started converting machines attached
to its research networks to the new TCP/IP protocols. The ARPANET, already in place,
quickly became the backbone of the new Internet and was used for many of the early
experiments with TCP/IP. The transition to Internet technology became complete in January
1983 when the Office of the Secretary of Defense mandated that all computers connected to
long-haul networks use TCP/IP. At the same time, the Defense Communication Agency
(DCA) split the ARPANET into two separate networks, one for further research and one for
military communication. The research part retained the name ARPANET; the military part,
which was somewhat larger, became known as the military network, (MILNET).
To encourage university researchers to adopt and use the new protocols, DARPA made an
implementation available at low cost. At that time, most university computer science
departments were running a version of the UNIX operating system available in the
University of California's Berkeley Software Distribution, commonly called Berkeley UNIX
or BSD UNIX. By funding Bolt Beranek and Newman, Incorporated (BBN) to implement its
TCPIIP protocols for use with UNIX and funding Berkeley to integrate the protocols with its
software distribution, DARPA was able to reach over 90% of university computer science
departments. The new protocol software came at a particularly significant time because many
departments were just acquiring second or third computers and connecting them together
with local area networks. The departments needed communication protocols that provided
application services such as file transfer.
Besides a set of utility programs, Berkeley UNIX provided a new operating system
abstraction known as a socket that allowed application programs to access communication
protocols. A generalization of the UNIX mechanism for I/O, the socket interface has options
for several types of network protocols in addition to TCPIIP. The introduction of the socket
abstraction was important because it allowed programmers to use TCPIIP protocols with
little effort. The socket interface has become a de facto standard, now used in most operating
systems.
Realizing that network communication would soon be a crucial part of scientific research, the
National Science Foundation (NSF) took an active role in expanding the TCPIIP Internet to
reach as many scientists as possible. In the late 1970s, NSF funded a project known as the
Computer Science NETwork (CSNET), which had as its goal connecting all computer
scientists. Starting in 1985, NSF began a program to establish access networks centered
around its six supercomputer centers, and in 1986 expanded networking efforts by funding a
new wide area backbone network, known as the NSFNET backbone. NSF also provided seed
money for regional networks, each of which connected major scientific research institutions
in a given area. Within seven years of its inception, the Internet had grown to span hundreds
of individual networks located throughout the United States and Europe. It connected nearly
20,000 computers at universities, government, and corporate research laboratories. Both the
size and the use of the Internet continued to grow much faster than anticipated. By late 1987,
it was estimated that the growth had reached 15% per month. By 2005, the global Internet
reached nearly 300 million computers in 209 countries.
Early adoption of TCP/IP protocols and growth of the Internet was not limited to
government-funded projects. Major .computer corporations connected to the Internet as did
many other large corporations including: oil companies, the auto industry" electronics firms,
pharmaceutical companies, and telecommunications carriers. Medium and small companies
began connecting in the 1990s. In addition, many companies used TCP/IP protocols on their
internal corporate intranets even if they chose not to be part of the global Internet.
2. What is internetworking?
3. What is DARPA?
4. What is TCP/IP?
5. What is MILNET?
6. What is NSF
Essay questions
Chapter 2
2.1Introduction
This chapter makes a conceptual leap by describing a scheme that al1ows us to col1ect the
diverse network technologies into a coordinated whole. The primary goal is a system that hides
the details of underlying network hardware while providing universal communication services.
The primary result is a high-level abstraction that provides the framework for al1design
decisions.
The first observation is an economic as well as technical one. Inexpensive Local Area Networks
that provide high speed communication only cover short distances; wide area networks that span
long distances cannot supply local communication cheaply. Because no single network
technology satisfies all needs, we are forced to consider multiple underlying hardware
technologies. The second observation is self-evident. Ultimately, users would like to be able to
communicate between any two points. In particular, we desire a communication system that is
not constrained by the boundaries of physical networks. The goal is to build a unified,
cooperative interconnection of networks that supports a universal communication service. Within
each network, computers will use underlying technology-dependent communication facilities.
New software, inserted between the technology-dependent communication mechanisms and
application programs, will hide the low-level details and make the collection of networks appear
to be a single large network. Such an interconnection scheme is called an internetwork or
internet. The idea of building an internet follows a' standard pattern- of system design:
researchers imagine a high-level computing facility and work from available computing
technology, adding layers of software until they have a system that efficiently implements the
imagined high-level facility. The next section shows the first step of the design process by
defining the goal more precisely.
Think of the modules of protocol software on each machine as being stacked vertically into
layers, as in Figure 2.1 Each layer takes responsibility for handling onepart of the problem.
In practice, the protocol software is much more complex than the simple model of Figure 2.1
indicates. Each layer makes decisions about the correctness of the message and chooses an
appropriate action based on the message type or destination address.
For example, one layer on the receiving machine must decide whether to keep the message or
forward it to another machine. Another layer must decide which application program should
receive the message. To understand the difference between the conceptual organization of
protocol software and the implementation details, consider the comparison shown in Figure 2.2.
The conceptual diagram in Figure 2.2a shows an Internet layer between a high level protocol
layer and a network interface layer. The realistic diagram in Figure 2.2b shows that the IP
software may communicate with multiple high-level protocol modules and with multiple
network interfaces.
Although a diagram of conceptual protocol layering does not show all details, it does help
explain the general concept. For example, Figure 11.3 shows the layers of protocol software
used by a message that traverses three networks. The diagram shows only the network
interface and Internet Protocol layers in the routers because only those layers are needed to
receive, route, and send datagram. We understand that any machine attached to two
networks must have two network interface modules, even though the conceptual layering
diagram shows only a single network interface layer in each machine.
Figure 2.2 A comparison of (a) conceptual protocol layering and (b) a realistic view of software
organization showing multiple network interfaces below IP and multiple protocols above it.
As Figure 2.3 shows, a sender on the original machine transmits a message which the IP layer
places in a datagram and sends across network 1. On intermediate routers, the datagram passes
up to the IP layer which sends it back out again (on a different network). Only when it reaches
the final destination machine, does IP extract the message and pass it up to higher layers of
protocol software.
Figure 2.3 The path of a message traversing the Internet from the senderthrough two
intermediate routers to the receiver. Intermediaterouters only send the datagram to the 1P
software layer.
Once the decision has been made to partition the communication problem and organize the
protocol software into modules that each handle one sub problem, the question arises: "what
functionality should reside in each module?" The question is not easy to answer for several
reasons. First, given a set of goals and constraints governing a particular communication
problem, it is possible to choose an organization that will optimize protocol software for
that problem. Second, even when considering general network-level services such as reliable
transport, it is possible to choose from among fundamentally distinct approaches to solving
the problem. Third, the design of network (or internet) architecture and the organization of the
protocol software are interrelated; one cannot be designed without the other.
Two ideas about protocol layering dominate the field. The first, based on early work
done by the International Organization for Standardization (ISO), is known as ISO's
Reference Model of Open System Interconnection, often referred to as the IS0 model. The
IS0 model contains 7 conceptual layers organized as Figure 2.4 shows.
The IS0 model, built to describe protocols for a single network, does not contain a specific
layer for internetwork routing in the same way TCP/IP protocols do.
The second major layering model did not arise from a standards committee, butcame instead
from research that led to the TCPIIP protocol suite. With a little work, the IS0 model can be
stretched to describe the TCPAP layering scheme, but the underlying assumptions are different
enough to warrant distinguishing the two.
Broadly speaking, TCPDP software is organized into five conceptual layers - four software
layers that build on a fifth layer of hardware. Figure 2.5 shows the conceptual layers as well as
the form of data as it passes between them.
Figure 2.5 The 4 conceptual layers of TCPIIP software above the hardware layer, and the form
of objects passed between layers. The layer labeled network interface is sometimes called the
data link layer.
Application Layer.At the highest layer, users invoke application programs that access
services available across a TCPDP internet. An application interacts with one of the transport
layer protocols to send or receive data. Each application program chooses the style of transport
needed, which can be either a sequence of individual messages or a continuous stream of bytes.
The application program passes data in the required form to the transport layer for delivery.
Transport Layer. The primary duty of the transport layer is to provide communication
from one application program to another. Such communication is often called end-to-end.
The transport layer may regulate flow of information. It may also provide reliable transport,
ensuring that data arrives without error and in sequence. To do so, transport protocol
software arranges to have the receiving side send back acknowledgements and the sending
side retransmit lost packets. The transport software divides the stream of data being
transmitted into small pieces (sometimes called packets) and passes each packet along with
a destination address to the next layer for transmission.
Although Figure 2.5 uses a single block to represent the application layer, a general purpose
computer can have multiple application programs accessing an internet at one time. The
transport layer must accept data from several user programs and send it to the next lower layer.
To do so, it adds additional information to each packet, including codes that identify which
application program sent it and which application program should receive it, as well as a
checksum. The receiving machine uses the checksum to verify that the packet arrived intact,
and uses the destination code to identify the application program to which it should be
delivered.
Internet Layer. As we have already seen, the Internet layer handles communication from one
machine to another. It accepts a request to send a packet from the transport layer along with
an identification of the machine to which the packet should be sent. It encapsulates the
packet in an IP datagram, fills in the datagram header, uses the routing algorithm to determine
whether to deliver the datagram directly or send it to a router, and passes the datagram to
the appropriate network interface for transmission.
The Internet layer also handles incoming datagram, checking their validity, and uses the
routing algorithm to decide whether the datagram should be processed locally or forwarded. For
datagrams addressed to the local machine, software in the internet layer deletes the
datagram header, and chooses from among several transport protocols the one that will handle
the packet. Finally, the Internet layer sends and receives ICMP error and control messages as
needed.
Network Interface Layer. The lowest layer TCP/IP software comprises a network
interface layer, responsible for accepting IP datagram and transmitting them overa specific
network. A network interface may consist of a device driver (e.g., when the network is a
local area network to which the machine attaches directly) or a complex subsystem that uses
its own data link protocol (e.g., when the network consists of packet switches that
communicate with hosts using HDLC).
Independent of the particular layering scheme used or the functions of the layers, the operation
of layered protocols is based on a fundamental idea. The idea, called the layering principle, can
be summarized succinctly:
Layered protocols are designed so that layer n at the destination receives exactly the same
object sent by layer n at the source. The layering principle explains why layering is such a
powerful idea. It allows the protocol designer to focus attention on one layer at a time, without
worrying about how other layers perform. For example, when building a file transfer
application, the designer considers only two copies of the application program executing on
two computers, and concentrates on the messages they need to exchange for file transfer.
The designer assumes that the application on one host receives exactly the data that the
application on the other host sends.
Figure 2.6 The path of a message as it passes from an application on one host to an
application on another. Layer n on host B receives exactly the same object that layer n on
host A sent.
Our statement of the layering principle is somewhat vague, and the illustration in Figure 2.6
skims over an important issue because it fails to distinguish between transfers from
source to ultimate destination and transfers across multiple networks. Figure 2.7 illustrates
the distinction, showing the path of a message sent from an application program on one host to
an application on another through a router.
As the figure shows, message delivery uses two separate network frames, one for the
transmission from host A to router R, and another from router R to host B. The network
layering principle states that the frame delivered to R is identical to the frame sent by host A.
By contrast, the application and transport layers deal with end-toend issues and are designed so
the software at the source communicates with its peer at the ultimate destination. Thus, the
layering principle states that the packet received by the transport layer at the ultimate
destination is identical to the packet sent by the transport layer at the original source.
Figure 2.7 The layering principle when a router is used. The frame delivered to router R is
exactly the frame sent from host A, but differs from the frame sent between R and B.
It is easy to understand that in higher layers, the layering principle applies across end-to-end
transfers, and that at the lowest layer it applies to a single machine transfer. It is not as easy to
see how the layering principle applies to the Internet layer. On one hand, we have said that
hosts attached to an internet should view it as a large, virtual network, with the IP datagram
taking the place of a network frame. In this view, datagrams travel from original source
to ultimate destination, and the layering principle guarantees that the ultimate destination
receives exactly the datagram that the original source sent. On the other hand, we know that
the datagram header contains fields, like a time to live counter, that change each time the
datagram passes through a router.
Thus, the ultimate destination will not receive exactly the same datagram as the source sent.
We conclude that although most of the datagram stays intact as it passes across an internet, the
layering principle only applies to datagrarns across single machine transfers. To be
accurate, we should not view the Internet layer as providing end-to-end service.
We have seen how computers connect to individual networks. The question arises, "How are
networks interconnected to form an internetwork?" The answer has two parts. Physically, two
networks can only be connected by a computer that attaches to both of them. A physical
attachment does not provide the interconnection we have in mind, however, because such a
connection does not guarantee that the computer will cooperate with other machines that wish to
communicate. To have a viable internet, we need special computers that are willing to transfer
packets from one network to another. Computers that interconnect two networks and pass
packets from one to the other are called internet gateways or internet routers.
Consider an example consisting of two physical networks shown in Figure . In the figure, router
R connects to both network 1and network 2. For R to act as a router, it must capture packets on
network 1that are bound for machines on network 2 and transfer them. Similarly, R must capture
packets on network 2 that are destined for machines on network1 and transfer them.
In the Figure 2.8 clouds are used to denote physical networks because the exact hardware is
unimportant. Each network can be a LAN or a WAN, and each may have many computers
attached or a few computers attached.
In this example, router R1 must transfer from network1 to network 2 all packets destined for
computers on either network 2 or network 3. For a large internet composed of many networks,
the router's task of making decisions about where to send packets becomes more complex. The
idea of a router seems simple, but it is important because it provides a way to interconnect
networks, not just computers. In fact, we have already discovered the principle of
interconnection used throughout an internet:
You might suspect that routers, which must each know how to forward packets toward their
destination, are large machines with enough primary or secondary memory to hold information
about every computer in the internet to which they attach. In fact, routers used with TCP/IP
internets are usually small computers. They often have little disk storage and modest main
memories. The trick to building a small internet router lies in the following concept:
Routers use the destination network, not the destination computer, when forwarding a packet.
If packet forwarding is based on networks, the amount of information that a router needs to keep
is proportional to the number of networks in the internet, not the number of computers. Because
routers playa key role in internet communication, we will return to them in later chapters and
discuss the details of how they operate and how they learn about routes. For now, we will
assume that it is possible and practical to have correct routes for all networks in each router in
the internet. We will also assume that only routers provide connections between physical
networks in an internet.
The advantage of providing interconnection at the network level now becomes clear. Because
application programs that communicate over the internet do not know the details of underlying
connections, they can be run without change on any computer. Because the details of each
machine's physical network connections are hidden in the internet software, only the internet
software needs to change when new physical connections are added or existing connections are
removed. In fact, it is possible to optimize the internal structure of the internet by altering
physical connections while application programs are executing.
A second advantage of having communication at the network level is more subtle: users do not
have to understand, remember, or specify how networks connect or what traffic they carry.
Application programs can be written that communicate independent of underlying physical
connectivity. In fact, network managers are free to change interior parts of the underlying
internet architecture without changing application software in most of the computers attached to
the internet (of course, network software must be reconfigured when a computer moves to a new
network). Routers do not provide direct connections among all pairs of networks. It, may be
necessary for traffic traveling from one computer to another to pass through several routers as
the traffic crosses intermediate networks. Thus, networks participating in an internet are
analogous to-highways in the U.S. interstate system: each net agrees to handle transit traffic in
exchange for the right to send traffic throughout the internet. Typical users are unaffected and
unaware of extra traffic on their local network.
5. What are the two fundamental observations about the design of communication systems?
Essay questions
4. With the help of a diagram explain the process of interconnection through IP routers.
6. With the help of a diagram explain the conceptual layer of a protocol software.
7. With the help of a diagram explain The path of a message traversing the Internet from the
sender through two intermediate routers to the receiver. Intermediate routers only send
the datagram to the 1P software layer.
11. Explain the layering principles using routers for different network.
CHAPTER 3
INTERNET ADDRESSES
3.1 Introduction
Think of an internet as a large network like any other physical network. The difference, of
course, is that the internet is a virtual structure, imagined by its designers, and implemented
entirely in software. Thus, the designers are free to choose packet formats and sizes, addresses,
delivery techniques, and so on; nothing is dictated by hardware. For addresses, the designers of
TCP/IP chose a scheme analogous to physical network addressing in which each host on the
internet is assigned a 32-bit integer address called its internet address or I/P address. The clever
part of internet addressing is that the integers are carefully chosen to make routing efficient.
Specifically, an IP address encodes the identification of the network to which a host attaches as
well as the identification of a unique host on that network. We can summarize:
Each host on a TCPI/IP internet is assigned a unique 32-bit internet address that is used in all
communication with that host.
Figure:3.1 The five forms of Internet (lP) addresses used with the original classful addressing
scheme.The three primary classes, A. Band C. can be distinguished by the first three bits.
In the classful addressing scheme, each address is said to be self-identifying because the
boundary between prefix and suffix can be computed from the address alone, without reference
to external information. In particular, the class of an address can be determined from the three
high-order bits; with two bits being sufficient to distinguish among the three primary classes.
Class A addresses, used for the handful of networks that have more than 2 16(i.e., 65,536) hosts,
devote 7 bits to netid and 24 bits to hostid. Class B addresses, used for intermediate size
networks that have between 28 (i.e., 256) and 216hosts, allocate 14 bits to the netid and 16 bits to
the hostid. Finally, class C addresses, used for networks that have less than 28hosts, allocate 21
bits to the netid and only 8 bits to the hostid. Note that the IP address was originally defined in
such a way that it was possible to extract the hostid or netid portions quickly. Efficiency was
especially important for routers, which use the netid portion of an address when deciding where
to send a packet. We will return to the discussion of efficient route lookup after examining recent
changes and extensions to the addressing scheme.
network, they do not specify an individual computer, but a connection to a network. Thus, a
router connecting n networks has n distinct IP addresses, one for each network connection.
Internet addresses can be used to refer to networks as well as individual hosts. By convention, an
address that has all bits of the hosted equal to 0 is reserved to refer to the network. .
Another significant advantage of the internet addressing scheme is that it includes a directed
broadcast address that refers to all hosts on the network. According to the standard, any address
with the hostid consisting of all Isis reserved for directed broadcast.
When a packet is sent to such an address, a single copy of the packet is transferred across the
internet from the source. Routers along the path use the netid portion of the address when
choosing a path; they do not look at the host portion. Once the packet reaches a router attached to
the final network, that router examines the host portion of the address to determine how to
deliver the packet. If it finds all 1s, the router broadcasts the packet to all hosts on the network.
On many network technologies (e.g., Ethernet), broadcasting is as efficient as unicast
transmission; on others,' broadcasting is supported by the network software, but requires
substantially more delay than single transmission. Some network hardware does not support
broadcast at all. Thus, having an IP directed broadcast address does not guarantee the availability
or efficiency of broadcast delivery. In summary,
IP addresses can be used to specify a directed broadcast in which a packet is sent to all
computers on a network; such addresses map to hardware broadcast, (I' available By
convention, a directed broadcast address has a valid netid and has a hostid with all bits set to 1.
powerful (and somewhat dangerous) mechanism that allows a remote system to send a single
packet that will be broadcast on the specified network. From an addressing point of view, the
chief disadvantage of directed broadcast is that it requires knowledge of the network address.
Another form of broadcast address, called a limited broadcast address or local network
broadcast address,provides a broadcast address for the local network independent of the
assigned IP address. The local broadcast address consists of thirty-two 1s (hence, it is sometimes
called the "all 1s" broadcast address). A host may use the limited broadcast address as part of a
startup procedure before it learns its IP address or the IP address prefix for the local network.
Once the host learns the correct IP address for the local network, however, it should use directed
broadcast. As a general rule, TCP/IP protocols restrict broadcasting to the smallest possible set of
machines. We will see how this rule affects multiple networks that share addresses in the chapter
on subnet addressing.
addressing, the scheme allows multiple physical networks to share a prefix. In the 1990s, a
second extension was devised that ignored the classful hierarchy and allowed the division
between prefix and suffix to occur at an arbitrary point. calledclassless addressing or
supernetting, the scheme allows more complete utilization of the address space. Chapter 10 will
consider details of the subnet and supernet addressing extensions. For now, it is only important
to know that the addressing scheme has been extended, and that the original classful scheme
described in this chapter is no longer the most widely used.
is written
128.10.2.30
We will use dotted decimal notation when expressing IP addresses throughout the remainder of
this text. Indeed, most TCP/IP software that displays or requires a human to enter an IP address
uses dotted decimal notation. For example, the UNIX' netstatcommand, which displays
information about routes and connections, and application programs such as telnet and ftp all use
dotted decimal notation when accepting or displaying IP addresses. Thus, when classful
addressing is used, it is helpful to understand the relationship between IP address classes and
dotted decimal numbers. Some values are reserved for special purposes.
The table in Figure 3.2 summarizes the range of values for each class.
Figure 3.2 The range of dotted decimal values that correspond to each IP address class.
4. In class A scheme the entire networking can be organized in to how many network and
how many host per network?
5. In class B scheme the entire networking can be organized in to how many network and
how many host per network?
6. In class C scheme the entire networking can be organized in to how many network and
how many host per network?
10. Give the address of the loopback address and mention the need for the same.
Essay Questions.
1. Explain the classful addressing scheme with the help of a diagram.
2. Explain how to broadcast the packet to the entire network?
CHAPTER 4
4.1 Introduction
TCP/IP address is a scheme in which each host is assigned a 32-bit address and an internet
behaves like a virtual network, using only the assigned addresses when sending and receiving
packets.Two machines on a given physical network can communicate only if they know each
other's physical network address. But how a host or a router maps an IP address to the correct
physical address when it needs to send a packet across a physical net? This chapter considers
that mapping, showing how it is implemented for the two most common physical network
address schemes.
The problem of mapping high-level addresses to physical addresses is known as the address
resolution problem and has been solved in several ways. Some protocol suites keep tables
in each machine that contain pairs of high-level and physical addresses. Others solve the
problem by encoding hardware addresses in high-level addresses. Using either approach
exclusively makes high-level addressing awkward at best. This chapter discusses two
techniques for address resolution used by TCPIIP protocols and shows when each is appropriate.
PA=ƒ(IA)
We want the computation off to be efficient. If the set of physical addresses is constrained,
it may be possible to arrange efficient mappings other than the one given in the example
above. For instance, when using IP over a connection-oriented network such as ATM, one
cannot choose physical addresses. On such networks, one or more computers (servers) store
pairs of addresses, where each pair contains an Internet address and the corresponding
physical address. Typically, such servers store the pairs in a table in memory to speed
searching. To guarantee efficient address resolution in such cases, software can use a
conventional hash function to search the table. Exercise 4.1 suggests a related alternative.
As Figure 4.1 shows, the idea behind dynamic resolution with ARP is simple: when host
A wants to resolve IP address ZB, it broadcasts a special packet that asks the host with IP
address le to respond with its physical address, PB. AU hosts, including B, receive the request,
but only host B recognizes its IP address and sends a reply that contains its physical address.
When A receives the reply, it uses the physical address to send the internet packet directly
to B. We can summarize:
The Address Resolution Protocol, ARP, allows a host to find the physical address of a target
host on the same physical network, given only the target's IP address.
Figure 4.1 The ARP protocol. To determine PB, 8's physical address, from IB, its IP address, (a)
host Abroadcasts an ARP request containing IBto all machines on the net, and (b) host 8 responds
with an ARP reply that contains the pair (IB, PB).ARP using Dynamic Bynding.
The ARP cache provides an example of soft state, a technique commonly used in network
protocols. The name describes a situation in which information call become "stale" without
warning. In the case of ARP, consider two computers, A and B, both connected to an Ethernet.
Assume A has sent an ARP request, and B has replied. Further assume that after the exchange B
crashes. Computer A will not receive any notification of the crash. Moreover, because it already
has address binding information for B in its ARP cache, computer A will continue to send
packets to B. The Ethernet hardware provides no indication that B is not on-line because Ethernet
does not have guaranteed delivery. Thus, A has no way of knowing when information in its ARP
cache has become incorrect. To accommodate soft state, responsibility for correctness lies with
the owner of the information. Typically, protocols that implement soft state use timers, with the
state information being deleted when the timer expires. For example, whenever address binding
information is placed in an ARP cache, the protocol requires a timer to be set, with a typical
timeout being 20 minutes. When the timer expires, the information must be removed. After
removal there are two possibilities. If no further packets are sent to the destination, nothing
occurs. If a packet must be sent to the destination and there is no binding present in the cache,
the computer follows the normal procedure of broadcasting ARP request and obtaining the
binding. If the destination is still reachable the binding will again be placed in the ARP cache. If
not, the sender will discover that the destination is off-line.
The use of soft state in ARP has advantages and disadvantages. The chief advantage arise
from autonomy. First, a computer can determine when information in its ARP cache should be
revalidated independent of other computers. Second, a sender that does not need successful
communication with the receiver or a third party to determine sender has become invalid; if a
target does not respond to an ARP request, the sender will declare the target to be down. Third,
the scheme does not rely on network hardware to provide reliable transfer.
Ethernet hardware (where physical addresses are 48-bits or 6 octets long), when resolving
IP protocol addresses (which are 4 octets long).
Figure 4.2 shows an ARP message with 4 octets per line, a format that is standard throughout
this text. Unfortunately, unlike most of the remaining protocols, the variable-length fields
in ARP packets do not align neatly on 32-bit boundaries, making the diagram difficult to read.
For example, the sender's hardware address, labeled SENDER HA, occupies 6 contiguous
octets, so it spans two lines in the diagram.
Figure 4.2:An example of the ARPW message format when used for IP- to-Ethernet address
resolution. The length of fields depends on the hardware and protocol address lengths, which
are 6 octets for an Ethernet address and 4 octets for an IP address.
Field HARDWARE TYPE specifies a hardware interface type for which the sender seeks an
answer; it contains the value 1 for Ethernet. Similarly, field PROTOCOL TYPE specifies
the type of high-level protocol address the sender has supplied; it contains 0800,, for IP
addresses. Field OPERATION specifies an ARP request (I), ARP response (2), RARP request
(3), or RARP response (4). Fields HLEN and PLEN allow ARP to be used with arbitrary
networks because they specify the length of the hardware address and the length of the
high-level protocol address. The sender supplies its hardware address and IF' address, if
known, in fields SENDER HA and SENDER IP. When making a request, the sender also
supplies the target hardware address (RARP) or target IP address (ARP), using fields
TARGET HA or TARGET IP. Before the target machine responds, it fills in the missing
addresses, swaps the target and sender pairs, and changes the operation to a reply. Thus,
a reply carries the IP and hardware addresses of the original requester, as well as the IP
and hardware addresses of the machine for which a binding was sought.
Interestingly, RARP uses the same packet format as ARP. A RARP request is formed by filling
in the target protocol address field, changing the message type from request to reply, and sending
the reply back directly to the machine making the request. Like an ARP message, a RARP
message is sent from one machine to another encapsulated in the data portion of a network
frame. For example, an Ethernet frame carrying a RARP request has the usual preamble,
Ethernet source and destination addresses, and packet type fields in front of the frame. The frame
type contains the value 803516 to identify the contents of the frame as a RARP message.
4.10 Assignment Questions
Answer the following questions. Each carries 2 marks.
1. What is ARP?
3. What is the purpose of HARDWARE TYPE field in the ARP protocol format?
4. What is the purpose of PROTOCOL TYPE field in the ARP protocol format?
5. What is the purpose of HLEN and PLEN field in the ARP protocol format?
7. What is RARP?
8. Essay Questions.
Essay Questions.
1. Write a note on Address resolution problem.
CHAPTER 5
IP ROUTING PRINCIPLES AND ROUTING OF IP DATAGRAM
The analogy between a network and a TCP/IP internet is strong. On a physical network, the unit
of transfer is a frame that contains a header and data, where header gives information such as the
(physical) source and destination addresses. e internet calls its basic transfer unit an Internet
datagram, sometimes referred to as an IP datagram or merely a datagram. Like a typical
physical network frame, a datagram is divided into header and data areas. Also like a frame, the
datagram header contains the source and destination addresses and a type field that identifies the
contents of the datagram. The difference, of course, is that the datagram header contains IP
addresses whereas the frame header contains physical addresses. Figure 5.1 shows the general
form of a datagram:
The following figure 5.2 Figure shows the arrangement of fields in a datagram:
Figure 5.2: Format of an Internet datagram, the basic unit of transfer in a TCP/IP internet.
Because datagram processing occurs in software, the contents and format are not constrained by
any hardware. For example, the first 4-bit field in a datagram (VERS) contains the version of the
IP protocol that was used to create the datagram. It is used to verify that the sender, receiver, and
any routers in between them agree on the format of the datagram. All IP software is required to
check the version field before processing a datagram to ensure it matches the format the software
expects. If standards change, a machines will reject datagram with protocol versions that differ
from theirs, preventing them from misinterpreting datagram contents according to an outdated
format. The current IP protocol version is 4. Consequently, the term IPv4 is often used to denote
the current protocol.
The header length field (HLEN), also 4 bits, gives the datagram header length measured in 32-bit
words. As we will see, all fields in the header have fixed length except for the IP OPTIONS and
corresponding PADDING fields. The most common header, which contains no options and no
padding, measures 20 octets and has a header length field equal to 5.
The TOTAL LENGTH field gives the length of the IP datagram measured in octets, including
octets in the header and data. The size of the data area can be computed by subtracting the length
of the header (HLEN) from the TOTAL LENGTH. Because the TOTALLENGTH field is 16 bits
long, the maximum possible size of an IP datagram is 216or 65,535 octets. In most applications
this is not a severe limitation. It may become more important in the future if higher speed
networks can carry data packets larger than 65,535octets.
physical network directly to another, is the basis on which all internet communication rests.
Two machines can engage in direct delivery only if they both attach directly to the same
underlying physical transmission system (e.g., a single Ethernet). Indirect delivery occurs
when the destination is not on a directly attached network, forcing the sender to pass the
datagram to a router for delivery.
How does the sender know whether the destination lies on a directly connected network? The
test is straightforward. We know that IP addresses are divided into a network-specific
prefix and a host-specific suffix. To see if a destination lies on one of the directly connected
networks, the sender extracts the network portion of the destination IP address and compares
it to the network portion of its own IP address(es). A match means the datagram can be
sent directly. Here we see one of the advantages of the Internet address scheme, namely:
Because the internet addresses of all machines on a single network include a common
network pre& and extracting that pre& requires only a few machine instructions, testing
whether a machine can be reached directly is extremely efficient.
From an internet perspective, it is easiest to think of direct delivery as the final step in
any datagram transmission, even if the datagram traverses many networks and intermediate
routers. The final router along the path between the datagram source and its destination will
connect directly to the same physical network as the destination.
Thus, the final router will deliver the datagram using direct delivery. We can think of direct
delivery between the source and destination as a special case of general purpose routing - in a
direct route the datagram does not happen to pass through any intervening routers.
How can a router know where to send each datagram? How can a host know which
router to use for a given destination? The two questions are related because they both involve
IP routing. We will answer them in two stages, considering the basic table-driven routing
algorithm in this chapter and postponing a discussion of how routers learn new routes until
later.
What information should be kept in routing tables? If every routing table contained
information about every possible destination address, it would be impossible to keep the
tables current. Furthermore, because the number of possible destinations is large, machines
would have insufficient space to store the information.
Conceptually, we would like to use the principle of information hiding and allow machines to
make routing decisions with minimal information. For example, we would like to isolate
information about specific hosts to the local environment in which they exist and arrange for
machines that are far away to route packets to them without knowing such details. Fortunately,
the IP address scheme helps achieve this goal. Recall that IP addresses are assigned to make
all machines connected to a given physical network share a common prefix (the network
portion of the address). We have already
seen that such an assignment makes the test for direct delivery efficient. It also means that
routing tables only need to contain network prefixes and not full IP addresses.
It is important to understand that each entry in a routing table points to a router that can
be reached across a single network. That is, all routers listed in machine M's routing table
must lie on networks to which M connects directly. When a datagram is ready to leave M, IP
software locates the destination IP address and extracts the network portion. M then uses the
network portion to make a routing decision, selecting a router that can be reached directly.
In practice, we apply the principle of information hiding to hosts as well. We insist that
although hosts have IP routing tables, they must keep minimal information in their tables. The
idea is to force hosts to rely on routers for most routing.
Figure 5.3 shows a concrete example that helps explain routing tables. The example internet
consists of four networks connected by three routers. In the figure, the routing table gives the
routes that router R uses. Because R connects directly to networks 20.0.0.0 and 30.0.0.0, it
can use direct delivery to send to a host on either of those networks (possibly using ARP to
find physical addresses). Given a datagram destined for a host on network 40.0.0.0, R routes it
to the address of router S, 30.0.0.7. S will then deliver the datagram directly. R can reach
address 30.0.0.7 because both R and S attach directly to network 30.0.0.0.
Figure 5.3 (a) An example intemet with 4 networks and 3 routers, and (b) the routing table in
R.
As Figure 5.3 demonstrates, the size of the routing table depends on the number of networks in
the intemet; it only grows when new networks are added. However, the table size and
contents are independent of the number of individual hosts connected to the networks. We can
summarize the underlying principle:
To hide information, keep routing tables small, and make routing decisions efficient, IP
routing software only keeps information about destination network addresses, not about
individual host addresses.
Choosing routes based on the destination network ID alone has several consequences.
First, in most implementations, it means that all traffic destined for a given network takes the
same path. As a result, even when multiple paths exist, they may not be used concurrently.
Also, all types of traffic follow the same path without regard to the delay or throughput of
physical networks. Second, because only the final router along the path attempts to
communicate with the destination host, only it can determine if the host exists or is operational.
Thus, we need to arrange a way for that router to send reports of delivery problems back
to the original source. Third, because each router forwards traffic independently, datagram
traveling from host A to host B may follow an entirely different path than datagrams
traveling from host B back to host A. We need to ensure that routers cooperate to guarantee
that two-way communication is always possible.
Default routing is especially useful when a site has a small set of local addresses and only
one connection to the rest of the internet. For example, default routes work well in host
computers that attach to a single physical network and reach only one router leading to
the remainder of the internet. The routing decision consists of two tests: one for the local net
and a default that points to the only router. Even if the site contains a few local networks, the
routing is simple because it consists of a few tests for the local networks plus a default for all
other destinations.
Although we said that all routing is based on networks and not on individual hosts, most IP
routing software allows per-host routes to be specified as a special case. Having per-host routes
gives the local network administrator more control over network use, permits testing, and can
also be used to control access for security purposes. When debugging network connections or
routing tables, the ability to specify a special route to one individual machine turns out to be
especially useful.
Despite minor improvements over its predecessors, the popularity of RIP as an IGP does not
arise from its technical merits alone. Instead, it is the result of Berkeley distributing routed
software along with their popular 4BSD UNIX systems. Thus, many TCP/IP sites adopted
and installed routed, and started using RIP without even considering its technical merits or
limitations. Once installed and running, it became the basis for local routing, and research
groups adopted it for larger networks.
Perhaps the most startling fact about RTP is that it was built and widely adopted before a
formal standard was written. Most implementations were derived from the Berkeley code,
with interoperability among them limited by the programmer's understanding of
undocumented details and subtleties. As new versions appeared, more problems arose. An RFC
standard appeared in June 1988, and made it possible for vendors to ensure interoperability.
them to update their routing table, but do not advertise. Only a router can run RIP in active
mode; a host must use passive mode.
A router running RIP in active mode broadcasts a routing update message every 30 seconds. The
update contains information taken from the router's current routing database. Each update
contains a set of pairs, where each pair contains an IP network address and an integer
distance to that network. RIP uses a hop count metric to measure distances. In the RIP metric,
a router is defined to be one hop from a directly connected network?, two hops from a network
that is reachable through one other router, and so on. Thus, the number of hops or the hop
count along a path from a given source to a given destination refers to the number of routers
that a datagram encounters along that path. It should be obvious that using hop counts to
calculate shortest paths does not always produce optimal results. For example, a path with hop
count 3 that crosses three Ethernets may be substantially faster than a path with hop count 2
that crosses two satellite connections. To compensate for differences in technologies, many
RIP implementations allow managers to configure artificially high hop counts when
advertising connections to slow networks. Both active and passive RIP participants listen to all
broadcast messages, and update their tables according to the distance-vector algorithm described
earlier. For example, in the internet of Figure 16.2, router R, will broadcast a message on
network 2 that contains the pair (1, I), meaning that it can reach network 1 at cost 1. Routers
R, and R, will receive the broadcast and install a route to network 1 through R, (at cost
2). Later, routers R, and R, will include the pair (1,2) when they broadcast their RIP messages
on network 3. Eventually, all routers and hosts will install a route to network 1.
RIP specifies a few rules to improve performance and reliability. For example, once a
router learns a route from another router, it must apply hysteresis, meaning that it does not
replace the route with an equal cost route. In our example, if routers R, and R, both advertise
network 1 at cost 2, routers R, and R, will install a route through the one that happens to
advertise first. We can summarize:
To prevent oscillation among equal cost paths, RIP specifies that existing routes should
be retained until a new route has strictly lower cost.
What happens if the first router to advertise a route fails (e.g., if it crashes)? RIP specifies
that all listeners must timeout routes they leam via RIP. When a router in- stalls a route in
its table, it starts a timer for that route. The timer must be restarted whenever the router
receives another RIP message advertising the route. The route be- comes invalid if 180 seconds
pass without the route being advertised again.
RIP must handle three kinds of errors caused by the underlying algorithm. First, because the
algorithm does not explicitly detect routing loops, RIP must either assume participants can be
trusted or take precautions to prevent such loops. Second, to prevent instabilities RIP must use a
low value for the maximum possible distance (RIP uses 16). Thus, for internets in which
legitimate hop counts approach 16, managers must divide the internet into sections or use an
alternative protocol. Third, the distance vector algorithm used by RIP can create a slow
convergence or count to infinity problem, in which inconsistencies arise because routing update
messages propagate slowly across the network. Choosing a small infinity (16) helps limit slow
convergence, but does not elirninate it.
HELLO provides two functions: it synchronizes the clocks among a set of machines, and
it allows each machine to compute shortest delay paths to destinations. Thus, HELLO
messages carry timestamp information as well as routing information. The basic idea behind
HELLO is simple: each machine participating in the HELLO exchange maintains a table of its
best estimate of the clocks in neighboring machines. Before transmitting a packet, a machine
adds its timestamp by copying the current clock value into the packet. When a packet arrives,
the receiver computes an estimate of the current delay on the link by subtracting the timestamp
on the incoming packet from the local estimate for the current clock in the neighbor.
Periodically, machines poll their neighbors to reestablish estimates for clocks.
HELLO messages also allow participating machines to compute new routes. The protocol uses
a modified distance-vector scheme that uses a metric of delay instead of hop count. Thus, each
machine periodically sends its neighbors a table of destinations it can reach and an estimated
delay for each. When a message arrives from machine X, the receiver examines each entry in
the message and changes the next hop to X if the route through X is less expensive than the
current route (i.e., any route where the delay to X plus the delay from X to the destination is
less than the current delay to the destination).
OSPF includes type of service routing. Managers can install multiple routes to a given
destination, one for each priority or type of service. When routing a datagram, a router
running OSPF uses both the destination address and type of service field in an IP header
to choose a route. OSPF is among the first TCP/IF' protocols to offer type of service
routing.
To permit growth and make the networks at a site easier to manage, OSPF allows a site
to partition its networks and routers into subsets called areas. Each area is self
contained; knowledge of an area's topology remains hidden from other areas. Thus,
multiple groups within a given site can cooperate in the use of OSPF for routing even
though each group retains the ability to change its internal network topology
independently.
The OSPF protocol specifies that all exchanges between routers can be authenticated.
OSPF allows a variety of authentication schemes, and even allows one area to choose
a different scheme than another area. The idea behind authentication is to
guarantee that only trusted routers propagate routing information. To understand why
this could be a problem, consider what can happen when using RIP1, which has no
authentication. If a malicious person uses a personal computer to propagate RIP
messages advertising low cost routes, other routers and hosts running RIP will change
their routes and start sending datagrams to the personal computer.
OSPF includes support for host-specific, subnet-specific, and classless routes as well
as classful network-specific routes. All types may be needed in a large internet.
To accommodate multi-access networks like Ethernet, OSPF extends the SPF algorithm
described in Chapter 14. We described the algorithm using a point-to-point graph
and said that each router running SPF would periodically broadcast link status
messages about each reachable neighbor. If K routers attach to an Ethernet, they will
broadcast K2 reachability messages. OSPF minimizes broadcasts by allowing a more
complex graph topology in which each node represents either a router or a network.
Consequently, OSPF allows every multi-access network to have a designated gateway
(i.e., a designated router) that sends link status messages on behalf of all routers
attached to the network; the messages report the status of all links from the network
to routers attached to the network. OSPF also uses hardware broadcast capabilities,
where they exist, to deliver link status messages.
if the physical connection between the two routers requires communication across a
transit network.
OSPF allows routers to exchange routing information learned from other (external) sites.
Basically, one or more routers with connections to other sites learn information about
those sites and include it when sending update messages. The message format
distinguishes between information acquired from external sources and information
acquired from routers interior to the site, so there is no ambiguity about the source or
reliability of routes.
Computer scientists use the term Exterior Gateway Protocol (EGP) to denote any protocol used
to pass routing information between two autonomous systems. Currently a single exterior
protocol is used in most TCP/IP internets. Known as the Border Gate way Protocol (BGP), it
has evolved through four (quite different) versions. Each version is numbered, which gives
rise to the formal name of the current version: BGP-4.
When a pair of autonomous systems agree to exchange routing information, each must
designate a router that will speak BGP on its behalf; the two routers are said to become BGP
peers of one another. Because a router speaking BGP must communicate with a peer in
another autonomous system, it makes sense to select a machine that is near the "edge" of the
autonomous system. Hence, BGP terminology calls the machine a border gateway or border
router.
BGP is unusual in several ways. Most important, BGP is neither a pure distance vector protocol
nor a pure link state protocol. It can be characterized by the following:
Inter-Autonomous System Communication. Because BGP is designed as an exterior
gateway protocol, its primary role is to allow one autonomous system to comrnunicate
with another.
Policy Support. Unlike most distance-vector protocols that advertise exactly the
routes in the local routing table, BGP can implement policies that the local
administrator chooses. In particular, a router running BGP can be configured to
distinguish between the set of destinations reachable by computers inside its
autonomous system and the set of destinations advertised to other autonomous systems.
Reliable Transport. BGP is unusual among protocols that pass routing information
because it assumes reliable transport. Thus, BGP uses TCP for all communication.
Path Information. In addition to specifying destinations that can be reached and a next
hop for each, BGP advertisements include path information that allows a receiver to
learn a series of autonomous systems along a path to the destination.
Incremental Updates. To conserve network bandwidth, BGP does not pass full
information in each update message. Instead, full information is exchanged once,
and then successive messages carry incremental changes called deltas.
Support For Classless Addressing. BGP supports CIDR addresses. That is, rather than
expecting addresses to be self-identifying, the protocol provides a way to send a mask
along with each address.
6. What is BGP?
Essay Questions
CHAPTER 6
CIDR SUBNETTING
6.1 Introduction
The chief advantage of dividing an IP address into two parts arises from the size of the routing
tables required in routers. Instead of keeping one routing entry per destination host, a router can
keep one routing entry per network, and examine only the network portion of a destination
address when making routing decisions.
Recall that the original IP addressing scheme accommodated diverse network sizes by dividing
host addresses into three primary classes. Networks assigned class Aaddresses partition the 32
bits into an 8-bit network portion and a 24-bit host portion. Class B addresses partition the 32 bits
into 16-bit network and host portions, while class C partitions the address into a 24-bit network
portion and an 8-bit host portion.
To understand some of the address extensions in this chapter, it will be important to realize that
individual sites have the freedom to modify addresses and routes as long as the modifications
remain invisible to other sites. That is; a site can choose to assign and use IP addresses in
unusual ways internally as long as:
All hosts and routers at the site agree to honor the site's addressing scheme.
Other sites on the Internet can treat addresses as a network prefix and a host suffix.
giving its hardware address and then routing datagrams correctly when they arrive. In essence, R
lies about IP-lo-physical address bindings.
In the figure two network share a single IP network address. Imagine that labeled Main Network
was the original network, and that the second, labeled network a hidden network, was added
later. The router connecting the two networks, R, knows which host lie on which physical
network and uses ARP to maintain the illusion that only one network exists, To make the illusion
work, R keeps the location of hosts completely hidden, allowing all other machines on the
network to communicate as if directly connected. In our example when host H1needs to
communicate with host H4, it first invokes ARP to map H4's IP address into a physical address.
Once it has a physical address. H1can send the datagram directly to that physical address.
Because R runs proxy ARP software, it captures the broadcast ARP request from H decides that
the machine in question lies on the other physical network, and responds to the ARP request by
sending its own physical address. HI receives the ARP response, installs the mapping in its ARP
table, and then uses the mapping to send datagrams destined for H4 to R. When R receives a
datagram, It searches a special, routing table to determine how to route the datagram. R must
forward datagrams destined for H over the hidden network. To allow hosts on the hidden
network to reach hosts on 4, the main network, R performs the proxy ARP service on that
network as well.
Routers using the proxy ARP technique are taking advantage of an important Feature of the ARP
protocol, namely, trust. ARP is based on the idea that all machines cooperate and that any
response is legitimate. Most hosts install mappings obtained through ARP without checking their
validity and without maintaining consistency. Thus, it may happen that the ARP table maps
several IP addresses to the same physical address, but that does not violate the protocol
specification.
Some implementations of ARP are not as lax as others. In particular, ARP implementations
designed to alert managers to possible security violations will inform them when ever two
distinct IP addresses map to the same physical hardware address. The purpose of alerting the
manager is to warn about spoofing, a situation in which one machine claims to be another in
order to intercept packets, Host implementations of ARP that warn managers of possible
spoofing cannot be used on networks that have Proxy ARP routers because the software will
generate messages frequently.
The chief advantage of proxy ARP is that it can be added to a single router on a network without
disturbing the routing tables in other hosts or routers on that network. Thus, proxy ARP
completely hides the details of physical connections.
The chief disadvantage of proxy ARP is that it does not work for networks unless they use ARP
for address resolution, Furthermore, it does not generalize to more complex network topology
(e.g.: multiple routers interconnecting two physical networks) nor does it b support a reasonable
form of routing, In fact most implementations of proxy ARP in rely on managers to maintain
tables of machines and addresses manually, making it both time consuming and prone to errors.
The second technique used to allow a single network address to span multiple physical networks
is called subnet addressing, subnet routing, or subnetting. Subnetting is the most widely used of
the three techniques because it is the most general and because it has been standardized. In fact,
subnetting is a required part of IP addressing. The easiest way to understand subnet addressing is
to imagine that a site has a single class B IP network address assigned to it, but it has two or
more physical networks. Only local routers know that there are multiple physical nets and how to
route traffic among them; routers in other autonomous systems route all traffic as if there were a
single physical network. Figure 6.2 shows an example.
Figure 6.2 A site with two physical networks using subnet addressing to label them with a single
class B network address.
A site with two physical networks using subnet addressing to label them with a single class B
network address. Router R accepts all traffic for net 128.10.0.0 and chooses a physical network
based on the third octet of the address.
In the example, the site is using the single class B network address 128.10.0.0 for two networks.
Except for router R, all routers in the internet route as if there were a single physical net. Once a
packet reaches R, it must be sent across the correct physical network to its destination. To make
the choice of physical network efficient, the local site has chosen to use the third octet of the
address to distinguish between the two networks. The manager assigns machines on one physical
net addresses of the form 128.10.1.X, and machines on the other physical net addresses of the
form 128.10.2.X, where X, the final octet of the address, contains a small integer used to identify
a specific host. To choose a physical network, R examines the third octet of the destination
address and routes datagrams with value 1 to the network labeled 128.10.1.0 and those with
value 2 to the network labeled 128.10.2.0.
Conceptually, adding subnets only changes the interpretation of IP addresses slightly. Instead of
dividing the 32-bit IP address into a network prefix and a host suffix, subnetting divides the
address into a network portion and a local portion. The interpretation of the network portion
remains the same as for networks that do not use subnetting. As before, reach ability to the
network must be advertised to outside autonomous systems; all traffic destined for the network
will follow the advertised route. The interpretation of the local portion of an address is left up to
the site (within the constraints of the formal standard for subnet addressing). To summarize:
We think of a 32-bit IP address as having an internet portion and a local portion, where the
internet portion identifies a site, possibly with multiple physical networks, and the local portion
identifies a physical network and host at that site.
The example of Figure showed subnet addressing with a class B address that had a 2-octet
internet portion and a 2-octet local portion. To make routing among the physical networks
efficient, the site administrator in our example chose to use one octet of the local portion to
identify a physical network, and the other octet of the local portion to identify a host on that
network, as Figure6.3 shows.
Figure 6.3: Redistribution of Class B address into network ,subnetwork and host portion.
The result is a form of hierarchical addressing that leads to corresponding hierarchical routing.
The top level of the routing hierarchy (i.e., other autonomous systems in the internet) uses the
first two octets when routing, and the next level (i.e., the local site) uses an additional octet.
Finally, the lowest level (i.e., delivery across one physical network) uses the entire address.
Hierarchical addressing is not new; many systems have used it before. The best example is the
U.S. telephone system, where a 10-digit phone number is divided into a 3-digit area code, 3-
digit exchange, and 4-digit connection. The advantage of using hierarchical addressing is that it
accommodates large growth because it means a given router does not need to know as much
detail about distant destinations as it does about local ones. One disadvantage is that choosing a
hierarchical structure is difficult, and it often becomes difficult to change a hierarchy once it has
been established.
maximum autonomy, the TCPAP subnet standard provides even more flexibility than indicated
above. An organization may select a subnet partition on a per network basis. Although the
technique is known as variable-length subnetting, the name is slightly misleading because the
value does not "vary" over time - once a partition has been selected for a particular
network, the partition never changes. All hosts and routers attached to that network must follow
the decision; if they do not, datagrams can be lost or rnisrouted. We can summarize:
To allow maximum flexibility in choosing how to partition subnet addresses, the TCP/IP
subnet standard permits variable-length subnetting in which the partition can be chosen
independently for each physical network. Once a subnet partition has been selected, all
machines on that network must honour it.
Most IP software uses dotted decimal representation for subnet masks; it works best when sites
choose to align subnetting on octet boundaries. For example, many sites choose to subnet class B
addresses by using the third octet to identify the physical net and the fourth octet to identify hosts
as on the previous page. In such cases, the subnet mask has dotted decimal representation
255.255.255.0, making it easy to write and understand.
In this representation, the value -1 means "all ones." For example, if the subnet mask for a class
B network is 255.255.255.0, it can be written {-1, -1, 0}.
The chief disadvantage of the 3-tuple representation is that it does not accurately specify how
many bits are used for each part of the address; the advantage is that it abstracts away from the
details of bit fields and emphasizes the values of the three parts of the address. To see why
address values are sometimes more important than bit fields, consider the 3-tuple:
{ 128.10,-1,0}
which denotes an address with a network number 128.10, all ones in the subnet field, and all
zeroes in the host field. Expressing the same address value using other representations requires a
32-bit subnet mask as well as a 32-bit IP address, and forces readers to decode bit fields before
they can deduce the values of individual fields. Further more, the 3-tuple representation is
independent of the IP address class or the size of the subnet field. Thus, the 3-tuple can be used
to represent sets of addresses or abstract ideas. For example, the 3-tuple:
denotes "addresses with a valid network number, a subnet field containing all ones, and a host
field containing all ones". We will see additional examples later in this chapter.
The addressing scheme described so far requires a unique network prefix for each physical
network. Although that was, indeed, the original plan, it did not last long. In the 1980s as Local
Area Network technologies became increasingly popular, it became apparent that requiring a
unique prefix for each physical network would exhaust the address space quickly. Consequently,
an addressing extension was developed to conserve network prefixes. Known as subnet
addressing, the scheme allows multiple physical networks to share a prefix. In the 1990s, a
second extension was devised that ignored the classful hierarchy and allowed the division
between prefix and suffix to occur at an arbitrary point. calledclassless addressing or
supernetting, the scheme allows more complete utilization of the address space. Chapter 10 will
consider details of the subnet and supernet addressing extensions. For now, it is only important
to know that the addressing scheme has been extended, and that the original classful scheme
described in this chapter is no longer the most widely used.
2. How do you redistribute the class B addressing for net id, subnet id and host id?
Essay Questions
CHAPTER 7
UDP (USER DATAGRAM PROTOCOL)
In the TCP/IP protocol suite, the User Datagram Protocol or UDP provides the primary
mechanism that application programs use to send datagrams to other application programs. UDP
provides protocol ports used to distinguish among multiple programs executing on a single
machine. That is, in addition to the data sent, each UDP message contains both a destination port
number and a source port number, making it possible for the UDP software at the destination to
deliver the message to the correct recipient and for the recipient to send a reply.
UDP uses the underlying internet layer to transport a message from one machine to another, and
provides the same unreliable, connectionless datagram delivery semantics as IP. It does not use
acknowledgements to make sure messages arrive; it does not order incoming messages, nor does
it provide feedback to control the rate at which information flows between the machines. Thus,
UDP messages can be lost, duplicated, or arrive out of order. Furthermore, packets can arrive
faster than the recipient can processthem. We can summarize:
The User Datagram Protocol (UDP) provides an unreliable connectionless delivery service
using IP to transport messages between machines. It uses IP to carry messages, but adds the
ability to distinguish among multiple destinations within a given host computer.
An application program that uses UDP accepts full responsibility for handling the problem of
reliability, including message loss, duplication, delay, out-of-order delivery, and loss of
connectivity. Unfortunately, application programmers often ignore these problems when
designing software. Furthermore, because programmers often test network software using highly
reliable, low-delay local area networks, testing may not expose potential failures. Thus, many
application programs that rely on UDP work well in a local environment, but fail in dramatic
ways when used in the global Internet.
Each UDP message is called a user datagram. Conceptually, a user datagram consists of two
parts: a UDP header and a UDP data area. As Figure 7.1 shows, the header is divided into four
16-bit fields that specify the port from which the message was sent, the port to which the
message is destined, the message length, and a UDP checksum.
The SOURCE PORT and DESTINATION PORT fields contain the 16-bit UDP protocol port
numbers used to demultiplex datagrams among the processes waiting to receive them. The
SOURCE PORT is optional. When used, it specifies the port to which replies should be sent; if
not used, it should be zero.
The LENGTH field contains a count of octets in the UDP datagram, including the UDP header
and the user data. Thus, the minimum value for LENGTH is eight, the length of the header alone.
The UDP checksum is optional and need not be used at all; a value of zero in the CHECKSUM
field means that the checksum has not been computed. The designers chose to make the
checksum optional to allow implementations to operate with little computational overhead when
using UDP across a highly reliable local area network.
Recall, however, that IP does not compute a checksum on the data portion of an IP datagram.
Thus, the UDP checksum provides the only way to guarantee that data has arrived intact and
should be used.
Beginners often wonder what happens to UDP messages for which the computed checksum is
zero. A computed value of zero is possible because UDP uses the same checksum algorithm as
IP: it divides the data into 16-bit quantities and computes the one's complement of their one's
complement sum. Surprisingly, zero is not a problem because one's complement arithmetic has
two representations for zero: all bits set to zero or all bits set to one. When the computed
checksum is zero, UDP uses the representation with all bits set to one.
The UDP checksum includes a pseudo-header that has fields for the source and destination IP
addresses. It can be argued that the destination IP address must be known to the user when
sending a UDP datagram, and the user must pass it to the UDP layer. Thus, the UDP layer can
obtain the destination IP address without interacting with the IP layer. However, the source IP
address depends on the route IP chooses for the datagram, because the IP source
addressidentifies the network interface over which the datagram is transmitted. Thus, unless
itinteracts with the IP layer, UDP cannot know the IP source address.
We assume that UDP software asks the IP layer to compute the source and (possibly) destination
IP addresses, uses them to construct a pseudo-header, computes thechecksum, discards the
pseudo-header, and then passes the UDP datagram to IP fortransmission. An alternative approach
that produces greater efficiency arranges to havethe UDP layer encapsulate the UDP datagram in
an IP datagram, obtain the source address from IP, store the source and destination addresses in
the appropriate fields of thedatagram header, compute the UDP checksum, and then pass the IP
datagram to the IPlayer, which only needs to fill in the remaining IP header fields.
Does the strong interaction between UDP and IP violate our basic premise thatlayering reflects
separation of functionality? Yes. UDP has been tightly integrated withthe IP protocol. It is
clearly a compromise of the pure separation, made for entirelypractical reasons. We are willing
to overlook the layering violation because it is impossible to fully identify a destination
application program without specifying the destination machine, and we want to make the
mapping between addresses used by UDP andthose used by IP efficient. One of the exercises
examines this issue from a differentpoint of view, asking the reader to consider whether UDP
should be separated from IP.
Conceptually all multiplexing and demultiplexing between UDP software and application
programs occur through the port mechanism. In practice, each application program must
negotiate with the operating system to obtain a protocol port and an associated port number
before it can send a UDP datagram. Once the port has been assigned, any datagram the
application program sends through the port will have that port number in its UDP SOURCE
PORT field. While processing input, UDP accepts incoming datagrams from the IP software and
demultiplexes based on the UDP destination port, as Figure 7.2 shows.
Figure 7.2:Example of demultiplexing one layer above IP. UDP uses the UDP destination port
number to select an appropriate destination port for incoming datagrams.
The easiest way to think of a UDP port is as a queue. In most implementations, when an
application program negotiates with the operating system to use a given port, the operating
system creates an internal queue that can hold arriving messages. Often, the application can
specify or change the queue size. When UDP receives a datagram, it checks to see that the
destination port number matches one of the ports currently in use.
If not, it sends an ICMP port unreachable error message and discards the datagram. If a match is
found, UDP enquires the new datagram at the port where an application program can access it.
Of course, an error occurs if the port is full, and UDP discards the incoming datagram.
CHAPTER 8
TCP
8.1 Introduction
The implementation of TCP is also substantially more complex. Although TCP is presented here
as part of the TCP/IP Internet protocol suite, it is an independent, general purpose protocol that
can be adapted for use with other delivery systems. For example, because TCP makes very few
assumptions about the underlying network, it is possible to use it over a single network like an
Ethernet, as well as over the global Internet.
At the lowest level, computer communication networks provide unreliable packet delivery.
Packets can be lost or destroyed when transmission errors interfere with data, when network
hardware fails, or when networks become too heavily loaded to accommodate the load presented.
Packet switching systems change routes dynamically, deliver packets out of order, deliver them
after a substantial delay. or deliver duplicates. Furthermore, underlying network technologies
may dictate an optimal packet size or pose other constraints needed to achieve efficient transfer
rates.
At the highest level, application programs often need to send large volumes of data from one
computer to another. Using an unreliable connectionless delivery system for large volume
transfers becomes tedious and annoying, and it requires that programmers build error detection
and recovery into each application program. Because it is difficult to design, understand, or
modify software that correctly provides reliability, few application programmers have the
necessary technical background. As a consequence, onegoal of network protocol research has
been to find general purpose solutions to the problems of providing reliable stream delivery,
making it possible for experts to build a single instance of stream protocol software that all
application programs use. Having a single general purpose protocol helps isolate application
programs from the details of networking, and makes it possible to define a uniform interface for
the stream transfer service.
The interface between application programs and the TCP/IP reliable delivery service can be
characterized by five features:
• Stream Orientation. When two application programs transfer large volumes of data, the
data is viewed as a stream of bits, divided into 8-bit octets or bytes. The stream delivery
service on the destination machine passes to the receiver exactly the same sequence of
octets that the sender passes to it on the source machine.
• Virtual Circuit Connection. Making a stream transfer is analogous to placing atelephone
call. Before transfer can start, both the sending and receiving application programs
interact with their respective operating systems, informing them of the desire fora stream
transfer. Conceptually, one application places a "call" which must be accepted by the
other. Protocol software modules in the two operating systems communicateby sending
messages across the underlying internet, verifying that the transfer is authorized, and that
both sides are ready. Once all details have been settled, the protocolmodules inform the
application programs that a connection has been established andthat transfer can begin.
During transfer, protocol software on the two machines continue to communicate to
verify that data is received correctly. If the communication failsfor any reason (e.g.,
because network hardware along the path between the machinesfails), both machines
detect the failure and report it to the appropriate application programs. We use the term
virtual circuit to describe such connections because althoughapplication programs view
the connection as a dedicated hardware circuit, the reliabilityis an illusion provided by the
stream delivery service.
• Buffered Transfer. Application programs send a data stream across the virtualcircuit by
repeatedly passing data octets to the protocol software. When transferringdata, an
application uses whatever size pieces it finds convenient, which can be as smallas a
single octet. At the receiving end, the protocol software delivers octets from thedata
stream in exactly the same order they were sent, making them available to the receiving
application program as soon as they have been received and verified. The protocol
software is free to divide the stream into packets independent of the pieces the application
program transfers. To make transfer more efficient and to minimize networktraffic,
implementations usually collect enough data from a stream to fill a reasonablylarge
datagram before transmitting it across an internet. Thus, even if the applicationprogram
generates the stream one octet at a time, transfer across an internet may bequite efficient.
• Unstructured Stream. It is important to understand that the TCP/IP stream service does
not honor structured data streams. For example, there is no way for a payrollapplication
to have the stream service mark boundaries between employee records, or toidentify the
contents of the stream as being payroll data. Application programs usingthe stream
service must understand stream content and agree on stream format beforethey initiate a
connection.
• Full Duplex Connection. Connections provided by the TCP/IP stream service allow
concurrent transfer in both directions. Such connections are called full duplex.From the
point of view of an application process, a full duplex connection consists oftwo
independent streams flowing in opposite directions, with no apparent interaction.The
stream service allows an application process to terminate flow in one directionwhile data
continues to flow in the other direction, making the connection half duplex.The
advantage of a full duplex connection is that the underlying protocol software cansend
control information for one stream back to the source in datagrams carrying data inthe
opposite direction. Such piggybacking reduces network traffic.
transmission efficient. To understand the motivation for sliding windows,To achieve reliability,
the sender transmits a packet and then waits for-an acknowledgement before transmitting
another. The data only flows between the machines in one direction at anytime, even if the
network is capable of simultaneous communication in both directions.
The network will remain completely idle during times that machines delay responses(e.g., while
machines compute routes or checksums). If we imagine a network withhigh transmission delays,
the problem becomes clear:
The sliding window technique is a more complex form of positive acknowledgement and
retransmission than the simple method discussed above. Sliding window protocols use network
bandwidth better because they allow the sender to transmit multiple packets before waiting for an
acknowledgement. The easiest way to envision sliding window operation is to think of a
sequence of packets to be transmitted as Figure 8.1 shows. The protocol places a small, fixed-
size window on the sequence and transmits all packets that lie inside the window.
Figure 8.1: (a) A sliding window protocol with eight packets in the window, and (b) The window
sliding so that packet 9 can be sent when an acknowledgement has been received for packet 1.
Only un acknowledged packets are retransmitted.
We say that a packet is unacknowledged if it has been transmitted but no acknowledgement has
been received. Technically, the number of packets that can be unacknowledged at any given time
is constrained by the window size, which is limited to a small, fixed number. For example, in a
sliding window protocol with window size 8, the sender is permitted to transmit 8 packets before
it receives an acknowledgement.
As Figure 8.1 shows, once the sender receives an acknowledgement for the first packet inside the
window, it "slides" the window along and sends the next packet. The window continues to slide
as long as acknowledgements are received.
The performance of sliding window protocols depends on the window size and the speed at
which the network accepts packets. Figure 8.2 shows an example of the operation of a sliding
window protocol when sending three packets. Note that the sender transmits all three packets
before receiving any 'acknowledgements.
With a window size of 1, a sliding window protocol is exactly the same as our simple positive
acknowledgement protocol. By increasing the window size, it is possible to eliminate network
idle time completely. That is, in the steady state, the sender can transmit packets as fast as the
network can transfer them. The main point is:
Because a well-tuned sliding window protocol keeps the network completely saturated with
packets, it obtains substantially higher throughput than a simple positive acknowledgement
protocol.
Conceptually, a sliding window protocol always remembers which packets have been
acknowledged and keeps a separate timer for each unacknowledged packet. If a packet is lost,
the timer expires 'and the sender retransmits that packet. When the sender slides its.window, it
moves past all acknowledged packets. At the receiving end, the protocol software keeps an
analogous window, accepting and acknowledging packets as they arrive. Thus, the window
partitions the sequence of packets into three sets: those packets to the left of the window have
been successfully transmitted, received, and acknowledged; those packets to the right have not
yet been transmitted; and those packets that lie in the window are being transmitted. The lowest
numbered packet in the window is the first packet in the sequence that has not been
acknowledged.
Figure 8.2 An example of three packets transmitted using a sliding window protocol. The key
concept is that the sender can transmit all packets in the window without waiting for an
acknowledgement.
Now that we understand the principle of sliding windows, we can examine the reliable stream
service provided by the TCP/IP Internet protocol suite. The service is defined by the
Transmission Control Protocol, or TCP. The reliable stream service is so significant that the
entire protocol suite is referred to as TCP/IP. It is important to understand that
TCP is a communication protocol but not a piece of software.
The difference between a protocol and the software that implements it is analogous to the
difference between the definition of a programming language and a compiler. As in the
programming language world, the distinction between definition and implementation sometimes
becomes blurred. People encounter TCP software much more frequently than they encounter the
protocol specification, so it is natural to think of a particular implementation as the standard.
Nevertheless, the reader should try to distinguish between the two.
Exactly what does TCP provide? TCP is complex, so there is no simple answer. The protocol
specifies the format of the data and acknowledgements that two computers exchange to achieve a
reliable transfer, as well as the procedures the computers use to ensure that the data arrives
correctly. It specifies how TCP software distinguishes among multiple destinations on a given
machine, and how communicating machines recover from errors like lost or duplicated packets.
The protocol also specifies how two computers initiate a TCP stream transfer and how they agree
when it is complete.
It is also important to understand what the protocol does not include. Although the TCP
specification describes how application programs use TCP in general terms, it does not dictate
the details of the interface between an application program and TCP. That is, the protocol
documentation only discusses the operations TCP supplies; it does not specify the exact
procedures application programs invoke to access these operations.
The reason for leaving the application program interface unspecified is flexibility. In particular,
because programmers usually implement TCP in the computer's operating system, they need to
employ whatever interface the operating system supplies. Allowing the implementor flexibility
makes it possible to have a single specification for TCP that can be used to build software for a
variety of machines.
Because TCP assumes little about the underlying communication system, TCP can be used with
a variety of packet delivery systems. In particular, because it does not require the underlying
system to be reliable or fast, TCP can run over a variety of hardware mechanisms such as a
dialup telephone line, a local area network, a high-speed fiber optic network, a satellite
connection, or a noisy wireless connection in which many packets are lost. The large variety of
delivery systems TCP can use is one of its strengths.
created, application programs can begin to pass data; the TCP software modules at each end
exchange messages that guaranty the reliable delivery.
8.7 Establishing a TCP connection
To establish a connection, TCP uses a three-way handshake. In the simplest case, the handshake
proceeds as Figure 8.3 shows.
Figure 8.3 The sequence of messages in a three-way handshake. Time proceeds down the page;
diagonal lines represent segments sent between sites. SYN segments carry initial sequence
number information.
The first segment of a handshake can be identified because it has the SYN bit set in the code
field. The second message has both the SYN and ACK bits set, indicating that it acknowledges
the first SYN segment as well as continuing the handshake. The final handshake message is only
an acknowledgement and is merely used to inform the destination that both sides agree that a
connection has been established. Usually, the TCP software on one machine waits passively for
the handshake, and the TCP software on another machine initiates it. However, the handshake is
carefully designed to work even if both machines attempt to initiate a connection simultaneously.
Thus, a connection can be established from either end or from both ends simultaneously. Once
the connection has been established, data can flow in both directions equally well. There is no
master or slave. The three-way handshake is both necessary and sufficient for correct
synchronization between the two ends of the connection. To understand why, remember that
TCP builds on an unreliable packet delivery service, so messages can be lost, delayed,
duplicated, or delivered out of order. Thus, the protocol must use a timeout mechanism and
retransmit lost requests. Trouble arises if retransmitted and original requests arrive while the
connection is being established, or if retransmitted requests are delayed until after a connection
has been established, used, and terminated. A three-way handshake (plus the rule that TCP
ignores additional requests for connection after a connection has been established) solves these
problems.
Two programs that use TCP to communicate can terminate the conversation gracefully using the
close operation. Internally, TCP uses a modified three-way handshake to close connections.
Recall that TCP connections are full duplex and that we view them as containing two
independent stream transfers, one going in each direction. When an application program tells
TCP that it has no more data to send, TCP will close the connection in one direction. To close its
half of a connection, the sending TCP finishes transmitting the remaining data, waits for the
receiver to acknowledge it, and then sends a segment with the FIN bit set. The receiving TCP
acknowledges the FIN segment and informs the application program on its end that no more data
is available (e.g., using the operating system's end-of-tile mechanism).
Once a connection has been closed in a given direction, TCP refuses to accept more data for that
direction. Meanwhile, data can continue to flow in the opposite direction until the sender closes
it. Of course, acknowledgements continue to flow back to the sender even after a connection has
been closed. When both directions have been closed, the TCP software at each endpoint deletes
its record of the connection.
The details of closing a connection are even more subtle than suggested above because TCP uses
a modified three-way handshake to close a connection. Figure 8.4 illustrates the procedure.
Figure8.4 The modified three-way handshake used to close connections. The site that receives
the first FIN segment acknowledges it immediately, and then delays before sending the second
FIN segment.
The difference between three-way handshakes used to establish and break connections occurs
after a machine receives the initial FIN segment. Instead of generating a second FIN· segment
immediately, TCP sends an acknowledgement and then informs the application of the request to
shut down. Informing the application program of the request and obtaining a response may take
considerable time (e.g., it may involve human interaction). The acknowledgement prevents
retransmission of the initial FIN segment during the wait. Finally, when the application program
instructs TCP to shut down the connection completely, TCP sends the second FIN segment and
the original site replies with the third message, an ACK.
8.9 Assignment Questions.
Answer the following questions each carries 2 marks.
1. Expand TCP.
Essay Questions.
2. Explain with the help of a diagram three packet transmission using sliding window.
CHAPTER 9
IP MULTICASTING
9.1 Introduction
This chapter explores another feature of IP: multipoint delivery of datagrams. We begin with a
brief review of the underlying hardware support. Later sections describe IP addressing for
multipoint delivery and protocols that routers use to propagate the necessary routing information.
With most hardware technologies, a computer specifies broadcast delivery by sending a packet to
a special, reserved destination address called the broadcast address. For example, Ethernet
hardware addresses consist of 48-bit identifiers, with the all Is address used to denote broadcast.
Hardware on each machine recognizes the machine's hardware address as well as the broadcast
address, and accepts incoming packets that have either address as their destination. The chief
disadvantage of broadcasting arises from its demand on resources in addition to using network
bandwidth, each broadcast consumes computational resources on all machines. For example.it
would be possible to design an alternative internet protocol suite that used broadcast to deliver
datagrams on a local network and relied on IP software to discard datagrams not intended for the
local machine. However, such a scheme would be extremely inefficient because all computers on
the network would receive and process every datagram, even though a machine would discard
most of the datagrams that arrived. Thus, the designers of TCP/IP used unicast addressing and
address binding mechanisms like ARP to eliminate broadcast delivery.
Some hardware technologies support a second, less common form of multi-point delivery called
multicasting. Unlike broadcasting, multicasting allows each system to choose whether it wants to
participate in a given multicast. Typically, a hardware technology reserves a large set of
addresses for use with multicast. When a group of machines want to communicate, they choose
one particular multicast address to use for communication. After configuring their network
interface hardware to recognize theselected multicast address, all machines in the group will
receive a copy of any packet sent to that multicast address.
At a conceptual level, multicast addressing can be viewed as a generalization of all other address
forms. For example, we can think of a conventional unicast address as a form of multicast
addressing in which there is exactly one computer in the multicast group. Similarly, we can think
of directed broadcast addressing as a form of multicasting in which all computers on a particular
network are members of the multicast group. Other multicast addresses can correspond to
arbitrary sets of machines. Despite Its apparent generality, multicasting cannot replace
conventional forms of addressing because there is a fundamental difference in the underlying
mechanisms that implement forwarding and delivery. Unicast and broadcast addresses identify a
computer or a set of computers attached to one physical segment, so forwarding depends on the
network topology. A multicast address identifies an arbitrary set of listeners, so the forwarding
mechanism must propagate the packet to all segments. For example, considertwo LAN segments
connected by an adaptive bridge that has learned host addresses. If a host on segment 1 sends a
unicast frame to another host on segment 1, the bridge will not forward the frame to segment 2.
If a host uses a multicast address, however, the bridge will forward the frame. Thus, we can
conclude:
• Group Address. Each multicast group is a unique class D address. A few IP multicast
addresses are permanently assigned by the Internet authority, and correspond to groups
that always exist even if they have no current members. Other addresses are temporary,
and are available for private use.
• Dynamic Group Membership. A host can join or leave an IP multicast group at any time.
Furthermore, a host may be a member of an arbitrary number of multicast groups.
• Delivery Semantics. IP multicast uses the same best-effort delivery semantics as other IP
datagram delivery, meaning that multicast datagrams can be lost, delayed, duplicated, or
delivered out of order.
• Membership And Transmission. An arbitrary host may send datagrams to any multicast
group; group membership is only used to determine whether the host receives datagrams
sent to the group.
Two types of multicast addresses are permanently assigned and for temporary use. Permanent
addresses
are called well-known; they are used for major services on the global Internet as well as for
infrastructure maintenance (e.g., multicast routing protocols). Other multicast addresses
correspond to transient multicast groups that are created when needed and discarded when the
count of group members reaches zero. Like hardware multicasting, IP multicasting uses the
datagram's destination address to specify that a particular datagram must be delivered via
multicast. IP reserves class D addresses for multicast; they have the form shown in Figure 9.1.
Figure 9.1 The format of class D IP addresses used for multicasting. Bits 4 through 31 identify a
particular multicast group.
The first 4 bits contain 1110 and identify the address as a multicast. The remaining 28 bits
specify a particular multicast group. There is no further structure in the group bits. In particular,
the group field is not partitioned into bits that identify the origin or owner of the group, nor does
it contain administrative information such as whether all members of the group are on one
physical network.
To participate in IP multicast on a local network, a host must have software that allows it to send
and receive multicast datagrams. To participate in a multicast that spans multiple networks, the
host must inform local multicast routers. The local routers contact other multicast routers,
passing on the membership information and establishing routes. We will see later that the
concept is similar to conventional route propagation among internet routers. Before a multicast
router can propagate multicast membership information, it must determine that one or more hosts
on the local network have decided to join a multicast group. To do so, multicast routers and hosts
that implement multicast must use the Internet Group Management Protocol (IGMP) to
communicate group membership information. Because the current version is 3, the protocol
described here is officially known as IGMPv3.
IGMP is analogous to ICMP. Like ICMP, it uses IP datagrams to carry messages. Also like
ICMP, it provides a service used by IP. Therefore,
Although IGMP uses IP datagrams to carry messages, we think of it as an integral part of IP,
not a separate protocol.
Furthermore, IGMP is a standard for TCP/IP; it is required on all machines that receive IP
multicast (i.e., all hosts and routers that participate at level 2). Conceptually, IGMP has two
phases. Phase 1: When a host joins a new multicast group, it sends an IGMP message to the
group's multicast address declaring itsmembership. Local multicast routers receive the message,
and establish necessary routing by propagating the group membership information to other
multicast routers throughout the internet. Phase 2: Because membership is dynamic, local
multicast routers periodically poll hosts on the local network to determine whether any hosts still
remain members of each group. If any host responds for a given group, the routerkeeps the group
active. If no host reports membership in a group after several polls, the multicast router assumes
that none of the hosts on the network remain in the group, and stops advertising group
membership to other multicast routers. To further complicate group membership, IGMP permits
an application on a host to install a source address filter that specifies whether the host should
include or exclude multicast traffic from a given source address. Thus, it is possible to join a
multicast group, but to exclude datagrams sent to the group by a given source. The presence of
filters is important because IGMP allows a host to pass the set of filter specifications to the local
router along with group membership information. In the case where two applications disagree
(i .e., one application excludes a given source and another includes the source), software on the
host must rationalize the two specifications and then handle the decision about which
applications receive a given datagram locally.
Essay Questions
CHAPTER 10
DOMAIN NAME SYSTEM
The protocols described earlier use 32-bit integers called Internet Protocol addresses (IP
addresses) to identify machines. Although such addresses provide a convenient, compact
representation for specifying the source and destination in datagrams sent across an internet,
users prefer to assign machines pronounceable, easily remembered names.
This chapter considers a scheme for assigning meaningful high-level names to a large set of
machines, and discusses a mechanism that maps between high-level machine names and IP
addresses. It considers both the translation from high-level names to IP addresses and the
translation from IP addresses to high level machine names. The naming scheme is interesting for
two reasons. First, it has been used to assign machine names throughout the Internet. Second,
because it uses a geographically distributed set of servers to map names to addresses, the
implementation of the name mapping mechanism provides a large scale example of the client-
server paradigm
Early machine names reflected the small environment in which they were chosen. It was quite
common for a site with a handful of machines to choose names based on the machines' purposes.
For example, machines often had names like accounting, development, and production. Users
find such names preferable to cumbersome hardware addresses.
Although the distinction between address and name is intuitively appealing, it is artificial. Any
name is merely an identifier that consists of a sequence of characters chosen from a finite
alphabet. Names are only useful if the system can efficiently map them to the object they denote.
Thus, we think of an IP address as a low-level name, and we say that users prefer high-level
names for machines. The form of high-level names is important because it determines how
names are translated to low-level names or bound to objects, as well as how name assignments
are authorized. With only a few machines, choosing names is easy - each administrator can
choose an arbitrary name and verify that the name is not in use. For example, when its main
departmental computer was connected to the Internet in 1980, the ComputerScience Department
at Purdue University chose the name purdue to identify the connected machine. The list of
potential conflicts contained only a few dozen names. By mid 1986, the official list of hosts on
the Internet contained 3100 officially registered names and 6500 official aliases. Although the
list was growing rapidly in the 1980s, most sites had additional machines (e.g., personal
computers) that were not registered. In the current Internet, with hundreds of millions of
machines, choosing symbolic names is much more difficult.
How can a naming system accommodate a large, rapidly expanding set of names without
requiring a central site to administer it? The answer lies in decentralizing the naming mechanism
by delegating authority for parts of the names pace and distributing responsibility for the
mapping between names and addresses. The Internet uses such a scheme. Before examining the
details, we will consider the motivation and intuition behind it.
The partitioning of a namespace must be defined in a way that supports efficient name mapping
and guarantees autonomous control of name assignment. Optimizing only for efficient mapping
can lead to solutions that retain a flat names pace and reduce traffic by dividing the names
among multiple mapping machines. Optimizing only for administrative ease can lead to solutions
that make delegation of authority easy but name mapping expensive or complex.
To understand how the namespace should be divided, consider the internal structure of large
organizations. At the top, a chief executive has overall responsibility. Because the chief
executive cannot oversee everything, the organization may be partitioned into divisions, with an
executive in charge of each division. The chief executive grants each division autonomy within
specified limits. More to the point, the executive in charge of a particular division can hire or fire
employees, assign offices, and delegate authority, without obtaining direct permission from the
chief executive.
Besides making it easy to delegate authority, the hierarchy of a large organization introduces
autonomous operation. For example, when an office worker needs information like the telephone
number of a new employee, he or she begins by asking local clerical workers (who may contact
clerical workers in other divisions). The point is that although authority always passes down the
corporate hierarchy, information can flow across the hierarchy from one office to another.
The syntax of hierarchically assigned names often reflects the hierarchical delegation of
authority used to assign them. As an example, consider a namespace with names of the form:
local.site
where site is the site name authorized by the central authority, local is the part of name
controlled by the site, and the period (".") is a delimiter used to separate them. When the topmost
authority approves adding a new site, X, it adds X to the list of valid sites and delegates to site X
authority for all names that end in ".X".
The domain name system uses a hierarchical naming scheme known as domain names. As 'in our
earlier examples, a domain name consists of a sequence of sub names separated by a delimiter
character, the period. In our examples we said that individual sections of the name might
represent sites or groups, but the domain name system simply calls each section a label. Thus,
the domain name
cs.purdue.edu
contains three labels: cs, purdue, and edu. Any suffix of a label in a domain name is also called a
domain. In the above example, the lowest-level domain is cs. purdue. edu, (the domain name for
the Computer Science Department at Purdue University), thesecond level domain is purdue. edu
(the domain name for Purdue University), and the top-level domain is edu (the domain name for
educational institutions). As the example shows, domain names are written with the local label
first and the top domain last. As we will see; writing them in this order makes it possible to
compress messages that contain multiple domain names.
Although the conceptual tree makes understanding the relationship between servers easy, it hides
several subtle details. Looking at the name resolution algorithm will help explain them.
Conceptually, domain name resolution proceeds top-down, starting with the root name server
and proceeding to servers located at the leaves of the tree. There are two ways to use the domain
name system: by contacting name servers one at a time or asking the name server system to
perform the complete translation. In either case, the client software forms a domain name query
that contains the name to be resolved, a declaration of the class of the name, the type of answer
desired, and a code that specifies whether the name server should translate the name completely.
It sends the query to a name server for resolution.
When a domain name server receives a query, it checks to see if the name lies in the sub domain
for which it is an authority. If so, it translates the name to an address according to its database,
and appends an answer to the query before sending it back to the client. If the name server
cannot resolve the name completely, it checks to see what type of interaction the client specified.
If the client requested complete translation (recursive resolution, in domain name terminology),
the server contacts a domain name server that can resolve the name and returns the answer to the
client. If the client requested non-recursive resolution (iterative resolution), the name server
cannot supply an answer. It generates a reply that specifies the name server the client should
contact next to resolve the name. How does a client find a name server at which to begin the
search? How does a name server find other name servers that can answer questions when it
cannot? The answers are simple. A client must know how to contact at least one name server. To
ensure that a domain name server can reach others, the domain system requires thateach server
know the address of at least one root server. In addition, a server may know the address of a
server for the domain immediately above it (called the parent).
Domain name servers use a well-known protocol port for all communication, so clients know
how to communicate with a server once they know the IP address of the machine in which the
server executes. There is no standard way for hosts to locate a machine in the local environment
on which a name server runs; that is left to whoever designs the client software. In some systems,
the address of the machine that supplies domain name service is bound into application programs
at compile time, while in others, the address is stored in a file on secondary storage. Many
systems obtain the address of a domain server automatically as part of the bootstrap process
The cost of lookup for non local names can be extremely high if resolvers send each query to the
root server. Even if queries could go directly to the server that has authority for the name, name
lookup can present a heavy load to an internet. Thus, to improve the overall performance of a
name server system, it is necessary to lower the cost of lookup for nonlocal names.
Internet name servers use caching to optimize search costs. Each server maintains a cache of
recently used names as well as a record of where the mapping information for that name was
obtained. When a client asks the server to resolve a name, the server first checks to see if it has
authority for the name according to the standard procedure. If not, the server checks its cache to
see if the name has been resolved recently. Servers report cached information to clients, but mark
it as a non authoritative binding, and give the domain name of the server, S, from which they
obtained the binding. The local server also sends along additional information that tells the client
the binding between S and an IP address. Therefore, clients receive answers quickly, but the
information may be out-of-date. If efficiency is important, the client will choose to accept the
non authoritative answer and proceed. If accuracy is important, the client will choose to contact
the authority and verify that the binding between name and address is still valid.
Caching works well in the domain name system because name to address bindings change
infrequently. However, they do change. If servers cached information the first time it was
requested and never updated it, entries in the cache could become stale (i.e., incorrect). To keep
the cache correct, servers time each entry and dispose of entries that exceed a reasonable time.
When a server is asked for the information after it has removed the entry from its cache, the
server must go back to the authoritative source and obtain the binding again. More important,
servers do not apply a single fixed timeout to all entries, but allow the authority for an entry to
configure its timeout. Whenever an authority responds to a request, it includes a Time To Live
(TTL) value in the response that specifies how long it guarantees the binding to remain valid.
Thus, authorities can reduce network overhead by specifying long timeouts for entries that they
expect to remain unchanged, while improving correctness by specifying short timeouts for
entriesthat they expect to change frequently.
Caching is important in hosts as well as in local domain name servers. Most resolver software
caches DNS entries in the host. Thus, if a user looks up the same name repeatedly, subsequent
lookups can be resolved from the local cache without using the network.
Looking at the details of messages exchanged between clients and domain name servers will help
clarify how the system operates from the view of a typical application program. We assume that
a user invokes an application program and supplies the name of a machine with which the
application must communicate. Before it can use protocols like TCP or UDP to communicate
with the specified machine, the application program must find the machine's IP address. It passes
the domain name to a local resolver'and requests an IP address. The local resolver checks its
cache and returns the answer if one is present. If the local resolver does not have an answer, it
formats a message and sends it to the server (i.e., it becomes a client). Although our example
only involves one name, the message format allows a client to ask multiple questions in a single
message. Each question consists of a domain name for which the client seeks an IP address, a
specification of the query class (i.e., internet), and the type of object desired (e.g., address). The
server responds by returning a similar message that contains answers to the questions for which
the server has bindings. If the server cannot answer all questions, the response will contain
information about other name servers that the client can contact to obtain the answers.Responses
also contain information about the servers that are authorities for the replies and the IP addresses
of those servers. Figure 10.1 shows the message format.
Figure 10.1 Domain name server message format. The QUESTION, ANSWER, AUTHORITY,
and ADDITIONAL INFORMATION sections are variable length.
As the figure shows, each message begins with a fixed header. The header contains a unique
IDENTIFICATION field that the client uses to match responses to queries, and a PARAMETER
field that specifies the operation requested and a response code.
The TCP/IP protocol suite includes a simple textual remote terminal protocol called TELNET
that allows a user to log into a computer across an internet. TELNET establishes a TCP
connection, and then passes keystrokes from the user's keyboard directly to the remote computer
as if they had been typed on a keyboard attached to the remote machine. TELNET also carries
textual output from the remote machine back to the user's screen. The service is called
transparent because it gives the appearance that the user's keyboard and display attach directly to
the remote machine.
TELNET offers three basic services. First, it defines a network virtual terminal that provides a
standard interface to remote systems. Client programs do not have to understand the details of all
possible remote systems; they are built to use the standard interface. Second, TELNET includes a
mechanism that allows the client and server to negotiate options, and it provides a set of standard
options (e.g., one of the options controls whether data passed across the connection uses the
standard 7-bit ASCII character set or an 8-bit character set). Finally, TELNET treats both ends of
the connection symmetrically. In particular, TELNET does not force client input to come from a
keyboard, nor does it force the client to display output on a screen. Thus, TELNET allows an
arbitrary program to become a client. Furthermore, either end can negotiate options.
Figure 10.2 illustrates how application programs are used to implement a TELNET client and a
TELNET server.
Figure 10.2:The path of data in a TELNET remote terminal session as it travels from the user's
keyboard to the remote operating system.
As the figure shows, when a user invokes TELNET, an application program on the user's
machine becomes the client. The client establishes a TCP connection to the server over which
they will communicate. Once the connection has been established, the client accepts keystrokes
from the user's keyboard and sends them to the server, while it concurrently accepts characters
that the server sends back and displays them on the user's screen. The client also checks for an
escape character that a user can type to control the client. The server accepts a TCP connection
from the client, and then relays data between the TCP connection and the local operating system.
In practice, the server is more complex than the figure shows because it must handle multiple,
concurrent connections. Usually, a master server process waits for new connections and creates a
new slave copy to handle each connection. Thus, the 'TELNET server', shown in Figure 10.2,
represents the slave that handles one particular connection. The figure does not show the master
server that listens for new requests, nor does it show the slaves handling other connections.
We use the term pseudo terminal to describe the operating system entry point that allows a
running program like the TELNET server to transfer characters to the operating system as if they
came from a keyboard. It is impossible to build a TELNET server unless the operating system
supplies such a facility. If the system supports a pseudo terminal abstraction, the TELNET server
can be implemented with application programs.
Each slave server connects a TCP stream from one client to a particular pseudo terminal.
Arranging for the TELNET server to be an application-level program has advantages and
disadvantages. The most obvious advantage is that it makes modification and control of the
server easier than if the code were embedded in the operating system. The obvious disadvantage
is inefficiency. Each keystroke travels from the user's key-board through the operating system to
the client program, from the client program back through the operating system and across the
underlying internet to the server machine. After reaching the destination machine, the data must
travel up through the server's operating system to the server application program, and from the
server application program back into the server's operating system at a pseudo terminal entry
point. Finally, the remote operating system delivers the character to the application program the
user is running. Meanwhile, output (including remote character echo if that option has been
selected) travels back from the server to the client over the same path. Readers who understand
operating systems will appreciate that for the implementation shown in Figure 10.2, every
keystroke requires computers to switch process context several times. In most systems, an
additional context switch is required because the operating system on the server's machine must
pass characters from the pseudo terminal back to another application program (e.g., a command
interpreter). Although context switching is expensive, the scheme is practical because users do
not type at high speed.
Although TELNET and SSH are part of the TCP/IP protocols, many other remote access
protocols have been devised. A few examples illustrate some of the diversity. Rlogin. One of the
earliest alternatives to TELNET, devised as part of the BSD Unix operating system, was known
as rlogin. Rlogin pioneered an idea that has been used with subsequent services, including SSH:
trusted hosts. In essence, the mechanismallows system administrators to choose a set of
machines over which login names and file access protections are shared and to establish
equivalences among user logins. Users can control access to their personal accounts by
authorizing remote login based on remote host and remote user names. Thus, it is possible for a
user to have login name X on one machine and Yon another, and still be able to remotely login
from one of the machines to the other without typing a password each time. Virtual Network
Computing (VNC). Unlike TELNET, rlogin, or SSH, VNC provides a remote desktop capability
instead of a textual interface. That is, VNC allows a user on one computer to see an exact copy
of the desktop on another computer and to use the keyboard and mouse to interact with the
remote computer - the user can see the windows, icons, and other graphics. More important,
VNC software runs across multiple platforms. As a result, the client can run on a computer that
uses Linux, evenif the server runs on a computer that uses Windows.
Remote Desktop Protocol (RDP). Microsoft Corporation has defined a remotedesktop protocol
for use with their operating system. Like other remote desktop systems, RDP allows a remote
computer to see an exact copy of the desktop and to run applications. Also like other remote
desktop technologies, RDP can be used across platforms (e.g., a Linux client exists).
10.11 Assignment Questions
Answer the questions Each carries 2 marks.
8. Expand RDP and mention which company has defined the same?
Essay Questions
6. With the help of a diagram explain how application programs implement a Telnet client
to a Telnet server.
CHAPTER 11
VARIOUS INTERNET PROTOCOLS
The alternative to integrated, transparent on-line access is a file transfer mechanism. Accessing
remote data with a transfer mechanism is a two-step process: the user first obtains a local copy of
a file and then operates on the copy. Most transfer mechanisms operate outside the local file
system (i.e., they are not integrated). A user must invoke a special-purpose client program to
transfer files. The client contacts a server on the remote machine and requests a copy of the file.
Once the transfer is complete, the user terminates the client and uses an application program on
the local system to read or modify the local copy. One advantage of whole-file copying lies in
the efficiency of operations - once a local copy of a remote file has been made, application
programs can operate on the local copy at high speed.
As with on-line sharing, whole-file transfer between heterogeneous machines can be difficult.
The client and server must agree on authorization, notions of file owner ship and access
protections, and data formats. Data formats are especially important because translation may
change the file slightly (e.g., may modify line termination). As a consequence, if a file is
transferred from machine A to B and then back to A, the result can differ from the original.
File transfer is among the most frequently used TCP/IP applications, and still accounts for a
nontrivial amount of Internet traffic. Standard file transfer protocols existed for the ARPANET
before TCP/IP became operational. These early versions of file transfer software evolved into a
current standard known as the File Transfer Protocol (FTP).
• Format Specification. FTP allows the client to specify the type and representation of
stored data. For example, the user can specify whether a file contains text or binary data
and whether text files use the ASCII or EBCDIC character sets.
Like other servers, most FTP server implementations allow concurrent access by multiple clients.
Clients use TCP to connect to a server. A single master server process awaits connections and
creates a slave process to handle each connection. Unlike most servers, however, the FTP slave
process does not perform all necessary computation. Instead, the slave accepts and handles a
control connection from the client, but uses an additior.al process and an additional TCP
connection to handle each data transfer operation. The control connection carries commands that
tell the server which file to transfer. A new TCP connection and a new process on both the client
and server side is created for each data transfer operation (i.e., each file transfer). While the exact
details of the process architecture depend on the operating systems used, Figure 11.1 illustrates
the concept:
Figure 11.1: An FTP client and server with a TCP control connection betweenthem and a
separate TCP connection between their associateddata transfer processes.
As the figure shows, the client control process connects to the server control process using one
TCP connection, while the associated data transfer processes use their own TCP connection. In
general, the control processes and the control connection remain alive as long as the user keeps
the FTP session active, and a data transfer connection persists for one file transfer. The idea can
be summarized
Data transfer connections and the data transfer processes that use them are created
dynamically when needed, but the control connection persists throughout a session. Once the
control connection disappears, the session is terminated and the software at both ends
terminates all data transfer processes
11.5 TFTP
Although FTP is the most general file transfer protocol in the TCP/IP suite, it is also the most
complex and difficult to program. Many applications do not need the full functionality FTP
offers, nor can they afford the complexity. For example, FTP requires clients and servers to
manage multiple concurrent TCP connections, something that may be difficult or impossible on
embedded computers that do not have sophisticated operating systems.
The TCP/IP suite contains a second file transfer protocol that provides inexpensive,
unsophisticated service. Known as the Trivial File Transfer Protocol, or (TFTP), it is intended
for applications that do not need complex interactions between the client and server. TFTP
restricts operations to simple file transfers and does not provide authentication. Because it is
more restrictive, TFTP software is much smaller than FTP.
Small size is important in many applications. For example, manufacturers of embedded systems
can encode TFTP in read-only memory (ROM) and use it to obtain an initial memory image
when the machine is powered on. The program in ROM is called the system bootstrap. The
advantage of using TFTP is that it allows bootstrapping code to use the same underlying TCP/IP
protocols that the operating system uses once it begins execution. Thus, it is possible for a
computer to bootstrap from a server on another physical network.
Unlike FTP, TFTP does not need a reliable stream transport service. It runs on top of UDP or any
other unreliable packet delivery system, using timeout and retransmission to ensure that data
arrives. The sending side transmits a file in fixed size (512 byte) blocks and awaits an
acknowledgement for each block before sending the next.
The receiver acknowledges each block upon receipt. The rules for TFTP are simple. The first
packet sent requests a file transfer and establishes the interaction between client and server - the
packet specifies a file name and whether the file will be read (transferred to the client) or written
(transferred to the server). Blocks of the file are numbered consecutively starting at 1. Each data
packet contains a header that specifies the number of the block it carries, and each
acknowledgement contains the number of the block being acknowledged. A block of less than
512 bytes signals the end of file. It is possible to send an error message either in the place of data
or an acknowledgement; errors terminate the transfer.
Figure 11.2 shows the format of the five TFTP packet types. The initial packet must use
operation codes 1 or 2 to specify either a read request or a write request, the FILENAME field to
specify the name of a file, and the MODE field to specify whether the client will read the file,
write the file, or both.
Figure 11.2: The five TFTP message types. Fields are not shown to scale because some are
variable length; an initial 2-octet operation code identifies the message format.
Once a read or write request has been made, the server uses the IP address and UDP protocol
port number of the client to identify subsequent operations. Thus, neither data messages (the
messages that carry blocks from the file) nor ack messages (the messages that acknowledge data
blocks) need to specify the file name. The final message type illustrated in Figure 11.2 is used to
report errors. Lost messages can be re transmitted after a timeout, but most other errors simply
cause termination of the interaction.
TFTP retransmission is unusual because it is symmetric - each side implements a timeout and
retransmission. If the side sending data times out, it retransmits the last data block. If the side
responsible for acknowledgements times out, it retransmits the last acknowledgement. Having
both sides participate in retransmission helps ensure that transfer will not fail after a single
packet loss.
data packet k+ 1. The receiver will acknowledge both copies of data packet k+l, and the two
acknowledgements will each cause the sender to transmit data packet k+2. The Sorcerer's
Apprentice Bug can also start if theunderlying internet duplicates packets. Once started, the cycle
continues indefinitelywith each data packet being transmitted exactly twice. A fix for the
Sorcerer's Apprentice Bug appears in the latest version of TFTP.
11.6 NFS
Initially developed by Sun Microsystems Incorporated, the Network File System (NFS) has been
published as an IETF standard for transparent and integrated shared file access. Figure 11.3
illustrates how NFS is embedded in an operating system.
When an application program executes, it calls the operating system to open a file, to read data
from a file, or to write data into a file. The file access mechanism accepts the request, and
automatically passes it to either the local file system software or to the NFS client, depending on
whether the file is on the local disk or on a remote machine. When it receives a request, the client
software uses the NFS protocol to contact the appropriate server on a remote machine and
perform the requested operation. When the remote server replies, the client software returns the
results to the application program.
Mail transactions begin with a MAIL command that gives the sender identification as well as a
FROM: field that contains the address to which errors should be reported. A recipient prepares
its data structures to receive a new mail message, and replies to a MAIL command by sending
the response 250. Response 250 means that all is well.
The full response consists of the text 250 OK. After a successful MAIL command, the sender
issues a series of RCPT commands that identify recipients of the mail message. The receiver
must acknowledge each RCPT command by sending 250 OK or by sending the error message
550 No such user here.
After all RCPT commands have been acknowledged, the sender issues a DATA command. In
essence, a DATA command informs the receiver that the sender is ready to transfer a complete
mail message. The receiver responds with message 354 Start mail input, and specifies the
sequence of characters used to terminate the mail message. The termination sequence consists of
5 characters: carriage return, line feed, period, carriage return, and line feed.
Once it has finished sending all the mail messages, a client issues a QUIT command. The other
side responds with command 221, which means it agrees to terminate.Both sides then close the
TCP connection gracefully.SMTP is much more complex than we have outlined here. For
example, if a userhas moved, the server may know the user's new mailbox address. SMTP allows
theserver to inform the client about the new address so the client can use it in the future.
When informing the client about a new address, the server may choose to forward themail that
triggered the message, or it may request that the client take the responsibilityfor forwarding. In
addition, SMTP includes Transport Layer Security (TLS) extensionsthat allow an SMTP session
to be encrypted.
The SMTP transfer scheme described above implies that a server must remain ready to accept e-
mail at all times. The scenario works well if the server runs on a computer that has a permanent
Internet connection, but it does not work well for a computer that has intermittent connectivity
(e.g., a laptop computer that is disconnected when being moved). It makes no sense for such a
computer to run an e-mail server because the server will only be available while the user's
computer is connected – all other attempts to contact the server will fail, and e-mail sent to the
user will remain undelivered. The question arises, "How can a user without a permanent
connection receive e-mail?" The answer to the question lies in a two-stage delivery process. In
the first stage, each user is assigned a mailbox on a computer that is always on and has a
permanent Internet connection. The computer runs a conventional SMTP server, which always
remains ready to accept e-mail. In the second stage, the user connects to the Internet and then
runs a protocol that retrieves messages from the permanent mailbox. The protocol transfers the
messages to the user'~ computer where they can be read.
Two protocols exist that allow a remote user to access mail in a permanent mail box. Although
they have similar functionality, the protocols take opposite approaches: one allows the user to
download a copy of messages, and the other allows a user to view and manipulate messages on
the server. The next two sections describe the two protocols.
The most popular protocol used to transfer e-mail messages from a permanent mailbox to a local
computer is known as version 3 of the Post Office Protocol (POP3); a secure version of the
protocol is known as POP3S. The user invokes a POP3 client, which creates a TCP connection to
a POP3 server on the mailbox computer. The user first sends a login and a password to
authenticate the session. Once authentication has been accepted, the client sends commands to
retrieve a copy of one or more messages and to delete the message from the permanent mailbox.
The messages are stored and transferred as text files in 2822 standard format.
Note that the computer with the permanent mailbox must run two servers – an SMTP server
accepts mail sent to a user and adds each incoming message to the user's permanent mailbox, and
a POP3 server allows a user to extract messages from the mail box and delete them. To ensure
correct operation, the two servers must coordinate use of the mailbox so that if a message arrives
via SMTP while a user is extracting messages via POP3, the mailbox is left in a valid state.
Unlike POP3, however, IMAP4 allows a user to access mail messages from multiple locations
(e.g., from work and from home), and ensures that all copies are synchronized and consistent.
IMAP4 also provides extended functionality for message retrieval and processing. A user can
obtain information about a message or examine header fields without retrieving the entire
message. In addition a user can search for a specified string and retrieve portions of a message.
Partial retrieval is especially useful for slow-speed dialup connections because it means a user
does not need to download useless information.
The Multipurpose Internet Mail Extensions (MIME) were defined to allow transmission of non-
ASCII data through e-mail. MIME does not change or replace protocols such as SMTP, POP3,
and IMAP4. Instead, MIME allows arbitrary data to be encoded in ASCII and then transmitted in
a standard e-mail message. To accommodate arbitrary data types and representations, each
MIME message includes information that tells the recipient the type of the data and the encoding
used. MIME information resides in the 2822 mail header - the MIME header lines specify the
MIME version, the data type, and the encoding that was used to convert the data to ASCII. For
example, Figure 11.4 illustrates a MIME message that contains a photograph in standard JPEG
representation. The IPEG image has been converted to a 7-bit ASCII representation using the
base64 encoding.
In the figure, the header line MIME- Version: declares that the message was composed using
version 1.0 of the MIME protocol. The Content-Type: declaration specifies that the data is a
JPEG image, and the Content-Transfer-Encoding: header declares that base64 encoding was used
to convert the image to ASCII.
To view the image in a figure, a receiver's mail system must first convert from base64 encoding
back to binary, and then run an application that displays a IPEG image on the user's screen.
Base64 was chosen to provide sixty-four ASCII characters that have the same representation
across various versions of ISO English character sets. Thus, a receiver can be guaranteed that the
image extracted from the encoded data is exactly the same as the original image.
The MIME standard specifies that a Content-Type declaration must contain two identifiers, a
content type and a subtype, separated by a slash. In the example, image is the content type, and
jpeg is the subtype.
The standard defines seven basic content types, the valid subtypes for each, and transfer
encodings. For example, although an image must be of subtype jpeg or gif, text cannot use either
subtype. In addition to the standard types and subtypes, MIME permits a sender and receiver to
define private content types Figure 11.5 lists the seven basic content types.
Figure 11.4:An example MIME message. Lines in the header identify the type of the data as well
as the encoding used.
Figure 11.5:The seven basic types that can appear in a MIME Content-Type declaration and their
meanings.
11.12 Assignment Questions
Answer the following questions Each carries 2 marks.
Essay Questions.
5. With the aid of a diagram explain the five TFTP packet types.
9. Explain IMAP.
CHAPTER 12
IPV6 – FEATURES DATAGRAM FORMAT
12.1 Introduction
Evolution of TCP/IP technology is intertwined with evolution of the global Internet for several
reasons. First, the Internet is the largest installed TCP/IP internet, so many problems related to
scale arise in the Internet before they surface in other TCP/IP internets. Second, funding for
TCP/IP research and engineering comes from companies and government agencies that use the
operational Internet, so they tend to fund projects that impact the Internet. Third, because most
researchers use the global Internet daily, they have immediate motivation to solve problems
that will improve service and extend functionality.
With millions of users at tens of thousands of sites around the world depending on the global
Internet as part of their daily work environment, it might appear that the Internet is a
completely stable production facility. We have passed the early stage of development in
which every user was also an expert, and entered a stage in which few users understand the
technology. Despite appearances, however, neither the Internet nor the TCP/IP protocol suite is
static. Groups discover new ways to use the technology.
Researchers solve new networking problems, and engineers improve the underlying
mechanisms. In short, the technology continues to evolve. The purpose of this chapter is to
consider the ongoing evolutionary process and examine one of the most significant engineering
efforts: a proposed revision of IP. When the proposal is adopted by vendors, it will have a
major impact on TCP/TP and the global Internet.
• Increases In Size And Load. The global Internet has experienced many years of
sustained exponential growth, doubling in size every nine months or faster. In 1999, on
the average, a new host appeared on the Internet every two seconds.Traffic has also
increased rapidly as animated graphics and video proliferate.
12.3Features
The proposed IPv6 protocol retains many of the features that contributed to the success of
IPv4. In fact, the designers have characterized IPv6 as being basically the same as IPv4 with a
few modifications. For example, rPv6 still supports connectionless delivery (i.e., each
datagram is routed independently), allows the sender to choose the size of a datagram, and
requires the sender to specify the maximum number of hops a datagram can make before being
terminated. As we will see, IPv6 also retains most of the concepts provided by IPv4 options,
including facilities for fragmentation and source routing.
Despite many conceptual similarities, IPv6 changes most of the protocol details. For example,
IPv6 uses larger addresses, and adds a few new features. More important, IPv6 completely
revises the datagram format by replacing IPv4's variable-length options field by a series of
fixed-format headers. We will examine details after considering major changes and the
underlying motivation for each. The changes introduced by IPv6 can be grouped into seven
categories:
• Larger Addresses. The new address size is the most noticeable change. IPv6
quadruples the size of an IPv4 address from 32 bits to 128 bits. The IPv6 address space
is so large that it cannot be exhausted in the foreseeable future.
• Extended Address Hierarchy. IPv6 uses the larger address space to create additional
levels of addressing hierarchy. In particular, Pv6 can define a hierarchy of ISPs as
well as a hierarchical structure within a given site.
• Flexible Header Format. IPv6 uses an entirely new and incompatible datagram format.
Unlike the IPv4 fixed-format header, IPv6 defines a set of optional headers.
• Improved Options. Like IPv4, IPv6 allows a datagram to include optional control
information. IPv6 includes new options that provide additional facilities not available
in IPv4.
• Provision For Protocol Extension. Perhaps the most significant change in IPv6 is a
move away from a protocol that fully specifies all details to a protocol that can permit
additional features. The extension capability has the potential to allow the IETF to
adapt the protocol to changes in underlying network hardware or to new applications.
• Support For Autoconfiguration And Renumbering. IPv6 provides facilities that allow
computers on an isolated network to assign themselves addresses and begin
communicating without depending on a router or manual configuration. The protocol
also includes a facility that permits a manager to renumber networks dynamically.
• Support For Resource Allocation. IPv6 has two facilities that permit preallocation of
network resources: a flow abstraction and a differentiated service specification. The
latter will use the same approach as IPv4's differentiated services.
IPv6 completely changes the datagram format. As Figure 12.1 shows, an IPv6 datagram has a
fixed-size base header followed by zero or more extension headers, followed by data.
Figure 12.1:The general form of an IPv6 datagram with multiple headers.Only the base
header is required; extension headers are optional.
Figure 12.2 shows the contents and format of an IPv6 base header. Several fields in an IPv6
base header correspond directly to fields in an IPv4 header. As in IPv4 the initial 4-bit VERS
field specifies the version of the protocol; VERS always contains 6 in an IPv6 datagram. As in
IPv4, the SOURCE ADDRESS and DESTINATION ADDRESS fields specify the addresses
of the sender and intended recipient. In IPv6, however, each address requires 16 octets. The
HOP LIMIT field corresponds to the IPv4 TIME-TO-LIVE field. Unlike IPv4, which
interprets a time-to-live as a combination of hop count and maximum time, IPV6 interprets the
value as giving a strict bound on the maximum number of hops a datagram can make before
being discarded.
Figure 12.2: The format of the 40-octet IPv6 base header. Each 1-6 datagram begins with a
base header.
IPv6 handles datagram length specifications in a new way. First, because the size of the base
header is fixed at 40 octets, the base header does not include a field for the header length.
Second, IPv6 replaces IPv4's datagram length field by a 16-bit PAY-LOAD LENGTH
field that specifies the number of octets carried in the datagram excluding the header itself.
Thus, an IPV6 datagram can contain 64K octets of data. Two fields in the base header are used
in making forwarding decisions. The IPv4 SERVICE CLASS field has been renamed
TRAFFIC CLASS. In addition, a new mechanism in IPv6 supports resource reservation and
allows a router to associate each datagram with a given resource allocation. The underlying
abstraction, a flow, consists of a path through an internet along which intermediate routers
guarantee a specific quality of service. Field FLOW LABEL in the base header contains
information that routers use to associate a datagram with a specific flow and priority. For
example, two applications that need to send video can establish a flow on which the delay and
bandwidth is guaranteed. Alternatively, a network provider may require a subscriber to
specify the quality of service desired, and then use a flow to limit the traffic a specific
computer or a specific application sends. Note that flows can also be used within a given
organization to manage network resources and ensure that all applications receive a fair
share. A router uses the combination of datagram source address and flow identifier when
associating a datagram with a specific flow. To summarize:
Each IPv6 datagram begins with a 40-octet base header that includes fields for the source
and destination addresses, the maximum hop limit, the traffic class, the flow label, and
the type of the next header. Thus, an IPv6 datagram must contain at least 40 octets in
addition to the data.
The paradigm of a fixed base header followed by a set of optional extension headers was
chosen as a compromise between generality and efficiency. To be totally general, IPv6 needs to
include mechanisms to support functions such as fragmentation, source routing, and
authentication. However, choosing to allocate fixed fields in the datagram header for all
mechanisms is inefficient because most datagrams do not use all mechanisms; the large IPv6
address size exacerbates the inefficiency. For example, when sending a datagram across a
single local area network, a header that contains empty address fields can occupy a
substantial fraction of each frame. More important, the designers realize that no one can predict
which facilities will be needed. The IPV6 extension header paradigm works similar to IPv4
options - a sender can choose which extension headers to include in a given datagram and
which to omit. Thus, extension headers provide maximum flexibility. We can summarize:
IPv6 extension headers are similar to IPv4 options. Each datagram includes extension
headers for only those facilities that the datagram uses.
CHAPTER 13
VALUE ADDED CHAPTER INTERNET SECURITY AND FIREWALL
13.1 Introduction
Like the locks used to help keep tangible property secure, computers and data networks need
provisions that help keep information secure. Security in an internet environment is both
important and difficult. It is important because information has significant value - information
can be bought and sold directly or used indirectly to create new products and services that yield
high profits. Security in an internet is difficult because security involves understanding when
and how participating users, computers, services, and networks can trust one another as well as
understanding the technical details of network hardware and protocols. Security is required on
every computer and every protocol; a single weakness can compromise the security of an
entire network. More important, because TCP/IP supports a wide diversity of users, services,
and networks and because an internet can span many political and organizational boundaries,
participating individuals and organizations may not agree on a level of trust or policies for
handling data.
This chapter considers two fundamental techniques that form the basis for internet security:
perimeter security and encryption. Perimeter security allows an organization to determine the
services and networks it will make available to outsiders and the extent to which outsiders can
use resources. Encryption handles most other aspects of security. We begin by reviewing a
few basic concepts and terminology.
The terms network security and information security refer in a broad sense to confidence that
information and services available on a network cannot be accessed by unauthorized users.
Security implies safety, including assurance of data integrity, freedom from unauthorized
access of computational resources, freedom from snooping or wiretapping, and freedom from
disruption of service. Of course, just as no physical property is absolutely secure against
crime, no network is completely secure. Organizations make an effort to secure networks for
the same reason they make an effort to secure buildings and offices: basic security measures
can discourage crime by making it significantly more difficult.
Providing security for information requires protecting both physical and abstract resources.
Physical resources include passive storage devices such as disks and CD-ROMs as well as
active devices such as users' computers. In a network environment, physical security extends
to the cables, bridges, and routers that comprise the network infrastructure. Indeed, although
physical security is seldom mentioned, it often plays an important role in an overall security
plan. Obviously, physical security can prevent wiretapping. Good physical security can
also eliminate sabotage (e.g., disabling a router to cause packets to be routed through an
alternative, less secure path). Protecting an abstract resource such as information is usually
more difficult than providing physical security because information is elusive. Information
security encompasses many aspects of protection:
Privacy or confidentiality. The system must prevent outsiders from making copies
of data as it passes across a network or understanding the contents if copies are
made.
Authorization. Although physical security often classifies people and resources into
broad categories, (e.g., all nonemployees are forbidden from using a particular hallway),
security for information usually needs to be more restrictive (e.g., some parts of an
employee's record are available only to the personnel office, others are available only
to the employee's boss, and others are available to the payroll office).
Authentication. The system must allow two communicating entities to validate each
other's identity.
Replay avoidance. To prevent outsiders from capturing copies of packets and using
them later, the system must prevent a retransmitted copy of a packet from being
accepted.
Humans are usually the most susceptible point in any security scheme. A worker who is
malicious, careless, or unaware of an organization's information policy can compromise the
best security.
choices of an encryption algorithm, a key, and the contents of messages can make it virtually
impossible for intermediate machines to decode messages or manufacture messages that are
valid.
Mechanisms that control internet access handle the problem of screening a particular network
or an organization from unwanted communication. Such mechanisms can help prevent
outsiders from: obtaining information, changing information, or disrupting communication on an
organization's intranet. Successful access control requires a careful combination of restrictions
on network topology, intermediate information staging, and packet filters.
A single technique known as an internetfirewall, has emerged as the basis for internet access
control. An organization places a firewall at its connection to external networks (e.g., the
global Internet). A firewall partitions an internet into two regions, referred to informally as
the inside and outside.