0% found this document useful (0 votes)
20 views32 pages

CCN-Module - 18

The document discusses techniques for managing data transmission over unreliable communication channels, focusing on pipelining and error handling strategies such as go-back-n and selective repeat. Go-back-n requires the receiver to discard all frames after a lost or damaged frame, while selective repeat allows for buffering of subsequent frames, improving efficiency. The document also covers the network layer's role in packet switching, connection-oriented and connectionless services, and the establishment of virtual circuits for efficient routing.

Uploaded by

abdulhazma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views32 pages

CCN-Module - 18

The document discusses techniques for managing data transmission over unreliable communication channels, focusing on pipelining and error handling strategies such as go-back-n and selective repeat. Go-back-n requires the receiver to discard all frames after a lost or damaged frame, while selective repeat allows for buffering of subsequent frames, improving efficiency. The document also covers the network layer's role in packet switching, connection-oriented and connectionless services, and the establishment of virtual circuits for efficient routing.

Uploaded by

abdulhazma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

 The technique of keeping multiple frames in flight

is an example of pipelining.
 Pipelining frames over an unreliable
communication channel raises some serious issues.
First, what happens if a frame in the middle of a
long stream is damaged or lost?

 Large numbers of succeeding frames will arrive at


the receiver before the sender even finds out that
anything is wrong.

 When a damaged frame arrives at the receiver, it


obviously should be discarded, but what should the
receiver do with all the correct frames following it?
The receiving data link layer is obligated to hand
packets to the network layer in sequence.
 One option, called go-back-n, is for the receiver
simply to discard all subsequent frames, sending no
acknowledgements for the discarded frames.

 This strategy corresponds to a receive window of size


1. In other words, the data link layer refuses to accept
any frame except the next one it must give to the
network layer.

 If the sender’s window fills up before the timer runs


out, the pipeline will begin to empty. Eventually, the
sender will time out and retransmit all unacknowledged
frames in order, starting with the damaged or lost one.

This approach can waste a lot of bandwidth if the error


rate is high.
 Go-back-n for the case in which the receiver’s window
is large. Frames 0 and 1 are correctly received and
acknowledged. Frame 2, however, is damaged or lost.

 The sender, unaware of this problem, continues to


send frames until the timer for frame 2 expires. Then it
backs up to frame 2 and starts over with it, sending 2,
3, 4, etc. all over again.

 The other general strategy for handling errors when


frames are pipelined is called selective repeat. When it
is used, a bad frame that is received is discarded, but
any good frames received after it are accepted and
buffered.

 When the sender times out, only the oldest


unacknowledged frame is retransmitted.
 If that frame arrives correctly, the receiver can deliver
to the network layer, in sequence, all the frames it has
buffered.

 Selective repeat corresponds to a receiver window


larger than 1. This approach can require large amounts
of data link layer memory if the window is large.

 Selective repeat is often combined with having the


receiver send a negative acknowledgement (NAK) when
it detects an error, for example, when it receives a
checksum error or a frame out of sequence. NAKs
stimulate retransmission before the corresponding
timer expires and thus improve performance.
 In (b), frames 0 and 1 are again correctly received and
acknowledged and frame 2 is lost. When frame 3 arrives at
the receiver, the data link layer there notices that it has
missed a frame, so it sends back a NAK for 2 but buffers 3.
 When frames 4 and 5 arrive, they, too, are buffered by the
data link layer instead of being passed to the network layer.

 Eventually, the NAK 2 gets back to the sender, which


immediately resends frame 2.

 When that arrives, the data link layer now has 2, 3, 4, and 5
and can pass all of them to the network layer in the correct
order.

 It can also acknowledge all frames up to and including 5, as


shown in the figure. If the NAK should get lost, eventually
the sender will time out for frame 2 and send it (and only it)
of its own accord, but that may be a quite a while later.
 The selective repeat protocol, is to allow the
receiver to accept and buffer the frames following a
damaged or lost one.

 In this protocol, both sender and receiver maintain


a window of outstanding and acceptable sequence
numbers, respectively.

 The sender’s window size starts out at 0 and grows


to some predefined maximum. The receiver’s
window, in contrast, is always fixed in size and
equal to the predetermined maximum.

 The receiver has a buffer reserved for each


sequence number within its fixed window.
 Whenever a frame arrives, its sequence number is
checked by the function between to see if it falls
within the window.

 If so and if it has not already been received, it is


accepted and stored. This action is taken without
regard to whether or not the frame contains the next
packet expected by the network layer.

 Of course, it must be kept within the data link layer


and not passed to the network layer until all the
lower-numbered frames have already been delivered
to the network layer in the correct order.
 Initially, the sender’s and receiver’s windows are as
shown in Fig. (a). The sender now transmits frames 0
through 6.

 The receiver’s window allows it to accept any frame


with a sequence number between 0 and 6
inclusive. All seven frames arrive correctly, so the
receiver acknowledges them and advances its
window to allow receipt of 7, 0, 1, 2, 3, 4, or 5, as
shown in Fig. (b).

 All seven buffers are marked empty. It is at this point


that disaster strikes in the form of a lightning bolt
hitting the telephone pole and wiping out all the
acknowledgements.
 The protocol should operate correctly despite this
disaster. The sender eventually times out and
retransmits frame 0.

 When this frame arrives at the receiver, a check is


made to see if it falls within the receiver’s window.

 Unfortunately, in Fig. 3-22(b) frame 0 is within the


new window, so it is accepted as a new frame. The
receiver also sends a (piggybacked)
acknowledgement for frame 6, since 0 through 6
have been received.

 The sender is happy to learn that all its transmitted


