MSc in Industrial Computing Systems Computer Communications Lecture 5. - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

MSc in Industrial Computing Systems Computer Communications Lecture 5.

Description:

1. A link is monopolised during transmission, thus holding up other messages ... 2. A node storage is monopolised if destination host is busy thus other messages ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 25
Provided by: compu354
Category:

less

Transcript and Presenter's Notes

Title: MSc in Industrial Computing Systems Computer Communications Lecture 5.


1
MSc in Industrial Computing SystemsComputer
CommunicationsLecture 5.
  • Lecturer Dr. David Al-Dabass
  • Room N315
  • Tel. 6015
  • email david.al-dabass_at_doc.ntu.ac.uk

2
FLOW CONTROL
SEQUENCE NUMBERING AND ACKNOWLEDGEMENTThree
main problems in controlling flow of
blocks/packets1. Receiver must maintain a
correct sequence of data in the information
unit (e.g. file) being received.2. Sender must
store blocks already sent until acknowledgement
is received, i.e. in NAK case re-send.3. Often
receiver gets data faster than it can handle it
-gt local storage is needed to hold data until
user at the receiving end can deal with them.
3
SOLUTION1. Maintain sequence by giving each
block a unique sequence number to be used by the
receiver to acknowledge receipt or otherwise of
that block.2. Send acknowledgement with data
block in reverse/return direction, i.e. no need
to have a block for the acknowledgement on its
own.3. The header of the data block has 2
numbers - The sequence number of the block
being sent (S ) and - The sequence number of
the block received (K), i.e. ACK is piggy-backed
on data block in the return direction. 4.
Each computer maintains 2 numbers - The
sequence number of the transmitted block (T)
and - The sequence number of the received block
(R).
4
Computer A
Computer B
? of Transmitted Block
? of Received Block
Sequence ? of this block
Sequence ? of ACK-ed block (as received from B)
Block Header
When A sends a block, it copies T into S
increments T, i.e. S T T T 1and
copies R into K K R5.1. When B receives a
block (with no errors) it compares S with its own
R if equal then sequencing is OK and increments
R.5.2. Receiver then compares K with its own T
if equal OK, otherwise send NAK.
5
EXAMPLE of sequence number operations
Computer A
Computer B
(K2 means B has received the 2 blocks sent by A)
.
Note sequence numbers of sent blocks S 0, 1,
2, sequence numbers of received blocks R 1,
2,
6
EXAMPLE of Error Recovery
Computer A
Computer B
.
Sequence Numbering Operations during Error
Recovery
7
Limits of the size of T, R, S, K. It is
important to keep track of a limited number of
blocks those already sent, received and
acknowledged can be forgotten.Size is limited
to a small number, e.g. 8 (0 7), which needs 3
bits in header to express it.But, remember,
block sequence numbers must recycle after
reaching MAX (7), i.e. sequence is 0, 1, 2, 3,
4, 5, 6, 7, 0, 1, 2, .Problem new blocks
must not have the same numbers as those not yet
acknowledged.Solution use WINDOW technique to
avoid errors.
window
Acknowledged blocks
Waiting to be transmitted blocks
Transmitted but not yet Acknowledged blocks
  • window size must be less than the cycle size of
    the sequence numbers.
  • when number of blocks sent, but not yet
    acknowledged window size sender stops waits
    for ACK to arrive before starting to send again
  • window moves forward after each acknowledgement
    is received.
  • receiver can briefly control rate of
    transmission by delaying acknowledgements, but
    not for long as sender may time-out or abort.

8
  • window size is determined by receiver buffer
    size i.e. amount of storage allocated for
    received blocks which can not be handled (used)
    immediately by the host.
  • window size determines buffer size of the
    sender i.e. blocks not yet acknowledged must be
    held in buffer for resending if necessary.

