CN Lecture 21
CN Lecture 21
COMPUTER NETWORKS
•
Let us assume that the message is four times longer than the maximum packet size, so the network layer has to break it
into four packets, 1, 2, 3, and 4 and sends each of them in turn to router A using some point-to-point protocol, for example,
PPP.
At this point the carrier takes over. Every router has an internal table telling it where to send packets for each possible
destination. Each table entry is a pair consisting of a destination and the outgoing line to use for that destination.
Only directly-connected lines can be used. For example, in Fig. 5-2, A has only two outgoing lines—to B and C—so every
incoming packet must be sent to one of these routers, even if the ultimate destination is some other router. A's initial
routing table is shown in the figure under the label ''initially.''
However, something different happened to packet 4. When it got to A it was sent to router B, even though it is also
destined for F. For some reason, A decided to send packet 4 via a different route than that of the first three.
Perhaps it learned of a traffic jam somewhere along the ACE path and updated its routing table, as shown under the label
''later.'' The algorithm that manages the tables and makes the routing decisions is called the routing algorithm.
4. Implementation of Connection-
Oriented Service
•
For connection-oriented service, we need a virtual-circuit subnet. The idea behind virtual circuits is to avoid having to choose a new route for every
packet sent, as in Fig. 3-2.
Instead, when a connection is established, a route from the source machine to the destination machine is chosen as part of the connection setup and
stored in tables inside the routers. That route is used for all traffic flowing over the connection, exactly the same way that the telephone system
works.
When the connection is released, the virtual circuit is also terminated. With connection-oriented service, each packet carries an identifier telling
which virtual circuit it belongs to. As an example, consider the situation of Fig. 3-3. Here, host H1 has established connection 1 with host H2.
It is remembered as the first entry in each of the routing tables. The first line of A's table says that if a packet bearing connection identifier 1 comes
in from H1, it is to be sent to router C and given connection identifier 1. Similarly, the first entry at C routes the packet to E, also with connection
identifier 1.
Figure 3-3. Routing within a virtual-circuit subnet.
•
Now let us consider what happens if H3 also wants to establish a connection to H2. It chooses connection identifier 1 and tells the subnet to establish
the virtual circuit. This leads to the second row in the tables.
Note that we have a conflict here because although A can easily distinguish connection 1 packets from H1 from connection 1 packets from H3, C
cannot do this. For this reason, A assigns a different connection identifier to the outgoing traffic for the second connection.
Avoiding conflicts of this kind is why routers need the ability to replace connection identifiers in outgoing packets. In some contexts, this is called
label switching.
5. Comparison of Virtual-Circuit and
Datagram Subnets
• Both virtual circuits and datagrams have their
supporters and their detractors. We will now
attempt to summarize the arguments both
ways. The major issues are listed in Fig. 3-4,
although purists could probably find a
counterexample for everything in the figure.