frames did actually arrive correctly, so it advances its
window and immediately sends frames 7, 0, 1, 2, 3,
4, and 5.
 Frame 7 will be accepted by the receiver and its
packet will be passed directly to the network layer.

 Immediately thereafter, the receiving data link layer


checks to see if it has a valid frame 0 already,
discovers that it does, and passes the old buffered
packet to the network layer as if it were a new
packet.

 To ensure that there is no overlap, the maximum


window size should be at most half the range of the
sequence numbers. This situation is shown in Fig. (c)
and Fig. (d).

 With 3 bits, the sequence numbers range from 0 to


7. Only four unacknowledged frames should be
outstanding at any instant.
 That way, if the receiver has just accepted frames 0
through 3 and advanced its window to permit
acceptance of frames 4 through 7, it can
unambiguously tell if subsequent frames are
retransmissions (0 through 3) or new ones (4
through 7).

 In general, the window size for protocol 6 will be


(MAX SEQ + 1)/2.
 The network layer is concerned with getting packets
from the source all the way to the destination.
Getting to the destination may require making many
hops at intermediate routers along the way.

 The network layer is the lowest layer that deals with


end-to-end transmission. To achieve its goals, the
network layer must know about the topology of the
network (i.e., the set of all routers and links) and
choose appropriate paths through it, even for large
networks.

 It must also take care when choosing routes to avoid


overloading some of the communication lines and
routers while leaving others idle.

 Finally, when the source and destination are in


different networks, new problems occur. It is up to
the network layer to deal with them.
• Store-and-Forward Packet Switching.
• Services Provided to the Transport Layer.
• Implementation of Connectionless Service.
• Implementation of Connection-Oriented Service.
• Comparison of Virtual-Circuit and Datagram
Subnets.
 The major components of the network are the ISP’s
equipment (routers connected by transmission
lines), shown inside the shaded oval, and the
customers’ equipment, shown outside the oval.

 Host H1 is directly connected to one of the ISP’s


routers, A, perhaps as a home computer that is
plugged into a DSL modem. In contrast, H2 is on a
LAN, which might be an office Ethernet, with a
router, F, owned and operated by the customer.

 This router has a leased line to the ISP’s


equipment.
 This equipment is used as follows. A host with a
packet to send transmits it to the nearest router,
either on its own LAN or over a point-to-point link
to the ISP.
 The packet is stored there until it has fully arrived
and the link has finished its processing by verifying
the checksum.

 Then it is forwarded to the next router along the


path until it reaches the destination host, where it
is delivered. This mechanism is store-and-forward
packet switching
 The network layer provides services to the
transport layer at the network layer/transport layer
interface

 Services the network layer provides to the transport


layer are carefully designed with the following
goals in mind:

 1. The services should be independent of the


router technology.
 2. The transport layer should be shielded from the
number, type, and topology of the routers present.
 3. The network addresses made available to the
transport layer should use a uniform numbering
plan, even across LANs and WANs.
 Two different organizations are possible, depending on the
type of service offered. If connectionless service is offered,
packets are injected into the network individually and
routed independently of each other. No advance setup is
needed.

 In this context, the packets are frequently called datagrams


(in analogy with telegrams) and the network is called a
datagram network.

 If connection-oriented service is used, a path from the


source router all the way to the destination router must be
established before any data packets can be sent. This
connection is called a VC (virtual circuit), in analogy with
the physical circuits set up by the telephone system, and
the network is called a virtual-circuit network.
 In a datagram network works, Suppose that the
process P1 as in Fig. has a long message for P2. It
hands the message to the transport layer, with
instructions to deliver it to process P2 on host H2.

 The transport layer code runs on H1, typically within


the operating system. It prepends a transport header
to the front of the message and hands the result to
the network layer, probably just another procedure
within the operating system.

 Assume for this example 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 send each of them in turn to router A using
some point-to-point protocol, for example, PPP.
 Every router has an internal table telling it where to
send packets for each of the possible destinations.
 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, A has only two outgoing lines—


to B and to C—so every incoming packet must be sent
to one of these routers, even if the ultimate
destination is to some other router.

 A’s initial routing table is shown in the figure under


the label ‘‘initially.’’
 At A, packets 1, 2, and 3 are stored briefly, having
arrived on the incoming link and had their checksums
verified.

 Then each packet is forwarded according to A’s table,


onto the outgoing link to C within a new frame. Packet
1 is then forwarded to E and then to F.

 When it gets to F, it is sent within a frame over the


LAN to H2. Packets 2 and 3 follow the same route.

 something different happens to packet 4. When it gets


to A it is 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 packets.
 At A, packets 1, 2, and 3 are stored briefly, having
arrived on the incoming link and had their checksums
verified.

 Then each packet is forwarded according to A’s table,


onto the outgoing link to C within a new frame. Packet
1 is then forwarded to E and then to F.

 When it gets to F, it is sent within a frame over the


LAN to H2. Packets 2 and 3 follow the same route.

 something different happens to packet 4. When it gets


to A it is 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 packets.
 For connection-oriented service, we need a virtual-
circuit network. The idea behind virtual circuits is to
avoid having to choose a new route for every packet
sent, as in Fig.

 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 in the fig, host H1 has established connection 1
with host H2. This connection 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.

 If H3 also wants to establish a connection to H2. It


chooses connection identifier 1 (because it is initiating
the connection and this is its only connection) and
tells the network to establish the virtual circuit. This
leads to the second row in the tables.
 As in the fig, host H1 has established connection 1
with host H2. This connection 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.

 If H3 also wants to establish a connection to H2. It


chooses connection identifier 1 (because it is initiating
the connection and this is its only connection) and
tells the network to establish the virtual circuit. This
leads to the second row in the tables.
 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 process is called label
switching.

You might also like