Notes on Error Recovery1. Blocks are discarded
when receiver detects an error. R is not
incremented which indicates receiver has not
accepted block.2. When next block arrives its
sequence number will not match R (received
blocks) receiver then sends a special (on its
own) negative acknowledgement (NAK) message with
KR to indicate the number of the last correctly
received block (note R is also the sequence
number of the rejected block) sender then
re-transmits that block AND all following blocks
(Go-Back-N)3. at the receiver received S
number is usually R4. if S ? R then the two
ends are out of synch5. similarly for K and T
received K is usually T, i.e. number of blocks
received by the other end (for which K is sent
back as ACK) is equal to the number of previously
transmitted blocks from this end6. if K ? T
then the two ends are out of synch.
9
Summary of Error and Flow Control1. Only
negative acknowledgements (NAKs) need special
messages, positive acknowledgements (ACK) are
piggy-backed on the data blocks going in reverse
direction.2. The above flow/error control
scheme is used in Continuous Repeat reQuest (CRQ)
methods with Go-Back-N.3. For Idle R-Q
transmission schemes, a cycle of 2 (modulo 2)
system is used for sequence numbering.4.
Sequencing ACK are also used for short data
blocks (some only 8 bit (1 byte) long. In this
case the message contains several blocks, with
the message header having the sequence number of
the 1st byte only, i.e. not every byte in the
message is numbered individually.
10
Questions1. What are the 3 problems of
transmitting data in blocks?2. How many
variables are used in block number
sequencing?3. With the aid of a diagram,
explain how 2 computers exchange data in
blocks.4. Use the register pairs T, R, and S, K
to explain how a computer receiving data blocks
recovers from error.5. Block sequence numbers
are usually restricted to some small maximum,
which may lead to more than one block having the
same number the window technique overcomes this
problem. Explain.6. Discuss the effect of the
window technique on the buffer size at the sender
and the receiver nodes. How is the window size
related to the cycle size of the sequence
numbers?7. How are positive acknowledgments
(ACK) and negative acknowledgments (NAK) handled?
11
Elements of Computer Networks - 1Historically,
only very large/powerful computers were connected
to networks communication protocols were so
complex that only the fastest machines had the
spare CPU capacity to handle them.Now1. PCs
have powerful microprocessors which can handle
fairly complicated protocols2. cheap LSI chips
make it easy to have dedicated communication
processors.Wide Area Networks - a network
that covers a whole country or larger area. -
it uses dedicated circuits rates gtgt 64
kB/sExamples Packet Switched Service (PSS)
BT ARPA net Advanced Research Projects Agency
networks also DARPA Defence ARPA (US
DoD) TYMNET TELENET
12
How do we connect computers together?a) with 2
machines it is easy a bi-directional linkb)
more than 2 simplest method fully
interconnected network.
Weaknesses1. very costly as number of machines
increase 2. each machine doesnt need to
communicate with every other machine all of the
time i.e. lines will be idle most of the time.
Answerreduce number of lines have special
switching techniques to emulate full
inter-connectivity.
13
Circuit switchingConnect each machine via a
dedicated line to a local exchange (which is
part of an exchange network) and let it do the
switching of lines to establish a physical link
between any pair of computers, i.e. like PSTN.
2 lines are needed to talk to more than 1
computer at a time
Computer A
Computer B
Weaknesses1. Takes long time to setup
connections (often a few seconds)2. Cost of
exchange and lines are very high.3. Each
computer can talk to only one computer at any one
time, without breaking the connection making a
new one otherwise extra dedicated lines between
computer and exchange are needed.
14
STRENGTHS of Circuit Switching1. for short
connection durations at infrequent
intervals make use of the PSTN because of the
low cost 2 modems plus the cost of the call.2.
well suited for long duration connections between
2 machines, i.e. when the effects of weakness 1
3 are insignificant, e.g. for 10 minutes
connection between 2 sites, the few seconds
set-up time (weakness 1) is negligible and the
fact that only 2 machines are involved eliminates
weakness 3.
Message SwitchingAvoid the disadvantages of
physical circuit switching by having a small
number of permanent links and switching the data
(to be communicated) through them.
(DCE)
link
a
b
Host(DTE)
o - node
Computer
c
d
Message from A to B must pass through either d or
c o-nodes.Message header must contain its
destination address.
15
Method of operation - A sends its message
through the link to d node. - d examines the
message destination address and passes the
message to b, i.e. switches the message to a
link which leads to B.Two features1.
Addressing destination node address is included
in the message.2. Receive, Store and Forward
the node has a protocol program to process the
message as follows - receive whole message
store locally - check message for errors -
identify its destination address by processing
its header - decide which output link it
should be sent along if there are more than
one - determine the output link that leads to
the shortest route to the destination - more
intelligent message switching algorithm stores
knowledge about routes immediate past workload
(i.e. how many messages have I sent along routes
Ri, Rj, Rk during the previous second) and
decides whether it would be quicker to send this
message along a longer but may be faster route.
16
Example
Message Destination D
Node X
Node X may decide to send the message via route
BC rather than A if it has knowledge that A will
be busy when it receives the message.Nodes are
mini-computer based and operate in real-time to
handle the switching of messages.
17
Questions1. What are wide area networks? Give
two examples.2. What is Circuit Switching? What
are its strengths and weaknesses?3. Give an
example well suited to Circuit Switching.4.
What is Message Switching?5. What does a node
do when it receives a message?5. Does a node
always send a message along the shortest route to
its destination? Discuss with respect to the
additional information needed by the node and
outline a program structure for the node.
18
Characteristics Of Message Switching1.
Complete interconnectivity without direct
physical links2. One machine can address a
number of other machines without additional lines
of equipment3. No circuit set-up delays but
some delay as message passes through nodes
(receive/store/forward) PLUS protocol
delay..(ACK, error check etc) special
protocol delays e.g. local node negotiating for
network resource of time and circuits before
sending messages.
Strengths Of Message Switching1. Message can
be sent even when receiver is busy node storage
holds message until receiving Host is
ready.However node storage may run out causing
old messages to be lost by being overwritten by
new ones protocols usually guard against such
events.2. Different hosts may send receive
messages at different rates according to their
current workloads.3. Broadcast of one to many
is easily achieved.4. Efficient use of
equipment idle time of lines is minimised by
nodes switching messages away from busy links to
even out the communications workload.5.
Priority is easily achieved by attaching
appropriate tag to urgent messages.
19
Weaknesses Of Message SwitchingWhen messages
are very long several problems occur1. A link
is monopolised during transmission, thus holding
up other messages (which may be more urgent).2.
A node storage is monopolised if destination host
is busy thus other messages can not get
through.3. Messages can not be stored if larger
than available node storage, therefore get lost.
20
Packet SwitchingNeed a communications scheme
to cope with any message regardless of how long
(or short) it is.1. Break message into
packets - header of overall message is part of
1st packet - each packet has its own header.
Header
Data
Message level
Packet level
2. Send packets individually into the
network.3. Receiver re-assembles packets into
original messagePacket switching is the most
popular technique for computer communication.
21
Advantages over Message Switching1. as packet
is small it eliminates all the problems of long
messages2. packets are inter-leaved
(pipe-lined) so they can (in many cases) arrive
at their destination faster than long messages.
Intermediate node
Destination node
Source node
1st link
2nd link
d delay intermediate node
3k
1st link
time for whole message to arrive
3k
3k
d
2nd link
k
k
k
1st link
d
2nd link
time for whole message to arrive in destination
node 4k d
22
Disadvantages of Packet Switching1. Introduces
another layer of complexity in the software
between the user application and the link
circuits between nodes.2. More overheads are
involved, each packet has its own header,
therefore less efficient.Example ARPA
message 8K bits
Host
IMP
Interface Message Processor (IMP)


