Data Communication and Networks (PDFDrive)
Data Communication and Networks (PDFDrive)
CIT 852:
DATA COMMUNICATION AND NETWORK
CIT 852 DATA COMMUNICATION AND NETWORK
COURSE
GUIDE
CIT 852
DATA COMMUNICATION AND NETWORK
ii
CIT 852 DATA COMMUNICATION AND NETWORK
Abuja Office
5, Dar Es Salaam Street
Off Aminu Kano Crescent
Wuse II, Abuja
Nigeria.
e-mail: [email protected]
URL: www.nou.edu.ng
Published by
National Open University of Nigeria
Printed 2008
ISBN: 978-058-378-5
iii
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS PAGE
Introduction…………………………………………………….. 1
What You Will Learn in this Course …………………….……. 1
Course Aims …………………………………………………… 1
Course Objectives ……………………………………………... 1
Working through this Course ………………………………….. 2
Course Materials ………………………………………………. 2
Study Units …………………………………………………….. 2
Textbooks and References …………………………………….. 3
Assignment File ……………………………………………….. 4
Presentation Schedule …………………………………………. 4
Assessment …………………………………………………….. 4
Tutor-Marked Assignment ……………………………………... 5
Final Examination and .Grading ………………………………... 5
Course Marking Scheme ……………………………………….. 6
Course Overview ……………………………………………….. 6
How to Get the Best from this Course ………………………… 7
Facilitators/Tutors and Tutorials ………………………………. 8
Summary ……………………………………………………….. 9
Introduction
CIT 852 -Data Communication and Networks is a three [3] credit unit
course of 16 units. The main objective of the course is to deal with
fundamental issues in Computer Networks. It starts with the philosophy
of data communication covering different modulation and multiplexing
techniques. Then, it proceeds to cover MAC layer protocols, several
routing techniques protocols, congestion techniques and several network
layer protocol. The final module of the course takes up issues related to
the transport layer mechanism, such as, addressing, connection,
establishment, flow control and multiplexing issues. It also covers the
transport layer protocol in details. The module ends with the security
issue, which is an important topic today.
This Course Guide gives you a brief overview of the course content,
course duration, and course materials.
Course Aims
iv
CIT 852 DATA COMMUNICATION AND NETWORK
Course Objectives
Certain objectives have been set out to ensure that the course achieves
its aims. Apart from the course objectives, every unit of this course has
set objectives. In the course of the study, you will need to confirm, at the
end of each unit, if you have met the objectives set at the beginning of
each unit. By the end of this course you should be able to:
v
CIT 852 DATA COMMUNICATION AND NETWORK
Course Materials
These include:
1. Course Guide
2. Study Units
3. Recommended Texts
4. A file for your assignments and for records to monitor your
progress.
Study Units
There are sixteen study units in this course:
vi
CIT 852 DATA COMMUNICATION AND NETWORK
Assignments File
These are of two types: the self-assessment exercises and the Tutor-
Marked Assignments. The self-assessment exercises will enable you
monitor your performance by yourself, while the Tutor-Marked
Assignment is a supervised assignment. The assignments take a certain
percentage of your total score in this course. The Tutor-Marked
Assignments will be assessed by your tutor within a specified period.
The examination at the end of this course will aim at determining the
level of mastery of the subject matter. This course includes twelve
Tutor-Marked Assignments and each must be done and submitted
accordingly. Your best scores however, will be recorded for you. Be
sure to send these assignments to your tutor before the deadline to avoid
loss of marks. .
vii
CIT 852 DATA COMMUNICATION AND NETWORK
Presentation Schedule
Assessment
There are two aspects to the assessment of the course. First are the tutor
marked assignments; second, is a written examination.
At the end of the course, you will need to sit for a final three-hour
examination. This will also count for 70% of your total course mark.
There are sixteen tutor marked assignments in this course. You need to
submit all the assignments. The total marks for the best four (4)
assignments will be 30% of your total course mark.
Assignment questions for the units in this course are contained in the
Assignment File. You should be able to complete your assignments
from the information and materials contained in your set textbooks,
reading and study units. However, you may wish to use other references
to broaden your viewpoint and provide a deeper understanding of the
subject.
When you have completed each assignment, send it together with form
to your tutor. Make sure that each assignment reaches your tutor on or
before the deadline given. If, however, you cannot complete your work
on time, contact your tutor before the assignment is due to discuss the
possibility of an extension.
The final examination for the course will carry 70% percentage of the
total marks available for this course. The examination will cover every
viii
CIT 852 DATA COMMUNICATION AND NETWORK
aspect of the course, so you are advised to revise all your corrected
assignments before the examination.
This course endows you with the status of a teacher and that of a learner.
This means that you teach yourself and that you learn, as your learning
capabilities would allow. It also means that you are in a better position
to determine and to ascertain the what, the how, and the when of your
language learning. No teacher imposes any method of learning on you.
The course units are similarly designed with the introduction following
the table of contents, then a set of objectives and then the dialogue and
so on.
The objectives guide you as you go through the units to ascertain your
knowledge of the required terms and expressions.
ix
CIT 852 DATA COMMUNICATION AND NETWORK
Assessment Marks
Assignment 1-4 Four assignments, best three marks of the
four count at 30% of course marks
Final examination 70% of overall course marks
Total 100% of course marks
Course Overview
x
CIT 852 DATA COMMUNICATION AND NETWORK
In distance learning the study units replace the university lecturer. This
is one of the great advantages of distance learning; you can read and
work through specially designed study materials at your own pace, and
at a time and place that suit you best. Think of it as reading the lecture
instead of listening to a lecturer. In the same way that a lecturer might
set you some reading to do, the study units tell you when to read your
set books or other material. Just as a lecturer might give you an in-class
exercise, your study units provide exercises for you to do at appropriate
points.
Each of the study units follows a common format. The first item is an
introduction to the subject matter of the unit and how a particular unit is
integrated with the other units and the course as a whole. Next is a set of
learning objectives. These objectives enable you know what you should
be able to do by the time you have completed the unit. You should use
these objectives to guide your study. When you have finished the units
you must go back and check whether you have achieved the objectives.
If you make a habit of doing this you will significantly improve your
chances of passing the course.
Remember that your tutor's job is to assist you. When you need help,
don't hesitate to call and ask your tutor to provide it.
4. Turn to Unit 1 and read the introduction and the objectives for the
unit.
xi
CIT 852 DATA COMMUNICATION AND NETWORK
6. Work through the unit. The content of the unit itself has been
arranged to provide a sequence for you to follow. As you work
through the unit you will be instructed to read sections from your
set books or other articles. Use the unit to guide your reading.
7. Review the objectives for each study unit to confirm that you
have achieved them. If you feel unsure about any of the
objectives, review the study material or consult your tutor.
10. After completing the last unit, review the course and prepare
yourself for the final examination. Check that you have achieved
the unit objectives (listed at the beginning of each unit) and the
course objectives (listed in this Course Guide).
Your tutor will mark and comment on your assignments, keep a close
watch on your progress and on any difficulties you might encounter and
provide assistance to you during the course. You must mail or submit
your tutor-marked assignments to your tutor well before the due date (at
east two working days are required). They will be marked by your tutor
and returned to you as soon as possible.
xii
CIT 852 DATA COMMUNICATION AND NETWORK
you do not understand any part of the study units or the assigned
readings,
you have difficulty with the self-tests or exercises,
you have a question or problem with an assignment, with your tutor's
comments on an assignment or with the grading of an assignment.
You should try your best to attend the tutorials. This is the only chance
to have face to face contact with your tutor and to ask questions which
are answered instantly. You can raise any problem encountered in the
course of your study. To gain the maximum benefit from course
tutorials, prepare a question list before attending them. You will learn a
lot from participating in discussions actively.
Summary
I wish you success with the course and hope that you will find it both
interesting and useful.
xiii
CIT 852 DATA COMMUNICATION AND NETWORK
xiv
CIT 852 DATA COMMUNICATION AND NETWORK
Abuja Office
5, Dar Es Salaam Street
Off Aminu Kano Crescent
Wuse II, Abuja
Nigeria.
e-mail: [email protected]
URL: www.nou.edu.ng
Published by
National Open University of Nigeria
Printed 2008
ISBN: 978-058-378-5
xv
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS PAGE
xvi
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENT
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 What is a Computer Network?
3.2 Network Goals and Motivations
3.3 Classification of Networks
3.3.1 Broadcast Networks
3.3.2 Point-to-Point or Switched Networks
3.4 work Topology
3.4.1 Bus Topology
3.4.2 Star Topology
3.4.3 Ring Topology
3.4.4 Tree Topology
3.4.5 Mesh Topology
3.4.6 Cellular Topology
3.5 Applications of Network
3.6 Networking Model
3.6.1 OSI Reference Model
3.6.2 TCP/IP Reference Model
3.7 Network Architecture
3.7.1 Client/Server Architecture
3.7.2 Peer-lo-Peer Architecture
3.8 Example Networks
3.8.1 Novell Netware
3.8.2 ARPANET
3.8.3 Internet
3.8.4 ATM Network
3.9 Types of Computer Networks
3.9.1 Metropolitan Area Network (MAN)
3.9.2 Wide Area Network (WAN)
3.9.3 Comparison between LAN, MAN, WAN and GAN
3.10 Advantages of Networks
4.0 Conclusion
1
CIT 852 DATA COMMUNICATION AND NETWORK
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
Towards t4e end of this unit the concept of Delays in computer networks
is also discussed.
2.0 OBJECTIVES
2
CIT 852 DATA COMMUNICATION AND NETWORK
3
CIT 852 DATA COMMUNICATION AND NETWORK
Some of the basic goals that a Computer network should satisfy are:
4
CIT 852 DATA COMMUNICATION AND NETWORK
Broadcast networks.
5
CIT 852 DATA COMMUNICATION AND NETWORK
time slot comes up. This method is inefficient because the channel
capacity is wasted when a machine has nothing to broadcast during its
allocated slot.
2) Satellite Networks.
6
CIT 852 DATA COMMUNICATION AND NETWORK
Topology
Protocols
The rules and encoding specifications for sending data. The protocols
also determine whether the network uses peer-to-peer or client/server
architecture.
Media
LANs are capable of transmitting data at very fast rates, much faster
than data can be transmitted over a telephone line; but the distances are
limited, and there is also a limit on the number of computers that can be
attached to a single LAN.
High speed.
7
CIT 852 DATA COMMUNICATION AND NETWORK
8
CIT 852 DATA COMMUNICATION AND NETWORK
The first international standard for wide area packet switching networks
was X.25, which was defined when all circuits were digited and
susceptible to noise. Subsequent technologies, such as frame relay and
SMDS were designed for today’s almost-error-free digital lines.
Bus topology
Star topology
Ring topology
Tree topology
Mesh topology
Cellular topology.
9
CIT 852 DATA COMMUNICATION AND NETWORK
In Bus topology, all devices are connected to a central cable, called the
bus or backbone. The bus topology connects workstations using a single
cable. Each workstation is connected to the next workstation in a point-
to-point fashion. All workstations connect to the same cable. Figure 2
shows computers connected using Bus Topology.
10
CIT 852 DATA COMMUNICATION AND NETWORK
Start topology uses a central hub through which, all components are
connected. In a Star topology, the central hub is the host computer, and
at the end of each connection is a terminal as shown in Figure 3.
An advantage of the star topology is, that failure, in one of the terminals
does not affect any other terminal; however, failure of the central hub
affects all terminals. This type of topology is frequently used to connect
terminals to a large time-sharing host computer.
11
CIT 852 DATA COMMUNICATION AND NETWORK
In Ring Topology all devices are connected to one another in the shape
of a closed loop, so that each device is connected directly to two other
devices, one on either side of it, i.e., the ring topology connects
workstations in a closed loop, which is depicted in Figure 4 Each
terminal is connected to two other terminals (the next and the previous),
with the last terminal being connected to the first. Data is transmitted
around the ring in one direction only; each station passing on the data to
the next station till it reaches its destination.
Information travels around the ring from one workstation to the next.
Each packet of data sent on the ring is prefixed by the address of the
station to which it is being sent. When a packet of data arrives, the
workstation checks to see if the packet address is the same as its own, if
it is, it grabs the data in the packet. If the packet does not belong to it, it
sends the packet to the next workstation in the ring.
Faulty workstations can be isolated from the ring. When the workstation
is powered on, it connects itself to the ring. When power is off, it
disconnects itself from the ring and allows the information to bypass the
workstation.
The common implementation of this topology is token ring. A break in
the ring causes the entire network to fail. Individual workstations can be
isolated from the ring.
12
CIT 852 DATA COMMUNICATION AND NETWORK
13
CIT 852 DATA COMMUNICATION AND NETWORK
14
CIT 852 DATA COMMUNICATION AND NETWORK
It is robust.
Cellular topology, divides the area being serviced into cells. In wireless
media each point transmits in a certain geographical area called a cell,
each cell represents a portion of the total network area. Figure 7 shows
computers using Cellular Topology. Devices that are present within the
cell, communicate through a central hub. Hubs in different cells are
interconnected and hubs are responsible for routing data across the
network. They provide a complete network infrastructure. Cellular
topology is applicable only incase of wireless media that does not
require cable connection.
15
CIT 852 DATA COMMUNICATION AND NETWORK
When a hub fails, all devices serviced by the hub lose service (are
affected).
Person-to-person communication.
Interactive entertainment.
16
CIT 852 DATA COMMUNICATION AND NETWORK
These days, many newspapers and digital libraries are available online
and allow users to access news and information which is of interest to
them. Another application is the World Wide Web, which contains
information about a wide variety of subjects like health, sports, science,
recreation, history, government etc.
Person-to-person Communication
Interactive Entertainment
17
CIT 852 DATA COMMUNICATION AND NETWORK
concern the layer in question and not worry about the architecture in a
macro sense.
Data are not directly transferred from layer-n on one computer to layer-n
on another computer. Rather, each layer passes data and control
information to the layer directly below until the lowest layer is reached.
Below layer-1 (the bottom layer), is the physical medium (the hardware)
through which the actual transaction takes place. In Figure 8 logical
communication is shown by a broken-line arrow and physical
communication by a solid-line arrow.
18
CIT 852 DATA COMMUNICATION AND NETWORK
19
CIT 852 DATA COMMUNICATION AND NETWORK
developed by the ISO and other standards bodies. The OSI model
divides the tasks involved with moving information between networked
computers into seven smaller, more manageable task groups. A task or
group of tasks is then assigned to each of the seven OSI layers. Each
layer is reasonably self-contained so that the tasks assigned to each layer
can be implemented independently. This enables the solutions offered
by one layer to be updated without affecting the other layers.
The OSI model is modular. Each successive layer of the OSI model
works with the one above and below it.
Although, each layer of the OSI model provides its own set of functions,
it is possible to group the layers into two distinct categories. The first
four layers i.e., physical, data link, network, and transport layer provide
the end-to-end services necessary for the transfer of data between two
systems. These layers pr9.f1de the protocols associated with the
communications network used to link two computers together. Together,
these are communication oriented.
The top three layers i.e., the application, presentation, and session layers
provide the application services required for the exchange of
information. That is, they allow two applications, each running on a
different node of the network to interact with each other through the
services provided by their respective operating systems. Together, these
are data processing oriented.
The following are the seven layers of the Open System Interconnection
(OSI) reference model:
20
CIT 852 DATA COMMUNICATION AND NETWORK
21
CIT 852 DATA COMMUNICATION AND NETWORK
If data is sent incorrectly, this layer has the responsibility of asking for
retransmission of the data. Specifically, it provides a network-
independent, reliable message-independent, reliable message-
interchange service to the top three application-oriented layers. This
layer acts as an interface between the bottom and top three layers. By
providing the session layer (layer 5) with a reliable message transfer
service, it hides the detailed operation of the underlying network from
the session layer.
The network layer establishes the route between the sending and
receiving stations. The unit of data at the network layer is called a
packet. It provides network routing and flow and congestion functions
across computer-network interface.
The data link layer groups the bits that we see on the Physical layer into
Frames. It is primarily responsible for error-free delivery of data on a
hop. The Data link layer is split into two sub-layers i.e., the Logical
Link Control (LLC) and Media Access Control (MAC).
22
CIT 852 DATA COMMUNICATION AND NETWORK
The main network device found at the Datalink layer is a bridge. This
device works at a higher layer than the repeater and therefore is a more
complex device. It has some understanding of the data it receives and
can make a decision based on the frames it receives as to whether it
needs to let the information pass, or can remove the information from
the network. This means that the amount of traffic on the medium can be
reduced and therefore, the usable bandwidth can be increased.
The data units on this layer are called bits. This layer defines the
mechanical and electrical definition of the network medium (cable) and
network hardware. This includes how data is impressed onto the cable
and retrieved from it.
The physical layer is responsible for passing bits onto and receiving
them from the connecting medium. This layer gives the data-link layer
(layer 2) its ability to transport a stream of serial data bits between two
communicating systems; it conveys the bits that moves along the cable.
It is responsible for ensuring that the raw bits get from one place to
another, no matter what shape they are in, and deals with the mechanical
and electrical characteristics of the cable.
This layer has no understanding 01 the meaning of the bits, but deals
with the electrical and mechanical characteristics of the signals and
signalling methods.
The main network device found the Physical layer is a repeater. The
purpose of a repeater (as the name suggests) is simply to receive the
digital signal, reform it, and retransmit the signal. This has the effect of
increasing the maximum length of a network, which would not be
possible due to signal deterioration if, a repeater were not available. The
repeater, simply regenerates cleaner digital signal so it doesn’t have to
understand anything about the information it is transmitting, and
processing on the repeater is non-existent.
Each layer, with the exception of the physical layer, adds information to
the data as it travels from the Application layer down to the physical
layer. This extra information is called a header. The physical layer does
not append a header to information because it is concerned with sending
and receiving information on the individual bit level.
We see that the data for each layer consists of the header and data of the
next higher layer. Because the data format is different at each layer,
23
CIT 852 DATA COMMUNICATION AND NETWORK
different terms are commonly used to name the data package at each
level. Figure 10 summarises these terms layer by layer.
OSI Protocols
24
CIT 852 DATA COMMUNICATION AND NETWORK
The data frames are finally transmitted to the physical layer. In the
physical layer, the data is in the fond of a stream of bits and this is
placed on the physical network medium and is sent across the medium
to System B.
B receives the bits at its physical layer and passes them on to the Data
link layer, which verifies that no error has occurred. The Network layer
ensures that the route selected for transmission is reliable, and passes the
25
CIT 852 DATA COMMUNICATION AND NETWORK
The data is then passed to the Presentation layer, which mayor may not
reformat it to suit the environment of B and sends it to the Application
layer. Finally the Application layer of System B passes the information
to the recipient Application program to complete the communication
process.
A given layer in the OSI layers generally communicates with three other
OSI layers: the layer directly above it, the layer directly below it, and its
Peer layer in another networked computer system. The data link layer in
System A, for example, communicates with the network layer of System
A, the physical layer of System A, and the data link layer in System B.
One OSI layer communicates with another layer to make use of the
services provided by the second layer. The services provided by
adjacent layers help a given OSI layer communicate with its peer layer
in other computer systems. Three basic elements are involved inlayer
services: the service user, the service provider, and the service access
point (SAP).
In this context, the service user is the OSI layer .that requests services
from an adjacent OSI layer. The service provider is the OSI layer that
provides services to service users. OSI layers can provide services to
multiple service users. The SAP is a conceptual location at which one
OSI layer can request the services of another OSI layer.
26
CIT 852 DATA COMMUNICATION AND NETWORK
Headers, trailers, and data are relative concepts, depending on the layer
that analyses the information unit. At the network layer, an information
unit, for example, consists of a Layer 3 header and data. At the data link
layer, however, all the information passed down by the network layer
(the Layer 3 header and the data) is treated as data. In other words, the
data portion of an information unit at a given OSI layer potentially can
contain headers, trailers, and data from all the higher layers. This is
known as encapsulation.
APPLCIATION LAYER
TRANSPORT LAYER
NETWORK LAYER
LINK/PHYSICAL LAYER
TCP/IP is a layered protocol similar to the ones used in all the other
major networking architectures, including IBM’s SNA, Windows’
NetBIOS, Apple’s AppleTalk, Novell’s NetWare and Digital’s DECnet.
The different layers of the TCP/IP reference model are shown in Figure
13. Layering means that after an application initiates the
communications, the message (data) to be transmitted is passed through
a number of stages or layers until it actually moves out onto the wire.
The data are packaged with a different header at each layer. At the
receiving end, the corresponding programs at each protocol layer unpack
the data, moving it “back up the stack” to the receiving application.
27
CIT 852 DATA COMMUNICATION AND NETWORK
The top layer of the protocol stack is the application layer. It refers to
the programs that initiate communication in the first place. TCP/IP
includes several application layer protocols for mail, file transfer, remote
access, authentication and name resolution. These protocols are
embodied in programs that operate at the top layer just as any custom-
made or packaged client/server application would.
There are many Application Layer protocols and new protocols are
always being developed.
The most widely known Application Layer protocols are those used for
the exchange of user information, some of them are:
28
CIT 852 DATA COMMUNICATION AND NETWORK
TCP/IP does not contain Presentation and Session layers, the services
are performed if required, but they are not part of the formal TCP/IP
stack. For example, Layer 6 (Presentation Layer) is where data
conversion (ASCII to EBCDIC, floating point to binary, etc,) and
encryption/decryption is performed, Layer 5 is the Session Layer, which
is performed in layer 4 in TCP/IP, Thus, we jump from layer 7 of OS I
down to layer 4 of TCP/IP.
The core protocols of the Transport Layer are TCP and the User
Datagram Protocol (UDP).
29
CIT 852 DATA COMMUNICATION AND NETWORK
The Internet Layer is analogous to the Network layer of the OSI model.
30
CIT 852 DATA COMMUNICATION AND NETWORK
The Network Interface Layer encompasses the Data Link and Physical
layers of the OSI Model. Note, that the Internet Layer does not take
advantage of sequencing and acknowledgement services that may be
present in the Data Link Layer. An unreliable Network Interface Layer
is assumed, and reliable communications through session establishment
and the sequencing and acknowledgement of packets is the
responsibility of the Transport Layer.
Both OSI and TCP/IP reference models are based on the concept of a
stack of protocols. The functionality of the layers is almost similar. In
both models the layers are there to provide an end-to-end network-
independent transport service to processes wishing to communicate with
each other.
31
CIT 852 DATA COMMUNICATION AND NETWORK
The OSI reference model was devised before the OSI protocols were
designed. The OSI model was not biased toward one particular set of
protocols, which made it quite general. The drawback of this ordering is
that the designers did not have much experience with the subject, and
did not have a good idea of the type of functionality to put in a layer.
With TCP/IP the reverse was true: the protocols carne first and the
model was really just a description of the existing protocols. There was
no problem with the protocols fitting the model. The only drawback was
that the model did not fit any other protocol stacks.
32
CIT 852 DATA COMMUNICATION AND NETWORK
33
CIT 852 DATA COMMUNICATION AND NETWORK
The client contains the user interface and may perform some or all of the
application processing. Servers can be high-speed microcomputers,
minicomputers or even mainframes. A database server maintains the
databases and processes requests from the client to extract data from or
update the database. An application server provides additional business
processing for the clients.
Non-client/server
34
CIT 852 DATA COMMUNICATION AND NETWORK
Two-tier client/server
Three-tier client/server
35
CIT 852 DATA COMMUNICATION AND NETWORK
design and the people who use them user communities). Here we shall
discuss some of the popular networks, such as, Novell NetWare,
ARPANET, Internet, ATM network etc.
Dedicated file server runs only NetWare and do not run any other
software, such as Windows application. Dedicated file servers are
mostly used in large networks, because, in large networks, one extra
client is less significant and a dedicated server can handle a larger
number of requests more efficiently. In large networks security is one of
the major concerns 3J1d providing a clear distinction between client and
server hardware provides greater security.
Non-dedicated File Server
There are many other servers within a Novell NetWare such as, Print
server, Message server, Database server etc.
36
CIT 852 DATA COMMUNICATION AND NETWORK
Print server
The job of the Print server is to allow users to access shared printers. A
Print server manages both requests and printers.
37
CIT 852 DATA COMMUNICATION AND NETWORK
Here, the Session and Presentation layers do not exist. The Application
layer contains various application protocols like SAP, File server etc.
3.8.2 Arpanet
Once these smaller networks were connected to the backbone, they were
in effect connected to each other.
38
CIT 852 DATA COMMUNICATION AND NETWORK
Because of the success of the NSFNET, plans were made to phase out
ARPANET. Many of the sites connected to ARPANET were absorbed
by the NSFNE’t and in 1990 ARPANET was officially dissolved.
3.8.3 Internet
The internet is said to have been “officially” born around 1982 when the
different networks (BITNET, EARN, etc.) agreed on using the TCP/IP
protocol as a standard for their interconnections making it a network of
networks and overcoming some of the previous cacophony of standards,
protocols and increasing its coverage.
The word Internet was coined from the words “interconnection” and
“network”, Now Internet is the world’s largest computer network. It is
considered to be the network of networks, and is scattered allover the
world. The computers connected to the Internet may communicate with
each other using fiber optic cables, telephone lines, satellite links and
other media.
39
CIT 852 DATA COMMUNICATION AND NETWORK
The Internet Protocol (IP) gives the physical 32-bit address, which
uniquely identifies an individual computer connected to the Internet,
while Transmission Control Protocol (TCP) is a connection-oriented
protocol, which takes care of the delivery and order of the packages.
TCP also provides the port numbers for individual services within a
computer.
The major information services provided by the Internet are (with the
protocol in parentheses): electronic mail (SMTP), remote file copying
(FTP), remote login, terminal connections (TELNET), menu-based file
access (GOPHER), wide area information servers (W AIS, Z39.50), the
World Wide Web (HlTP), and the Packet Internet Groper (PING).
There are three major ways to connect your computer to the Internet:
Switched circuits are not permanent. They exist only for the duration of
the connection and are switched by the public network (it connects the
circuits). Switched dial-up lines are not generally suited to data
transmission, but are used heavily for some types of services (e.g.,
Bulletin Boards). Using a modem, a user can use their phone line to dial
up a network provider via the phone line and connect to the Internet. At
present speeds upto 56Kbps are possible over standard dial up telephone
circuits.
40
CIT 852 DATA COMMUNICATION AND NETWORK
Leased Lines
Let’s say you want to pay a visit to the IGNOU’s website. First, you
enter the address or URL of the website in your web browser (more
about this in a while). Then your browser requests the web page from
the web server. The IGNOU’s server sends the data over the Internet to
your computer. Your web browser interprets the data and displays it on
your computer screen.
The glue that holds the Web together is called hypertext and hyperlinks.
This feature allows electronic files on the Web to be linked so that you
can easily jump between them. On the Web you can navigate through
41
CIT 852 DATA COMMUNICATION AND NETWORK
ATM technology is used for both local and wide area networks (LANs
and WANs) that support real-time voice and video as well as data. The
topology uses switches that establish a logical circuit from end to end,
which guarantees quality of service (QoS). However, unlike telephone
switches that dedicate circuits end-to-end, unused bandwidth in ATM’s
logical circuits can be utilised when needed. For example, idle
bandwidth in a videoconference circuit can be used to transfer data.
42
CIT 852 DATA COMMUNICATION AND NETWORK
Advantages of ATM
Disadvantages of ATM
43
CIT 852 DATA COMMUNICATION AND NETWORK
44
CIT 852 DATA COMMUNICATION AND NETWORK
Resource Sharing
45
CIT 852 DATA COMMUNICATION AND NETWORK
High Reliability
Saving Money
Scalability
Communication Medium
Increased Productivity
46
CIT 852 DATA COMMUNICATION AND NETWORK
one person can handle accounts receivable, and someone else processes
the profit-and-loss statements.
4.0 CONCLUSION
In this introductory unit, you have learnt about the basic concepts of
Computer Networks. You have not only learnt about Networks, but also
about the different types of Networks, their applications, Network
Topology Network protocols, OST reference mode and the TCP/IP
reference model which is the most commonly used on the Internet today.
Also, the importance of the network protocols and the importance of
using networked system have been extensively discussed.
5.0 SUMMARY
In this unit we have learnt about the basic concepts of Networking. Here
we discussed the different types of networks and the difference between
them. Computer networks are basically classified as LAN, MAN, WAN
depending on the geographical distance covered and depending on the
various ways of interconnecting computers in a network (network
topology) like Star, Bus, Ring, Tree, Mesh and cellular topologies.
We have seen the immense benefits that the computer networks provide
in the form of excellent sharing of computational resources,
computational load, increased level of reliability, economy and efficient
person-to-person communication. Here we have briefly explained some
of the network protocols which define a common set of rules and signals
that computers on the network use to communicate with each other.
47
CIT 852 DATA COMMUNICATION AND NETWORK
48
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Data Communication Terminology
3.1.1 Channel
3.1.2 Baud
3.1.3 Bandwidth
3.1.4 Frequency
3.2 Modes of Data Transmission
3.2.1 Serial and Parallel Communication
3.2.2 Synchronous, Asynchronous and Isochronous
Communication
3.2.3 Simplex, Half Duplex and Full Duplex
Communication
3.3 Analog and Digital Data Transmission
3.4 Transmission Impairments
3.4.1 Attenuation
3.4.2 Delay Distortion
3.4.3 Noise
3.4.4 Concept of Delays
3.5 Transmission Media and its Characteristics
3.5.1 Magnetic media
3.5.2 Twisted Pair
3.5.3 Baseband Coaxial Cable
3.5.4 Broadband Coaxial Cable
3.5.5 Optical Fiber
3.5.6 Comparison between Optical Fiber and Copper
wire
3.6 Wireless Transmission
3.6.2 Microwave Transmission
3.6.2 Radio Transmission
3.6.3 Infrared and Millimeter Waves
3.7 Wireless LAN
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
49
CIT 852 DATA COMMUNICATION AND NETWORK
of information from the sender to the receiver. The transfer of data from
one machine to another machine such that, the sender and the receiver
both interpret the data correctly is known as Data Communication.
2.0 OBJECTIVES
The transfer of data from one machine to another machine such that, the
sender and the receiver both interpret the data correctly is known as
Data Communication.
3.1.1 Channel
50
CIT 852 DATA COMMUNICATION AND NETWORK
3.1.2 Baud
3.1.3 Bandwidth
The amount of data or signals that the transmission media can carry in a
fixed amount of time is called Bandwidth. The Bandwidth depends upon
the length, media and signaling technique used. A high bandwidth
allows increased throughput and better performance. A medium that has
a high capacity has a high bandwidth. A medium that has limited
capacity has a low bandwidth. It is calculated using the difference
between the highest and the lowest frequencies that the medium can
carry. For digital devices, the bandwidth is usually expressed in bits per
second (bps) or bytes per second. For analog devices, the bandwidth is
expressed in cycles per second, or Hertz (Hz).
51
CIT 852 DATA COMMUNICATION AND NETWORK
3.1.4 Frequency
Serial communication.
Parallel communication.
Serial Communication
In Serial data transmission, bits are transmitted serially, one after the
other, as shown in Figure J. The least significant bit (LSB) is usually
transmitted first. While sending data serially, characters or bytes have to
52
CIT 852 DATA COMMUNICATION AND NETWORK
Parallel Communication
Asynchronous Communication
53
CIT 852 DATA COMMUNICATION AND NETWORK
Synchronous Communication
Isochronous Communication
Asynchronous Communication
1) A start bit: Signals the starting a frame and enables the receiving
device to synchronise itself with the message.
54
CIT 852 DATA COMMUNICATION AND NETWORK
As start, stop and parity bits must be added to each character that
is to be transmitted, this adds a high overhead to transmission.
This wastes the bandwidth; as a result, asynchronous
transmission is undesirable for transmitting large amounts of
data.
Synchronous Communication
Sync signals, generally utilise a bit pattern that cannot appear elsewhere
in the messages, ensuring that they will always be distinct and easy for
the receiver to recognise. As the transmitter and receiver remain in
synchronisation for the duration of the transmission, frames can be of
longer length.
As frames are longer the parity method of error detection is not suitable
because, if multiple bits are affected, then, the parity technique will not
report error accurately. Hence, the technique used with synchronous
transmission is the Cyclic Redundancy Check (CRC).
An end bit pattern indicates the end of the frame. Like sync the bit
pattern for end is such that, it will not appear elsewhere in the messages,
ensuring that they will always be distinct and easy for the receiver to
recognise at the end of the frame.
55
CIT 852 DATA COMMUNICATION AND NETWORK
Isochronous Communication
56
CIT 852 DATA COMMUNICATION AND NETWORK
Simplex.
Half Duplex
Full Duplex, sometimes called Duplex.
Simplex
Half Duplex
57
CIT 852 DATA COMMUNICATION AND NETWORK
Half duplex refers to two-way communication where, only one party can
transmit data at a time. Unlike, the Simplex mode here, both devices can
transmit data though, not at the same time, that is Half duplex provides
Simplex communication in both directions in a single channel as shown
in Figure 4. When one device is sending data, the other device must
only receive it and vice versa. Thus, both sides take turns at sending
data. This requires a definite turn around time during which, the device
changes from the receiving mode to the transmitting mode. Due to this
delay, half duplex communication is slower than simplex
communication. However, it is more convenient than simplex
communication as both the devices can send and receive data.
Most modems contain a switch that lets you select between half-duplex
and full-duplex modes. The correct choice depends on which program
you are using to transmit data through the modem.
Full Duplex
58
CIT 852 DATA COMMUNICATION AND NETWORK
Most modems have a switch that lets you choose between full-duplex
and half-duplex modes. The choice depends on which communications
program you are running.
We know that the two major types of signals are Analog and Digital.
The manner in which these two types of signals can be transmitted from
source to destination is of the same two types that is:
Analog Signal
59
CIT 852 DATA COMMUNICATION AND NETWORK
attenuation that the signal suffers on its way. The drawback is that
amplifiers amplify noise along with the original signal and hence, if the
signal gets distorted, it cannot be reconstructed and it is a permanent
loss. Due to this reason, this type of transmission is not used where a
high level of accuracy is needed. This is used in telephony where a
slight distortion in human communication does not matter.
The ability to capture the subtle nature of the real world is the single
advantage of analog techniques. However, once captured, modern
electronic equipment, no matter how advanced, cannot copy analog
signals perfectly. Third and fourth generations of audio and video
recordings show marked deterioration.
60
CIT 852 DATA COMMUNICATION AND NETWORK
When information, music, voice and video are turned into binary digital
form, they can be electronically manipulated, preserved and regenerated
perfectly at high speed. The millionth copy of a computer file is exactly
the same as the original. This is, nevertheless, a major advantage of
digital processing.
Attenuation.
Delay distortion.
Noise.
3.4.1 Attenuation
If the attenuation is high, the receiver may not be able to detect the
signal at all, or the signal may fall below the noise level. In many cases,
the attenuation properties of a medium are known, so amplifiers can be
put in place to try to compensate for the frequency-dependent
attenuation. This approach helps but can never restore the signal exactly
back to its original shape.
61
CIT 852 DATA COMMUNICATION AND NETWORK
3.4.3 Noise
A large delay is disastrous for data transfer. The total delay can be
categorised into two types. The first type is fixed delay. This is the total
delay which is always present due to buffering, link capacity etc. The
second type is variable delay. This is the delay component which is
caused by packets queuing in the routers, congestions etc. Among the
different types of delays, here, we shall discuss Transmission delay and
Propagation delay.
62
CIT 852 DATA COMMUNICATION AND NETWORK
Transmission delay
Propagation delay is the time between the last bit transmitted at the head
node of the link and the time the last bit is received at the tail node. This
is proportional to the physical distance between the transmitter and the
receiver; it can be relatively substantial, particularly for a satellite link or
a very high-speed link.
One of the most common ways to transport data from one computer to
another is to write them onto magnetic tape or floppy disks, physically
transport the tape or disks to the destination machine, and read them
back in again. While, this method is not as sophisticated as using a
63
CIT 852 DATA COMMUNICATION AND NETWORK
Twisted pairs can be used for either analog or digital transmission. The
bandwidth depends on the thickness of the wire and the distance
travelled, but several megabits/sec can be achieved for a few kilometers
in many cases.
64
CIT 852 DATA COMMUNICATION AND NETWORK
65
CIT 852 DATA COMMUNICATION AND NETWORK
bit stream to an analog signal, and the incoming analog signal to a bit
stream. Depending on the type of electronics, 1 bps may occupy
roughly, 1 Hz of bandwidth. At higher frequencies, many bits per Hz are
possible using advanced modulation techniques.
Fiber optic cable is made of fine strands of silicon glass fiber (thinner
than a human hair), and is coated with a refractive surface. The signals
are converted to light pulses before being sent. When light (provided by
a laser or LED) is show into the strand, it travels along the fiber strand
(the refractive layer prevents it from escaping). Each fiber optic strand
can support thousands of speech channels and multiple TV channels
simultaneously. It is used for long haul telecommunications links, for
providing high-speed data communications links for computers, and
information services to homes (e.g., PAY TV).
costly,
difficult to join, and
expensive to install and greater skill is required.
66
CIT 852 DATA COMMUNICATION AND NETWORK
Optical fiber has many advantages over copper wire. The advantages
are:
Optical fiber can handle much higher bandwidths than copper wire. Due
to the low attenuation, repeaters are needed only about every 30 km on
long lines, whereas, copper wires require repeaters every 5 km, which, is
substantial sayings in cost. Optical fiber also has the advantage of not
being affected by power surges, electromagnetic interference, or power
failures. Neither, is it affected by corrosive chemicals in the air, making
it ideal for harsh factory environments.
Finally, optical fibers do not leak light and are quite difficult to tap. This
gives them excellent security against potential wire trappers.
67
CIT 852 DATA COMMUNICATION AND NETWORK
The reason that optical fiber is better than copper wire is inherent in
underlying physics. When electrons move in a wire, they affect one
another and are themselves affected by electrons outside the wire.
Photons in a fiber do not affect one another (they have no electric
charge) and are not affected by stray photons outside the fiber.
Radio wave,
Microwave, and
Infrared.
68
CIT 852 DATA COMMUNICATION AND NETWORK
Above 100 MHz, the waves travel in straight lines and can therefore, be
narrowly focused upon. Concentrating all the energy into a small beam,
using a parabolic antenna (like the familiar satellite TV dish) gives a
much higher signal to noise ratio, but the transmitting and receiving
antennas must be accurately aligned with each other. In addition, this
directionality allows, multiple transmitters lined up in a row to
communicate with multiple receivers in a row without interference.
Before fiber optics, microwaves formed the heart of long distance
telephone transmission system.
Since, microwaves travel in straight lines, if, the towers are too far apart,
the earth will get in the way. Consequently, repeaters are needed
periodically. The higher the towers are, the further apart they can be.
The distance between repeaters increases roughly, with the square root
of the tower height. For 100-m high towers, repeaters can be spaced 80
km apart.
69
CIT 852 DATA COMMUNICATION AND NETWORK
medium capacity,
medium cost, and
can go long distances.
noise interference,
geographical problems due to line of sight requirements, and
becoming outdated.
Terrestrial Microwave
70
CIT 852 DATA COMMUNICATION AND NETWORK
Satellite Microwave
As all signals must travel 36,000 miles to the satellite and 36,000 miles
when returning to the receiver, the time required to transmit a signal is
independent of the distance. The time required for the signal to arrive at
its destination is called propagation delay. The delay encountered with
satellite transmissions is about 0.5 seconds.
71
CIT 852 DATA COMMUNICATION AND NETWORK
Satellite links operate in the low-giga hertz range, typically at 4-6 GHz.
Attenuation depends on transmitter power, frequency and atmospheric
conditions. Rain and atmospheric conditions may cause attenuation at
higher frequencies.
Short wave,
VHF (Very High Frequency) used for television and FM radio,
and
UHF (Ultra High Frequency) used for television.
Radio waves are easy to generate, can travel long distances, and
penetrate buildings easily, so they are widely used for communication,
both indoors and outdoors. Radio waves also are omni directional,
meaning that they travel in all directions from the source, so that the
transmitter and receiver do not have to be carefully aligned physically
and that the signal can be received by all the radios within the broadcast
area.
Unguided infrared and millimeter waves are widely used for short-range
communication. The remote controls used on televisions, VCR’s, and
stereos all use infrared communication. The remote control transmits
pulses of infrared light that carry coded instructions to the receiver on
the TV. They are relatively directional, cheap, and easy to build, but
72
CIT 852 DATA COMMUNICATION AND NETWORK
they have a major drawback, that is, they do not pass through solid
objects (try standing between your remote control and your television
and see if it still works). In general, as we go from long-wave radio
toward visible light, the waves behave more and more like light and less
and less like radio.
Infrared waves do not pass through solid walls well, as a result of which,
an Infrared system in one room of a building, will not interfere with a
similar system in adjacent rooms, which is a great advantage. Due to this
nature, security of infrared systems against eavesdropping is better than
that of radio systems. Because of these reasons, no government license
is needed to operate an infrared system, in contrast to radio systems,
which must be licensed.
These properties have made infrared suitable for indoor wireless LANS.
For example, the computers and offices in a building can be equipped
with relatively unfocused (i.e., somewhat omni directional), infrared
transmitters and receivers. In this way, portable computers with infrared
capability can be on the local LAN without having to physically connect
to it. During a meeting where several people use their portables, they
can just sit down in the conference room and be fully connected, without
having to plug in. Infrared communication cannot be used outdoors
because the sun shines as brightly in the infrared as in the visible
spectrum.
Point-to-point
High power laser transmitters can be used in order to transmit data for
several thousand yards when the line of sight communication is
possible.
The cost of Point-to-point infrared equipment is higher than the cost for
a comparable cabled network. When systems use transmitters that are
based on LED technology and hardware cost is moderate, but, when
long distance systems use high powered laser transmitters then the cost
is very high.
73
CIT 852 DATA COMMUNICATION AND NETWORK
Broadcast Infrared
When the receiver is within the range of two active transmitters, the
resulting signal will usually be grab led and hence, useless.
74
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
5.0 SUMMARY
We also discussed the two major types of signals that is Analog and
Digital and, the manner in which these two types of signals can be
transmitted from the source to the destination.
When, data is transmitted from the source to the destination, there is,
always a scope for transmission errors and the data may not reach in
exactly the same form as it was sent. We have seen that these
transmission errors are classified into three main categories that is Delay
distortion, Attenuation and Noise. Delay distortion is caused because,
signals at different frequencies, travel at different speeds along the
transmission medium. As the signal travels along the transmission
medium, its strength decreases over distance, this is known as
Attenuation. Usually, some unwanted electromagnetic energy gets
inserted during the course of transmission and this is called Noise. The
concept of Delays and how to reduce them were also discussed.
75
CIT 852 DATA COMMUNICATION AND NETWORK
media uses physical cable for data transmission. Twisted pair, co-axial
cable and optical fiber are the three main types of guided media; they
differ in their physical characteristics as well as transmission capacities.
In case of unguided media, the transmission medium is air. Unguided
media can be Radio, Microwave or Infrared. Security is a major concern
when using unguided media for transmission.
Towards the end, Wifeless LAN’s were also discussed. Here, we saw
that Wireless LAN’s make use of Radio transmission and their main
objective is to provide high speed communication among computers that
are located in relatively close proximity. In the next unit, we will be
studying, the different Data encoding and communication techniques.
76
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Encoding
3.2 Analog to Analog Modulation
3.3 Analog to Digital Modulation
3.4 Digital to Analog Modulation
3.5 Digital to Digital Encoding
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
You might be aware from the description in the previous blocks, how
data is transmitted through a channel (wired or wireless) in the form of
an analog or digital signal. In this unit, we will elaborate on the
techniques to produce these types of signals from analog or digital data.
We will look at, in brief, on the following encoding techniques
[Figure1]:
77
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
3.1 Encoding
You know that there are two kinds of signals: analog and digital.
Likewise, there are two types of information that we may want to
transmit, again analog and digital. So, we get four basic combinations of
78
CIT 852 DATA COMMUNICATION AND NETWORK
Let us first look at a situation where our signal and information are both
of the analog type. The act of charging or encoding the information in
the signal is known as modulation. A good example of such encoding is
radio broadcasting. Here we primarily want to send sound in some form
over the atmosphere to the receiving radio gets. The sound is converted
into an analog electrical signal at the source and is used to encode the
signal which is the base frequency at which the transmission is being
done. The reverse process is performed at the radio set to recover the
information in electrical form, which is then converted back to sound so
that, we hear what was being said at the radio station.
79
CIT 852 DATA COMMUNICATION AND NETWORK
Therefore, there are three different ways in which this encoding of the
analog signal with analog information is performed. These methods are:
Amplitude Modulation
Now, let us go into the details. In this type of modulation the frequency
and phase of the carrier or base signal are not altered. Only the
amplitude changes and we can see that the information is contained in
the envelope of the carrier signal. It can be proud/demonstrated that, the
bandwidth of the composite signal is twice that of the highest frequency
in the information signal that modulates the carrier.
80
CIT 852 DATA COMMUNICATION AND NETWORK
AM Bandwidth
Frequency Modulation
This method is the less susceptible to noise and gives the best
performance of all data encoding types as far as the quality of the
transmitted signal is concerned. Although digital encoding methods may
give better performance over multiple hops (because in their case, the
original signal can be accurately reconstructed at each hop), Frequency
Modulation (PM) is the best as far as single hop transmission goes.
81
CIT 852 DATA COMMUNICATION AND NETWORK
Phase Modulation
82
CIT 852 DATA COMMUNICATION AND NETWORK
Natural phenomena are analog in nature and can take on any of the
potentially infinite number of values. For example, the actual
frequencies contained in a sound made by a human is an analog signal,
as is the amplitude or loudness of the sound. One example of coding
analog data in digital form is when, we want to record sound on digital
media such as a DVD or in other forms such as MP3 or as a “.wav” file.
Here, the analog signal, that is, the musical composition or the human
voice is encoded in digital form. This is an example of analog to digital
encoding.
The first step in PCM is, to convert the analog signal into a series of
pulses (Figure 3). This is called Pulse Amplitude Modulation (PAM).
To do this the analog signal is sampled at fixed intervals and the
amplitude at each sample decides the amplitude of that pulse. You can
see that at this step, the resulting signal is still actually an analog signal
because the pulse can have any amplitude, equal to the amplitude of the
original signal at the time the sample was taken. In PAM, the sampled
value is held for a small time so that the pulse has a finite width. In the
original signal the value occurs only for the instant at which it was
sampled.
One question that arises here is, how many samples do we have to take?
We would not want to take too many samples as that would be wasteful.
83
CIT 852 DATA COMMUNICATION AND NETWORK
At the same time, if, we take too few samples, we may not be able to
reconstruct the original signal properly. The answer comes from
Nyqist’s theorem, which states that, to be able to get back the original
signal, we must sample at a rate, that is, at least twice that of the highest
frequency contained in the original signal.
The above discrete value~ are now represented as 8 binary digits with, I
bit giving the sign while the other 7 bits represent the value of the
sample.
In the final stage of the encoding, the binary digits are then transformed
into a digital signal using any of the digital to digital encoding
mechanisms discussed later in this unit. This digital signal is now the
representation of the original analog signal.
84
CIT 852 DATA COMMUNICATION AND NETWORK
but instead of quantising them into 256 or more levels, only the
direction of change is retained. If the sample is larger in value than the
previous one, it is considered a 1 while otherwise it is considered a o bit.
So the sequence above would be encoded as:
85
CIT 852 DATA COMMUNICATION AND NETWORK
If, there is no modulation, the carrier signal will be a pure sine wave at
the frequency of transmission. You will realise that the baud rate that
can be supported also depends on the quality of the line and the amount
of random noise that is present in the medium. Like in analog-to-analog
encoding, there are three properties of the sine wave that we can alter to
convey information. These are the amplitude, the frequency and the
phase. In addition, we can also use a combination of amplitude and
phase change to encode information more efficiently. Modulation is also
referred to as shift keying in this type of encoding technique.
86
CIT 852 DATA COMMUNICATION AND NETWORK
87
CIT 852 DATA COMMUNICATION AND NETWORK
of the carrier are unaltered by FSK. Just as in FM, noise in the line has
little effect on the frequency and so, this method is less susceptible to
noise.
FSK is not much used in practice because of the need for higher
bandwidth and the comparative complex requirement for changing the
frequency.
We can also encode by varying the phase of the carrier signal. This is
called phase shift keying (PSK) and here, the frequency and amplitude
of the carrier are not altered. To send a 1 we could use a phase of 0
while we could change it to 180 degrees to represent a 1. Such an
arrangement is not affected by the noise in the line, because that affects
amplitude rather than the phase of the signal.
This quality of PSK can be used to achieve more efficient encoding. For
example, instead of having only 2 phases, we could have four phases, 0,
90 degrees, 180 degrees and 270 degrees. Each of these phase shifts
could represent 2 bits at one go, say, the combinations 00, 01, 10 and 11
respectively. Such a scheme is called 4-PSK. The concept can be
extended to higher levels and we could have 8-PSK to send groups of3
bits in one go. This method can be extended further, but at some point
the sensitivity of the communication equipment will not be enough to
detect the small phase changes and we are then limited for that reason.
88
CIT 852 DATA COMMUNICATION AND NETWORK
Clearly, the scheme is more efficient than ASK because, we can now
achieve a higher bit rate from the same bandwidth. It can be shown that
the bandwidth required in 2-PSK is the same as that needed in ASK. But
the same bandwidth at 8-PSK can transmit thrice the number of bits at
the same baud rate.
Why can we not apply the same trick in ASK? We could have 4, 8 or
more amplitude levels to transmit 2, 3 or more bits in one signal
transition. The reason is that, ASK is vulnerable to noise and that makes
it unsuitable for using many different amplitude levels for encoding.
Similarly, FSK has higher bandwidth requirements and so we do not use
this kind of technique there as, there is not much to be gained.
We have already seen how ASK is vulnerable to noise. That is why the
number of different amplitude levels is small while there may be more
phase shift levels possible. There are a large number of schemes
possible in the QAM method. For example 1 amplitude and 4 phases is
called 4-QAM. It is the same as 4-PSK because there is no change in the
amplitude. With 2 amplitudes and 4 phases we can send 3 bits at a time
and so this scheme is called 8-QAM (Figure 6).
89
CIT 852 DATA COMMUNICATION AND NETWORK
Note, that the errors we have talked of here are at the physical layer. By
using the appropriate techniques, at the data link layer we achieve error
free transmission irrespective of the underlying mechanisms at the
physical layer. That is not something that will be looked at in this unit.
It can be shown that QAM requires the same bandwidth as ASK or PSK.
So, we are able to achieve a much higher bit rate using the same baud
rate. That is why QAM is the method of encoding used currently in data
communication applications.
Let us, now look at the last combination of encoding possible, from
digital to digital signals. A simple example is when sending data from a
computer to a printer, both of which understand digital signals. The
transmission has to be for short distances over the printer cable and
occurs as a series of digital pulses. Another example of such encoding is
for transmission over local area networks such as an Ethernet, where the
communication is between computer and computer.
This kind of encoding is really of three types and we will look at each of
the types here. Again, there can be many other mechanisms other than
the ones discussed in this unit, but we will look at only the methods that
are used in data communication applications. These types are unipolar,
polar and bipolar techniques.
90
CIT 852 DATA COMMUNICATION AND NETWORK
Unipolar Encoding
What then are the problems that preclude widespread use of this
technique? The two problems are those of synchronisation and of the
direct current (DC) component in the signal.
91
CIT 852 DATA COMMUNICATION AND NETWORK
Polar
Unlike unipolar schemes, the polar methods use both a positive as well
as a negative voltage level to represent the bits. So, a positive voltage
may represent a 1 and a negative voltage may represent a 0, or the other
way round. Because both positive and negative voltages are present, the
average voltage is much lower than in the unipolar case, mitigating the
problem of the DC component in the signal. Here, we will look at three
popular polar encoding schemes.
92
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 9: RZ encoding
A third polar method is biphase encoding. While in RZ, the signal goes
to zero midway through each bit, in biphase it goes to the opposite
polarity midway through each bit. These transitions help in
synchronisation, as you may have guessed. Again this has two flavours
called Manchester encoding and Differential Manchester encoding. In
the former, there is a transition at the middle of each bit that achieves
synchronisation. A 0 is represented by a negative to positive transition
while a 1 is represented by the opposite. In the Differential Manchester
method, the transition halfway through the bit is used for
synchronisation as usual, but a further transition at the beginning of the
bit represents the bit itself. There is no transition for a 1 and there is a
transition for a 0, so that a 0 is actually represented by two transitions.
93
CIT 852 DATA COMMUNICATION AND NETWORK
Bipolar
This encoding method uses three levels, with a zero voltage representing
a 0 and a 1 being represented by positive and negative voltages
respectively. This way the DC component is done away with because,
every I cancel the DC component introduced by the previous 1. This
kind of transmission also ensures that every 1 bit is synchronised. This
simplest bipolar method is called Alternate Mark Inversion (AMI). The
problem with Bipolar AMI is that synchronisation can be lost in a long
string of 0’s.
HDB3 changes the pattern of four O’s depending on the number of 1’s
since the last such substitution and the polarity of the last 1. If the
number of 1’s since the last substitution is odd, the pattern is violated at
the fourth O. So if the previous 1 was positive, the 0 is also made
positive to avoid confusion with a 1. If the number of 1’s since the last
substitution is even, the first and fourth zeroes have a pattern violation.
4.0 CONCLUSION
In this unit, you have learnt about data encoding and communication
techniques. I believe by now you should be able to discuss intelligently
about encoding, what it means, why it is readed and the various types of
encoding mechanisms and techniques.
94
CIT 852 DATA COMMUNICATION AND NETWORK
5.0 SUMMARY
In this unit, you have seen the need for data encoding and seen that there
are four types of data encoding. These arise from the fact that there are 2
source signal types and 2 transmission types. You have seen the
different kind of techniques used for each type of data encoding -analog-
to-analog, analog to digital, digital to analog and digital-to-digital. The
bandwidth needed, noise tolerance, synchronisation methods and other
features of each different technique of encoding have been elaborated
upon.
95
CIT 852 DATA COMMUNICATION AND NETWORK
96
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Multiplexing
3.1.1 Frequency Division Multiplexing
3.1.2 Time Division Multiplexing
3.2 Digital Subscriber Lines
3.3 ADSL vs. Cable
3.4 Switching
3.4.1 Circuit Switching
3.4.2 Packet Switching
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
97
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
3.1 Multiplexing
If, one wanted to send data between a single source and a single
destination, things would be comparatively easy. All it would need is a
single channel between the two nodes, of a capacity sufficient to handle
the rate of transmission based on Nyqist’s theorem and other practical
considerations. Granted that there would be no other claimants for the
resources, there would be no need for sharing and no contention.
98
CIT 852 DATA COMMUNICATION AND NETWORK
because, there can be many different sources and the intended recipients
for each source are often different. The transmission resource, that is the
available frequencies, is scarce compared to the large number of users.
So, there will have to share the resource and consequently, the issue of
preventing interference between them will arise.
99
CIT 852 DATA COMMUNICATION AND NETWORK
100
CIT 852 DATA COMMUNICATION AND NETWORK
101
CIT 852 DATA COMMUNICATION AND NETWORK
We, thus, see that the original signal could find itself subjected to
modulation several times, each of which may be of different kinds,
before it is finally transmitted. This raises the possibility of interference
and noise, but, with the very good equipment available today, this need
not be a matter of concern.
102
CIT 852 DATA COMMUNICATION AND NETWORK
103
CIT 852 DATA COMMUNICATION AND NETWORK
One scheme to attain .this is to add an extra bit of data to each frame. In
succeeding frames, this extra bit forms a fixed pattern that is highly
unlikely to occur naturally in the data. The receiver can then use this fact
to synchronise the frames. Suppose each frame has n bits. Starting from
anywhere, the receiver compares bit number 1, n+ 1, 2n+ 1 and so on. If
the fixed data pattern is found, the frames are synchronised. Otherwise,
the receiver commences to check bit number 2, n+2, 2n+2, ...until it can
determine whether the frames are in synchronization or otherwise. This
continues till, it is able to synchronise the frames and can then start
receiving the data from the various channels.
104
CIT 852 DATA COMMUNICATION AND NETWORK
The multiplexer data rate is not higher than that of the sum of all the
input devices connected to it. So statistical, TDM can make do with a
lower transmission rate than needed by synchronous TDM, at the cost of
more complexity. The other way in which this is of benefit is, by the
ability to support higher throughput for the same available data rate of
the multiplexer. This capability is easily realised during the normal,
expected data transmission periods when the amount of data that the
different input devices have available for transmission is, in fact, lower
than the capacity of the multiplexing device. But the same attribute
becomes a disadvantage during peak loads, where all or many of the
devices may have data to transmit for a short time. In such a situation,
the slack that was available to us for more efficient transmission is no
longer present. We will see later how to handle peak load situations in
statistical TOM.
In this kind of scheme it is not known to us which input device will have
data to send at a given time. So we cannot use a round robin positional
scheme that was possible in synchronous TOM. Each frame has to be
accompanied by information that will tell the demultiplexer which input
device the frame belongs to, so that it can be delivered to the appropriate
destination. This is the overhead of statistical TDM, besides increased
complexity of equipment.
If, we are sending input data from only one source at a time, the
structure of a frame would need to have an address field for the source
followed by the data for it. This is really the statistical TDM data frame.
It would form the data part of a larger, enclosing HOLC frame if we are
using HOLC as the transmission protocol. This frame would itself have
various other fields that we will not discuss here.
Such a scheme is also not as efficient as we can make it. This is because
the quantum of data available from the source, in that time slot, may not
be enough to fill the TDM sub frame. So, while it may be an adequate
method if the load is not heavy, we also need to think of a method that
can utilise available resources better.
105
CIT 852 DATA COMMUNICATION AND NETWORK
The way to do this would be, to have more than one input data source
transmit in a single TDM frame. We would then need to have a more
complex structure for the frame whereby, we would have to specify the
different input devices in the frame followed by the length of the data
field. More sophisticated approaches could be used, in order to optimise
the number of bits, we need to encode all this addressing and data
information.
For peak loads, there is need for some kind of buffering mechanism, so
that, whenever there is excess input from the data sources that the
multiplexer cannot immediately handle, it is stored until it can be sent.
The size of the buffer needed will increase as the transmission capacity
of the multiplexer decreases, as it will become more likely that an input
data stream will not be transmitted immediately. It will also depend on
the average data rate of the input devices taken together. No matter what
the buffer size we choose, there is always a non-uro probability that the
buffer itself will overflow, leading to loss of data. If, the average data
rate of all devices is close to the peak rate, then we are approaching a
situation of synchronous TDM where we are not able to take advantage
of periods of silence that is the basis of statistical TDM.
The 56 Kbps rate is really an artificial barrier arising from the fact that
voice telephone line standards limited the bandwidth to about 3.1 KHz
to take advantage of the normal range of the human voice in
conversation. Nyquist’s theorem and the limitations of line quality
ensured that we ended up with that rate. Once the 3.1 KHz limit is
removed, the telephone line can support much higher data speeds.
Out of the several different technical solutions that came about, the
ADSL (Asymmetric DSL) technology has proved to be the most
popular. Asymmetric comes from the fact that the data rates in the two
directions are different. The approach is to divide the 1.1 MHz
bandwidth available over the Cat-3 telephone cables into 256 channels.
Of these channels, 0 is used for normal voice communication. The next
5 channels are not used to ensure separation and non-interference
between data and voice transmissions. The next 2 channels are used for
106
CIT 852 DATA COMMUNICATION AND NETWORK
Like in voice circuits, it would have been possible to use half the
channels for communication in each direction. But, statistics show that
most users download much more data than they upload. So usually 32
channels are dedicated to uploading, that is, transferring data from the
users to the provider and the remaining 216 channels are used for
downloading data to the users. This typically translates into 512 Kbps to
1 Mbps download and 64 Kbps to 256 Kbps upload data rates. This
then, is the asymmetric aspect of the DSL line.
A problem with ADSL is that the physics of the local loop is such that,
the speed at which it can be driven depends heavily on the distance
between the subscriber’s premises and the provider’s nearest termination
point. The speed falls sharply with distance and so, distance can become
a limiting factor in being able to offer competitive speed compared to
that of the cable television providers.
At the provider’s end office, the signal from the users is recovered and
converted into packets that are then sent to the Internet Service Provider,
which may be the telephone company itself.
At first glance, a comparison between ADSL and cable may seem like a
no contest. Cable television, sent over coaxial cables, has a bandwidth
that is potentially hundreds of times that of the twisted pair Cat-3 cable
used for telephone connections. But, as we go along, it turns out that
there are considerations in favour of both sides.
First, there are specific assurances regarding bandwidth that we get from
telephone companies who provide ADSL connectivity. An ADSL link is
a dedicated connection that is always available to the user, unlike
television cable that is shared by scores or even hundreds of subscribers
in the immediate neighbourhood. So the kind of speeds that we can get
107
CIT 852 DATA COMMUNICATION AND NETWORK
over cable can vary from one moment to the next, depending on the
number of users that are working at the time.
There are security risks associated with the fact that cable is shared.
Potentially other users can always tap in and read (even change) what
you are sending or receiving. The problem does not exist on ADSL,
because, each channel is separate and dedicated to the specific user.
Though, cable traffic is usually encrypted by the provider, this situation
is worse than ADSL where other users just do not get your traffic at all.
Also because the channel is dedicated to you, the total number of users
does not have any effect on your access speeds as there is no contention
with other users.
3.4 Switching
There are many potential sources of data in the world and likewise,
many potential recipients. Just think of the number of people who may
like to reach one another over the telephone. How can one ensure that
every data source is able to connect to the recipient? Clearly one cannot
have a physical link between every pair of devices that might want to
communicate! Therefore, we need a mechanism, to be able to connect
together devices that, need to transfer data between them. This is the
problem of switching.
108
CIT 852 DATA COMMUNICATION AND NETWORK
shown in the Figure 4 where there are 7 devices. These are divided into
two groups of 3 on the left and 4 on the right. To ensure complete
connectivity between them at all times, we would need 12 physical
links. But, if connectivity is not required at all times, we can achieve
connectivity between any of the devices by grouping them together and
using switches to achieve temporary links.
For example, we can have 7 links that connect the devices A, Band C on
the left to the switch. The other devices D, E, F and G on the right are
also connected to the same switch. The switch can connect any two
devices together using only these seven links as desired.
109
CIT 852 DATA COMMUNICATION AND NETWORK
The way to get around this limitation is, to split the switch into different
stages. If we consider a 36 line exchange where each of36 inputs needs
to be connected to 36 outputs, we can do so in, say, 3 stages. The first
stage could have 3 switches, each with 12 inputs and 2 outputs to the
two second stage switches. These intermediate switches could each have
3 inputs from the 3 first stage switches and 3 outputs to the 3 third stage
switches. The last stage of the switches would then have 2 inputs from
the 2 second stage switches and 12 outputs, each to 12 of the 36 devices.
It is thus, possible for each of the 36 inputs to connect to each of the 36
outputs as required, using only 72 + 18 + 72 = 162 crosspoints, instead
of the 1296 crosspoints that would have been required without the
multistage design. The following Figure 5 shows the multistage switch.
110
CIT 852 DATA COMMUNICATION AND NETWORK
If, we use a single stage switch, we will always be able to connect each
device to any other device that is not already busy. This is because all
the paths are independent and do not overlap. What this means is that,
we will never be starved of circuits and will never suffer the problem of
blocking. For multistage switching, the reduction in the number of
crosspoints required comes at the cost of possible blocking. This
happens when there is no available path from a device, to another free
device, that we desire to connect to. In the Figure 5, if we have a switch
in the first stage that is already serving 2 input devices, then there are no
free outputs from that stage. We cannot therefore service more than 2
input devices connected to one switch at a time and the 3M device
would not be able to connect anywhere, getting a busy signal.
Let us, now look at another method of switching that uses time slots
rather than spatial separation. You have already seen how synchronous
TDM involves transmission between input and output devices using
fixed time slots dedicated to each channel. But, that is not switching
because the input-output device combinations are fixed. So, if we have
three devices A, B and C transmitting and three devices D, E and F that
are receiving the respective transmissions, there will be no way to
change the circuit path so that A can transmit to E or F.
111
CIT 852 DATA COMMUNICATION AND NETWORK
How does the TSI work? It consists of a control unit that does the actual
reordering of the input. For this, it has to first, buffer the input it gets, in
the order it gets it. This would be stored in some kind of volatile
memory. The control unit then sends out the data from the buffer in the
order in which it is desired. Usually the size of each buffer would be that
of the data that the input generates in one time slice.
Again, because it is human beings that are present at both ends, the rate
at which data is generated at both ends is similar, even if one person
talks a bit faster than the other! Also, the other human can usually
understand what is being said even if he cannot at the same rate. And if
really required, one can communicate to the other to speak slower or
louder. But, when we are dealing with data generating devices, there can
always be a mismatch between the rate at which one device generates
data and at which the other device can assimilate it. Moreover, there can
be long periods when there is no data generated at all for transmission.
In such a situation, circuit switching will not be a suitable method and
we have to look at something that takes care of the characteristics of
data communication between devices.
112
CIT 852 DATA COMMUNICATION AND NETWORK
Some of the other limitations of circuit switching for sending data are:
A circuit, once set up, defines the route that will be taken by the
data until it is dismantled and set up again. Sometimes, that
circuit may have been set up via a less advantageous set of links
because that was the best route available at the time it was set up
(best could be in terms of channel capacity, delays, line quality or
other parameters). Now, subsequently, even if another, better
route is released by other devices, we cannot change over to this
better route without disconnecting the previous circuit and
forcing the participants to set up the call again.
113
CIT 852 DATA COMMUNICATION AND NETWORK
Again, the physical link between two nodes can be of any type and is of
no consequence at the higher layers of the communication protocol in
use. That link itself may be multiplexed and may carry several
transmissions simultaneously, for the same or different pairs of source
and destination nodes. Moreover, these transmissions may be happening
in different directions.
In a virtual circuit, when the first datagram is sent out, we decide on the
route that will be followed, and subsequent datagrams continue to
follow that route. So, it is like circuit switching to’ a large extent. But, in
circuit switching the link is dedicated to the pair of nodes and there is no
114
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
5.0 SUMMARY
115
CIT 852 DATA COMMUNICATION AND NETWORK
ADSL is a means of utilising sing the existing capacity of the local loop
in the telephone system for providing subscribers with high speed data
access. Such access is also provided by companies over the cable
television network. ADSL is more secure and predictable in terms of
service quality, while cable does not have the limitations of distance
from the end office that ADSL has.
116
CIT 852 DATA COMMUNICATION AND NETWORK
117
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Framing
3.2 Basics of Error Detection
3.3 Forward Error Correction
3.4 Cyclic Redundancy Check Codes for Error Detection
3.5 Flow Control
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
Data Link Layer (DLL) is the second layer of the OSI model which
takes services from the Physical layer and provides services to the
network layer. DLL transfers the data from a host to a node or a node to
another node.
The main task of the data link layer is to take a raw data from
transmission facility and transform it into a line that appears free of
transmission errors to the network layer. Data packets are encoded and
decoded into bits. These are called frames. The Functions of the Data
Link Layer are Framing, Frame synchronisation, Error Handling Flow
Regulation, Addressing and Access Control. The data link layer is
divided into two sublayers: The Media Access Control (MAC) layer and
the Logical Link Control (LLC) layer. The MAC sublayer controls how
a computer on the network gains access to the link resources and grants
permission to transmit it. The LLC layer controls frame synchronisation,
flow control and error checking.
118
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
3.1 Framing
As you already know, the physical layer deals with raw transmission of
data in the form of bits and gives services to the data link layer. The data
link layer provides services to the network layer as shown in the Figure
1:
119
CIT 852 DATA COMMUNICATION AND NETWORK
The raw data coming from the Physical layer is converted into frames
for forwarding to the network layer. This is done to ensure that the
transmission of data is error free. Error detection and correction (if
required) is done by the Data link layer, which is discussed in the
following sections. The structure of the frame is shown in Figure 2.
But, it is difficult to keep track of counts on timing to mark the start and
end time of each frame. So to overcome the same, we will discuss the
following methods for framing.
Character Count
Character Patterns
Bit Patterns
Framing by Illegal code (code violation)
Character Count
The first framing method, Character count, uses a header field to specify
the number of characters in the frame. The Data Link Layer at the
destination checks the header field to know the size of the frame and
hence, the end of frame. The process is shown in Figure 3 for a four-
frame of size 4,5,5 and 9 respectively.
120
CIT 852 DATA COMMUNICATION AND NETWORK
Character Patterns
The frame after adding the start sequence and the end sequence is shown
in Figure 5.
If a OLE ETX occurs in the middle of the data and interferes with the
data during framing then, insert an ASCII OLE character just before
121
CIT 852 DATA COMMUNICATION AND NETWORK
DLE character in the data. The Receiver interprets the single DLE as an
escape indicating that the next character is a control character.
A problem with character stuffing is that not all bit streams are character
oriented (e.g., Unicode is a 16-bit code). Hence, for arbitrary sized
characters the process of character stuffing becomes more complex. So
next we will discuss a new method known as the bit stuffing, which
solves the problem of arbitrary sized character.
Bit Patterns
This method is similar to the one discussed above, except that, the
method of bit stuffing allows insertion of bits instead of the entire
character (8 bits). Bit pattern framing uses a particular sequence of bits
called a flag for framing. The flag is set as the start and the end of the
frame.
Use of bit patterns is to keep the sequence of data in the same order.
122
CIT 852 DATA COMMUNICATION AND NETWORK
11111111110010011
01111110111110111110001001101111110
11111111110010011
1-It can be coded into two parts i.e., high to low =10
0 -It can be coded into two parts i.e., low to high =01
Codes of all low (000) or all high (111) aren’t used for the data and
therefore, can be used for framing.
The Network should ensure complete and accurate delivery of data from
the source node to destination node. But many times data gets corrupted
during transmission. As already discussed in the previous block, many
factors can corrupt or alter the data that leads to an error. A reliable
system should have methods to detect and correct the errors. Firstly, we
will discuss what the error could be then, in the later section we will
discuss the process of detecting and correcting them.
123
CIT 852 DATA COMMUNICATION AND NETWORK
Types of Error
Several types of error may occur during transmission over the network:
1-bit error
burst error
lost message (frame)
1-bit error: 1-bit error/Single bit error means that only one bit is
changed in the data during transmission from the source10 the
destination node i.e., either 0 is changed to 1 or 1 is changed to 0 as
shown in Figure 8.
This error will not appear generally in case of serial transmission. But it
might appear in case of parallel transmission.
Burst error: Burst error means that 2 or more bits of data are altered
during transmission from the source to the destination node. But, it is
not necessary that error will appear in consecutive bits. Size of burst
error is from the first corrupted bit to the last corrupted bit as shown in
Figure 9.
The sender has sent the frame but that is not received properly, this is
known as loss of frame during transmission. To deal with this type of
124
CIT 852 DATA COMMUNICATION AND NETWORK
Error Detection
For error detection the sender can send every data unit twice and the
receiver will do bit by bit comparison between the two sets of
information. Any alteration found after the comparison will, indicate an
error and a suitable method can be applied to correct the error.
But, sending every data unit twice increases the transmission time as
well as overhead in comparison. Hence, the basic strategy for dealing
with errors is to include groups of bits as additional information in each
transmitted frame, so that, the receiver can detect the presence of errors.
This method is called Redundancy as extra bits appended in each frame
are redundant. At the receiver end these extra bits will be discarded
when the accuracy of data is confirmed.
Parity check
CRC
Checksum
125
CIT 852 DATA COMMUNICATION AND NETWORK
Parity Check
The most common method used for detecting errors when the
number of bits in the data is small, is the use of the parity bit.
In the example below, even parity is used. The ninth column contains
the parity bit.
010101010
011110011
111100110
126
CIT 852 DATA COMMUNICATION AND NETWORK
This method detects single bit errors as well as increases the probability
of finding burst error.
CRC
Checksum
In this method the checksum generator divides the given input data into
equal segments of k bits (8 or16). The addition of these segments using
ones complement arithmetic is complimented. This result is known as
the checksum and it is appended with the data stream. This appended
data stream is transmitted across the network on the transmission media.
At the receiver end add all received segments. If the addition of
segments at the receiver end is all 1’s then, the data received is error free
as, complement of the same will be all 0’s. Then the data can be
accepted, otherwise, data can be discarded.
For example:
127
CIT 852 DATA COMMUNICATION AND NETWORK
00000010
01010000
Sum 01010010
At receiver’s end
00000010
01010000
10101101
sum 11111111
Complement 00000000
The checksum method detects all errors as it retains all its carries.
Firstly we consider the simple case i.e., correcting single bit error. As
we have discussed earlier that a single bit error can be detected by
adding one additional bit (parity bit! redundant bit). This additional bit
can detect error in any bit stream by differentiating the two condition
error or not error as a bit can have two states only i.e., 0 and 1.
128
CIT 852 DATA COMMUNICATION AND NETWORK
For correction of detected single bit error two states are not sufficient.
As an error occurs in bit stream indicates that one bit is altered from
either 0 to 1 or 1 to 0. To correct the same, conversion of altered bit is
required. For performing this conversion we must know the location of
bit which is in error. Therefore, for error correction identification of
location of error bit is required. For example, for applying error
correction of single bit error in ASCII character we must find which of 7
bit is altered. For doing this we could have eight different states i.e., no
error, error in bit position 1, error in bit position 2 up to error in bit
position 7. For this we need many redundant bits to represent all eight
states.
Here, 3 bit redundancy code can represent all possible eight states
because 3 bits can represent 8 states (000 to 111). But if an error occurs
in redundancy bit then we need 3 Additional bits added with 7 ASCII
character bits, it covers all possible error locations.
2r >= n+r+1
For the example discussed above for a 7 bit ASCII character and 4
redundant bit, we will have total bits as n+r i.e., 7+4 = 11. These 4
redundant bits can be inserted in 7 bit data stream in position 1,2,4 and 8
(in II bit sequence at 2°,21,22,23) named as rl,r2,r4 and r8 respectively.
rl: 1,3,5,7,9,11
r2: 2,3,6,7,10,11
r3: 4,5,6,7
r8: 8,9,10,11
Now we will find the values of redundant bit rl,r2, r4 and r8 for the data
bit sequence 1010101 as shown in following Figure.
129
CIT 852 DATA COMMUNICATION AND NETWORK
0101 = 5. It implies 5th bit is the error bit. The binary number obtained
from new parties will indicate the error bit location in the received data
stream. Subsequently that bit can be altered and data can be corrected.
If all the values in the new parity column are 0, we conclude that the
data is error free. In the given example if no error it should be 0000.
The most commonly used method for detecting burst error in the data
stream is Cyclic Redundancy Check Method. This method is based on
the use of polynomial codes. Polynomial codes are based on
representing bit strings as polynomials with coefficients as 0 and 1 only.
For example, the bit string 1110011 can be represented by the following
polynomial:
x6 + x5 + x4 + x1 + 1.
130
CIT 852 DATA COMMUNICATION AND NETWORK
The computed check digits are called the frame check sequence
(FCS) or the cyclic redundancy check (CRC).
To compute the checksum for a frame with m bits, the size of the
frame must be longer than the generator polynomial.
Let D(x) be the data and G(x) be the generating polynomial. Let r be the
degree of generator polynomial G(x).
Step 1: Multiple the data D(x)by x’, giving r zeros in the low-
order end of the frame.
131
CIT 852 DATA COMMUNICATION AND NETWORK
Example:
Data 1011101
Data 10111010000
The remainder obtained after the division of 011 1, will be placed on the
low order bits of the data stream. So the Data that is transmitted over the
network by the sender is D(x)= 10111010111
132
CIT 852 DATA COMMUNICATION AND NETWORK
Now at the receiver’s end, the receiver receives D(x) as data which will
be divided by the generator polynomial as shown in Figure 11.
Here the remainder obtained after division is 0000, so it ensure that data
received at the receiver end is error free otherwise, it indicates that the
data has some error in it. In this way the CRC method can detect
whether the data has some error or is error free.
Another important issue for the data link layer is dealing with the
situation which occurs when the sender transmits frames faster than the
receiver can accept or process them. If the sender is working on a fast
machine and the receiver is working on a slow machine this situation
may occur in the network. In this process of transmission, some of the
frames might be lost as they were not processed by the receiver due to
it’s low speed, while the sender might have through the transmission to
133
CIT 852 DATA COMMUNICATION AND NETWORK
There are several methods available for deciding when a sender should
send one frame or the next frame. Flow control ensures that the speed of
sending the frame, by the sender, and the speed of processing the
received frame by the receiver are compatible.
1) Stop-and-wait
2) Sliding window.
We shall start with the assumption that the transmission is error free and
that we have an ideal channel.
Operations:
134
CIT 852 DATA COMMUNICATION AND NETWORK
The problem with stop and wait is that only one frame can be
transmitted at a time and that often leads to inefficient transmission
channel till we get the acknowledgement the sender can not transmit any
new packet. During this time both the sender and the channel are
unutilised.
To deal with this problem, there is another flow control method i.e.,
sliding window protocol which is discussed below:
In this flow control method, the receiver allocates buffer space for n
frames in advance and allows transmission of multiple frames. This
method allows the sender to transmit n frames without an ACK. A k-bit
sequence number is assigned to each frame. The range of sequence
number uses modul0-2 arithmetic. To keep track of the frames that have
been acknowledged, each ACK has a sequence number. The receiver
acknowledges a frame by sending an ACK that includes the Sequence
number of the next expected frame. The sender sends the next n frames
starting with the last received sequence number that has been
transmitted by the receiver (ACK). Hence, a single ACK can
acknowledge multiple frames as shown in the Figure 13.
135
CIT 852 DATA COMMUNICATION AND NETWORK
The receiver receives frames 1,2 and 3. Once frame 3 arrives ACK4 is
sent to the sender. This ACK4 acknowledge the receipt of frame 1,2 and
3 and informs the sender that the next expected frame is frame 4.
Therefore, the sender can send multiple back-to-back frames, making
efficient use of the channel.
Sequence number is a field in the frame that is of finite size. If k bits are
reserved for the sequence number, then the values of sequence number
ranges from 0 to 2k–1 (Modulo Arithmetic).
Sending Window
136
CIT 852 DATA COMMUNICATION AND NETWORK
Receiving Window
Flow control is achieved as the receiver can control the size of the
sending window by limiting the size of the sending window. Similarly,
data flow from the sender to the receiver can be limited, and that too can
controls the size of receiving window as explained with the help of an
example in Figure 16.
137
CIT 852 DATA COMMUNICATION AND NETWORK
Example
1) Go-back-n ARQ
2) Selective-repeat ARQ
Details of these two ARQ requests are discussed in the next unit.
138
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
In this unit we have described the elementary issues of the Data Link
Lagos such as how to divide data streams into frames. You have learnt
the different types of errors that may occur. During the transmission of
frames from the source mode to the destination mode, also detecting and
correcting these errors. You have also learnt about flow control and the
various methods for flow control.
5.0 SUMMARY
This unit introduced the basic fundamental issues related to the Data
Link Layer. The concept of framing and different methods of framing
like Character Count, Character Stuffing, Bit stuffing and Framing by
Illegal code has been focused up on. In the Data Link layer, data flow
and error control is discussed. This error and flow control is required in
the system for reliable delivery of data in the network. For the same,
different types of error, different methods for error detection and
correction are discussed. Among various methods, Block sum check
method detects burst of error with high probability. CRC method is the
one which detects the error with simplicity. Forward Error Correction is
the error correction method that uses the parity concept. For flow
control, stop and wait method tries to ensure that the speed of the sender
and the receivers are matching to an extent. To overcome this sliding
Window protocol is introduced. Sliding window protocol can send many
frames at one instance and that increases the efficiency of transmission
channel. If some error occurs in the data then retransmission of the error
frame is required and it is known as ARQ.
139
CIT 852 DATA COMMUNICATION AND NETWORK
140
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Stop & Wait ARQ
3.2 Go-Back-N ARQ
3.3 Selective Repeat ARQ
3.4 Pipelining
3.5 Piggybacking
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
Flow control deals with when the sender should send the next frame and
for how long the sender should wait for an acknowledgement. Data link
protocol takes care of the amount of data that a sender can send and that
a receiver can process as, the receiver has its own limitation in terms of
speed for processing the frames. It also sees the compatibility of speed
of both the sender and the receiver.
Error control deals with error detection and correction method that we
have already discussed in the previous unit. If, an error is found in the
frame either due to Joss of frame or due to damage of frame,
retransmission of the same is required by the sender. Retransmission is
required when a sender does not receive a positive acknowledgement in
time, due to a loss of frame or loss of acknowledgement or if, the sender
receives negative acknowledgment from the receiver due to frame not
been error free. This process of retransmission is called ARQ
(Automatic Repeat Request). The set of rules that will determine the
operations for the sender and the receiver are named the ARQ protocol.
This ARQ protocol makes the network reliable, and that is, one of the
important requirements of a network system if, data transmits from one
node to another over the network and ensures that data received at
141
CIT 852 DATA COMMUNICATION AND NETWORK
receiver’s site is complete and accurate. Here, we will refer to ACK, for
positive acknowledgement (that is receiver has correct data) and NAK
(REJect) to refer to negative acknowledgement (that is frame is received
with some error). In this unit, you will study three commonly used
methods for flow and error control that is Stop & Wait ARQ, GoBack-n
ARQ and Selective Repeat ARQ.
2.0 OBJECTIVES
This is the simplest method for flow and error control. This protocol is
based on the concept that, the sender will send a frame and wait for its
acknowledgment. Until it receives an acknowledgment, the sender
cannot send the next frame to the receiver. During transmission of frame
over the network an error can appear.
At times the receiver receives the frame correctly, in time and sends the
acknowledgment also, but the acknowledgment gets lost/damaged
during transmission. For the sender it indicates time out and the demand
for retransmission of the same frame appears in the network. If, the
sender sends the last frame again, at the receiver’s site, the frame would
be duplicated. To overcome this problem it, follows a number
mechanism and discards the duplicate frame.
142
CIT 852 DATA COMMUNICATION AND NETWORK
Both the sender and the receiver both maintain control variable with
volume 0 or 1 to get the status of recently sent or received. The sender
maintains variable S that can hold 0 or 1 depending on recently sent
frame 0 or 1. Similarly the receiver maintains variable R that holds 0 or
1 depending on the next frame expected 0 or 1.
Normal Operation
When ACK is lost
When frame is lost
When ACK time out occurs
Normal Operation
If the sender is sending frame 0, then it will wait for ack 1 which will be
transmitted by the receiver with the expectation of the next frame
numbered frame1. As it receives ACK1 in time (allotted time) it will
send frame I. This process will be continuous till complete data
transmission takes place. This will be successful transmission if ack for
all frames sent is received in time. It is shown with the help of Figure.1
143
CIT 852 DATA COMMUNICATION AND NETWORK
Here the sender will receive corrupted ACK1 for frame sent frame O. It
will simply discard corrupted ACK 1 and as the time expires for this
ACK it will retransmit frame O. The receiver has already received frame
0 and is expecting frame1, hence, it will discard duplicate copy of frame
0. In this way the numbering mechanism solves the problem of duplicate
copy of frames. Finally the receiver has only one correct copy of one
frame. This is explained with the help of Figure. 2.
144
CIT 852 DATA COMMUNICATION AND NETWORK
the sender will not get ACK0 as frame has not been received by the
receiver. The sender will be in waiting stage for ACK0 till its time out
occurs in the system. As soon as time out occurs in the system, the
sender will retransmit the same frame i.e frame 1 (F1) and the receiver
will send ACKO in reply as shown in Figure. 3.
In this operation, the receiver is not able to send ACK1 for received
frame0 in time, due to some problem at the receiver’s end or network
communication. The sender retransmits frame0 as ACK1 is not received
in time. Then, the sender retransmits frame0 as ACK1 time expires. At
the receiver end, the receiver discards this frarne0 as the duplicate copy
is expecting frame1 but sends the ACK1 once again corresponding to
the copy received for frame0. At the sender’s site, the duplicate copy of
ACK1 is discarded as the sender has received ACK1 earlier as explained
with the help of Figure 4.
145
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 5: Piggybacking 1
The problem with stop and wait is that only one frame can be
transmitted at a time and this leads to inefficiency of transmission. To
deal with this, we have another error and flow control method that we
will discuss in the next section.
146
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 6: Go-Back-N
If, the error rate is high, then, this leads to a lot of wastage of bandwidth
as the sender will retransmit all the frames from, the frame in which
error appears till the last sent. To increase the efficiency of transmission,
when the error rate is high, another protocol called Selective Repeat
ARQ is used which is discussed in the next section.
147
CIT 852 DATA COMMUNICATION AND NETWORK
discussed, each frame will have a sequence number that will be added
with the frame. If, the frame can have k bit sequence number then the
sequence number of frames will range between 0 t0 2k-1. For example, if
k is 2 bit then numbers will be 0,1,2,3,0,1,2,3,0, Size of sender and
receiver window would be 2k/2 i.e 4/2=2 or it can be written as 2k-1. If
the window size is 2 and acknowledgement for frame0 and frame1 both
gets lost during transmission then, after timer expires the sender will
retransmit frame0 though the receiver is expecting frame2 after frame1
was received without any error. Hence, frame0 will be discarded by the
receiver as a duplicate frame. If the receiver window size is more than
two, the receiver will accept duplicate frame0 as a new frame and hence,
the size of window should be 2k/2. The process is shown in Figure. 7.
TCP uses Selective repeat ARQ strategy to deal with flow and error
control If, we consider bidirectional transmission i.e., data and
acknowledgement flow from both sender and receiver then, the concept
of Piggybacking can be used in a similar fashion as already discussed in
Stop & Wait ARQ method, in order to better utilize bandwidth.
3.4 Pipelining
Pipelining in the network is one task that starts before the previous one
is completed. We might also say that the number of tasks is buffered in
line, to be processed and this is called pipelining. For example, while
printing, through the printer before one task printing is over we can give
commands for printing second task. Stop & Wait ARQ does not use
pipelining. As in Stop & Wait ARQ the sender cannot send the next
frames till it receives acknowledgement for the frame sent. Here,
Pipelining is used in Go-Back-N ARQ and Selective repeat ARQ as
both methods can send multiple frames without holding the sender for
receiving the acknowledgement for frame sent earlier. This process of
pipe lining improves the efficiel1cy of bandwidth utilisation. Now, we
will explain with the help of Figure 8 how pipelining is used in Go-
Back-N ARQ.
148
CIT 852 DATA COMMUNICATION AND NETWORK
3.5 Piggybacking
149
CIT 852 DATA COMMUNICATION AND NETWORK
Sender Receiver
Here, both the sender and the receiver maintain control variables S and
R. The sender sends frame 0 (F0) with ACK0 appended along with it.
Similarly, the receiver sends Frame 0(FO) with ACK1 appended to it.
This way transmitting both frame and acknowledgement will
concurrently increase optimal efficiency of bandwidth utilisation
because piggybacking will get a free side.
4.0 CONCLUSION
In this unit you have learnt about various protocols for retransmission in
cases where errors occur during transmission like stop and wait ARQ
method, Gob Back – ARQ, Selective repeat ARQ and pipelining.
5.0 SUMMARY
This unit focuses on one prime function of the Data link layer that is
flow and error control for achieving the goal of reliable data
transmission over the network. For flow and error control retransmission
strategies are considered. Flow control specifically talks about the speed
of sending the frame by the sender and processing the received frame by
the receiver. The speed for the sender and the receiver must be
compatible. So, that all frames can be received in order and processed in
time. Error control technique combines two processes error detection
and error correction in the data frame. In Stop & wait ARQ protocol
sender waits for acknowledgment for the last frame sent. After the
acknowledgment is received by the sender then only the next frame can
be sent. In Go-Back-N ARQ frames can be sent continuously without
waiting for the sender to send the acknowledgement. If an error is found
in any frame then frames received after that will be discarded by the
receiver. Retransmission of frames will start from the error frame itself.
In selective repeat Process frames can be sent continuously. But here,
the receiver has a buffer window that can hold the frames received after
the error frame. Hence, retransmission will be only for error frame. This
150
CIT 852 DATA COMMUNICATION AND NETWORK
151
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Advantages of Multiple Access Sharing of Channel
Resources
3.2 Pure ALOHA
3.3 Slotted ALOHA
3.4 Carrier Sense Multiple Access (CSMA)
3.5 CSMA with Collision Detection (CSMA/CD)
3.6 Ethernet Frame Format (IEEE 802.3)
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
As discussed in first unit of this module the Data Link Layer (DLL) is
divided into two sub layers i.e., the Media Access Control (MAC) layer
and the Logical Link Control (LLC)layer. In a network nodes are
connected to or use a common transmission media. Based on the
connection of nodes, a network can be divided into two categories, that
is, point-to-point link and broadcast link. In this unit, we will discuss,
broadcast link and their protocols. If, we talk about broadcast network
then, a control process for solving the problem of accessing a multi
access channel is required. Many protocols are available for solving the
problem of multi-access channel. These protocols can control an access
on shared link as in broadcast network. It is an important issue to be
taken into consideration that is, how to who gets access to the channel
while, many nodes are in competition as shown in Figure 1.
152
CIT 852 DATA COMMUNICATION AND NETWORK
The protocol which decides who will get access to the channel and who
will go next on the channel belongs to MAC sub-layer of DLL. Channel
allocation is categorized into two, based on the allocation of broadcast
among competeting users that is Static channel allocation problem and
Dynamic Channel allocation problem as shown in Figure 2. In this unit,
we will also discuss whether some access conflict or collision comes in
the network, and how to deal with these conflicts. This is an important
issue for LAN.
Here the transmission of frames can occupy the medium or any arbitrary
time or in slotted time intervals (time is divided into slots). When the
transmission station senses whether the channel is busy or free, this is
called carrier sensing.
2.0 OBJECTIVES
153
CIT 852 DATA COMMUNICATION AND NETWORK
Many methods are available for multiple access channel like ALOHA,
CSMA etc. that we will discuss in the following section.
As we have discussed earlier in the previous unit, if, one node sends a
frame to another node, there can be some error in the frame. For the
same we discussed some retransmission strategies to deal with the error.
But, in case of allocating a single channel among N uncoordinated
competing users, then the probability of collision will be high. Station
accesses the channel and when their frames are ready. This is called
random access. In an ALOHA network one station will work as the
central controller and the other station will be connected to the central
station. If, any of stations want to transmit data among themselves, then,
the station sends the data first to the central station, which broadcast it to
all the stations.
154
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 3: ALOHA
Here, the medium is shared between the stations. So, if two stations
transmit a frame at overlapping time then, collision will occur in the
system. Here, no station is constrained, any station that has data /frame
to transmit can transmit at any time. Once one station sends a frame
(when it receives its own frame and assumes that the destination has
received it) after 2 times the maximum propagation time. If the sender
station does not receive the its own frame during this time limit then, it
retransmit this frame by using back off algorithm that we will discuss
later on. And if, after a number of repeats if it does receive own pocket
then the station gives up and stops retransmitting the same frame.
Let R be the bit rate of the transmission channel and L be the length of
the frame. Here, we are assuming that the size of frame will be constant
and hence, it will take constant time t= L/R for transmission of each
packet.
As in the case of Pure ALOHA protocol frames can be sent any time so,
the probability of collision will be very high. Hence, to present a frame
from colliding, no other frame should be sent within its transmission
time. We will explain this with the help of the concept of vulnerable
period as shown in Figure 4. Let a frame is that transmitted at time to
and t be the time required for its transmission. If, any other station sends
a frame between to and t0+t then the end of the frame will collide with
that earlier sent frame. Similarly, if any other station transmits a frame
between the time interval t0+t and t0+2t again, it will result in a garbage
frame due to collision with the reference frame. Hence, 2t is the
vulnerable interval for the frame. In case a frame meets with collision
that frame is retransmitted after a random delay.
155
CIT 852 DATA COMMUNICATION AND NETWORK
The throughput of the system S is equal to total arrival rate 0 times the
probability of successful transmission with no collision
That is S = G * P
S = G * P (zero frame transmission in the vulnerable interval i.e.,
2t seconds) since
P [K frame in vulnerable interval 2t) = (2G)e-2G , K = 0, 1,2,3
K!
Thus
P [K = 0 in 2t] = -, 2G
Hence, S = G * P = G.e-2G
Note that the averages load is O. Hence it is 20 in 2t
S = G * e-2G
156
CIT 852 DATA COMMUNICATION AND NETWORK
The throughput of the system S is equal to the total arrival rateG times
the probability of successful transmission with no collision
That is S = G’P
S = G * P (zero frame transmission in t seconds)
157
CIT 852 DATA COMMUNICATION AND NETWORK
S= G’ e-G
From the figure we can see that the system is exhibiting its performance,
Maximum throughput that can be achieved with Slotted ALOHA S=l/e=
36 % (Approx.) However, with this performance also we are not able to
utilise the medium in an efficient manner. Due to the high rate of
collision systems the bandwidth is which was designed to implement
random access in LANs. So, we will discuss a new protocol called
CSMA in the next section.
158
CIT 852 DATA COMMUNICATION AND NETWORK
1-Persistent CSMA
Non-Persistent CSMA
p-Persistent CSMA
1-Persistent CSMA
In this protocol a station i.e., who wants to transmit some frame will
sense the channel first, if it is found busy than that some transmission is
going on the medium, then, this station will continuously keep sensing
that the channel. And as soon as this station finds that the channel has
become idle it will transmit its frame. But if more than one station is in
waiting state and keeps track of the channel then a collision will occur in
the system because both waiting station will transmit their frames at the
same time. The other possibility of collision can be if the frame has not
reached any other station then, it indicates to the second station that the
channel is free. So the second station also starts its transmission and that
will lead to collision. Thus I-persistent CSMA a greedy protocol as to
capture the channel as soon as it finds it idle. And, hence, it has a high
frequency of collision in the system. In case of collision, the station
senses the channel again after random delay.
Non-Persistent CSMA
159
CIT 852 DATA COMMUNICATION AND NETWORK
p-Persistent CSMA
As before here also any transmission in the system needs to sense the
channel to see whether it is busy or free. The stations ensure that the
transmission will start only when it finds that the channel is idle. In
CSMA/CD the station aborts the process of transmission as soon as they
detect some collision in the system. If two stations sense that the
channel is free at the same time, then, both start transmission process
immediately. And after that, both stations get information that collision
has occurred in the system. Here, after the station detecting the collision,
the system aborts the process of transmission. In this way, time is saved
and utilisation of bandwidth is optimised. This protocol is known as
CSMA/CD and, this scheme is commonly used in LANs. Now, we will
discuss the basic operation of CSMA/CD. Let, t be the maximum
transmission time between two extreme ends of a network system
(LAN). At to station A, at one extreme end of the LAN begins the
process of transmitting a frame FA. This frame reaches the station E
which at another extreme end of the same network system in t
propagation delay away. If no other station in between has started its
frame transmission, it implies that A has captured the channel
successfully. But, in case EF station E starts its frame transmission just
before the arrival of frame from station A frame then, collision will take
place. Station A will get the signal of collision after 2t time. Hence, 2t
time is required to ensure that station A has captured the channel
successfully as shown with the help of Figure 8.
160
CIT 852 DATA COMMUNICATION AND NETWORK
Backoff Algorithm
With the help of backoff algorithm we will see how the randomisation
process occurs as soon as collision detection takes place. Time is
divided into discrete slots with the length of worst case propagation time
(propagation time between two extreme ends of LAN) 2t. After the first
collision in the system, each station waits for 0 or I slot time before
161
CIT 852 DATA COMMUNICATION AND NETWORK
trying transmission for the next time. If, two stations that collide is
select the same random number then collision will be repeated. After the
second collision, the station will select 0, 1,2 or 3 randomly and wait for
these many number of slots. If, the process of collision will occur
repeatedly, then, the random number interval would be between 0 and
2i-1 for ith collision and this number of slots will be the waiting time for
the station. This algorithm is known as the binary exponential algorithm.
Preamble: The first field of 802.3 frame is 7 byte (56 bits) long with a
sequence of alternate 1 and 0 Le., 10101010. This pattern helps the
receiver to synchronise and get the beginning of the frame.
162
CIT 852 DATA COMMUNICATION AND NETWORK
Destination Address (DA): This fie)d is 6 byte (48 bit) long. It contains
the physical address of the receiver.
Source Address (SA): This filed is also 6 byte (48 bit) long. It contains
the physical address of the sender.
Length of Data Field: It is 2 byte (16 bit) long. It indicates the number
of bytes in the information field. The longest allowable value can be
1518 bytes.
Pad: This field size can be 0 to 46 bytes long. This is required if, the
data size is less than 46 bytes as a 802.3 frame must be at least 64 bytes
long.
Frame Checksum (FCS): This field is 4 bytes (32 bit) long. It contains
information about error detection. Here it is CRC-32.
Minimum length or lower limit for frame length is defined for normal
operation of CSMA/CD. This is required so that, the entire frame is not
transmitted completely before its first bit has been received by the
receiver. If, this happens then the probability of the occurrence of
collision will be high (the same has been explained earlier in the
previous section CSMA/CD).
Hence, Ethernet frame must be of64 bytes long. Some of the bytes are
header and trailer parts of the frame. If, we consider 6 bytes destination
address, 6 bytes source address, 2 bytes length and 4 bytes FCS
(6+6+2+4=18) then, the minimum length of data will be 64-18= 46
bytes. If, frame is less than 46 bytes then, padding bits fill up this
difference.
163
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
In this unit you have learnt about the various MAC sub-layer protocols
like pure ALOHA, slotted ALOHA, CSMA and CSMA/CD. The next
unit will introduce you to Wireless LAN and Data Link Layer
Switching.
5.0 SUMMARY
In some networks, if a single channel and many users use that channel,
then, allocation strategy is required for the channel. We have discussed
FDM and TDM allocation method. They are the simplest methods for
allocation. They work efficiently for a small number of user. For a large
number of users the ALOHA protocol is considered. There are two
versions of ALOHA that is Pure ALOHA and Slotted ALOHA. In Pure
ALOHA no slotting was done but the efficiency was poor. In Slotted
ALOHA, slots have been made, so that every frame transmission starts
at the beginning of the slot and throughput is increased by a factor of2.
For avoiding collision and to increase efficiency in sensing the channel,
CSMA is used. Many versions of CSMA are persistent and non-
persistent. In CSMA/CD collision detection process is added so that
process can be aborted just after a collision is detected. Ethernet is a
commonly used protocol for LAN. IEEE 802.3 Ethernet uses 1
persistent CSMA/CD access method.
1) Why is DLL divided into two sub layers? What are the key
functions of those sub layers?
2) How does Slotted ALOHA improve the performance of the
system over Pure ALOHA?
3) How has non-persistent reduced the probability of collision?
4) Explain Back off Algorithm and give one example of where it is
used.
164
CIT 852 DATA COMMUNICATION AND NETWORK
165
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Introduction to Wireless LAN
3.2 Wireless LAN Architecture (IEEE 802.1 I)
3.3 Hidden Station and Exposed Station Problems
3.4 Wireless JAN Protocols: MACA and MACAW 49
3.5 IEEE 802.11 Protocol Stack
3.5.1 The 802.11 Physical Layer
3.5.2 The 802.11 MAC Sub-layer Protocol
3.6 Switching at Data Link Layer
3.6.1 Operation of Bridges in Different LAN
Environment
3.6.2 Transparent Bridges
3.6.3 Spanning Tree Bridges
3.6.4 Source Routing Bridges
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
In this unit, we cover two broad topics: Wireless LAN, its protocols, its
standard and Data Link Layer Switching. In organisation we need an
interconnection mechanism so that all nodes can talk to each other.
Bridges and switches are used for this purpose. The spanning tree
algorithms are used to build plugs and act as bridges.
166
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
To understand the concept, we will take a simplistic view that, all radio
transmitters have some fixed range. When a receiver is within a range of
two active transmitters, the resulting signal will generally be garbled and
of no use. It is important to realise that in some wireless LANs, not all
stations are within the range of one another, which leads to a variety of
complications, which we will discuss in the next sections.
167
CIT 852 DATA COMMUNICATION AND NETWORK
168
CIT 852 DATA COMMUNICATION AND NETWORK
Now, let us consider the reverse situation called the exposed station
problem. (Figure 2 (b).)
In this section, we, will describe two wireless LAN protocols: MACA
and MACA W. MACA is the oldest protocol of the two. MACA was
proposed as an alternative to CSMA Protocol which has certain
drawbacks:
169
CIT 852 DATA COMMUNICATION AND NETWORK
Just assume that, there are four nodes A, B, C, and D in a wireless LAN
(Figure 3). A is a sender and B is a receiver. The station C is within
range of A but not within range of B. Therefore, it can hear transmission
from A (i.e., RTS) but not transmission from B (i.e., CTS) (Figure 3(a)
and 3(b). Therefore, it must remain silent long enough for the CTS to be
transmitted back to A without conflict. The station D is within the range
of B but not A so it hears CTS but not RTS. Therefore, it must remain
silent during the upcoming data transmission, whose length it can tell by
examining the CTS frame. This is illustrated through a diagram (Figure
3(a) and 3(c) A sends RTS to B. Then B sends CTS to A. Then, follows
data between A and B.
C hears the RTS from A but not the CTS from B. As long as it does not
interfere with the CTS, it is free to transmit while the data frame is being
sent. In contrast, the station D is within range of B but not A. It does not
hear the RTS but does hear the CTS. Hearing the CTS tips it off that, it
is close to a station that is about to receive a frame, so it defers sending
anything until that frame is expected to be finished.
Despite these precautions, collisions can still occur. For example, Band
C could both send RTS frames to A at the same time. These frames will
collide and will be lost. In the event of a collision, an unsuccessful
transmitter (i.e. one that does not hear a CTS within the expected time
interval) waits a random amount of time and tries again later. MACAW
(MACA for wireless) extends MACA to improve its performance which
will have the following handshaking mechanism. RTS-CTS-DS-Data
ACK It isalso illustrated through the following diagram (Figure
4).
170
CIT 852 DATA COMMUNICATION AND NETWORK
171
CIT 852 DATA COMMUNICATION AND NETWORK
The other two short range radio frequency techniques are known as
spread spectrum. It was initially developed for military and intelligence
requirement. The essential idea is to spread information signal over a
wider bandwidth to make jamming and interception more difficult. The
spread spectrum is ideal for data communication because, it is less
susceptible to radio noise and creates little interference. It is used to
comply with the regulations for use with ISM Band.
Both these techniques are used in wireless data network products as well
as other communication application such as, a cordless telephone please
refer to [5] for further studies.
172
CIT 852 DATA COMMUNICATION AND NETWORK
Under this scheme, the signal is broadcast over a seemingly random data
sequence RF hopping from frequency to frequency at split second
intervals. A receiver hopping between frequencies in synchronisation
with the transmitter, picks up the message. Using FHSS (Frequency
Hopped Spread Spectrum) the 2.4 GHz is divided into 75 MHz Channel.
In this scheme, a pseudorandom number generator is used to produce the
sequence of the frequencies hopped to. As long as all stations use the
same seed to the pseudorandom number generator and stay synchronised
in time, they will hop to the same frequencies simultaneously. FHSS’
randomisation provides a fair way to allocate spectrum in the
unregulated ISM band. It also provides some sort of security. Because
an intruder does not know the hopping sequence it cannot eavesdrop on
transmissions. Over longer distance, multipath fading can be an issue,
and FHSS offers good resistance to it. It is also relatively insensitive
radio interference, which makes it popular for building-to-building links.
Its main disadvantage is its low bandwidth. FHSS allows for a less
complex radio design than DSSS but FHSS is limited to 2 Mbps data
transfer rate due to FCC regulations that restrict subchannel bandwidth
to I MHz causing many hops which means a high amount of hopping
overhead. The DSSS is a better choice for WLAN application. It is also
restricted to 1 or 2 Mbps.
DSSS divides 2.4 GHz band into 14 channels. Channels using at the
same location should be separated 25 MHz from each other to avoid
interference. FHSS and DHSS are fundamentally different signaling
techniques and are not capable of inter operating with each other. Under
this scheme, each but in the original signal is represented by multiple
bits in the transmitted signal, which is known as chipping code. The
chipping code spreads the signal across a wider frequency band in direct
proportion to the number of bits used. Therefore, a 10 bit chopping code
spreads signal across a frequency band that is 10 times greater than I bit
chipping code (Ref. 3).
After the discussion on the physical layer it is time to switch over to the
IEEE 802.11 MAC sublayer protocols which are quite different from
that of the Ethernet due, to the inherent complexity of the wireless
environment compared to that of a wired system. With Ethernet (IEEE
802.3) a node transmits, in case, it has sensed that the channel is free. If,
it does not receive a noise burst back within the first 64 bytes, the frame
has almost assuredly been delivered correctly. With wireless technology,
this situation does not hold.
173
CIT 852 DATA COMMUNICATION AND NETWORK
(i) The Hidden Station Problem: CSMA does not avoid the hidden
station problem (Figure (a) & (b))
A transmit to B
B receives the message A tries to transmit to B
C does not hear the transmission C also tries to transmit both
(a) Message to B arrive at B
leading to garbage.
(b)
Radio Range
(iii) In addition, most radios are half duplex, meaning that they cannot
transmit and listen for noise bursts at the same time on a single
frequency as Ethernet does.
Now, we, will examine IEEE 802.11 DCF separately. It does not use
any central control. In this respect it is similar to Ethernet.
When DCF is employed, 802.11 uses a protocol called CSMA/CA
(CSMA with Collision Avoidance). In this protocol, both physical
174
CIT 852 DATA COMMUNICATION AND NETWORK
channel sensing and virtual channel sensing are used. Two methods
of operation are supported by CSMAICA. In the first method (Physical
sensing), before the transmission, it senses the channel. If the channel is
sensed idle, it just wants and then transmitting. But it does not sense the
channel while transmitting but, emits its entire frame, which may well
be destroyed at the receiver’s end due to interference there. If, the
channel is busy, the sender defers transmission until it goes idle and then
starts transmitting. If, a collision occurs, the colliding stations wait for a
random time, using the Ethernet binary exponential back off algorithm
and then try again later.
CTS frame back. Upon receipt of the CTS, A now sends its frame and
starts an ACK timer. Upon correct receipt of the data frame, B responds
with an ACK frame leading to the closure of data transfer operation
between A & B. In case A’s ACK timer expires before the ACK gets
back to it, the whole protocol is run again.
Now, how will C and D nodes react to it? Node C is within range of A,
so it may receive the RTS frame. C may receive the RTS frame because
it is in the rage of A. From the information in the RTS frame it estimates
how long the transfer will take, including the final ACK and asserting a
kind of virtual channel busy for itself, indicated by NA V (Network
Allocation Vector) as shown in Figure 7. Similarly, D also asserts the
175
CIT 852 DATA COMMUNICATION AND NETWORK
NA V signal for itself because it hears the CTS. The NA V signals are
not for transmission. They are just internal reminders to keep quite for a
certain period of time.
The basic mechanism is for the base station to broadcast a beacon frame
periodically (10 to 100 times per second). The beacon frame contains
system parameters, such as hopping sequences and dwell times (for
FHSS), clock synchronisation, etc. It also invites new stations to sign up
for polling services. Once a station has signed up for polling service at a
176
CIT 852 DATA COMMUNICATION AND NETWORK
PCF and DCF can coexist within one cell. At first it might seem
impossible to have central control and distributed control operating at
the same time, but 802.11 provides a way to achieve this goal. It works
by carefully defining the interframe time interval. After a frame has
been sent, a certain amount of dead time is required before any station
can send a frame.
Before discussing data ‘link layer switching devices, let us talk about
repeaters which are layer I devices. Repeaters provide both physical and
electrical connections. Their functions are to regenerating and propagate
a signal in a channel. Repeaters are used to extend the length of the
LAN which depends upon the type of medium. For example 10 mbps
802.3 LAN that uses UTP cable (10 BASE- T) has a maximum
restriction of 100 meters. Many organisations have multiple LANs and
wish to connect them. LANs can be connected by devices called
bridges, which operate as the data link layer. Unlike repeaters, bridges
connect networks that have different physical layers. It can also connect
networks using either the same or different types of architecture at the
MAC. (Token ring, FOOl, Ethernet etc).
Bridges are store and forward devices to provide error detection. They
capture an ell1tire frame before deciding whether to filter or forward the
frame, which provides a high level of error detection because a frame’s
CRC checksum can be calculated by Tile Bridge. Bridge is highly
susceptible to broadcast storms. A broadcast storm occurs when several
broadcasts are transmitted at the same time. It can take up huge
bandwidth.
Before looking at the technology of bridges, it is worthwhile taking a
look at some common situations in which bridges are used. Tanenbaun
177
CIT 852 DATA COMMUNICATION AND NETWORK
[Ref. I] has six reasons wmy a single organisation may end up with
multiple LANs.
2) Geographical difference
5) Reliability
178
CIT 852 DATA COMMUNICATION AND NETWORK
6) Security
It means that it should allow the movement of a machine from one cable
segment to another cable segment without change of hardware and
software or configuration tools.
(ii) Interpretability
4) Since the node is part of a wireless LAN, the packet goes to the
air using GRF.
6) When the packet arrives at the bridge which connects the wireless
LAN and Ethernet LAN, it starts at the physical layer of the
179
CIT 852 DATA COMMUNICATION AND NETWORK
bridge and moves to its LLC layer. At the MAC sublayer its
802.11 header is removed.
To start with, each of the LANs uses a different frame format. Unlike
the differences between Ethernet, token bus, and token ring, which were
due to history and big corporate egos, here the differences are to some
extent legitimate. For example, the Duration field in 802.11 is there, due
to the MACA W protocol and that makes no sense in Ethernet. As a
result, any copying between different LANs requires reformatting,
which takes CPU time, requires a new checksum calculation, and
introduces the possibility of undetected errors due to bad bits in the
bridge’s memory.
When forwarding a frame from a fast LAN to a Slower one, the bridge
will not be able to get rid of the frames as fast as they come in.
Therefore, it has to be buffered. For example, if a gigabit Ethernet is
pouring bits into an II-Mbps 802.11 LAN at top speed, the bridge will
have to buffer them, hoping not to run out of memory.
180
CIT 852 DATA COMMUNICATION AND NETWORK
4) Security
Both 802.11 and 802.16 support encryption in the data link layer, but the
Ethernet does not do so. This means that the various encryption services
available to the wireless networks are lost when traffic passes over the
Ethernet.
5) Quality of service
181
CIT 852 DATA COMMUNICATION AND NETWORK
LAN it arrives on (the source LAN) and the LAN its destination is on
(the destination LAN), as follows:
1) If destination and source LANs are the same, discard the frame.
(For example packet from A is going to B. Both are on the same
LAN i.e. LAN1).
When the bridges are first plugged in, all its hash tables are empty. None
of the bridges know where these destination nodes are exactly.
Therefore, they use a flooding algorithm: every incoming frame for an
unknown destination is output on all the LANs to which the bridge is
connected, except to the one it arrived on. Gradually, the bridges learn
where destinations are. Once the destination is known there is no more
flooding and the packet is forwarded on the proper LAN.
For reliability, some networks contain more than one bridge, which
increases the likelihood of networking loops. A networking loop occurs
when frames are passed from bridge to bridge in a circular manner,
never reaching its destination. To prevent networking loops when
multiple bridges are used, the bridges communicate with each other and
establish a map of the network to derive what is called a spanning tree
for all the networks. A spanning tree consists of a single path between
source and destination nodes that does not include any loops. Thus, a
spanning tree can be considered to be a loop-free subset of a network’s
topology. The spanning tree algorithm, specified in IEEE 802.ld,
describes how bridges (and switches) can communicate to avoid
network loops.
182
CIT 852 DATA COMMUNICATION AND NETWORK
IBM introduced source routing bridges for use in token ring networks.
With source routing, the sending machine is responsible for determining
whether, a frame is destined for a node on the same network or on a
different network. If, the frame is destined for a different network, then,
the source machine designates this by setting the high-order bit of the
group address bit of the source address to 1. It also includes in the
frame’s header the path the frame is to follow from source to
destination. Source routing bridges are based on the assumption that a
sending machine will provide routing information for messages destined
for different networks. By making the sending machine responsible for
this task, a source routing bridge can ignore frames that have not been
“marked” and forward only those frames with their high-order
destination bit set to 1.
4.0 CONCLUSION
In this conclusive unit of this module, you have bean take through the
two broad topics: Wireless LAN, its standard and Data Link Layer
Switching through bridges and Switches.
5.0 SUMMARY
In this unit we discussed two major topics wireless LANs and switching
mechanism at the data link layer with IEEE at the data link layer. With
IEEE 802.11 standardisation, wireless LANs are becoming common in
most of the organisations but, they have their own problems and
solutions CSMA/CD does not work due to hidden station problem. To
make CSMA work better two new protocols, MACA and MACA W
were discussed. The physical layer of wireless LAN standard i.e. IEEE
802.11 allows five different transmission modes, including infrared,
various spread spectrum schemes etc. As a part of inter LANs
connecting mechanism we discussed different types of bridges.
Bluetooth was not taken up in this unit, although, it is a very important
topic today. It is a also a wireless network used for connecting handsets
and other peripherals to computers without wires.
183
CIT 852 DATA COMMUNICATION AND NETWORK
184
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Connection Oriented vs. Connection-less Services
3.1.1 Connection-oriented Services
3.1.2 Connection-less Services
3.2 Implementation of the Network Layer Services
3.2.1 Packet Switching
3.2.2 Implementation of Connection -oriented Services
3.2.3 Implementation of Connection-less Services
3.3 Comparison between Virtual Circuit and Datagram Subnet
3.4 Addressing
3.4.1 Hierarchical versus Flat Address
3.4.2 Static vs Dynamic Address
3.4.3 IP Address
3.5 Concept of Congestion
3.6 Routing Concept
3.6.1 Main Issues in Routing
3.6.2 Classification of Routing Algorithm
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
185
CIT 852 DATA COMMUNICATION AND NETWORK
Path Determination
It determines the route taken by the packets from the source to the
destination.
Forwarding
Call Setup
Some network architectures require router call setup along the path
before the data flows. To perform these functions, the network layer
must be aware of the topology of the communication subnet (i.e., set of
routers, communication lines).
For end-to-end delivery, the network provides two type of services i.e.,
connection oriented service and connection less service to the
transport layer. The network layer services meet the following entries
[ref.1].
In this unit, we will first go through the basic concepts of these services
and will then differentiate between these two. Then, we will introduce
some other concepts like routing and congestion.
2.0 OBJECTIVES
186
CIT 852 DATA COMMUNICATION AND NETWORK
Connection-oriented services
Connection-less services.
ii) Only a single path is established for the call. and all the data
follows that path.
iv) If the network is over utilised, future call requests are refused.
187
CIT 852 DATA COMMUNICATION AND NETWORK
After the connection gets established, the sender starts sending data
packets to the receiver.
After all the data gets transferred, the connection has to be terminated.
Connection termination also requires a three-way handshake i.e.:
188
CIT 852 DATA COMMUNICATION AND NETWORK
The Internet Protocol (IP) and User Datagram Protocol (UDP) are
connectionless protocols, but TCP/IP (the most common use of IP) is
connection-orientated.
In this section, we will examine how the network layer services are
implemented. Two different services are taken into consideration
depending on the type of service being offered. These two schemes are
known as virtual circuit subnet (VC subnet) for connection-oriented
service and datagram subnet for connection-less services. A VC subnet
may be compared to the physical circuit required in a telephone setup. In
a connection-oriented service, a route from the source to the destination
must be established. In a datagram subnet, no advance set up is needed.
In this case, packets are routed independently. But, before we take up
the implementation issues let us, revisit the packet switching concepts
once again. The services are implement through a packet switched
network.
189
CIT 852 DATA COMMUNICATION AND NETWORK
But, why packet switching? Why not circuit switching? Now, let us
discuss these issues.
190
CIT 852 DATA COMMUNICATION AND NETWORK
191
CIT 852 DATA COMMUNICATION AND NETWORK
In these services, packets are individually injected into the subnet and
their routing decisions are not dependent on each other (packets).
Therefore, in connectionless services, no advance setup is needed. In
this context, the packets are frequently called datagrams and the subnet
is called a datagram subnet.
192
CIT 852 DATA COMMUNICATION AND NETWORK
host machines and RI, R2, R3, R4, R5 and R6 represent routers.
Suppose, that the process running at host HI has a long message to be
transmitted to a process running at H2 machine. To do so, it transfers the
message to the transport layer with appropriate instructions to deliver it
to the process running at H2. Where is the transfer layer process
running, can you figure out? Well, it may also be running on HI but
within the operating system. The transport layer process adds a transport
header to the front of the message and transfers the message (also called
TPDU) to the network layer, The network layer too, might be running as
another procedure within the operating system.
Let us assume, that the message is five times longer than the maximum
packet size, therefore, the network layer has to break it into five packets,
1,2, 3, 4 and 5 and send each of them in turn to router RI (because it is
linked to RI) using some point-to-point protocol. After this, the carrier
(supported by ISP) 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
Figure 3, RI has only two outgoing lines-to R2 and R3. So every
incoming packet must be sent to one of these routers.
The algorithm that manages the tables and makes the routing decisions
is known as the routing algorithm. In next unit, we shall study routing
algorithms. Students are requested to refer to [Ref. I] for further study
on the implementation of connection oriented and connection less
services. You should focus on connecting routing tables.
193
CIT 852 DATA COMMUNICATION AND NETWORK
Both virtual circuits and datagrams have their pros and cons. We shall
compare them on the basis of different parameters. These various
parameters are:
Using virtual circuits requires a setup phase, which takes time and
consumes memory resources. However, figuring out what to do with a
data packet in a virtual-circuit subnet is easy: the router simply uses the
circuit number to index into a table to find out where the packet goes. In
a datagram subnet, a more complicated lookup procedure is required to
locate the entry for the destination.
194
CIT 852 DATA COMMUNICATION AND NETWORK
Quality of service
Vulnerability
Traffic balance
Datagrams also allow the routers to balance the traffic throughout the
subnet, since routes can be changed partway through a long sequence of
packet transmissions. A brief comparison between a virtual circuit
subnet and a datagram subnet is given in Table 2. Students should refer
to Reference 1 for further discussion.
195
CIT 852 DATA COMMUNICATION AND NETWORK
(a) Reliable
(b) Unreliable
(a) UDP
(b) TCP
(c) IP
3.4 Addressing
196
CIT 852 DATA COMMUNICATION AND NETWORK
End systems generally have only one physical network connection and
thus, have only one data-link address. Routers and other internetworking
devices typically have multiple physical network connections and
therefore, have multiple data-link addresses.
MAC addresses are unique for each LAN interface. These address
consist of a subset of data link layer addresses. Figure 4 illustrates the
relationship between MAC addre,5ses, data-link addresses, and the
IEEE sub-layers of the data link layer.
197
CIT 852 DATA COMMUNICATION AND NETWORK
A flat address space is organised into a single group, such as. your
enrolment no. Hierarchical addressing offers certain advantages over
flat-addressing schemes. In hierarchical addressing, address sorting and
recalling is simplified using the comparison operation. For example,
“India” in a street address eliminates any other country as a possible
location. Figure 5 illustrates the difference between hierarchical and flat
address spaces.
198
CIT 852 DATA COMMUNICATION AND NETWORK
3.4.3 IP Address
(i) Class type: Indicate the IP class, to which the packet belongs:
Figur.6: IP address
199
CIT 852 DATA COMMUNICATION AND NETWORK
In the network layer, when the number of packets sent to the network is
greater than the number of packets the network can handle (capacity of
network), a problem occurs that is known as congestion. This is just like
congestion on a road due to heavy traffic. In networking, congestion
occurs on shared networks when, multiple users contend for access to
the same resources (bandwidth, buffers, and queues).
When the number of packet sent into the network is within the limits,
almost all packets are delivered, however, the traffic load increases
beyond the network capacity. As a result the system starts discarding
packets.
Figure 7: Congestion
Because routers receive packets faster than they can forward them, one
of these two things may happen in case of congestion:
Congestion Control
200
CIT 852 DATA COMMUNICATION AND NETWORK
In this scheme, a router detects that congestion may occur and attempts
to slow down senders before queues become full.
4) Resource allocation
201
CIT 852 DATA COMMUNICATION AND NETWORK
There are two main performance measures that are substantially affected
by the routing algorithm -throughput (quantity of service) and latency
(average packet delay when quality of service is required). The
parameter throughput refers to the number of packets delivered in the
subnet. Routing interacts with flow control in determining these
performance measures by means of a feedback mechanism shows in
Figure 8 When the traffic load offered by the external resources to the
subnet is within the limits of the carrying capacity of the subnet, it will
be fully accepted into the network, that is,
202
CIT 852 DATA COMMUNICATION AND NETWORK
But, when the offered load exceeds the limit, the packet will be rejected
by the flow control algorithm and
The traffic accepted into the network will experience an average delay
per packet that will depend on the routes chosen by the routing
algorithm.
Throughput
(Source Ref [2])
Figure 9: Throughput .s. delay graph
203
CIT 852 DATA COMMUNICATION AND NETWORK
and can easily be accommodated with a short delay by routing along the
leftmost and rightmost paths, 1-3-6 and 2-5-6, respectively. If instead,
however, the routes 1-4-6 and 2-4-6 are used, the flow on link (4,6) with
equal capacity, resulting in very large delays.
Observe Figure 10 once again. All links have a capacity of 10 units. If,
all traffic is routed through the middle link (R4,R6), congestion occurs.
If, instead, paths (RI -RJ-R6) and (R2-R5-R6) are used, the average
delay is shorter/lesses.
204
CIT 852 DATA COMMUNICATION AND NETWORK
In non-adaptive routing; routing decisions are not taken again and again
i.e., once the router decides a route for the destination, it sends all
packets for that destination on that same route. In it routing decisions are
not based on condition or the topology of the network.
4.0 CONCLUSION
You have also learnt the concept of ranting and congestion as well as the
interaction between ranting and flow control.
5.0 SUMMARY
205
CIT 852 DATA COMMUNICATION AND NETWORK
206
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Flooding
3.2 Shortest Path Routing Algorithm
3.3 Distance Vector Routing
3.3.1 Comparison
3.3.2 The Count-to-infinity Problem
3.4 Link State Routing
3.5 Hierarchical Routing
3.6 Broadcast Routing
3.7 Multicast Routing
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
As you have studied earlier, the main function of the network layer is to
find the best route from a source to a destination. In routing, the route
with the minimum cost is considered to be the best route. For this
purpose, a router plays an important role. On the basis of cost of a each
link, a router tries to find the optimal route with the help of a good
routing algorithm. There are a large number of routing algorithms.
These algorithms are a part of the network layer and are responsible for
deciding on which output line an incoming packet should be transmitted.
Some of these routing algorithms are discussed in this unit.
2.0 OBJECTIVES
207
CIT 852 DATA COMMUNICATION AND NETWORK
3.1 Flooding
208
CIT 852 DATA COMMUNICATION AND NETWORK
(i) Dijkstra algorithm divides the node into two sets i.e., tentative
and permanent. T F
(ii) Flooding generates lots of redundant packets. T F
(iii) Flooding discovers only the optimal routes T F
In this algorithm, each node has a label which represents its distance
from the source node along the best known path. On the basis of these
labels, the algorithm divides the node into two sets i.e., tentative and
209
CIT 852 DATA COMMUNICATION AND NETWORK
1) As shown in the Figure below, the source node (A) has been
chosen as T-node, and so its label is permanent.
2) In this step, as you see B, C are the tentative nodes directly linked
to T -node (A). Among these nodes, since B has less weight, it
has been chosen as T -node and its label has changed to
permanent.
3) In this step, as you see D, E are the tentative nodes directly linked
to T –node (B). Among these nodes, since D has less weight, it
has been chosen as T -node and its label has changed to
permanent.
210
CIT 852 DATA COMMUNICATION AND NETWORK
4) In this step, as you see C, E are the tentative nodes directly linked
to T -node(D). Among these nodes, since E has less weight, it has
been chosen as T -node and its label has changed to permanent.
5) E is the destination node. Now, since the destination node (E) has
been, reached so, we stop here, and the shortest path is A -8 -0
-E.
Bellman-Ford Algorithm
211
CIT 852 DATA COMMUNICATION AND NETWORK
s = source node
w(i,j) = link cost from node i to node j; w(i,j) = 00 if the two nodes are
not directly connected; w(i,j) > 0 if the two nodes are directly connected.
Lh(n) = cost of the least-cost path from node s to node n under the
constraint of no more than h links
1. [Initialisation]
2. [Update]
min
Lh+1(n) = [Lh (j) = w(j,n)]
j
Connect n with the predecessor node j that achieves the minimum, and
eliminate any connection of n with a different predecessor node formed
during an earlier iteration. The path from s to n terminates with the link
from j to n.
For the iteration of step 2 with h = K, and for each destination node n,
the algorithm compares potential paths from s to n of length K + 1 with
the path that existed at the end of the previous iteration. If the previous,
shorter path has less cost, then that path is retained. Otherwise a new
path with length K + 1 is defined from s to n; this path consists of a path
of length K from s to some node j, plus a direct hop from node j to node
n. In this case, the path from s to j that is used is the K-hop path for j
defined in the previous iteration.
212
CIT 852 DATA COMMUNICATION AND NETWORK
3.3.1 Comparison
213
CIT 852 DATA COMMUNICATION AND NETWORK
To see how fast good news propagates, consider the five-node (linear)
subnet of the following figure. (Figure 4), where the delay metric is the
number of hops. In the Figure 4 (a) there are five routers Ra, Rb, Rc, Rd
and Re linked to each other linearly. Suppose, a router Ra is down
initially and all the other routers know this. In other words, they have all
recorded the delay to Ra as infinity.
214
CIT 852 DATA COMMUNICATION AND NETWORK
We will describe this problem in the following stages: (i) when router
Ra is up, and (ii) when router Ra is down. Now let us take the first stage.
When Ra is up, the other routers in the subnet learn about it via the
information (vector) exchanges. At the time of the first exchange, Rb
learns that its left neighbour has zero delay to Ra Rb now makes an
entry in its routing table that Ra is just one hop away to the left. All the
other routers still think that Ra is down. At this point, the routing table
entries for Ra are as shown in the second row of Figure 4(b). On the
next exchange, Rc learns that Rb has a path of length 1 to A, so it
updates its routing table to indicate a path of length 2, but Rd and Re do
not hear the good news until later. Clearly, the good news is spreading at
the rate of one hop per exchange. In a subnet whose longest path is of
length N hops, within N exchanges everyone will know about the
newly-revived lines and routers.
Now, let us consider the second stage Figure 4(b), in which all the lines
and routers are initially up. Routers Rb Rc Rd and Re are at a distance of
1,2,3 and 4 from A. Suddenly, A goes down, or alternatively, the line
between A and B is cut, which is effectively the same thing from B's
point of view.
At the first packet exchange, Rb does not hear anything from Ra.
Fortunately, Rc says: Do not worry; 1 have a path to A of length 2. Little
does B know that C's path runs through Rb itself. For all Rb knows, Rc
might have ten lines all with separate paths to Ra of length 2. As a
result, Rb thinks it can reach Ra via Rc, with a path length of 3. Rd and
Re do not update their entries on the first exchange.
215
CIT 852 DATA COMMUNICATION AND NETWORK
Link state routing protocols are like a road map. A link state router
cannot be fooled as easily into making bad routing decisions, because it
has a complete picture of the network. The reason is that, unlike
approximation approach of distance vector, link state routers have first
hand information from all their peer routers. Each router originates
information about itself, its directly connected links, and the state of
those links. This information is passed around from router to router,
each router making a copy of it, but never changing it. Link-state
involves each router building up the complete topology of the entire
network (or at least of the partition on which the router is situated), thus,
each router contains the same information. With this method, routers
only send information to of all the other routers when there is a change
in the topology of the network. The ultimate objective is that every
router should have identical information about the network, and each
router should be able to calculate its own best path independently.
Independently calculate its own best paths.
216
CIT 852 DATA COMMUNICATION AND NETWORK
The idea behind link state routing is simple and can be stated in five
parts as suggested by Tanenbaum [Ref. I]. Each router must do the
following:
1) Neighbour discovery
The Router has to discover its neighbours and learn their network
addresses. As a router is booted, its first task is to learn who its
neighbours are.
The Router does this by sending a special HELLO packet on each point-
to-point line. The router on the other end is expected to send a reply
disclosing its identity. These names must be globally unique. If two or
more routers are connected by a LAN, the situation becomes slightly
more complicated one way of modeling the LAN is to consider it as a
node itself. Please see reference [I] for further explanation through a
diagram.
2) Measure delay
This method implicitly assumes that delays are symmetric, which may
not always be the case.
217
CIT 852 DATA COMMUNICATION AND NETWORK
After collecting the information needed for the exchange, the next step
for each router is to build a link state packet containing all the data. This
packet starts with the identity of the sender, followed by a sequence
number and age, and a list of neighbours. For each neighbour, the delay
to that neighbour is given.
Building the link state packets is easy.. The hard part is determining
when to build them. One possibility, is to build them periodically, that
is, at regular intervals. Another possibility is to build them when some
significant event occurs, such as a line or neighbour going down or
coming back up again or changing its properties appreciably.
Let us describe the basic algorithm in distributing the link state packet.
The fundamental concept here is flooding to distribute the packets. But
to keep the number of packets flowing in the subnet under control, each
packet contains a sequence number that is incremented for each new
packet delivered. When a new link state packet arrives, it is checked
against the list of packets already scene by a router. It is discarded in
case the packet is old; otherwise it is forwarded on all lines except the
218
CIT 852 DATA COMMUNICATION AND NETWORK
one it arrived on. A router discards an obsolete packet (i.e., with a lower
sequence) in case it has seen the packet with a highest sequence number.
After accumulating all link state packets, a router can construct the
entire subnet graph because every link is represented. In fact, every link
is represented twice, once for each direction. The two values can be
averaged or used separately.
In it bad data e.g., data from routers in error will corrupt the
computation.
As you see, in both link state and distance vector algorithms, every
router has to save some information about other routers. When the
network size grows, the number of routers in the network increases.
Consequently, the size of routing tables increases, as well, and routers
cannot handle network traffic as efficiently. We use hierarchical routing
to overcome this problem. Let's examine this subject with an example:
219
CIT 852 DATA COMMUNICATION AND NETWORK
220
CIT 852 DATA COMMUNICATION AND NETWORK
221
CIT 852 DATA COMMUNICATION AND NETWORK
a) It wastes bandwidth.
b) In this method source needs to have a complete list of all
destinations.
Because of this reason this method is the least desirable of the other
methods.
Flooding
Multidestination routing
A spanning tree is a subset of graph that includes all the nodes (of
graph) but contains no loops. This method uses the spanning tree,
therefore, each router knows which of its lines belong to the spanning
tree. When a packet arrives at a router, it copies onto all the spanning
tree lines except the one it arrived on.
222
CIT 852 DATA COMMUNICATION AND NETWORK
In this method each router must have knowledge of some spanning tree.
Sometimes this information is available (e.g., with link state routing) but
sometimes it is not (e.g., with distance vector routing), this is the major
disadvantage of this method.
If the packet arrived on the line that is normally used for sending packets
to the source of the broadcast then Router forwards copies of it onto all
lines except the one it arrived on.
Else (i.e., packet arrived on a line other than the preferred one for
reaching the source)
In many cases, you need to send same data to multiple clients at the
same time. In this case, if, we use unicasting then the server will connect
to each of its clients again and again, but each time it will send an
identical data stream to each client. This is a waste of both server and
network capacity. If, we use broadcasting in this case, it would be
inefficient because sometimes receivers are not interested in the message
but they receive it nonetheless, or sometimes they are interested but are
not supposed to see the message.
223
CIT 852 DATA COMMUNICATION AND NETWORK
224
CIT 852 DATA COMMUNICATION AND NETWORK
removing all lines that do not lead to hosts that are members of the
group. For example, Fig. 10 shows the pruned spanning tree for
group 1 and Fig. 11 shows the pruned spanning tree for group 2.
There are a number of ways of pruning the spanning tree. One of the
simplest ones that can be used, if link state routing is used and each
router is aware of the complete topology, including the hosts that
belong to those groups. Then, the spanning tree can be pruned,
starting at the end of each path, working toward the root, and
removing all routers that do not belong to the group under
consideration. With distance vector routing, a different pruning
strategy can be followed. The basic algorithm is reverse path
forwarding. However, whenever a router with no hosts interested in a
particular group and no connections to other routers, receives a
multicast message for that group, it responds with a PRUNE
message, thus, telling the sender not to send it any more multicasts
for that group. When a router with no group members among its own
hosts has received such a message on its lines, it, too, can respond
with a PRUNE message.
225
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
In this unit, you have learnt about ranting algorithms like broadcasting
and flooding. You have also learnt about the shortest path ranting,
distance vector costing.
5.0 SUMMARY
Next, we studied the link state routing algorit4m. In thIS algorithm, each
router originates information about itself, its directly connected links,
and the state of those links. This information is passed around from
router to router, each router making a copy of it, but never changing it.
The ultimate objective is that every router has identical information
about the network, and each router will independently calculate its own
best paths.
226
CIT 852 DATA COMMUNICATION AND NETWORK
multicast packet to a group, the first router examines its spanning tree
and prunes it. Then, packets are forwarded only along the appropriate
spanning tree.
(i) What are the problems with distance vector routing algorithm? .
(ii) What is LSP?
227
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Reasons for Congestion in the network
3.2 Congestion Control vs. Flow Control
3.3 Congestion Prevention Mechanism
3.4 General Principles of Congestion Control
3.5 Open Loop Control
3.5.1 Admission Control
3.5.2 Traffic Policing and its Implementation
3.5.3 Traffic Shaping and its Implementation
3.5.4 Difference between Leaky Bucket Traffic Shaper
and Token Bucket Traffic Shaper
3.6 Congestion Control in Packet-switched Networks
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
228
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
define congestion
list the factors for the occurrence of congestion in the Network
differentiate between congestion control and flow control
outline the general principles of congestion Control
discuss congestion prevention mechanism.
229
CIT 852 DATA COMMUNICATION AND NETWORK
The reason for comparing congestion and flow control is that, some
congestion control algorithms operate by sending messages back to the
senders to slow down incase, the network is congested. In case, the
receiver is overloaded, the host will get a similar message to slow down.
230
CIT 852 DATA COMMUNICATION AND NETWORK
Between transport and data link layer there are common issues (Flow
Control, acknowledge mechanism) with respect to Congestion Control
mechanism but at the transport layer, the extra problem is related to
determining time out internal across the network, which is a difficult
problem.
231
CIT 852 DATA COMMUNICATION AND NETWORK
Open Loop
Closed Loop.
Open loop solutions attempt to solve the problem with a good design,
that ensures that congestion does not occur in the network. Once having
network is running midcourse corrections are not made. Open loop
algorithm works on two basic mechanisms: i) Admission Control ii)
Resource Reservation. Admission control is a function performed by a
network to accept or reject traffic flow. Therefore, the purpose of open
loop solution is to ensure that the traffic generated by the source will not
lower the performance of network below the specified Q. S. The
network will accept traffic till QoS parameters are satisfied otherwise, it
rejects the traffic.
Queue length
The number of retransmitted packets due to timeout
Percentage of rejected packets due to shortage of the router's
memory
Average packet delay.
The presence of congestion means that the offered load in the network is
(temporarily) greater than the resources (routers) can handle. Two
straight forward solutions are to increase the resources or decrease the
load. To increase the resources the following mechanism may be used
as suggested in Tanenbaum [Ref 1].
232
CIT 852 DATA COMMUNICATION AND NETWORK
For subnets that use virtual circuits internally, these methods can be
used at the network layer. In the next section, we will focus on their use
in the network layer. We will also discuss the open loop control
mechanism in detail. The closed loop mechanism will be discussed in
Block 4 Unit 2 as a part of TCP Protocol.
233
CIT 852 DATA COMMUNICATION AND NETWORK
The bucket has certain depth to hold water just like a network can
accept a certain number of packets.
The bucket leaks at a certain rate (if there is water is the bucket)
no matter at what rate water enters the bucket. In terms of
computer networks, it should be interpreted as follows: No matter
at what rate the packets arrive at the input lines of a routers,
routers in a subnet passes to its outgoing link at a fixed rate.
If the bucket does not overflow when the water is poured into the
bucket, then the bucket of water is said to be conforming. In
terms of network, if the traffic is within the agreed norms, all
packets will be transferred.
The bucket will spillover if, it is full and if, additional water is
poured into it, if it gets more packets than it can handle, it will
lead to congestion and then the network due to which the
additional packets will be lost.
If, we expect the traffic flow to be very smooth, then the bucket has to
be of a shallow type. In case, the flow is bursty in nature, the bucket
should be deeper. In summary, what we want to observe is whether the
outflow of packets corresponds to the arrival rate of packets or not?
Implementation of a leaky bucket is similar to queue data structure
implementation. When a packet arrives, if there is space left in the
queue, it gets appended to the queue otherwise, it gets rejected.
234
CIT 852 DATA COMMUNICATION AND NETWORK
You can make observation from the Figure 2 that the Figure 2 (a)
shows the smoothened pattern will create less stress on the network but
the destination machine may not want to wait for 1 Second to retrieve 30
kbps data at each period. Now, we will look at its implementation. There
are two mechanisms:
235
CIT 852 DATA COMMUNICATION AND NETWORK
The leaky bucket traffic shaper has a very restricted approach. Since, the
output pattern is always constant no matter how bursty traffic is. Many
applications produce variable rate traffic; sometimes bursty but
sometimes normal. If, such traffic is allowed to pass through a leaky
bucket traffic shaper, it may cause a very long delay. One such
algorithm that deals with such situations is the token bucket algorithm.
New tokens are discarded, incase, the token buckets are full.
Just assume that the token bucket is empty and the numbers of packets
have arrived in the buffer. Since, there is no token in the token buffer,
the packets have to wait until the new packet is generated. Since, tokens
are generated periodically, the packet will be also transmitted
periodically at the rate at which the tokens arrive. In, the next section,
we will compare between the leaky bucket traffic shaper and token
236
CIT 852 DATA COMMUNICATION AND NETWORK
Table 3: Leaky Bucket Traffic Shaper and Token Bucket Traffic Shaper
237
CIT 852 DATA COMMUNICATION AND NETWORK
source node quickly, and this reduces the flow of packets into the
network. Alternatively, a node could add such information to
packets moving in the same direction as the congestion. The
destination either asks the source to adjust the load or returns the
signal to the source in the packets (or acknowledgements)
moving in the reverse direction.
4.0CONCLUSION
This unit has dealt exclusively with the problem of congesting control in
public switched network. You have therefore learnt the difference
between congestion control and flow control, general principles of
congestion control and congestion control mechanism.
5.0 SUMMARY
238
CIT 852 DATA COMMUNICATION AND NETWORK
UNIT 4 INTERNETWORKING
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Internetworking
3.1.1 How does a Network differ?
3.1.2 Networks Connecting Mechanisms
3.1.3 Tunneling and Encapsulation
3.2 Network Layer Protocols
3.2.1 IP Datagram Formats
3.2.2 Internet Control Message Protocol (ICMP)
3.2.3 OSPF: The Interior Gateway Routing Protocol
3.2.4 BGP: The Exterior Gateway Routing Protocol
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
There are many ways in which one network differs from another. Some
of the parameters in which a network differs from another network are
packet length, quality of services, error handling mechanisms, flow
control mechanism, congestion control mechanism, security issues and
addressing mechanisms. Therefore, problems are bound to occur when
we require interconnection between two different networks. Different
mechanisms have been proposed to solve this problem: Tunneling is
used when the source and destination are the same type of network but,
there is a different .network in-between, Fragmentation may be used for
different maximum packet sizes of different networks. The network
layer has a large set of protocols besides IP. Some of these are OSPF
and BOP and ICMP. In this unit, we will discuss some of these
protocols as well as some internetworking mechanisms.
2.0 OBJECTIVES
After going through this unit, you should be able to:
239
CIT 852 DATA COMMUNICATION AND NETWORK
3.1 Internetworking
In this section, we will examine some issues that arise when two or more
networks are interconnected. The purpose of interconnecting is to allow
any node or any network (e.g., Ethernet) to access data to any other node
on any other network. (e,g., A TM). Users should not be aware of the
existence of multiple networks.
240
CIT 852 DATA COMMUNICATION AND NETWORK
Finally, the transport layer and application layer gateways deal with
conversion of protocols at the transport and application layer
respectively, in order to interconnect networks.
The main difference between the two operations is that, with a switch,
the entire frame is forwarded to a different LAN on the basis of its MAC
address. With a router, the packet is extracted and encapsulated in a
different kind of a frame and forwarded to a remote router on the basis
of the IP address in the packet. Switches need not understand the
network layer protocol to switch a packet, whereas, a router requires to
do so. Tanenbaum [Ref 1] has described two basic mechanisms of
internetworking: Concatenated virtual circuit and connectionless
internetworking. In the next sections we will talk about them.
241
CIT 852 DATA COMMUNICATION AND NETWORK
Datagram Model
It is used when the source and destination networks are the same but the
network, which lies in-between, is different. It uses a mechanism called
encapsulation where, a data transfer unit of one protocol is enclosed
inside a different kind of protocol. Tunneling allows us to carry one kind
of frame that uses a particular network but uses, a different kind of
frame.
Suppose two hosts located very far away from each other wants to
communicate and both have access to the Internet link. It means that
both of them are running TCP/IP based protocol. The carrier (WAN)
which lies between the two hosts is based at X.25. Its format is different
from TCP/IP. Therefore, the IP datagram forwarded by the host one will
be encapsulated in X.25 network layer packet and will be transported to
242
CIT 852 DATA COMMUNICATION AND NETWORK
the address of the router of the destination host, when it gets there. The
destination router removes the IP packet and sends it to host 2. WAN
can be considered as a big tunnel extending from one router to another.
[Ref l]. The packet from host J travels from one end of a X.25 based
tunnel to another end of the tunnel encapsulated properly. Sending and
receiving hosts are not concerned about the process. It is done by the
concerned router at the other end.
(i) IP
(ii) ICMP
(iii) RIP, OSPF and BGP
243
CIT 852 DATA COMMUNICATION AND NETWORK
Fields in IP datagram
Address formats
Action taken by routers and end systems on a IP datagram
based on the values in these fields.
(iii) RIP, OSPF and BGP: The third component is related to routing
protocols: RIP and OSPF are used for Intra-AS routing, whereas,
BOP is used as exterior gateway routing protocol.
An IP datagram consists of a header part and a data part. The header has
a 20-byte fixed part and a variable length optional part as shown in the
Figure2(a). The header format is shown in Figure 2(b). It is transmitted
in big-endian order: from left to right, with the high-order bit of the
Version field going first. On little endian machines, software conversion
is required on both the transmission header as well as the reception
header. The key fields in the IPv4 Internet Protocol version 4 datagram
headers are the followings.
244
CIT 852 DATA COMMUNICATION AND NETWORK
The Version field specifies the IP version of the protocol, the datagram
belongs to. By including the version in each datagram, the router can
determine/interpret the reminder of the IP datagram.
The field defines the length of the header in multiples of four bytes. The
four bytes can represent a number between 0 and 15, which when
multiplied by 4, results in a 60 bytes. A typical IP datagram has 20 byte
header only, because most IP datagram do not contain options.
The Total length includes everything in the datagram both header and
data. The maximum length is 65,535 bytes. At present, this upper limit
is tolerable, but with future gigabit networks, larger datagrams may be
needed.
245
CIT 852 DATA COMMUNICATION AND NETWORK
Next, comes an unused bit and then two I-bit fields. DF stands for Don't
Fragment. It is an order to the router not to fragment the datagram
because, the destination is incapable of putting the pieces back together
again.
MF stands for More Fragments. All fragments except the last one have
this bit set. It is needed to know when all fragments of a datagram have
arrived.
The Fragment offset (13 bits) depicts the location of that the current
datagram, this fragment belongs to. All fragments except, the last one in
a datagram, must be multiple of 8 bytes, the elementary fragment unit.
Since.13 bits are provided, there is a maximum of 8192 fragments per
datagram, with a maximum datagram length of 65,536 bytes, one more
than the Total length field.
The Time to live (8 bit) field is a counter used to limit packet lifetimes. It
is supposed to count time in seconds allowing a maximum lifetime
of255 sec. It must be decremented on each hop and is supposed to be
decremented multiple times when queued for a longtime in the router. In
practice, it just counts hops. When it hits zero, the packet is dropped and
a warning packet is sent back to the source host. This feature, prevents
datagrams from wandering around forever, something that otherwise
might happen if the routing tables become corrupted.
Protocol (8 bits) is used when IP reaches its final destination. When, the
network layer has assembled a complete datagram, it needs to know
what to do with it. The Protocol field identifies the transport protocol
the network layers needs to give it to. TCP is one possibility, but so are
UDP and some others. The numbering of protocols is global across the
entire Internet.
The Header checkum verifies the header only. Such a checkum is useful
for detecting errors generated by bad memory words inside a router. this
algorithm is more robust than a normal add. Note, that the Header
checksum must be recomputed at each hop because, at least one field
always changes (the time to live field), but tricks can be used to speed up
the computation.
The Source address and Destination IP address: These fields carry the
32 bit IP addresses of the source and destination address. One portion of
the IP address indicates the network and the other portions indicate the
246
CIT 852 DATA COMMUNICATION AND NETWORK
host (or router) on the network. The IP addresses will be described in the
next section.
The Option filed (32 bits): This field allows an IP header to be extended
to be more functional. It can carry fields that control routing, timing and
security.
IP Addressing
All IP addresses are 32 bits long and are used in the Source address and
Destination address fields of IP packets.
For several decades, IP addresses were divided into the five categories
given in the Figure. The different classes are designed to cover the
needs of different types of organisations.
The three main address classes are class A, class B, and class C. By
examining the first few bits of an address, IP software can quickly
determine the class, and therefore, the structure, of an address. IP
follows these rules to determine the address class:
Class A
Class B
If, the first 2 bits of the address are 10, it is a class B network address.
The first 2 bits identify class; the next 14 bits identify the network, and
247
CIT 852 DATA COMMUNICATION AND NETWORK
the last 16 bits identify the host. There are thousands of class B network
numbers and each class B network can contain thousands of hosts.
Class C
If, the first 3 bits of the address are 110, it is a class C network address.
In a class C address, the first 3 bits arc class identifiers; the next 2] bits
are the network address, and the last 8 bits identify the host. There are
millions of class C network numbers, but each class C network is
composed of fewer than 254 hosts.
Class D
If, the first 4 bits of the address are 1110, it is a multicast address. These
addresses are sometimes called class D addresses, but they don't really
refer to specific networks. Multicast addresses are used to address
groups of computers together at moment in time. Multicast addresses,
identify a group of computers that share a common application, such as
a video conference, as opposed to a group of computers that share a
common network.
Class E
If, the first four bits of the address are 1111 it is a special reserved
address. These addresses are called class E addresses, but they don't
really refer to specific networks. No numbers are currently assigned in
this range.
IP addresses are usually written as four decimal numbers separated by
dots (periods). Each of the four numbers is in the range 0-255 (the
decimal values possible for a single byte). Because the bits that identify
class are contiguous with the network bits of the address, we can lump
them together and look at the address as composed of full bytes of
network address and full bytes of host address. If the value of the first
byte is:
Less than 128, the address is class A; the first byte is the network
number, and the next three bytes are the host address.
From 128 to 191, the address is class B; the first two bytes
identify the network, and the last two bytes identify the host.
From 192 to 223, the address is class C; the first three bytes are
the network address, and the last byte is the host number.
248
CIT 852 DATA COMMUNICATION AND NETWORK
The following table depicts each class range with other details.
249
CIT 852 DATA COMMUNICATION AND NETWORK
The size of a network (i.e., the number of host addresses available for
use on it) is a function of the number of bits used to identify the host
portion of the address. If, a subnet mask shows that 8 bits are used for
the host portion of the address block, a maximum of 256 possible host
addresses are available for that specific network. Similarly, if a subnet
mask shows that 16 bits are used for the host portion of the address
block, a maximum of 65,536 possible host addresses are available for
use on that network.
250
CIT 852 DATA COMMUNICATION AND NETWORK
each network (00001010 vs. 00001011) produces the same 23-bit subnet
mask (000001x), resulting in a consolidated 192.168.10.0 network.
However, it is not possible to combine the 24-bit 192.168.11.0 and
192.168.12.0 networks, since the binary values in the seventh bit
position (00001011 vs. 00001100) do not match when the trailing bit is
removed.
Subnet masks are used only by systems that need to communicate with
the network directly. For example, external systems do not need to be
aware of the subnet masks in use on your internal networks, since those
systems will route data to your network by way of your parent network's
address block. As such, remote routers need to know only the provider's
subnet mask. For example, if you have a small network that uses only a /
28 prefix that is, a subset of your ISP's /20 network, remote routers need
to know only about your upstream provider's /20 network, while your
upstream provider needs to know your subnet mask in order to get the
251
CIT 852 DATA COMMUNICATION AND NETWORK
data to your local /28 network. The rapid depletion of the class B
addresses showed that three primary address classes were not enough:
class A was much too large and class C was much too small. Even a
class B address was too large for many networks but was used because it
was better than the other alternatives.
252
CIT 852 DATA COMMUNICATION AND NETWORK
However, with bit masks we are no longer limited by the address class
structure. A mask of 255.255.0.0 can be applied to network address
195.4.0.0. This mask includes all addresses from 195.4.0.0 to
195.4.255.255 in a single network number. In effect, it creates a network
number as large as a class B network in the class C address space. Using
bit masks to create networks larger than the natural mask is called
supernetting, and the use of a mask instead of the address class to
determine the destination network is called Classless Inter-Domain
Routing (CIDR).
Specifying both the address and the mask is cumbersome when writing
out addresses. A shorthand notation has been developed for writing
CIDR addresses. Instead of writing network 172.16.26.32 with a mask
of 255.255.255.224, we can write 172.16.26.32/27. The format of this
notation is address/prefix-length, where prefix-length is the number of
bits in the network portion of the address. Without this notation, the
address 172.16.26.32 could easily be interpreted as a host address. RFC
1878 list all 32 possible prefix values. But little documentation is needed
because the CIDR prefix is much easier to understand and remember
than address classes. I know that 10.104.0.19 is a class A address, but
writing it as 10.104.0.19/8 shows me that this address has 8 bits for the
network number and therefore, 24 bits for the host number. I don't have
to remember anything about the class A address structure.
253
CIT 852 DATA COMMUNICATION AND NETWORK
Not all firms have the luxury of using Internet-legal addresses on their
hosts, for any number of reasons. For example, there may be legacy
applications that use hardcode addresses, or there may be t09 many
systems across the organisation for a clean upgrade to be successful. If
you are unable to use Internet-legal addresses, you should at least be
aware that there are groups of “private” Internet addresses that can be
used on internal networks by anyone. These address pools were set-
aside in RFC 1918, and therefore, cannot be “assigned” to any
organisation. The Internet's backbone routers are configured explicitly
not to route packets with these addresses, so they are completely useless
outside an organisation's internal network. The address blocks available
are listed in Table3.
Since these addresses cannot be routed across the Internet, you must use
an address-translation gateway or a proxy server in conjunction with
them. Otherwise, you will not be able to communicate with any hosts on
the Internet.
An important note here is that, since, nobody can use these addresses on
the Internet, it is safe to assume that anybody who is using these
addresses is also utilising an address-translation gateway of some sort.
254
CIT 852 DATA COMMUNICATION AND NETWORK
Therefore, while you will never see these addresses used as destinations
on the Internet, if your organisation establishes a private connection to a
partner organisation that is using the same block of addresses that you
are using, your firms will not be able to communicate on the Internet.
The packets destined for your partner's network will appear to be local
to your network, and will never be forwarded to the remote network.
There are many other problems that arise from using these addresses,
making their general usage difficult for normal operations. For example,
many application-layer protocols embed addressing information directly
into the protocol stream, and in order for these protocols to work
properly, the address-translation gateway has to be aware of their
mechanics. In the preceding scenario, the gateway has to rewrite the
private addresses (which are stored as application data inside the
application protocol), rewrite the UDP/TCP and IP checksums, and
possibly rewrite TCP sequence numbers as well. This is difficult to do
even with simple and open protocols such as FTP, and extremely
difficult with proprietary, encrypted, or dynamic applications (these are
problems for many database protocols, network games, and voice-over-
IP services, in particular). These gateways almost never work for all the
applications in use at a specific location.
Fragmentation
What happens if the original host sends a source packet which is too
large to be handled by the destination network? The routing algorithm
can hardly bypass the destination.
255
CIT 852 DATA COMMUNICATION AND NETWORK
This means that 4,980 data bytes in the original datagram must be
allocated to four separate segments (each of which are also IP
datagram). The original datagram has been stamped with an
identification number 999. It is desirable to have a minimum number of
fragments because fragmentation and reassembling creates extra
overheads or a network system and a host. This is done by limiting the
size of UDP and TCP segments to small size.
256
CIT 852 DATA COMMUNICATION AND NETWORK
Open Shortest Path First (OSPF) has become standard interior gateway
routing protocol. It supports many advanced features [Ref! and Ref5] to
meet a long list of requirements.
257
CIT 852 DATA COMMUNICATION AND NETWORK
258
CIT 852 DATA COMMUNICATION AND NETWORK
After having described all the components of OSPF, let us now conclude
the topic by describing its operation.
At its heart, however, OSPF is a link state protocol that uses flooding of
link state information and Dijkstra's Least-Cost path algorithm. Using
flooding each router informs all other routers in its area of its neighbours
and costs. This information allow each router to construct the graph for
its area (s) and computers the shortest path using Dijkstra's algorithm.
This is done by backbone routers also. In addition backbone routers
accept information from the area border routers in order to compute the
best route from each backbone router to every other router. This
information is propagated back to area border routers, which advertise it
within their areas. In this manner, the optimal route is selected.
259
CIT 852 DATA COMMUNICATION AND NETWORK
After receiving all the paths from the neighbours, 0 will find the best
route available. It will outright reject the path from C and E, since they
pass through 0 itself. Therefore, the choice left is between a route
announced by Band H. BOP easily solves count to infinity problems.
Now, suppose C crashes or the line B-C is down. Then if B receives,
two routes from its 2 neighbours: ABCDK and FBCDK, then these
which can be rejected because it passes through C itself. Other distance
vector algorithms make the wrong choice because, they cannot tell
which of their neighbours have independent routes to their destination or
not.
4.0 CONCLUSION
5.0 SUMMARY
260
CIT 852 DATA COMMUNICATION AND NETWORK
261
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Transport Services
3.1.1 Types of Services
3.1.2 Quality of Service
3.1.3 Data Transfer
3.1.4 Connection Management
3.1.5 Expedited Delivery
3.2 Elements of Transport Layer Protocols
3.2.1 Addressing
3.2.2 Multiplexing
3.2.3 Flow Control and Buffering
3.2.4 Connection Establishment
3.2.5 Crash Recovery
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
The transport layer is the core of the OSI model. It is not just another
layer but the heart of the whole protocol hierarchy. Protocols at this
layer oversee the delivery of data from an application program on one
device to an application program on another device. It is the first end-to-
end layer in the OSI model. It provides its services to the upper layer to
use the services of the network layer and other lower layer protocols.
262
CIT 852 DATA COMMUNICATION AND NETWORK
In this unit, we will first discuss types of services we might expect from
a transport layer. Next, we will examine several mechanisms to support
these services.
2.0 OBJECTIVES
263
CIT 852 DATA COMMUNICATION AND NETWORK
Types of services
Quality of service
Data transfer
Connection management
Expedited delivery
Connection-Oriented
264
CIT 852 DATA COMMUNICATION AND NETWORK
Connectionless Service
There is no handshaking here before sending the packet. There are also
no flow control and congestion control mechanisms. Since there is no
handshaking procedure, data can be transferred faster. But there is no
reliable data transfer either as these services are acknowledged. The
Internets connectionless service is called UDP (User Datagram
Protocol). Some of the applications of connection less service are
internet telephony and video conferencing.
The transport protocol entity should allow the upper layer protocol users
to specify the types of quality of transmission service to be provided.
Based on these specifications the transport entity attempts to optimise
the use of the underlying link, network, and other resources to the best
of its ability, so as to provide the collective requested services. But these
services are limited to the internet capabilities of the network layer
services.
265
CIT 852 DATA COMMUNICATION AND NETWORK
You are aware that IP is a standard protocol for the network layer. IP
does provide a quality-of-service parameter such as priority as well as a
binary specification for normal or low delay, normal or high throughput,
and normal or high reliability. Thus, the transport entity can make a
request to the internetwork entity. The network may alter flow control
parameters and the amount of network resources allocated on a virtual
circuit to achieve desired throughput. The transport layer may also split
one transport connection among multiple virtual circuits to enhance
throughput. This will be explained in section 3.2.2.
By reliable data transfer means that there is not a single bit of loss of
data during transmission. There are certain types of application, which
does not tolerate any loss of data, such as financial applications. In
particular, a loss of file data, or data in a financial transaction, can have
devastating consequences (in the latter case, for either the bank or the
customer). Other applications in the category are transfer of web
documents, electronic mail, file transfer and remote host access. But
there are some applications which can tolerate some amount of data loss.
266
CIT 852 DATA COMMUNICATION AND NETWORK
(ii) Bandwidth
The concept of bandwidth has be~ explained in the first block. Just to
recall, higher the bandwidth more the channel capacity. There are
certain applications, which are bandwidth sensitive. For example, the
Internet telephony, requires a given amount of bandwidth. But there are
some other types of application called elastic application which can
make use of as much or as little bandwidth as happens to be available.
Electronic mail, file transfer, and Web transfers are all elastic
application [Ref.2] of course; the more bandwidth, and the better would
be transport capacity.
(iii) Timing/delay
Here, you may ask the question if the network layer does a similar task,
why it is necessary at the transport layer. The network layer overseas the
hop by hop delivery of the individual packet but does not see any
relationship between those packets even those belonging to a single
message. Each packet is treated as an independent entity. The transport
layer on the other hand makes sure that not just a single packet but the
entire sequence of packets.
267
CIT 852 DATA COMMUNICATION AND NETWORK
3.2.1 Addressing
268
CIT 852 DATA COMMUNICATION AND NETWORK
3) The application process then sends a request for the next 10 days
weather report.
The question, that needs to be addressed: How does the host user know
that the address of the destination server process is attached to a
particular transport connection. To resolve this issue various strategies
are suggested [Refer 1]:
269
CIT 852 DATA COMMUNICATION AND NETWORK
3.2.2 Multiplexing
270
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 3: Multiplexing
271
CIT 852 DATA COMMUNICATION AND NETWORK
There are similarities as well as differences between data link layer and
transport layer in order to support flow control mechanism. The
similarity is in using the sliding window protocol. The main difference
is that a router usually has relatively few lines, whereas a host may have
numerous connections. Due to this reason it is impractical to implement
the data link buffering strategy in the transport layer.
The following delay may arise during the interaction of the two
transport entities A and B:
(i) Waiting time to get permission from its own transport entity
(interface flow control).
(ii) Waiting time by A to have permission to send the data to B.
(iii) Waiting time as network layer services.
In any case, once the transport entity has accepted the data, it sends out a
segment. Some time later, it receives an acknowledgement that the data
has been received at the remote end. It then sends a confirmation to the
sender.
First, we present two ways of coping with the flow control requirement
[Ref.3] by using a fixed sliding-window protocol and by using a credit
scheme.
272
CIT 852 DATA COMMUNICATION AND NETWORK
This scheme really works well. For example, consider a protocol with a
window size of 3. Whenever the sender receives an acknowledgement
from a particular segment, it is automatically authorised to send the
succeeding seven segments. (Of course, some may already have been
sent). Now, when the receiver’s butter capacity comes down to 7
segments, it can withhold acknowledgement of incoming segments to
avoid overflow. The sending transport entity can send, at most, seven
additional segments and then must stop. Because the underlying network
service is reliable, the sender will not time-out and retransmit. Thus, at
some point, a sending transport entity may have a number of segments
outstanding, for which no acknowledgement has been received. Because
we are dealing with a reliable network, the sending transport entity can
assume that the segments will come through and that the lack of
acknowledgement is a flow control tactic. Such a strategy would not
work well in an unreliable network, as the sending transport entity
would not know whether the lack of acknowledgement is due to flow
control or a lost segment.
From the receiving point of view, the concern is for received data and
for the window of credit that has been allocated. Note that the receiver is
273
CIT 852 DATA COMMUNICATION AND NETWORK
In both the credit allocation scheme and the sliding window scheme, the
receiver needs to adopt some policy concerning the amount of data it
permits the sender to transmit. The conservative approach is only to
allow new segments up to the limit of available butter space.
274
CIT 852 DATA COMMUNICATION AND NETWORK
Transport Entity A
Transport Entity A
!o!li21J\4lSl6l7IO\U2l:j\4!S\6\7\
(f) No remaining credits for A
Transport Entity B .
_,l.'l
c· -.t' >' --- lol 112lr3l4ul5rl6r!7!.olrli2n13m1415r16,17r1 ---
c
@ Acknowledsment of S segments by rece1ver
Transport Entity A
lol!1213141sl6!7!o! ti213!4ISI617!
275
CIT 852 DATA COMMUNICATION AND NETWORK
As connections are opened and closed and as the traffic pattern changes,
the sender and receiver needs to dynamically adjust their buffer
allocations. Consequef1tly, the transport protocol should allow a
sending host to request buffer space at the other end. Buffers could be
allocated per connection, or collectively, for all the connections running
between the two hosts. Alternatively, the receiver, knowing its buffer
station (but not knowing the offered traffic) could tell the sender “I have
reserved X buffers for you”. If the number of open connections should
increase, it may be necessary for an allocation to be reduced, so the
protocol should provide for this possibility.
276
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
In this unit you have learnt about transport services mechanism which
comprise types of transport services, quality of service data transfer
mechanism, connection establishment, multiplexing and finally flow
control and buffering.
5.0 SUMMARY
277
CIT 852 DATA COMMUNICATION AND NETWORK
278
CIT 852 DATA COMMUNICATION AND NETWORK
UNIT 2 TCP/UDP
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Services Provided by Internet Transport Protocols
3.1.1 TCP Services
3.1.2 UDP Services
3.2 Introduction to UDP
3.3 Introduction to TCP
3.4 TCP Segment Header
3.5 TCP Connection Establishment
3.6 TCP Connection Termination
3.7 TCP Flow Control
3.8 TCP Congestion Control
3.9 Remote Procedure Call
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
UDP is a much simpler protocol than TCP because, it does not establish
any connection between the two nodes. Unlike TCP, UDP does not
guarantee the delivery of data to the destination. It is the responsibility
of application layer protocols to make UDP as reliable as possible.
279
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
list and explain the various services provided by the Transport Layer
establish and release TCP connections
describe TCP and UDP header formats
describe TCP Flow Control mechanism and how it is different from
data link layer
discuss the Congestion mechanism in TCP.
The Internet provides two service models: TCP and UDP. The selection
of a particular service model is left to the application developers. TCP is
a connection oriented and reliable data transfer service whereas UDP is
connectionless and provides unreliable data transfer service.
Connection-oriented service
As you are aware from your understanding of the previous unit that the
connection oriented service is comprised of the handshake procedure
which is a full duplex connection in that, two processes can send
messages to each other over the connection at the same time. When the
application has finished sending the message, it must remove the
connection. The service is referred to as a “connection oriented” service.
We are also aware from the discussion on the network layer that this
service is implemented through the virtual circuit mechanism.
280
CIT 852 DATA COMMUNICATION AND NETWORK
Communicating processes can rely on TCP to deliver all the data that is
sent, without error and in the proper order. When one side of the
application passes a stream of bytes into a socket, it can count on TCP to
deliver the same stream of data to the receiving socket, with no missing
or duplicate bytes. Reliability in the Internet is achieved with the use of
acknowledgement and retransmissions.
Now we will look at the services TCP does not provide? Some of these
are:
281
CIT 852 DATA COMMUNICATION AND NETWORK
So you might have guessed from the previous section, that UDP is and
unreliable transport protocol. Apart from multiplexing/demultiplexing
and some error correction UDP adds little to the IP protocol. In this
section, we take a look at UDP, at how it works and at what it does.
So you might ask a question then why is UDP required? TCP should be
the choice for all types of application layer/protocol. DNS stands for
domain name system. It provides a directory service for the internet. It is
commonly used by other application protocols (HTTP, FTP etc.) to
translate user given host names to IP address. But before we answer
your question let-us look at another application called the DNS, which
runs exclusively in UDP only but unlike other protocols DNS is not an
application with which users interact directly. Instead DNS is a core
Internet function that translates the host name to IP addresses. Also
unlike other protocols, DNS typically uses UDP. When the DNS
application in a host wants to make a query, it constructs a DNS query
message and passes the message to the UDP. Without performing any
handshaking with the UDP entity running on the destination end system,
UDP adds header fields to the message and passes the resulting segment
to the network layer. The network layer encapsulates the UDP segment
into a datagram and sends the datagram to a name server. The DNS
application at the querying host then waits for a reply to its query. If it
doesn’t receive a reply (possibly because the underlying network lost the
282
CIT 852 DATA COMMUNICATION AND NETWORK
query or the reply), either it tries sending the query to another name
server, or it informs the invoking application that it can’t get a reply.
Like DNS, there are many applications, which are better suited for UDP
for the following reasons [Ref2]:
No Connection Establishment
Since UDP does not cause any delay in establishing a connection, this is
a probably the principal reason why DNS runs over UDP rather than
TCP-DNS which would be much slower if it runs over TCP. H1’TPuses
TCP rather than UDP, since reliability is critical for Web pages with
text.
Now let us examine the application services that are currently using the
UDP protocol. For example, remote file server, streaming media,
internet telephony, network management, routing protocol such as RIP
and, of course, DNS use UDP. Other applications like e-mail, remote
terminal access web surfing and file transfer use TCP. Please see
reference [2] for further details.
Before discussing the UDP segments structure, now, let us try to answer
another question. Is it possible to develop a reliable application on
UDP? Yes, it may be possible to do it by adding acknowledgement and
retransmission mechanisms, at the application level. Many of to day’s
283
CIT 852 DATA COMMUNICATION AND NETWORK
proprietary streaming applications do just this -they run over UDP, but
they have built acknowledgements and retransmissions into the
application in order to reduce packet loss. But you understand that it will
lead to complete application software design.
UDP is an end to end transport level protocol that adds only port
addresses, checksum error control and length information to the data
from the upper layer.
The application data occupies the data field of the UDP segment. For
example, for DNS, the data field contains either a query message or a
response message. For a streaming audio application, audio samples fill
the data field. The packet produced by UDP is called a user datagram.
The UDP header has only four fields, each consisting of two bytes
[Figure 1]. Let us discuss each field separately:
It is the address of the application program that has created the message.
Total length
284
CIT 852 DATA COMMUNICATION AND NETWORK
[When the PSH (data push) bit is set, this is an indication that the
receiver should pass the data to the upper layer immediately. The URG
(Urgent) bit is used to indicate that there is data in this segment that the
sending side upper layer entity has marked as urgent. The location of the
last byte of this urgent data is indicated by the 16 bit urgent data pointer
field 7).
TCP uses only a single type of protocol data unit, called a TCP segment.
The header is shown in Figure 2. Because one header must perform all
protocol mechanisms, it is rather large, with a minimum length of 20
octets. A segment beginning with 9 fixed format 20 byte headers may be
followed by header option [Ref. I]. After the options, if any, up to
65,535 -20 (IP header) -(TCP header) = 65,445 data bytes may follow.
A Segment with no data is used, for controlling messages and
acknowledgements.
285
CIT 852 DATA COMMUNICATION AND NETWORK
Source service access points and identify local end points of connection.
Sequence number of the first data octet in this segment except when
SYN is present. IfSYN is present, it is the initial sequence number
(ISN), and the first data octet is ISN + 1.
Reserved (6 bits)
Flags (6 bits):
URG: Used to indicate that there is data in this segment which sends the
at the upper layer has marked urgent. The location of the last byte of this
urgent data is indicated by the 16 bit urgent data pointer field.
ACK: Acknowledgement field indicates that the value carried in the
ACK field is valid.
PSH: Push function. The receiver is represented to deliver the data to the
application upon arrival, and not butter it until a full butter has been
received.
RST: Reset the connection due to host crash or some other reason.
286
CIT 852 DATA COMMUNICATION AND NETWORK
Used for credit based flow control scheme, in bytes. Contains the
number of data bytes beginning with the one indicated in the
acknowledgement field that the receiver is willing to accept.
Points to the octet following the urgent data; this allows the receiver to
know how much urgent data is coming.
Options (Variable)
Several of the fields in the TCP header warrant further elaboration. The
source port and destination port specify the sending and receiving users
of TCP. As with IP, there are a number of common users of TCP that
have been assigned numbers; these numbers should be reserved for that
purpose in any implementation. Other port numbers must be arranged by
agreement between communicating parties.
287
CIT 852 DATA COMMUNICATION AND NETWORK
Now, let us test how this mechanism handles delayed SYN and ACK
packets. It is shown that old SYN X arrives at B after the close of the
relevant connection as shown in Figure 3 (b). B assumes that this is a
fresh request and responds with SYN j, ACK i When A receives this
message, it realises that it has not requested a connection and therefore,
sends an RST, ACKj. Note that the ACKj portion of the RST message is
essential so that an old duplicate RST does not abort a legitimate
connection establishment. The final example Figure 3 (c) shows a case
in which an old SYN, ACK arrives in the middle of a new connection
establishment Because of the use of sequence numbers in the
acknowledgements, this event causes no harm.
SYNi
288
CIT 852 DATA COMMUNICATION AND NETWORK
289
CIT 852 DATA COMMUNICATION AND NETWORK
Acknowledgement Policy
Flow Control is the process of regulating the traffic between two end
points and is used to prevent the sender from flooding the receiver with
too much data. TCP provides a flow control service to its application to
eliminate the possibility of the sender overflowing. At the receivers
buffer TCP uses sliding window with credit scheme to handle flow
control. The scheme provides the receiver with a greater degree of
control over data flow. In a credit scheme a segment may be
acknowledged without the guarantee of a new credit and vice-versa.
Whereas in a fixed sliding window control (used at the data link layer),
the two are interlinked (tied).
Assume that the sender wants to send application data to the receiver.
The receiver has 4 K byte buffer which is empty as shown below:
290
CIT 852 DATA COMMUNICATION AND NETWORK
0 4 Kbyte
1) Initially buffer size= Empty
Receivers
Buffer = [2 K data Empty
Receivers
Buffer = Full
5) The sender must stop sending data until the application process
on the receiving host has removed some data from the buffer, at
which time TCP can advertise, a large window (credit value).
Receivers Application
Buffer = has read 2 K 2K
byte data
When the credit size is zero, normally there is no transmission from the
sender side except in two situations:
291
CIT 852 DATA COMMUNICATION AND NETWORK
Both senders and receivers can delay me transmission from their side to
resources. If a sender knows that the buffer capacity of a receiver
window is 8 K and currently it has received just 2 K, then it may buffer
it at the sender side till it gets more data from the application process.
Similarly, the receiver has to send some data to the sender it can delay
the acknowledgement till its data is ready for that the acknowledgement
can be piggybacked. Therefore, the basic reason of delaying the
acknowledgement is to reduce the bandwidth.
Total no. of bytes sent by the server = 20 bytes (TCP) +20 byte
(IP) = 40 bytes No extra byte is required for an
acknowledgement.
292
CIT 852 DATA COMMUNICATION AND NETWORK
Total no. bytes -20 bytes (TCP) + 20 byte (IP) + 1 byte (0 char) =
41 bytes.
The algorithm works as follows: When data comes the sender one byte
at a time, just send the first byte and buffer all the rest until the
outstanding byte is acknowledged. In the meantime, if the application
generates some more characters before the acknowledgement arrives,
TCP will not transmit the character but buffer them instead. After the
acknowledgement arrives TCP transmits all the characters that have
been waiting in the buffer in a single segment.
Another problem that wastes network bandwidth is when the sender has
a large volume of data to transmit and the receiver can only process its
receiver buffer a few bytes at a time. Sooner or later the receiver buffer
becomes full. When the receiving application reads a few bytes from the
receive buffer, the receiving TCP sends a small advertisement window
to the sender, which quickly transmits a small segment and fills the
receiver buffer again. This process goes on and on with many small
segments being transmitted by the sender for a single application
message. This problem is called the silly window syndrome. It can be
avoided if the receiver does not advertise the window until the
window size is at least as large as half of the receiver buffer size or
the maximum segment size. The sender side can cooperate by
refraining from transmitting small segments.
293
CIT 852 DATA COMMUNICATION AND NETWORK
Step II: Application process reads one byte at the receiver side.
Step III: The TCP running at the receiver sends a window update to
the sender.
294
CIT 852 DATA COMMUNICATION AND NETWORK
The protocols designers have to see that the network should be utilised
very efficiently (i.e., no congestion and no underutilisation). If the
senders are too aggressive and send too many packets, the network will
experience congestion. On the other hand, if TCP senders are too
conservative, the network will be underutilised. The maximum amount
of bytes that a TCP sender can transmit without congesting the network
is specified by another window called the congestion window. To avoid
network congestion and receiver buffer overflow, the maximum amount
of data that the TCP sender can transmit at any time is the minimum of
the advertised window (receiver window) and the congestion window.
Thus, the effective window is the minimum of what the sender thinks is
OK and what the receiver thinks is OK. If the receiver advertises for 8 K
window but the sender sends 4 K size of data if it thinks that 8 K will
congest the network, then the effective windows size is 4K.
The approach used in TCP is to have each sender limit the rate of data
traffic into the network as a function of perceived network congestion. If
a TCP sender perceives that there is small congestion along the path,
then it increases its send rate otherwise it reduce it
295
CIT 852 DATA COMMUNICATION AND NETWORK
the algorithm to reduce the rate of increase so that it will not overshoot
excessively. Specifically, the algorithm increases the congestion
window linearly rather than exponentially when it tries to avoid
congestion. This is realised by increasing the congestion window by one
segment for each round-trip time.
Number of transmissions
How does TCP detect network congestion? There are two approaches:
296
CIT 852 DATA COMMUNICATION AND NETWORK
You may wish to refer the references [1], [2] and [4] for further
clarification on the subject.
In this section we will look at two other files access mechanisms such as
Network File System and Remote Procedure Call used for accessing
files from a server at the client machine. These two mechanism allow
programs to call procedures located on remote machines.
297
CIT 852 DATA COMMUNICATION AND NETWORK
The network file system (NFS) is a file access protocol. FTP and TFTP
transfer entire files from a server to the client host. A file access service,
on the other hand, makes file systems on a remote machine visible,
though they were on your own machine but without actually transferring
the files. NFS provides a number of features:
(1) NFS allows you to edit a file on another machine exactly as you
would if it were on your own machine.
(2) It even allows you to transfer files from the server to a third host
not directly connected to either of you.
298
CIT 852 DATA COMMUNICATION AND NETWORK
4.0 CONCLUSION
299
CIT 852 DATA COMMUNICATION AND NETWORK
This unit has taken you through the various services provided by the
Transport layer as well as how to establish and release TCP connections.
You have also learnt how the TCP Flow Control mechanism and how it
is different from data link layer as well as congestion mechanism in
TCP.
5.0 SUMMARY
In this unit, we discussed the two transport layer protocols (TCP &
UDP) in detail.
The transport port can be light weight (very simple) which provide very
little facility. In such cases, the application directly talks to the IP. UDP
is an example of a transport protocol, which provides minimum facility,
with no control, no connection establishment, no acknowledgement and
no congestion handling feature. Therefore, if the application is to be
designed around the UDP, then such features have to be supported in the
application itself. On the other hand, there is another protocol- TCP
which provides several feature such as reliability, flow control,
connection establishment to the various application services.
Nevertheless, the services that the transport layer can provide often
constrain the network layer protocol.
300
CIT 852 DATA COMMUNICATION AND NETWORK
301
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Cryptography
3.2 Public Key Cryptography
3.3 Public Key Cryptography
3.3.1 RSA Public Key Algorithm
3.3.2 Diffie-Hellman
3.3.3 Elliptic Curve Public Key Cryptosystems
3.3.4 DSA
3.4 Mathematical Background
3.4.1 Exclusive OR
3.4.2 The Modulo Function
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
Secret writing can be traced back to 3,000 B.C. when it was used by the
Egyptians. They used hieroglyphics to conceal writing from unintended
recipients. Hieroglyphics is derived from the Greek word hieroglyphica,
which means “sacred carvings”. Hieroglyphics evolved into hieratic,
which was easier to use script. Around 400 B.C., military cryptography
was employed by the Spartans in the form of strip of papyrus or
parchment wrapped around a wooden rod. This system is called a
Scytale. The message to be encoded was written lengthwise down the
rod on the wrapped material. Then, the material was unwrapped and
carried to the recipient. In unwrapped form, the writing appeared to
random characters, and to read again the material was rewound on a rod
of the same diameter and length.
302
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
3.1 Cryptography
Types of Operation
303
CIT 852 DATA COMMUNICATION AND NETWORK
Key Used
If both sender and the receiver use the same key, then it is referred to as
symmetric, single-key, secret-key, or conventional encryption. And if
the encryption and decryption key are different, the system is
asymmetric key, two-key, or public key encryption.
About twenty years ago, cryptography was the art of making and
breaking codes. The codes were used to transfer messages over an
unsecured channel. The channel should be protected from intruders who
read, insert, delete or modify, messages, as depicted in Figure I. The
transmission of a message is done using an encryption function E that
converts the message or plaintext using the key into a cipher teXt. The
receiver does the reverse of this operation, using the decryption function
D and a decryption key to recover the plaintext from the cipher text. The
key is distributed in advance over a secure channel, for example by
courier.
Normally, the encryption and decryption function, but not the key, are
considered known to the adversary, so the protection of the information
depends on the key only. If the enemy knows the key, the whole system
is useless until a new key is distributed. In secret Key Cryptography, a
single key is used for both encryption and decryption, as shown in
Figure I. The main difficulty with this approach is the distribution of the
key.
304
CIT 852 DATA COMMUNICATION AND NETWORK
Block Ciphers
305
CIT 852 DATA COMMUNICATION AND NETWORK
One bit error in a ciphertext cannot affect the decrypted plaintext after n
bits. This makes the cipher self-synchronisirig.
The block cipher used should have sufficiently large block size to avoid
substitution attacks.
306
CIT 852 DATA COMMUNICATION AND NETWORK
Figure 5: Transition
S-Boxes
Lookup tables that map n bits to m bits, where n and m are often equal.
There are several ways of constructing and measuring good S-boxes for
ciphers.
The S-box may even be the only non-linear part of the cipher (e.g.,
DES) and thus, may be considered as the single most important part of
the cipher. In fact, DES’s S-boxes are so good that it is used in many
other ciphers design (for example, Serpent).
Feistel Networks
The original idea was used in the block cipher, Lucifer, invented by
Horst Feistel. Several variations have been devised from the original
version. A Feistel network (Figure 6) is a general way of constructing
block ciphers from simple functions. The standard Feistel network takes
a function from n bits to n bits and produces an invertible function from
2n bits to 2n bits. The structure of Fiestel network is based on round
function. The essential property of Feistel networks that makes them so
useful in cipher design is that the round function need not be invertible,
but always is the resulting function. If the round function depends on,
307
CIT 852 DATA COMMUNICATION AND NETWORK
say, k bits of a key, then the Feistel cipher requires rk bits of the key
where r is the number of rounds used. The security of the Feistel
structure is not obvious. It is compulsory that a Feistel cipher has
enough number of rounds, but just adding more rounds does not always
guarantee security.
The process of taking the user key and expanding it into rk bits for the
Feistel rounds is called key scheduling. This is often a non-linear
operation and hence does not directly provide any information about the
actual user key. There are many ciphers that have this basic structure;
Lucifer. DES, and Twofish etc.
Expansion, Permutation
They are linear operations, and thus, not sufficient to guarantee security.
They are common tools in mixing bits in a round function and when
used with good non-linear B-boxes (as in DES) they are vital for the
security because they propagate the non-linearity uniformly over all bits.
All block ciphers can be designed in bitslice manner, but this could
affect the speed of operations such as addition and multiplication they
may become very slow. On the other hand, permutations are almost free
as they only require a renaming of the registers and this can be done at
the coding level. Thus, for example, in DES exhaustive key search using
bitslice techniques, one can increment the current key in, a fraction of a
time than is usually needed for key scheduling.
308
CIT 852 DATA COMMUNICATION AND NETWORK
Modes of Operation
Block ciphers are the most commonly used cipher. Block ciphers
transform a fixed-size block of data (usually 64 bits) into another fixed-
size block (possibly 64 bits wide again) using a function selected by the
key. If the key, input block and output block have all n bits, a .block
cipher basically defines a one-to-one mapping from n-bit integers to
permutations of n-bit integers.
If the same block is encrypted twice with the same key. the resulting
ciphertext blocks are also the same (this mode of encryption is called
electronic code book, or ECB). This information could be useful for an
attacker. For identical plaintext blocks being encrypted to different
ciphertext blocks, three standard modes are generally used:
First XORing the plaintext block with the previous ciphertext block
obtains a ciphertext block, and then the resulting value needs to be
encrypted. In this, leading blocks influence all trailing blocks, which
increases the number of plaintext bits one ciphertext bit depends on, but
this may also leads to synchronisation problems ifone block is lost. The
Process of Cipher Block Chaining shown in Figure 7. In this Figure m”
m” m) are messages and C1, C2 and C3 are ciphertexts.
309
CIT 852 DATA COMMUNICATION AND NETWORK
310
CIT 852 DATA COMMUNICATION AND NETWORK
The one-time pad (OTP) is the only cipher that has been proven to be
unconditionally ‘secure, i.e., unbreakable in practice. Further, it has
been proven that any unbreakable, unconditionally secure cipher must
be a one-tin1e pad.
The main practical problem is that the key does not have a small
constant length, but the same length as the message, and one part of a
key should never be used twice (or the cipher can be broken). However,
this cipher has allegedly been in widespread use since its invention, and
even more since the security proof by C. Shannon in 1949. Although,
admittedly the security of this cipher had been conjectured earlier, it was
Shannon who actually found a formal proof for it.
DES
DES is a block cipher with a 64-bit block size. It uses 56-bit keys. This
makes it suspectible to exhaustive key search with modem computing
powers and special-purpose hardware. DES is still strong enough to
keep most .random hackers, adversaries and individuals out, DES is
easily breakable with special hardware by, government, criminal
organizations etc. DES is getting too weak, and should not be used in
new applications. NIST proposed in 2004 to withdraw the DES
standard.
311
CIT 852 DATA COMMUNICATION AND NETWORK
DES uses a 56-bit key, which is divided into eight 7-bit blocks and an
8th odd parity bit is added to each block (i.e., a “0” or “I” is added to the
block so that there are an odd number of I bit in each 8-bit block). By
using the 8 parity bits for rudimentary error detection, a DES key is
actually 64 bits in length for computational purposes (although it only
has 56 bits worth of randomness, or entropy).
312
CIT 852 DATA COMMUNICATION AND NETWORK
313
CIT 852 DATA COMMUNICATION AND NETWORK
Ln = Rn-1
Rn = Ln-1 XOR f(Rn-1, Kn)
The new L block value is taken from the prior R block value- The new
R block is calculated by taking the bit-by-bit exclusive-OR (XOR) of
the prior Lblock with the results of applying the DES cipher function,f,
to the prior R block and Kn. (Kn is a 48-bit value derived from the 64-bit
DES key). Each round uses a different 48 bits according to the
standard’s Key Schedule algorithm.
The cipher function, f, combines the 32-bit R block value and the 48-bit
subkey in the following way:
The result is a 48-bit value that is then divided into eight 6-bit
blocks.
These are fed as input into 8 selection (S) boxes, denoted S 1,….,S8.
Each 6-bit input yields a 4-bit output using a table lookup based
on the 64 possible inputs; this results in a 32-bit output from the
S-box. The 32 bits are then rearranged by a permutation function
(P), producing the results from the cipher function.
The results from the final DES round – i.e., L16 and R16 -are recombined
into a 64-bit value and fed into an inverse initial permutation (IP-1). At
this step, the bits are rearranged into their original positions, so that the
58th, 50th, and 42nd bits, for example, are moved back into the 1st, 2nd,
and 3rd positions, respectively. The output from IP-’ is the 64-bit
ciphertext block.
Breaking DES
DES’s 56-bit key was too short to withstand a brute-force attack from
computing power of modern computers. Remember Moore’s Law:
computer power doubles every 18 ‘months. Keeping this law in mind, a
key that could withstand a brute-force guessing attack in 2000 could
314
CIT 852 DATA COMMUNICATION AND NETWORK
315
CIT 852 DATA COMMUNICATION AND NETWORK
possible values. The DES cracker team initially assumed that some
recognisable plaintext would appear in the decrypted string even though
they didn’t have a specific known plaintext block. They then applied all
256 possible key values to the 64-bit block. The system checked to find if
the decrypted value of the block was “interesting”, which they defined
as bytes containing one of the alphanumeric characters, space, or some
punctuation. As the likelihood of a single byte being “interesting” is
about ¼, then the likelihood of the entire 8-byte stream being
“interesting” is about ¼8, or 1/65536 (½16). This dropped the number of
possible keys that might yield positive results to about 240, or about a
trillion.
DES Variants
EX2(EX1(P)) = EX3(P)
316
CIT 852 DATA COMMUNICATION AND NETWORK
C = EY2(EY1(P))
P = DYl(DY2(C))
C = EK3(DK2(EK1(P))
where EK(P) and DK(P) represent DES encryption and decryption,
respectively, of some plaintext P using DES key K. This is also
sometimes referred to as an encrypt-decrypt-encrypt mode operation.
P = DK1(EK2(DK3(C)))
317
CIT 852 DATA COMMUNICATION AND NETWORK
AES
318
CIT 852 DATA COMMUNICATION AND NETWORK
For simplicity, the block and cipher key are often given as an array of
columns where each array has 4 rows and each column represents a
single byte (8 bits). The number of columns in an array representing the
319
CIT 852 DATA COMMUNICATION AND NETWORK
state or cipher key, then, can be calculated as the block or key length
divided by 32 (32 bits = 4 bytes). An array representing a State will have
Nb columns, where Nb values of 4, 6, and 8 correspond to a 128-, 192-,
and 256-bit block, respectively. Similarly, an array representing a
Cipher Key will have Nk columns, where Nk values of 4, 6, and 8
correspond to a 128-, 192-, and 256-bit key, respectively. An example of
a 128-bit State (Nb = 4) and I 92-bit Cipher Key (Nk = 6) is shown
below:
The AES version of Rijndael does not support all nine combinations of
block and key lengths, but only the subset using a l28-bit block size.
NIST calls these supported variants AES-128, AES-192, and AES-256
where the number refers to the key size. The Nb, Nk, and Nr values
supported in AES are:
320
CIT 852 DATA COMMUNICATION AND NETWORK
The shift rows transformation cyclically shifts the bytes in the bottom
three rows of the State array. According to the more general Rijndael
specification, rows 2, 3, and 4 are cyclically left-shifted by C I, C2, and
C3 bytes, respect!vely, per the table below:
321
CIT 852 DATA COMMUNICATION AND NETWORK
The current version of AES, of course, only allows a block size of 128
bits (Nb = 4) so that CI=I, C2=2, and C3=3.
The diagram below shows the effect of)the Shift Rows transformation
on State s:
The column position does not change, however, the values within t\1e
column change.
The AES defines a key schedule by which the original Cipher Key (of
length Nk 32-bit words) is used to form an Expanded Key. The
Expanded Key size is equal to the block size multiplied by the number
of encryption rounds plus I, which will provide Nr+1 different keys.
(Note that there are Nr encipherment rounds but Nr+1.
322
CIT 852 DATA COMMUNICATION AND NETWORK
respectively. The original Cipher Key occupies the first portion of the
Expanded Key and is used to produce the remaining new key material.
The result is an Expanded Key that can be 11, 13, or 15 separate keys,
each used for one AddRoundKeY operation. These, then, are the Round
Keys. The diagram below shows an example using a 192-bit Cipher Key
(Nk=6). Shown in magenta italics:
This new design uses a special type of a Feistel network, which depends
heavily on the instruction sets available on modern 32-bit processors.
This has the benefit that on these target machines it is efficient, but it
may lead to implementation problems/difficulties in cheaper
architectures like smart cards.
323
CIT 852 DATA COMMUNICATION AND NETWORK
a Feistel cipher, but utilises many different ideas. This cipher has key
dependent S-boxeslike Blowfish (another cipher by Bruce Schneier).
Blowfish
CAST-128
IDEA
Rabbit
324
CIT 852 DATA COMMUNICATION AND NETWORK
RC4
(a) 1
(b) 0
(c) Indeterminate
(d) 10
2) A block cipher:
(a) 64 bits
(b) 128 bits
(c) Variable
(d) 256 bits
(a) 56 or 64 bits
(b) 512 bits
(c) 128,192,or 256 bits
(d) 512 or 1024 bits
325
CIT 852 DATA COMMUNICATION AND NETWORK
Generic PKC uses two keys that are mathematically related and
knowledge of one key does not allow someone to easily determine the
other key. One key is used to encrypt and the other key is used to
decrypt. It does not matter which key is applied first and because a pair
of keys are used, this is called asymmetric key cryptography. In PKC,
one of the keys is designated as the public key and the other key is
designated as the private key. The public key may be advertised but the
private key is never revealed to another party. It is straightforward
enough to send messages under this scheme. Suppose Alice wants to
send Bob a message, Alice encrypts some information using Bob’s
public key; Bob decrypts the ciphertext using his private key.
The most common PKC implementation is RSA, named after the three
MIT mathematicians who developed it – Ronald Rivest, Adi Shamir,
and Leonard Adleman. RSA can be used for key exchange, digital
signatures, or encryption of small blocks of data. The Figures 11 and 12
highlights how digital signature are created and verified. The detailed
discussion will be made in the next unit. RSA uses a variable size
326
CIT 852 DATA COMMUNICATION AND NETWORK
encryption block and variable size key. The key pair is derived from a
very large number, n, that is the product of two large prime numbers
selected through special rules; these primes may be 100 or more digits in
length each, yielding an n with roughly twice as many digits as the
prime factors. The pui1lic key includes n and a derivate of one of the
factor of n; an adversary cannot determine the prime factor of n (and,
therefore, the private key) from this information alone and that is what
makes the RSA algorithm so secure.
Several other signature schemes have been shown to be secure in the so-
called random-oracle model. The random-oracle model is a model of
327
CIT 852 DATA COMMUNICATION AND NETWORK
RSA
328
CIT 852 DATA COMMUNICATION AND NETWORK
329
CIT 852 DATA COMMUNICATION AND NETWORK
RSA Public Key Algorithm is the most commonly used public key
algorithm and this algorithm can be used both for encryption and for
signing. It is generally considered to be secure when sufficiently long
330
CIT 852 DATA COMMUNICATION AND NETWORK
keys are used (512 bits is insecure, 768 bits is moderately secure, and
1024 bits is good). The security of RSA relies on the difficulty of
factoring large integers. The recent advances in factoring large integers
would make RSA vulnerable. It is patented in US and the Patent expired
in year 2000.
RSA Algorithm
4) Compute the secret exponent d, I < d < phi, such that ed = 1 (mod
phi).
5) The public key is (n, e) and the private key is (n, d). The values
of p, q, and phi should also be kept secret.
Where
Encryption
331
CIT 852 DATA COMMUNICATION AND NETWORK
Decryption
Summary of RSA
Let us select two prime numbers, p = 7 and q= 17. Keys are generated as
follows:
Decryption
M=cd(modn)
= 6677(mod 119)
= 19
332
CIT 852 DATA COMMUNICATION AND NETWORK
3.3.2 Diffie-Hellman
3) The hosts next generate the public keys, ‘y’. They are created
with the function:
y=g^x%p
4) The two host now exchange the public keys (‘y’) and the
exchanged numbers are converted into a secret key, ‘z”.
z=y^x%p
‘z’ can now be used as the key for whatever encryption method is
used to transfer information between the two hosts.
Mathematically, the two hosts should have generated the same
value for ‘z’.
333
CIT 852 DATA COMMUNICATION AND NETWORK
Example:
After exchanging their public keys, A & B can compute the common
secret key:
A computes:
334
CIT 852 DATA COMMUNICATION AND NETWORK
y2=x3+ax+b
The set of all the solutions to the equation forms the elliptic curve.
Changing a and b changes the shape of the curve, and small changes in
these parameters can result in major changes in the set of (x,y) solutions.
The figure above shows the addition of two points on an elliptic curve.
Elliptic curves have the interesting property that adding two points on
the elliptic curve yields a third point on the curve. Therefore, adding two
points, PI and P2, gets us to point P3, also on the curve. Small changes
in PI or P2 can cause a large change in the position of P3.
335
CIT 852 DATA COMMUNICATION AND NETWORK
Since the ECC key sizes are so much shorter than comparable RSA
keys, the length of the public key and private key is much shorter in
elliptic curve cryptosystems. Therefore, this results in faster processing,
and lower demands on memory and bandwidth. In practice, the final
results are not yet in; RSA, Inc. notes that ECC is faster than RSA for
signing and decryption, but slower than RSA for signature verification
and encryption.
3.3.4 DSA
336
CIT 852 DATA COMMUNICATION AND NETWORK
1) p = a prime modulus, where 2L-I < P < 2L for 512 = < L = <1024
and L a multiple of 64
2) q=aprimedivisorofp-l,where2159<q<2160
5) y = gx mod p
337
CIT 852 DATA COMMUNICATION AND NETWORK
w = (sri mod q
ul = ((SHA(M’)w) mod q
u2 = ((r’)w) mod q
If v = r’, then the signature is verified-and the verifier can have high
confidence that the received message was sent by the party holding the
secret key x corresponding to y. For a proof that v = r` when M` = M, r`
= r, and s` = s, see Appendix 1.
If v does not equal r`, then the message may have been modified, the
message may have been incorrectly signed by the signatory, or the
message may have been signed by an impostor. The message should be
considered invalid.
338
CIT 852 DATA COMMUNICATION AND NETWORK
Note that the decryption algorithm does indeed produce the intended
message since:
1 m.h k m.h rk
c2 c1r m (mod q)
g rk g rk
If the space of possible messages is larger than the sire of G, then the
message can be split into several pieces and each piece can be encrypted
independently. Typically, however, a short key to a symmetric-key
cipher is first encrypted under EIGamal, and the (much longer) intended
message is encrypted more efficiently using the symmetric-key cipher –
this is termed hybrid encryption.
339
CIT 852 DATA COMMUNICATION AND NETWORK
NOT: The output value is the inverse of the input value (i.e., the
output is TRUE if the input is false, FALSE if the input is true).
XOR 0 1
0 0 1
1 1 0
mod 7 = I
25mod5=0
33 mod 12 = 9
203 mod 256 = 203
340
CIT 852 DATA COMMUNICATION AND NETWORK
(a)
(b) RSA
(c) Diffie-Hellman
(d) Knapsack
(a) Only the public key can encrypt, and only the private can decrypt
(b) Only the private key can encrypt, and only the public can decrypt
(c) The public key is used to encrypt and decrypt
(d) If the public key encrypts, and only the private can decrypt.
341
CIT 852 DATA COMMUNICATION AND NETWORK
(a) Work factor of double DES is the same as for single DES
(b) Elliptic curse cryptosystem have a lower strength per bit than
RSA.
(c) In digitally-signed message transmission using a hash function
the message digest is encrypted in the public key of the sender.
4.0 CONCLUSION
5.0 SUMMARY
342
CIT 852 DATA COMMUNICATION AND NETWORK
technology base to keep pace with global trends. As India has already
enacted IT Act 2000, this allows transactions signed electronically for e-
commerce primarily to be enforced in a court of law. Several issues arise
when we consider using digital documents and exchanging them over
the Internet, such as eavesdropping, tampering, impersonation etc. All
these can be remedied with the use of public key infrastructure (PKI).
However, the question of the time when a document was created may be
answered by using Digital Time stamping service, which is based on
PKI. This information may prove to be crucial for most e-commerce
legally binding transactions, in particular for supporting non-repudiation
of digitally signed transactions.
1) What is cryptography?
2) List the various requirements of application-to-application
communication.
3) List various types of cryptographic techniques.
343
CIT 852 DATA COMMUNICATION AND NETWORK
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Digital Signatures’
3.2 Management of Public Keys
3.3 Communication Security
3.4 Web Security
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Readings
1.0 INTRODUCTION
344
CIT 852 DATA COMMUNICATION AND NETWORK
2.0 OBJECTIVES
digital Signature
public Key Infrastructure
management of Public Keys
communication and Web Security.
The figure 2 shows how one key is used for encryption and another key is
used for decryption. The Figure 3 shows that a person is having two keys in
public key cryptography.
345
CIT 852 DATA COMMUNICATION AND NETWORK
Ram has been given two keys. One of Ram’s Key is called the Public
key, and the other is a Private Key
Ram’s Public key is available to anyone who needs it (Figure 4), but he
keeps his Private Key to himself. Keys are used to encrypt information.
Encrypting information means “scrambling it up”, so that only the
person with the appropriate key can make it readable again. One of
Ram’s two keys can encrypt the data, while the other key can decrypt
that same data.
Ravi (Figure 5) can encrypt a message using Ram’s Public Key. Ram
uses his Private Key to decrypt the message. Any of Ram’s co-workers
might have access to the message Ravi encrypted, but without Ram’s
Private Key, the data is worthless.
346
CIT 852 DATA COMMUNICATION AND NETWORK
With his private key and the right software, Ram can put digital
signatures on documents and other data. A digital signature is a “s\amp”
Ram places on the data which is unique to Ram, and is very difficult to
forge. In addition, the signature assures that any changes made to the
data that has been signed will not go undetected.
To sign a document, Ram’s software will crunch down the data into just
a few lines by a process called “hashing”(Figure 6). These few lines are
known as a message digest. (It is not possible to change a message
digest back into the original data from which it was created, as Hash is a
one way function).
Encrypt with
Private key
347
CIT 852 DATA COMMUNICATION AND NETWORK
Message Signature
Digest
Ram’s software then encrypts (Figure 7) the message digests with his
private key. The result is the digital signature.
Signature Append
Signature
Firs t,Decrypt
Shayam’s software decrypts the signature
Message
( nwgithRPuabm
usi lic’s public key) changing it back into a
Digest
Signature m sage digest. If this work, then it proves that
es
Ram has signed the document, because only Ram
has this private key. Mohan’s software then hashes
the document data into a message digest. If the
message digest is the same as the message digest
created when the signature was decrypted, then
Mohan knows that the signed data has not been
changed/tampered with.
Issues
348
CIT 852 DATA COMMUNICATION AND NETWORK
Ram’s co-workers can verify Ram’s trusted certificate to make sure that
his public key truly belongs to him. In fact, no one at Ram’s company
accepts a signature for which there does not exist a certificate generated
by Ravi. This gives Ravi the power to revoke signatures if private keys
are compromised, or no longer needed. There are even more widely
accepted certificate authorities that certify Ravi.
349
CIT 752 DATA COMMUNICATION AND NETWORK
Shayam’s software then takes Ram’s public key from the certificate and
uses it to check Ram’s signature. If Ram’s public key de-encrypts the
signature successfully, then Shayam is assured that the signature was
created using Ram’s private key, for Ravi has certified the matching
public key. And of course, if the signature is valid, then we know that
Mohan didn’t try to change the signed content.
Digital Certificate
User Certificate
User User
Name & Name
oCtheerrtificate
credDeantaiablsase User’s
Public
Signed Key
by using
Certificate CA’s CA’s
Request secret Name
key
Validation
period
350 Signature
Of CA
CIT 752 DATA COMMUNICATION AND NETWORK
Contracts
The ne1ct time you purchase a car, a home, or an insurance policy, you
may never need to meet with an agent or sales representative. You may
be able to review and sign all documents online, and save secure backup
copies to your own disk.
Buying online is now easy with a credit card, but digital checks or
money orders (authenticated by secure digital signatures) may be
preferable for some transactions, especially when you don’t want to face
a large credit card bill.
Approvals
351
CIT 752 DATA COMMUNICATION AND NETWORK
The Digital certificate and management of the certificate are the main
components of PKI. The purpose of the digital certificate is to verify
individual public key. This certificate is accomplished by digital1y
signing the individuals public key and associated information using the
Private Key. A CA (Certification Authority) acts as the notary for
verifying a person’s identity and issuing a certificate that vouches for
the public key of the individual concerned. The CA signs the certificate
with its own private key. The certificate is then sent to a repository,
which holds the certificates and CRLs that denote the revoked
certificates.
352
CIT 752 DATA COMMUNICATION AND NETWORK
X.509 Certificates
353
CIT 752 DATA COMMUNICATION AND NETWORK
Some of the different types of certificates that are issued include the
following:
CA certificates
Issued to CAs, these certificates contain the public keys used to verify
digital signatures on CRLs al1d certificates.
Issued to entities that are not CAs, these certificates contain the public
keys that are needed by the certificate’s user in order to perform key
management or verify a digital signature.
354
CIT 752 DATA COMMUNICATION AND NETWORK
Rollover certificates
Key Management
Key Distribution
355
CIT 752 DATA COMMUNICATION AND NETWORK
Splitting the keys into different parts and sending each part by a
different medium can also accomplish key distribution.
Key Revocation
Key Recovery
Key renewal
Obviously, the longer a secret key is used without changing it, the more
it is subject to compromise. The frequency with which you change the
key is a direct function of the value of the data being encrypted and
transmitted. Also, if the same secret key is used to encrypt valuable data
over a relatively long period of time, you risk compromising a larger
356
CIT 752 DATA COMMUNICATION AND NETWORK
Key destruction
Keys that have been in use for long periods of time and are replaced by
others should be destroyed. If the keys are compromised, older messages
sent with those keys can be read.
Multiple Keys
Usually an individual has more than one public/private key pair. The
keys may be of different sires for different levels of security. A larger
key sire may be used for digitally signing documents and smaller key
sire may be used for encryption. A person may also have multiple roles
or responsibilities wherein s/he may want to sign messages with a
different signature. One key pair may be used for business matters,
another for personal use, and another for some other activity, such as
being a school board member.
357
CIT 752 DATA COMMUNICATION AND NETWORK
Kerberos
358
CIT 752 DATA COMMUNICATION AND NETWORK
PGP
359
CIT 752 DATA COMMUNICATION AND NETWORK
S/MIME
360
CIT 752 DATA COMMUNICATION AND NETWORK
The VPN has become the de facto standard for secure remote access. It
provides business partners access to corporate network resources across
un-trusted networks. Typically, the untrusted network will be the
Internet, but VPNs offer excellent flexibility and can also be used across
more traditional network mediums such as frame relay or A TM
networks. VPNs guarantee the confidentiality and integrity of corporate
data through the use of strong encryption and authentication techniques.
VPNs have become famous because of excellent cost saving and
performance improvements in comparison to more traditional remote
access methods.
Types of VPN
VPNs are of two distinct categories: (I) Site to site VPNs, between two
or more offices or data centres; (2) Client to site VPNs, between a
desktop client and a central office or data center.
IPSec
Most clients to site VPNs are based on JPSec (short for IP Security),
which is a suite of protocols developed by the IETF to support secure
transmission of packets at the IP layer. Typically, an IPSec tunnel
connection will be created from a Client software component to a VPN
gateway (or firewall with VPN functionality). Following the
initialisation of this tunnel, all packets destined for the remote corporate
network will be routed through this tunnel. The tunnel provides the
necessary security, by encrypting each packet (using one of a selection
of algorithms) before forwarding it to the remote gateway. When
packets reach the remote gateway, they are decrypted and then
forwarded ‘in the clear’ to the final destination.
IPSec was initially devised for site to site VPN connections, so in order
to add the necessary functionality to IPSec to allow effective client to
site connections and management, each vendor has added vendor
specific features to it’s JPSec implementation. Good examples of this
include Check Point hybrid mode (to allow strong user authentication
without certificates) and NA T traversal techniques from the majority of
vendors.
361
CIT 752 DATA COMMUNICATION AND NETWORK
IPSec
Network Access Layer
(OSI Layers 1 & 2)
Figure 16: Functionality inspects traffic, and encapsulates and encrypt traffic
Secure Sockets Layer (SSL)
362
CIT 752 DATA COMMUNICATION AND NETWORK
Cost saving
With these benefits, SSL VPNs also has many complications and
disadvantages.
Benefits of SSL
Cost saving
Although IPSec clients can grant access across most mediums (Leased
line, DSL, Dial, GPRS) they only offer access from the corporate
desktop on which the client is installed. SSL VPNs can be configured to
allow access from corporate built laptops, home desktops, customer or
supplier desktops or any machine in an Internet cafe. This extra choice
allows a much wider audience (i.e., non-laptop users) to improve
productivity and work from any where (at home or while traveling).
Client IP mobility
363
CIT 752 DATA COMMUNICATION AND NETWORK
has caused issues with IPSec VPNs. Vendors have generally overcome
these issues by developing vendor specific NAT traversal mechanisms
based on Payload encapsulation in UDP packets. Although these
mechanisms normally function well, they break and cause
interoperability problems between vendors deployments. SSL VPNs do
not suffer such issues because they are not tied to the IP layer.
Although IPSec VPNs also offer highly granular access control through
machine and the service it provides, SSL VPNs can offer a greater
degree of granularity, even as far as the URL. SSL VPNs also lend
themselves to more granular access control because each resource
accessed must be explicitly defined. This differs from IPSec VPN
because the entire corporate network can be defined with a single
statement.
As stated above in the Figure 16 SSL VPNs make use of the existing
SSL functionality that are already present in most IP Stacks. Because
SSL fits into the stack between layers 4 and 5, each application must
explicitly define its use. Based on this fact, SSL VPNs fall into 3 distinct
categories: (i) Appli~tion layer proxies, (ii) Protocol redirectors, and (iii)
Remote control enhancers. Commercial SSL products are a
Combination of the above mentioned techniques.
Application layer proxies are the simplest form of SSL VPNs because
they rely on the SSL functionality used by existing applications.
Because of this, application layer proxies have the least application
support. Generally, they only support Email and Web-based traffic.
They function by using the SSL setup in existing applications, for
example, you would web browse to the gateway which will then proxy
364
CIT 752 DATA COMMUNICATION AND NETWORK
One of the advantages of application layer proxies are that they are truly
clientless. They operate with nearly all operating systems and web
browsers.
IPSec
Network Access Layer
(OSI Layers 1 & 2)
The only realistic method of capturing the traffic on the way through the
IP stack is to redirect traffic based on name resolution to a local
resource. For example, to connect to http://mail.yahoo.com, the port
redirector is enabled, then the name mail.yahoo.com will be forced to
connect to the localhost (127.0.0.1) through the use of a host file. This
means that the mini client must have the ability to write changes to the
hosts file, which at a hardend desktop may not always be possible. Also,
365
CIT 752 DATA COMMUNICATION AND NETWORK
Remote control enhancers are the most flexible form of SSL based VPN,
but they also have heavy overload. They work by enhancing a remote
control protocol like Windows Terminal Services or Citrix Metaframe
and adding SSL VPN functionality and Web Browser support. This
means any application can be added to the SSL VPN by adding the
application to the remote control desktop. As a stand-alone application,
this has serious limitations, because applications that reside on the local
desktop cannot be used directly. This is why most remote control
enhancers are partnered with other SSL VPN technologies.
On the positive side though, they can offer features like the ability to
read and update a documents held centrally without ever having to
download the entire document. While travelling and using VPN over
low speed connections, or when connection quality is poor this could be
a better option, because connections are restarted without loosing any
work.
Technical Issues
Performance
SSL VPNs can support large number of concurrent users with adequate
performance.
High Availability
Most vendors (especially the ones with more mature products) are able
to perform some form of internal High Availability and fail over
mechanisms.
366
CIT 752 DATA COMMUNICATION AND NETWORK
Application Support
367
CIT 752 DATA COMMUNICATION AND NETWORK
Client Security
Sandbox
This ensures that when users logoff the system all logon credentials are
wiped from the client machine. Of course, with enterprise strength VPN
solution, a strong authentication mechanism should also be used to
protect credentials further.
368
CIT 752 DATA COMMUNICATION AND NETWORK
As the client is nearly un-trusted, most SSL VPNs can also filter traffic
at the application level (especially if an application level proxy is used,
rather than a protocol redirector), blocking worms and viruses at the
gateway. SSL VPNs used for remote access, no doubt, have significant
advantages over the IPSec alternatives. But the advantages they offer
also add complexity, which must be weighed against the advantages.
Before considering an SSL VPN deployment you should consider:
security risks involved; added mobility and flexibility; protocol support
required.
SSL/TLS
369
CIT 752 DATA COMMUNICATION AND NETWORK
Both SSL and TLS use certificates for public key verification that are
based on the X.509 standard.
SSL 3.0
370
CIT 752 DATA COMMUNICATION AND NETWORK
TLS 1.0
Similar to SSL, the TLS protocol is comprised of the TLS Record and
Handshake Protocols. The TLS Record Protocol is layered on top of a
transport protocol such as TCP and provides privacy and reliability to
the communications. The privacy is implemented by encryption using
symmetric key cryptography (DES or RC4). Anew secret key is
generated for each connections; but, the Record Protocol can be used
without encryption. Integrity is provided through the use of a MAC
(Message Authentication Code) using hash algorithms such as SHA or
MOS.
Since TLS is based on SSL, they have similar functionality and goals;
however, SSL and TLS have enough differences that they cannot
interoperate. In order to address this situation, TLS through built-in
mechanism becomes compatible with SSL 3.0.
S-HTTP
371
CIT 752 DATA COMMUNICATION AND NETWORK
Instant Messaging
IM Vulnerabilities
Messages sent through the instant messaging protocol are not inherently
secure and safe. The instant messaging server is vulnerable because it
contains both the messages and the connection information of the user.
Thus, instant messaging servers should be secure servers located in
protected and limited access areas. In addition to that, some of the
security features provided by some instant messaging software utilities
include:
372
CIT 752 DATA COMMUNICATION AND NETWORK
Naming Conventions
Web servers that respond to requests for files in their DOS 83 fields
names are vulnerable to attacks that can cause the server to reveal source
code. A fix to this problem is, to disable DOS 8.3 file name creation on
the NTFS server, but this may result in difficulties in using l6-bit
applications.
4.0 CONCLUSION
In this concluding unit of this course you have been taken through
digital signature, public key infrastructure, management of public keys
as well as web security. It is our belief that with what you have learnt in
this course you will be able to show your own among dfgt professionals
and build upon it.
5.0 SUMMARY
373
CIT 752 DATA COMMUNICATION AND NETWORK
374