5.5
Internetworking
Until now, we have implicitly
assumed that there is a single homogeneous network, with each machine using the
same protocol in each layer. Unfortunately, this assumption is wildly
optimistic. Many different networks exist, including LANs, MANs, and WANs.
Numerous protocols are in widespread use in every layer. In the following
sections we will take a careful look at the issues that arise when two or more
networks are connected to form an internet.
Considerable controversy exists
about the question of whether today's abundance of network types is a temporary
condition that will go away as soon as everyone realizes how wonderful [fill in
your favorite network] is or whether it is an inevitable, but permanent,
feature of the world that is here to stay. Having different networks invariably
means having different protocols.
We believe that a variety of
different networks (and thus protocols) will always be around, for the
following reasons. First of all, the installed base of different networks is
large. Nearly all personal computers run TCP/IP. Many large businesses have
mainframes running IBM's SNA. A substantial number of telephone companies
operate ATM networks. Some personal computer LANs still use Novell NCP/IPX or
AppleTalk. Finally, wireless is an up-and-coming area with a variety of
protocols. This trend will continue for years due to legacy problems, new
technology, and the fact that not all vendors perceive it in their interest for
their customers to be able to easily migrate to another vendor's system.
Second, as computers and networks
get cheaper, the place where decisions get made moves downward in
organizations. Many companies have a policy to the effect that purchases
costing over a million dollars have to be approved by top management, purchases
costing over 100,000 dollars have to be approved by middle management, but
purchases under 100,000 dollars can be made by department heads without any
higher approval. This can easily lead to the engineering department installing
UNIX workstations running TCP/IP and the marketing department installing Macs
with AppleTalk.
Third, different networks (e.g., ATM
and wireless) have radically different technology, so it should not be
surprising that as new hardware developments occur, new software will be
created to fit the new hardware. For example, the average home now is like the
average office ten years ago: it is full of computers that do not talk to one
another. In the future, it may be commonplace for the telephone, the television
set, and other appliances all to be networked together so that they can be
controlled remotely. This new technology will undoubtedly bring new networks
and new protocols.
As an example of how different
networks might be connected, consider the example of Fig. 5-42. Here we see a corporate network with
multiple locations tied together by a wide area ATM network. At one of the
locations, an FDDI optical backbone is used to connect an Ethernet, an 802.11
wireless LAN, and the corporate data center's SNA mainframe network.
The purpose of interconnecting all
these networks is to allow users on any of them to communicate with users on
all the other ones and also to allow users on any of them to access data on any
of them. Accomplishing this goal means sending packets from one network to
another. Since networks often differ in important ways, getting packets from
one network to another is not always so easy, as we will now see.
Networks can differ in many ways.
Some of the differences, such as different modulation techniques or frame
formats, are in the physical and data link layers, These differences will not
concern us here. Instead, in Fig. 5-43 we list some of the differences that
can occur in the network layer. It is papering over these differences that
makes internetworking more difficult than operating within a single network.
When packets sent by a source on one
network must transit one or more foreign networks before reaching the
destination network (which also may be different from the source network), many
problems can occur at the interfaces between networks. To start with, when
packets from a connection-oriented network must transit a connectionless one,
they may be reordered, something the sender does not expect and the receiver is
not prepared to deal with. Protocol conversions will often be needed, which can
be difficult if the required functionality cannot be expressed. Address
conversions will also be needed, which may require some kind of directory
system. Passing multicast packets through a network that does not support
multicasting requires generating separate packets for each destination.
The differing maximum packet sizes
used by different networks can be a major nuisance. How do you pass an
8000-byte packet through a network whose maximum size is 1500 bytes? Differing
qualities of service is an issue when a packet that has real-time delivery
constraints passes through a network that does not offer any real-time
guarantees.
Error, flow, and congestion control
often differ among different networks. If the source and destination both
expect all packets to be delivered in sequence without error but an
intermediate network just discards packets whenever it smells congestion on the
horizon, many applications will break. Also, if packets can wander around
aimlessly for a while and then suddenly emerge and be delivered, trouble will
occur if this behavior was not anticipated and dealt with. Different security
mechanisms, parameter settings, and accounting rules, and even national privacy
laws also can cause problems.
. Let us briefly review that
material. In the physical layer, networks can be connected by repeaters or
hubs, which just move the bits from one network to an identical network. These
are mostly analog devices and do not understand anything about digital
protocols (they just regenerate signals).
One layer up we find bridges and
switches, which operate at the data link layer. They can accept frames, examine
the MAC addresses, and forward the frames to a different network while doing
minor protocol translation in the process, for example, from Ethernet to FDDI
or to 802.11.
In the network layer, we have
routers that can connect two networks. If two networks have dissimilar network
layers, the router may be able to translate between the packet formats,
although packet translation is now increasingly rare. A router that can handle
multiple protocols is called a multiprotocol router.
In the transport layer we find
transport gateways, which can interface between two transport connections. For
example, a transport gateway could allow packets to flow between a TCP network
and an SNA network, which has a different transport protocol, by essentially
gluing a TCP connection to an SNA connection.
Finally, in the application layer,
application gateways translate message semantics. As an example, gateways
between Internet e-mail (RFC 822) and X.400 e-mail must parse the e-mail
messages and change various header fields.
In this chapter we will focus on
internetworking in the network layer. To see how that differs from switching in
the data link layer, examine Fig. 5-44. In Fig. 5-44(a), the source machine, S, wants to
send a packet to the destination machine, D. These machines are on different
Ethernets, connected by a switch. S encapsulates the packet in a frame and
sends it on its way. The frame arrives at the switch, which then determines
that the frame has to go to LAN 2 by looking at its MAC address. The switch
just removes the frame from LAN 1 and deposits it on LAN 2.
Now let us consider the same
situation but with the two Ethernets connected by a pair of routers instead of
a switch. The routers are connected by a point-to-point line, possibly a leased
line thousands of kilometers long. Now the frame is picked up by the router and
the packet removed from the frame's data field. The router examines the address
in the packet (e.g., an IP address) and looks up this address in its routing
table. Based on this address, it decides to send the packet to the remote
router, potentially encapsulated in a different kind of frame, depending on the
line protocol. At the far end, the packet is put into the data field of an
Ethernet frame and deposited onto LAN 2.
An essential difference between the
switched (or bridged) case and the routed case is this. With a switch (or
bridge), the entire frame is transported on the basis of its MAC address. With
a router, the packet is extracted from the frame and the address in the packet
is used for deciding where to send it. Switches do not have to understand the
network layer protocol being used to switch packets. Routers do.
Two styles of internetworking are
possible: a connection-oriented concatenation of virtual-circuit subnets, and a
datagram internet style. We will now examine these in turn, but first a word of
caution. In the past, most (public) networks were connection oriented (and
frame relay, SNA, 802.16, and ATM still are). Then with the rapid acceptance of
the Internet, datagrams became fashionable. However, it would be a mistake to
think that datagrams are forever. In this business, the only thing that is
forever is change. With the growing importance of multimedia networking, it is
likely that connection-orientation will make a come-back in one form or another
since it is easier to guarantee quality of service with connections than
without them. Therefore, we will devote some space to connection-oriented
networking below
In the concatenated virtual-circuit
model, shown in Fig. 5-45, a connection to a host in a distant
network is set up in a way similar to the way connections are normally
established. The subnet sees that the destination is remote and builds a
virtual circuit to the router nearest the destination network. Then it
constructs a virtual circuit from that router to an external gateway (multiprotocol
router). This gateway records the existence of the virtual circuit in its
tables and proceeds to build another virtual circuit to a router in the next
subnet. This process continues until the destination host has been reached.
Once data packets begin flowing
along the path, each gateway relays incoming packets, converting between packet
formats and virtual-circuit numbers as needed. Clearly, all data packets must
traverse the same sequence of gateways. Consequently, packets in a flow are
never reordered by the network.
The essential feature of this approach
is that a sequence of virtual circuits is set up from the source through one or
more gateways to the destination. Each gateway maintains tables telling which
virtual circuits pass through it, where they are to be routed, and what the new
virtual-circuit number is.
This scheme works best when all the
networks have roughly the same properties. For example, if all of them
guarantee reliable delivery of network layer packets, then barring a crash
somewhere along the route, the flow from source to destination will also be
reliable. Similarly, if none of them guarantee reliable delivery, then the
concatenation of the virtual circuits is not reliable either. On the other
hand, if the source machine is on a network that does guarantee reliable
delivery but one of the intermediate networks can lose packets, the
concatenation has fundamentally changed the nature of the service.
Concatenated virtual circuits are
also common in the transport layer. In particular, it is possible to build a
bit pipe using, say, SNA, which terminates in a gateway, and have a TCP
connection go from the gateway to the next gateway. In this manner, an
end-to-end virtual circuit can be built spanning different networks and
protocols.
The alternative internetwork model
is the datagram model, shown in Fig. 5-46. In this model, the only service the
network layer offers to the transport layer is the ability to inject datagrams
into the subnet and hope for the best. There is no notion of a virtual circuit
at all in the network layer, let alone a concatenation of them. This model does
not require all packets belonging to one connection to traverse the same
sequence of gateways. In Fig. 5-46 datagrams from host 1 to host 2 are
shown taking different routes through the internetwork. A routing decision is
made separately for each packet, possibly depending on the traffic at the
moment the packet is sent. This strategy can use multiple routes and thus
achieve a higher bandwidth than the concatenated virtual-circuit model. On the
other hand, there is no guarantee that the packets arrive at the destination in
order, assuming that they arrive at all.
The model of Fig. 5-46 is not quite as simple as it looks. For
one thing, if each network has its own network layer protocol, it is not
possible for a packet from one network to transit another one. One could
imagine the multiprotocol routers actually trying to translate from one format
to another, but unless the two formats are close relatives with the same
information fields, such conversions will always be incomplete and often doomed
to failure. For this reason, conversion is rarely attempted.
A second, and more serious, problem
is addressing. Imagine a simple case: a host on the Internet is trying to send
an IP packet to a host on an adjoining SNA network. The IP and SNA addresses
are different. One would need a mapping between IP and SNA addresses in both
directions. Furthermore, the concept of what is addressable is different. In
IP, hosts (actually, interface cards) have addresses. In SNA, entities other
than hosts (e.g., hardware devices) can also have addresses. At best, someone
would have to maintain a database mapping everything to everything to the
extent possible, but it would constantly be a source of trouble.
Another idea is to design a
universal ''internet'' packet and have all routers recognize it. This approach
is, in fact, what IP is—a packet designed to be carried through many networks.
Of course, it may turn out that IPv4 (the current Internet protocol) drives all
other formats out of the market, IPv6 (the future Internet protocol) does not
catch on, and nothing new is ever invented, but history suggests otherwise.
Getting everybody to agree to a single format is difficult when companies
perceive it to their commercial advantage to have a proprietary format that
they control.
Let us now briefly recap the two
ways internetworking can be approached. The concatenated virtual-circuit model
has essentially the same advantages as using virtual circuits within a single
subnet: buffers can be reserved in advance, sequencing can be guaranteed, short
headers can be used, and the troubles caused by delayed duplicate packets can
be avoided.
It also has the same disadvantages:
table space required in the routers for each open connection, no alternate
routing to avoid congested areas, and vulnerability to router failures along
the path. It also has the disadvantage of being difficult, if not impossible,
to implement if one of the networks involved is an unreliable datagram network.
The properties of the datagram
approach to internetworking are pretty much the same as those of datagram
subnets: more potential for congestion, but also more potential for adapting to
it, robustness in the face of router failures, and longer headers needed.
Various adaptive routing algorithms are possible in an internet, just as they
are within a single datagram network.
A major advantage of the datagram
approach to internetworking is that it can be used over subnets that do not use
virtual circuits inside. Many LANs, mobile networks (e.g., aircraft and naval
fleets), and even some WANs fall into this category. When an internet includes
one of these, serious problems occur if the internetworking strategy is based
on virtual circuits.
Handling the general case of making
two different networks interwork is exceedingly difficult. However, there is a
common special case that is manageable. This case is where the source and
destination hosts are on the same type of network, but there is a different
network in between. As an example, think of an international bank with a
TCP/IP-based Ethernet in Paris, a TCP/IP-based Ethernet in London, and a non-IP
wide area network (e.g., ATM) in between, as shown in Fig. 5-47.
The solution to this problem is a
technique called tunneling. To send an IP packet to host 2, host 1 constructs
the packet containing the IP address of host 2, inserts it into an Ethernet
frame addressed to the Paris multiprotocol router, and puts it on the Ethernet.
When the multiprotocol router gets the frame, it removes the IP packet, inserts
it in the payload field of the WAN network layer packet, and addresses the
latter to the WAN address of the London multiprotocol router. When it gets
there, the London router removes the IP packet and sends it to host 2 inside an
Ethernet frame.
The WAN can be seen as a big tunnel
extending from one multiprotocol router to the other. The IP packet just
travels from one end of the tunnel to the other, snug in its nice box. It does
not have to worry about dealing with the WAN at all. Neither do the hosts on
either Ethernet. Only the multiprotocol router has to understand IP and WAN
packets. In effect, the entire distance from the middle of one multiprotocol
router to the middle of the other acts like a serial line.
An analogy may make tunneling
clearer. Consider a person driving her car from Paris to London. Within France,
the car moves under its own power, but when it hits the English Channel, it is
loaded into a high-speed train and transported to England through the Chunnel
(cars are not permitted to drive through the Chunnel). Effectively, the car is
being carried as freight, as depicted in Fig. 5-48. At the far end, the car is let loose
on the English roads and once again continues to move under its own power.
Tunneling of packets through a foreign network works the same way.
Routing through an internetwork is
similar to routing within a single subnet, but with some added complications.
Consider, for example, the internetwork of Fig. 5-49(a) in which five networks are connected
by six (possibly multiprotocol) routers. Making a graph model of this situation
is complicated by the fact that every router can directly access (i.e., send
packets to) every other router connected to any network to which it is
connected. For example, B in Fig. 5-49(a) can directly access A and C via
network 2 and also D via network 3. This leads to the graph of Fig. 5-49(b).
Once the graph has been constructed,
known routing algorithms, such as the distance vector and link state
algorithms, can be applied to the set of multiprotocol routers. This gives a
two-level routing algorithm: within each network an interior gateway protocol
is used, but between the networks, an exterior gateway protocol is used
(''gateway'' is an older term for ''router''). In fact, since each network is
independent, they may all use different algorithms. Because each network in an
internetwork is independent of all the others, it is often referred to as an Autonomous
System (AS).
A typical internet packet starts out
on its LAN addressed to the local multiprotocol router (in the MAC layer
header). After it gets there, the network layer code decides which
multiprotocol router to forward the packet to, using its own routing tables. If
that router can be reached using the packet's native network protocol, the
packet is forwarded there directly. Otherwise it is tunneled there,
encapsulated in the protocol required by the intervening network. This process
is repeated until the packet reaches the destination network.
One of the differences between
internetwork routing and intranetwork routing is that internetwork routing may
require crossing international boundaries. Various laws suddenly come into
play, such as Sweden's strict privacy laws about exporting personal data about
Swedish citizens from Sweden. Another example is the Canadian law saying that
data traffic originating in Canada and ending in Canada may not leave the
country. This law means that traffic from Windsor, Ontario to Vancouver may not
be routed via nearby Detroit, even if that route is the fastest and cheapest.
Another difference between interior
and exterior routing is the cost. Within a single network, a single charging
algorithm normally applies. However, different networks may be under different
managements, and one route may be less expensive than another. Similarly, the
quality of service offered by different networks may be different, and this may
be a reason to choose one route over another.
Each network imposes some maximum
size on its packets. These limits have various causes, among them:
- Hardware (e.g., the size of an Ethernet frame).
- Operating system (e.g., all buffers are 512 bytes).
- Protocols (e.g., the number of bits in the packet length field).
- Compliance with some (inter)national standard.
- Desire to reduce error-induced retransmissions to some level.
- Desire to prevent one packet from occupying the channel too long.
The result of all these factors is
that the network designers are not free to choose any maximum packet size they
wish. Maximum payloads range from 48 bytes (ATM cells) to 65,515 bytes (IP
packets), although the payload size in higher layers is often larger.
An obvious problem appears when a
large packet wants to travel through a network whose maximum packet size is too
small. One solution is to make sure the problem does not occur in the first
place. In other words, the internet should use a routing algorithm that avoids sending
packets through networks that cannot handle them. However, this solution is no
solution at all. What happens if the original source packet is too large to be
handled by the destination network? The routing algorithm can hardly bypass the
destination.
Basically, the only solution to the
problem is to allow gateways to break up packets into fragments, sending each
fragment as a separate internet packet. However, as every parent of a small
child knows, converting a large object into small fragments is considerably
easier than the reverse process. (Physicists have even given this effect a
name: the second law of thermodynamics.) Packet-switching networks, too, have
trouble putting the fragments back together again.
Two opposing strategies exist for
recombining the fragments back into the original packet. The first strategy is
to make fragmentation caused by a ''small-packet'' network transparent to any
subsequent networks through which the packet must pass on its way to the
ultimate destination. This option is shown in Fig. 5-50(a). In this approach, the small-packet
network has gateways (most likely, specialized routers) that interface to other
networks. When an oversized packet arrives at a gateway, the gateway breaks it
up into fragments. Each fragment is addressed to the same exit gateway, where
the pieces are recombined. In this way passage through the small-packet network
has been made transparent. Subsequent networks are not even aware that
fragmentation has occurred. ATM networks, for example, have special hardware to
provide transparent fragmentation of packets into cells and then reassembly of
cells into packets. In the ATM world, fragmentation is called segmentation; the
concept is the same, but some of the details are different.
Transparent fragmentation is
straightforward but has some problems. For one thing, the exit gateway must
know when it has received all the pieces, so either a count field or an ''end
of packet'' bit must be provided. For another thing, all packets must exit via
the same gateway. By not allowing some fragments to follow one route to the
ultimate destination and other fragments a disjoint route, some performance may
be lost. A last problem is the overhead required to repeatedly reassemble and
then refragment a large packet passing through a series of small-packet
networks. ATM requires transparent fragmentation.
The other fragmentation strategy is
to refrain from recombining fragments at any intermediate gateways. Once a
packet has been fragmented, each fragment is treated as though it were an
original packet. All fragments are passed through the exit gateway (or
gateways), as shown in Fig. 5-50(b). Recombination occurs only at the
destination host. IP works this way.
Nontransparent fragmentation also
has some problems. For example, it requires every host to be able to do
reassembly. Yet another problem is that when a large packet is fragmented, the
total overhead increases because each fragment must have a header. Whereas in
the first method this overhead disappears as soon as the small-packet network
is exited, in this method the overhead remains for the rest of the journey. An
advantage of nontransparent fragmentation, however, is that multiple exit
gateways can now be used and higher performance can be achieved. Of course, if
the concatenated virtual-circuit model is being used, this advantage is of no
use.
When a packet is fragmented, the
fragments must be numbered in such a way that the original data stream can be
reconstructed. One way of numbering the fragments is to use a tree. If packet 0
must be split up, the pieces are called 0.0, 0.1, 0.2, etc. If these fragments
themselves must be fragmented later on, the pieces are numbered 0.0.0, 0.0.1,
0.0.2, . . . , 0.1.0, 0.1.1, 0.1.2, etc. If enough fields have been reserved in
the header for the worst case and no duplicates are generated anywhere, this
scheme is sufficient to ensure that all the pieces can be correctly reassembled
at the destination, no matter what order they arrive in.
However, if even one network loses
or discards packets, end-to-end retransmissions are needed, with unfortunate
effects for the numbering system. Suppose that a 1024-bit packet is initially
fragmented into four equal-sized fragments, 0.0, 0.1, 0.2, and 0.3. Fragment
0.1 is lost, but the other parts arrive at the destination. Eventually, the
source times out and retransmits the original packet again. Only this time
Murphy's law strikes and the route taken passes through a network with a
512-bit limit, so two fragments are generated. When the new fragment 0.1
arrives at the destination, the receiver will think that all four pieces are
now accounted for and reconstruct the packet incorrectly.
A completely different (and better)
numbering system is for the internetwork protocol to define an elementary
fragment size small enough that the elementary fragment can pass through every
network. When a packet is fragmented, all the pieces are equal to the
elementary fragment size except the last one, which may be shorter. An internet
packet may contain several fragments, for efficiency reasons. The internet
header must provide the original packet number and the number of the (first)
elementary fragment contained in the packet. As usual, there must also be a bit
indicating that the last elementary fragment contained within the internet
packet is the last one of the original packet.
This approach requires two sequence
fields in the internet header: the original packet number and the fragment
number. There is clearly a trade-off between the size of the elementary
fragment and the number of bits in the fragment number. Because the elementary
fragment size is presumed to be acceptable to every network, subsequent
fragmentation of an internet packet containing several fragments causes no
problem. The ultimate limit here is to have the elementary fragment be a single
bit or byte, with the fragment number then being the bit or byte offset within
the original packet, as shown in Fig. 5-51.
Figure 5-51. Fragmentation when the elementary data size is
1 byte. (a) Original packet, containing 10 data bytes. (b) Fragments after
passing through a network with maximum packet size of 8 payload bytes plus
header. (c) Fragments after passing through a size 5 gateway.
Some internet protocols take this
method even further and consider the entire transmission on a virtual circuit
to be one giant packet, so that each fragment contains the absolute byte number
of the first byte within the fragment.
No comments:
Post a Comment
silahkan membaca dan berkomentar