up to 4
up to 4


1K bits
Host
Destination IMP re-assembles 1K bits long packets
into 1 message passes it to Destination Host
IMP
1. Messages gt 8K bits Host breaks down to 8K
bits2. Message-To-Packet mapping can take
place at 2 levels Host level 1K bytes (8K
bits) IMP level 1K bits (128 bytes)3.
Destination Host re-assembles messages which are
gt 1K bytes.
23
4. Packets go through different routes depending
on the instantaneous optimum path often reaching
destination IMP out of sequence IMP re-assembles
into original (source Host/IMP)
sequenceExample Packet Switched Service (PSS)
Host
Exchanges
Exchange has Node processor


Partially inter-connected

Host
X25/X400 protocol
As many as needed to cope with hosts attached to
this exchange
1. Exchange receives from Host the destination
address of destination Host.2. Network routes
the call to the destination exchange.3. Once
call has been established Hosts exchange their
own data, i.e. very similar to Circuit Switching,
but uses packets to transfer data.
24
Questions1. Explain the term Receive, Store,
Forward and discuss two characteristics of
Message Switching.2. Discuss the advantages of
Message Switching over Circuit Switching.3.
Explain why message length can cause problems in
data communications.4. Explain with the aid of
a diagram and an example why messages get to
their destinations faster when sent in
packets.5. Messages pass through IMPs between
hosts in the ARPA net use a diagram to explain
it.6. The PSS network operates differently to
the ARPA net explain, then compare and contrast
the two.
Write a Comment
User Comments (0)
About PowerShow.com