Concept Notes Pramod
Concept Notes Pramod
Concept Notes Pramod
UNIT I
INTRODUCTION
been developed for group working in Data Base Management (DBMS) and graphic works.
(d) Different departments of an organization may be separated physically being at distant places
but their data could be stored on a central computer. This data is accessed by computers
located in different departments. The data at the central computer may be updated from time to
time and accessed by all users. This prevents any bottlenecks in the smooth functioning of the
organization. The latest data (say for inventory) will be easily available at all times to all the
users.
(e) Fluctuations of prices in foreign exchange and shares/equities can be communicated
instantaneously
using the medium of computer communications only. The transfer can be accelerated and verified
at any instant of time.
Data Communication:
Data Communication is defined as the exchange of data between two devices via some
form of transmission medium such as a wire cable. The communicating devices must be a
part of a communication system made up of a combination of hardware ( physical
equipment) and software (programs).
Characteristics of data Communication :
The effectiveness of a data communication depends on three characteristics
1.Delivery
2.Accuracy
3.Timeliness
Delivery : The system must deliver data to correct destination.
Accuracy: The system must deliver data accurately.
Timeliness: The system must deliver data in a timely manner. Data delivered late are
useless. Timely delivery means delivering data as they are produced, in the same order
that they are produced. and without significant delay. This kind of delivery is called real
time transmission.
Components:
The components of a data communication are
Message
Sender
Receiver
Medium
Protocol
Numbers
Numbers are also represented by using bit patterns. ASCII is not used to represent
numbers.The number is directly converted to a binary number.
Images
Images are also represented by bit patterns.An image is divided into a matrix of
pixels,where each pixel is a small dot. Each pixel is assigned a bit pattern.The size and
value of the pattern depends on the image.The size of the pixel depends on what is called
the resolution.
Audio
Audio is a representation of sound. Audio is by nature different from text, numbers or
images. It is continuous not discrete
Video
Video can be produced either a continuous entity or it can be a combination of images.
Direction of data flow
Communication between two devices can be simplex, half-duplex or full-duplex
Simplex
In simplex mode ,the communication is unidirectional. Only one of the devices on a link
can transmit; the other can only receive.
The half-duplex mode is like a one-lane road with two directional traffic. The entire
capacity of a channel is taken over by whichever of the two devices is transmitting at the
time.
Ex. Walkie-talkies and CB(citizen band radios.
Full-duplex
In full-duplex mode ,both stations can transmit and receive simultaneously. It is like a
two-way street with traffic flowing in both directions at the same time. Signals going in
either direction share the capacity of the link.
The full duplex is like a two way street with traffic flowing in both directions at the
same time. Signals going in either direction share the capacity of the link.
Ex. Telephone network
When two people are communicating by a telephone line ,both can listen and talk at the
same time.
Network:
Definition :
An interconnected collection of autonomous computers interconnected = able to
exchange information
A set of nodes connected by communication links .A node can be any device capable of
sending &/or receiving data to &/or from other nodes in the network
A connected collection of hardware and software that permits information exchange and
resource sharing.
information = data, text, audio, video, images,
resources = printers, memory, link bandwidth
Uses of networks
companies & organizations
resource sharing: programs, equipment, data
high reliability: multiple processors/links/file copies/...
scalability: gradually improve system performance
rapid communications & remote cooperation
saving money
private individuals:
access to remote & diverse information sources
communicating with other people
entertainment
education, healthcare, access to government...
Distributed Processing
Networks use distributed processing which is termed as a task divided among multiple
computers. Instead of a single machine responsible for all aspects of a process, separate
computers handle a subset.
Performance
Performance can be measured by means of transit time, response time, number of users,
type of transmission medium, capabilities of the connected hardware and the efficiency
of the software.
Transit time
The amount of time required for a message to travel from one device to another.
Response time
The elapsed time between an inquiry and a response.
Reliability
Reliability is measured by the frequency of failure ,the time it takes a link to recover from
a failure.
Security
Network security is protecting data from unauthorized access.
Type of connection
There are two possible type of connections
Point-to-point
Multipoint
Point-to-point
A point-to-point connection provides a dedicated link between two devices. The entire
link is reserved for transmission between those two devices.
Ex. Change of television channel by infrared remote control. A point-to-point connection
is established between the remote control and the televisions control system.
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific
devices share a single link. The capacity of the channel is shared either spatially or
temporally.
Physical Topology
Physical Topology refers to the way in which network is laid out physically. Two or more
links form a topology. The topology of a network is the geometric representation of the
relationship of all the links and the linking devices tone another.
A fully connected mash network therefore has n(n-1)/2 physical channels to link n
devices. To accommodate that many links every device on the network has (n-1) I/O
ports.
Merits.
Dedicated link guarantees that each connection can carry its own data load. This
eliminates the traffic problems that occur when links shared by multiple
devices.
If one link becomes unusable ,it does not incapacitate the entire system.
Privacy or security: When every message travels along a dedicated line only the
intended recipient
Demerits
The amount of cabling and the I/O ports required
Installation and reconnection are difficult
The sheer bulk of the wire accommodate more space than available.
The hardware required to connect each link can be prohibitively expensive.
Star topology
Each device has a dedicated point to point link only to a central controller usually called
a hub. If one device has to send data to another it sends the data to the controller, which
then relays the data to the other connected device.
Merits
Less expensive than a mesh topology. Each device needs only one link and I/O
port to connect it to any number of others.
Installation and reconfigure is easy.
Robustness. If one link fails only that link is affected.
Requires less cable than a mesh.
Demerits
Require more cable compared to bus and ring topologies.
Bus
One long cable acts as a backbone to link all the devices in a network Nodes are
connected to the bus cable by drop lines and taps. A drop line is a connection running
between the device and the main cable. A tap is a connector that either splices into the
main cable or punctures the sheathing of a cable to create a contact with a metallic core.
As the signal travels farther and farther ,it becomes weaker .So there is limitation in the
number of taps a bus can support and on the distance between those taps.(In this diagram
taps and connectors are
Merits
Ease of installation.
Bus use less cabling than mesh or star topologies.
Demerits
Ring
Each device has a dedicated point to point connection only with the two devices on either
side of it.
A signal is passed along the ring in one direction from device to device until it reaches
the destination
Each device in the ring incorporates a repeater. It regenerates the bits and passes them
along ,when it receives the signal intended for another device.
Merits:
Easy to install and reconfigure.
To add or delete a device requires changing only two connections.
The constraints are maximum ring length and the number of devices.
If one device does not receive the signal within a specified period, it issue an
alarm that alerts the network operator to the problem and its location
Demerits
A break in the ring disables the entire network. It can be solved by using a dual
ring or a switch capable of closing off the break.
Categories of Network
The three primary categories are of network are Local Area Network (LAN),
Metropolitan Area Network (MAN), and Wide Area Network(WAN). The category into
which a network fall is determined by its size, ownership, the distance it covers and its
physical architecture.
LAN
A LAN is usually privately owned and links the devices in a single office,
building or campus.
A LAN can be as simple as two PCs or it can extend throughout a company. LAN
size is limited to a few kilometers. The most widely used LAN system is the
Ethernet system developed by the Xerox Corporation.
It is designed to allow resources (hardware , software or data) to be shared
between PCs or workstations. It may be used to provide a (shared) access to
remote organizations through a router connected to a Metropolitan Area Network
(MAN) or a Wide Area Network (WAN).
One of the computers may be given a large capacity disk drive and may become a
server to other clients. Software can be stored on this server and used by the
whole group.
The size of the LAN may be determined by the licensing restrictions on the
numbers per copy of software. or the number of users licensed to access the
operating system.
Also differentiated from other types of network by transmission media and
topology.
Internetwork
When two or more networks are connected they become an internetwork or internet
Protocols
A protocol is a set of rules that governs data communication. It defines what is
communicated, how it is communicated, and when it is communicated. The key elements
of a protocol are syntax, semantics and timing
Syntax
It refers to the structure or format of the data. This refers the order in which the data are
presented.
Example
The first 8 bits of data to be the address of the sender.
The second 8 bits to be the address of the receiver.
The rest of the stream may be the message itself
Semantics
It refers to the meaning of each section of bits. How a particular pattern to
be interpreted
What action is to be taken based on that interpretation
Example
An address specifies the route to be taken or the final destination of the
message.
Timing
It refers to two characteristics
When data should be sent and how fast they can be sent.
Example
If a sender produces data at 100 Mbps and the receiver process data at only
1 Mbps, it will overload the receiver and data will be lost.
Standards
Why do we need standards ?
To create and maintain an open and competitive market for equipment
manufacturers
To guarantee national and international interoperability of data,
telecommunication technology and process
To give a fixed quality and product to the customer
To allow the same product to be re used again elsewhere
To aid the design and implementation of ideas
To provide guidelines to manufacturers, vendors, government agencies and other
service providers to ensure kind of interconnectivity.
OSI
The Open Systems Interconnection (OSI) architecture has been developed by the
International Organization for Standardization (ISO) to describe the operation and design
of layered protocol architectures. This forms a valuable reference model and defines
much of the language used in data communications.
Layer
Each layer provides services to the next higher layer and shields the upper layer
from the details implemented in the lower layers.
Each layer appears to be in direct (virtual) communication with its associated
layer on the other computer. Actual communication between adjacent layers takes
place on one computer only.
Layering simplifies design, implementation, and testing. Only the lowest level
(Physical layer) can directly communicate with its peer communications process
into parts.
Peer-to-Peer Processes
The processes on each machine that communicate at a given layer are called peerto-peer processes.
At higher layers communication must move down through the layers on device A
aver to device B and then back up through the layers.
Each layer in the sending device adds its own information to the message it
receives from the layer just above it. and passes the whole package to the layer
just below and transferred to the receiving device.
Interfaces between layers
The passing of data and network information down through the layers of the
sending device and back up through the layers of the receiving device is made
possible by an interface between each pair of adjacent layers.
Each interface defines what information and services a layer must provide for
the layer above it.
Well defined interfaces and functions provide modularity to a network.
Physical Layer
It coordinates the functions required to transmit a bit stream over a
physical medium.
It deals with the mechanical and electrical specifications of the interface
and transmission media.
Mechanical: cable, plugs, pins...
Electrical/optical: modulation, signal strength, voltage levels,
bit times,
It also defines the procedures and functions that physical devices and
interfaces have to perform for transmission to occur
Major responsibilities of Physical layer are
Physical characteristics of interfaces and media:
It defines the characteristics of the interface between the devices and the
transmission media. Also defines the type of transmission medium.
Representation of bits:
To transmit the bits, it must be encoded into electrical or optical
signals. It defines the type of representation how 0s and 1s are
changed to signals.
Data rate:
The number of bits sent each second is also defined by the physical
layer.
Synchronization of bits:
Sender and the receiver must be synchronized at the bit level .i.e the
sender and the receiver clocks must be synchronized.
Information flows from top to bottom at the sender and bottom to top
at the receiver.
Data link layer
The data link layer is responsible for hop-to-hop (node-to-node) delivery. It
transforms the physical layer a raw transmission facility to a reliable link. It
makes physical layer appear error free to the network layer. The duties of the data
link layer are
Framing: The data link layer divides the stream of bits received from the
network layer into manageable data units called frames.
Physical Addressing: If the frames are to be distributed to different
systems on the network the data link layer adds a header to the frame to
define the receiver or sender of the frame. If the frame is intended for a
system located outside the senders network then the receiver address is
the address of the connecting device that connects the network to the next
one.
Flow Control: If the rate at which the data absorbed by the receiver is
less than the rate produced in the sender, the data link layer imposes a
flow control mechanism to overwhelming the receiver.
Error control Reliability is added to the physical layer by data link layer
to detect and retransmit loss or damaged frames. and also to prevent
duplication of frames. This is achieved through a trailer added to the end
of the frame
Access control When two or more devices are connected to the same link
it determines which device has control over the link at any given time.
Network Layer
The network layer is responsible for source-to-destination delivery of a packet across
multiple networks. It ensures that each packet gets from its point of origin to its final
destination .It does not recognize any relationship between those packets. It treats each
one independently as though each belong to separate message.
The functions of the network layer are
Logical Addressing If a packet has to cross the network boundary then the
header contains information of the logical addresses of the sender and the
receiver.
Networking When independent networks or links are connected to create an
internetwork or a large network the connective devices route the packet to the final
destination.
Transport Layer
The network layer is responsible for process-to-process delivery ,that is source to
destination delivery of the entire message.
The responsibilities of Transport layer are
Service-point (port) addressing :Computers run several programs at the same
time. source-to-destination delivery means delivery from a specific process on
one computer to a specific process on the other. The transport layer header
therefore include a type of address called a service point address.
Segmentation and reassembly A message is divided into segments and each
segment contains a sequence number. These numbers enable the Transport layer
to reassemble the message correctly upon arriving at the destination. The
packets lost in the transmission is identified and replaced.
File transfer, access and management. This application allows a user to access
files in a remote computer, to retrieve files from a remote computer and to
manage or control files in a remote computer.
Mail services. This application provides the basis for e-mail forwarding and
storage.
Directory services. It provides distributed database sources and access for global
information about various objects and services .
Transmission Media
Transmission media are actually located below the physical layer and directly
controlled by the physical layer.
Transmission media can be divided into two broad categories
Guided &
Unguided
Guided media
It includes twisted-pair cable, coaxial cable, and fiber-optic cable
Unguided media
It is usually air.
Guided media
Guided media, which are those that provide a conduit from one device to another.
Coaxial cable
Coaxial cable carries signals of higher frequency ranges than twisted pair cable.
It has a central core conductor of solid or stranded wire enclosed in an insulating
sheath. This in turn encased in an outer conductor of metal foil ,braid or a
combination of the two.
The metallic wrapping serves both as a shield against noise and as the second
conductor completes the circuit.
The outer conductor is also enclosed in an insulating sheath and the whole cable
is protected by a plastic cover.
Coaxial cable Standards
Coaxial cables are categorized by their radio government (RG) ratings .Each RG
number denotes a set of physical specifications such as,
wire gauge of the inner conductor
thickness and type of the inner insulator
the construction of the shield
the size and type of outer casing
Categories of coaxial cables
Category
RG-59
RG-58
RG-11
Impedance
75
50
50
Use
Cable TV
Thin Ethernet
Thick Ethernet
BNC connector
BNC T connector &
BNC terminator
BNC connector
It is used to connect the end of the cable to a device such as a TV set.
BNC T connector
It is used in Ethernet networks to branch out a cable for connection to a computer or
other devices.
BNC terminator
It is used at the end of the cable to prevent the reflection of the signal.
Performance
Attenuation is much higher in coaxial cables than in twisted pair cable.
Coaxial cable has a much higher bandwidth the signal weakens rapidly and
needs the frequent use of repeaters.
Basic definitions
Applications
Coaxial cable is used in analog telephone network where a single coaxial
cable could carry 10,000 voice signals.
It is also used in digital telephone network where a cable could carry
digital data up to 600 Mbps.
Cable TV networks also used RG-59 coaxial cables.
It is also used in traditional Ethernets.
Fiber Optic Cable.
A fiber optic cable is made of glass or plastic and transmit signals in the form of light.
Properties of light
A glass or plastic core is surrounded by a cladding of less dense glass or plastic. The
difference in the density of the two materials must be such that a beam of light moving
through the core is reflected off the cladding.
Propagation Modes
There are two modes for propagating light along optical channels, each requires fiber
with different physical characteristics
Multimode
Single mode
Multimode
Multiple beams from a light source move through the core in different paths.
Multimode can be implemented in two forms
Step-index
Graded index
If the signal is to pass through a system that does not allow the passage of a dc
component ,the signal is distorted and may create errors in the output.
This component is an extra energy residing on the line and is useless.
Self-synchronization:
Need : To correctly interpret the signals received from the sender, the receivers bit
intervals must correspond exactly to the senders bit intervals. If the receiver clock is
faster or slower ,the bit intervals are not matched and the receiver might interpret the
signals differently than the sender intended.
A Self-synchronizing digital signal includes timing information in the data being
transmitted. This can be achieved if there are transitions in the signal that alert the
receiver to the beginning ,middle or end of the pulse. If the receivers clock is out of
synchronization, these alerting points can reset the clock
Digital/digital encoding
Unipolar
encoding
Polar
Bipolar
AMI
NRZ
NRZ-L
Polar encoding :
It uses two voltage levels
Positive
Negative
RZ
NRZ-I
B8ZS
Biphase
Manchester
Differential
Manchester
HDB3
NRZ-I
The 1 bit is represented by an inversion (transition between a positive and a negative
voltage) of the voltage level.
The existence of 1s in the data stream allows the receiver to resynchronize its timer to
the actual arrival of the transmission.
A string of 0s can still cause problems.
RZ
It uses three values
Positive
Negative &
Zero
In RZ the signal changes during each bit.
A 1 bit is actually represented by positive-to-zero and
Differential Manchester
Inversion at the middle of the bit interval is used for synchronization.
Presence or absence of additional transition at the beginning of the interval is used to
identify the bit.
A bit 0 is represented by a transition.
A bit 1 means no transition.
It requires two signal changes to represent binary 0,but only one to represent binary 1.
Bipolar
It uses three voltage levels
Positive
Negative and
Zero
The bit 0 is represented by zero level
The 1s are represented by alternate positive and negative voltages.If the first 1 bit
is represented by positive amplitude,the second will be represented by the
negative amplitude, and so on.
There are three types of bipolar encoding
AMI
B8ZS
HDB3
Bipolar Alternate Mark Inversion
A binary 0 is represented by zero voltage.
A binary 1s are represented by alternate positive and negative voltages.
Merits
By inverting on each occurrence of 1,
The dc component is zero
A long sequence of 1s stays synchronized.
Pseudoternary
A binary 0 alternate between positive and negative voltages.
Comparison
The comparison of the different encoding schemes of the following NRZ, Polar
NRZ,NRZ Inverted, Bipolar, Manchester, Differential Manchester are given.
MODEMS
The term modem is a composite word that refers to the two functional entities that make
up the device; a signal modulator and a signal demodulator. A modulator creates a bandpass analog signal from binary data. A demodulator recovers the binary data from the
modulated signal.
Modem stands for modulator and demodulator.
TELEPHONE MODEMS
Traditional telephone lines can carry frequencies between 300 and 3300 HZ, giving them
BW of 3000 Hz; All this range is used for transmitting voice, where a great deal of
interference and distortion can be accepted without loss of intelligibility.
The effective BW of a telephone line being used for data Transmission is 2400 Hz,
covering the range from 600 to 3000 Hz.
MODULATION /DEMODULATION
Telco
Modem
Telephone
network
Telco
Modem
Figure shows the relationship of modems to a communication link. The computer on the
left sends binary data to the modulator portion of the modem; the data is sent as an analog
signal on the telephone lines. The modem on the right receives the analog signal,
demodulates it through its demodulator, and delivers data to the computer on the right.
The communication can be bidirectional, which means the computer on the right can also
send data to the computer on the left using the same modulation and demodulation
processes.
Modem standards
V-series standards published by the ITU-T.
V.32
V.32bis
V.34bis
V.90
V.92
V.32
This modem uses a combined modulation and demodulation encoding technique
called trellis-coded modulation. Trellis is essentially QAM plus a redundant bit. The Data
stream is divided into 4-bit sections. Instead of a quad bit, however, a pentabit is
transmitted. The value of the extra bit is calculated from the values of the data bits.
In any QAM system, the receiver compares each received signal point to all valid
points in the constellation and selects the closest point as the intended value.. A signal
distorted by transmission noise can arrive closer in value to an adjacent point than to the
intended point, resulting in a misidentification of the point and an error in the received
data.
By adding a redundant bit to each quad bit, trellis-coded modulation increases the
amount of information used to identify each bit pattern thereby reduces the number of
possible matches.
The V.32 calls for 32-QAM with a baud rate of 2400. Because only 4 bits of each
pentabit represents data, the resulting speed is 4*2400=9600.
FDX 2400 baud 9600 bps 2-wire
600
1800
3000
Bandwidth diagram
V.32 bis
The V.32 bis modem support 14,400-bps transmission. The V.32 uses
128-QAM transmission.
V.34 bis
The V.34 bis modem support 28,800-bps transmission with a 960-point
constellation to a bit rate of 33,600 with a 1664-point constellation.
V.90
Traditional modems have a limitations on the data rate.V.90 modems with
a bit rate of 56,000 bps, called 56Kmodems, are available. Downloading rate is 56K,
while the uploading rate is a maximum of 33.6 kbps.
Traditional modems
In traditional modems data exchange is between two computers, A and B,
Through digital telephone network.
PCM
Modem
Telephone
network
A to B
Quantization
noise happens in
the Telco office
near A
Inverse
PCM
Modem
Traditional modems
Sampling & noise
Inverse
PCM
Modem
Telephone
network
PCM
B to A
Quantization
noise happens in
the telco office
near B
Modem
After modulation by the modem, an analog signal reaches the telephone company
Switching station. Where it is sampled and digitized to be passed through the digital
network. The quantization noise introduced in the signal at the sampling point limits the
data rate according to the capacity. This limit is 33.6 Kbps.
56K Modems
Communication today is via the Internet. In Uploading, The analog signal must still be
sampled at the switching station, which means the data rate in the uploading is limited to
33.6 Kbps. There is no sampling in downloading. Data rate in downloading is 56Kbps.
56K MODEMS
Sampling & noise
PCM
Telephone
network
ISP
server
Modem
Uploading,
quantization
noise
A
Inverse
PCM
Telephone
network
Modem
downloading, no
quantization noise
A
ISP
server
V.92
The standard above V.92 is called V.92. These modems can adjust their speed,
and if the noise allows, they can upload data at the rate of 48 Kbps. The modem has
additional features. For example, the modem can interrupt the internet connection when
there is an incoming call if the lines has call-waiting service.
RS 232 INTERFACE
RS 232 is a standard interface by EIA and RS232C is the latest version of this
interface.
INTERFACING WITH RS232
PIN NUMBER
1
2
3
4
5
6
7
8
20
22
SIGNAL
--TXD
RXD
RTS
CTS
DSR
SG
RLSD or CD
DTR
RI
SIGNAL NAME
Frame ground
Transmit data
Receive data
Request to send
Clear to send
Data Set Ready
Signal Ground
Received line signal detect or carrier detect
Data Terminal Ready
Ring Indicator
Before sending data to the other end the DTE requests the permission from the
modem by issuing RTS signal.
The modem has a method to find out if any telephone line is free and if the other
end of modem is ready.
When the modem finds the communication path is ready for communication it
issues CTS signal to DTE as an acknowledgement.
The DTE issues DTR signal when it is powered on, error free and ready for
logical connection through the modem.
The modem issues a DSR signal to indicate that it is powered on and it is error
free.
The data is transferred by TXD signal from DTE to DCE and RXD signal
receives data from DCE to DTE.
The RI and RLSD signals are used with the dialed modem, when the telephone
link is shared.
Communication
Frame ground
1
1
RTS
4
CTS
5
DTR
MODEM
20
TERMINAL
20
DSR
DCE
6
DTE
6
TXD
2
2
RXD
3
RI
22
22
RLSD or CD
8
Ground
7
25 pin female connector
7
25 pin male connector
Burst Error:
A burst error means that 2 or more bits in the data unit have changed.
Example:
Here two bits are corrupted .
the bits in the frame can be inverted, anywhere within the frame including the
data bits or the frame's control bits,
additional bits can be inserted into the frame, before the frame or after the frame
and
bits can be deleted from the frame.
DETECTION
Redundancy
Error detection use the concept of redundancy, which means adding extra bits for
detecting errors at the destination .i.e., instead of repeating the entire data stream, a
shorter group of bits may be appended to the end of each unit.
101000000001010
10
1010000000010101
0
Ok
?
101000000001010
1011101
1010000000010101 1011101
Medium
101000000001010
Data unit
101101
Redundancy unit
Above figure shows the process of using redundant bits to check the accuracy of a data
unit. Once the data stream has been generated, it passes through a device that analyses it
and adds an appropriately coded redundancy check.
The receiver puts the entire stream through a checking function. The received bit stream
passes the checking criteria. The data portion of the unit is accepted if there is no error,
otherwise rejected and the redundant bits are discarded.
Detection methods
Parity check
Cyclic redundancy check
checksum
Parity check
A redundant bit called parity bit, is added to every data unit so that the total number of
1s in the unit becomes even (or odd).
SIMPLE PARITY CHECK
In a simple parity check a redundant bit is added to a string of data so that
total number of 1s in the data become even or odd.
The total data bit is then passed through parity checking function. For
even parity, it checks for even number of 1s and for odd parity it checks even number of
1s. If an error is detected the data is rejected.
5 1s in the data
Parity bit is 1
Transmitted codeword = 101101011
If receiver gets 101101011, parity check ok ---accept (OK)
If receiver gets 101100011, parity check fails ---reject (OK), ask for frame to be retransmitted
If receiver gets 101110011, parity check ok ---accept (NOT OK: even number of
errors undetected)
If receiver gets 001100011, parity check ok ---accept (NOT OK: even number of
errors undetected)
4 1s in the data
parity bit is 0
Data bits
1110001
1000111
0011001
0
0 row
1 parity bits
0101111 1
Column parity
bits
Example (cont.): suppose bit in position (1,3) is received in error (in other words,
1 bit error)
11000010
10001110
00110011
01011111
appended to the end of the data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number. At its destination, the incoming data
unit is assumed to be intact and is therefore accepted. A remainder indicates that the data
unit has been damaged in transit and therefore must be rejected.
STEP BY STEP PROCEDURE
Dividing the data unit by a predetermined divisor derives the redundancy bits
used by CRC; the remainder is CRC.
First a starting of n 0s is appended to the data unit. The number n is one less than
the number of bits in the predetermined divisor, which is n+1 bits.
The newly elongated data unit is divided by the divisor, using a process called
binary division. The remainder resulting from this division is the CRC.
The CRC of n bits derived in step 2 replaces the appended 0s at the end of the
data unit. Note that the CRC may consist of all 0s.
The data unit arrives at the receiver data first, followed by the CRC. The receiver
treats the whole string as unit and divides it by the same divisor that was used to
find the CRC remainder.
If the string arrives without error, the CRC checker yields a remainder of zero ad
the data unit passes. If the string has been changed in transit, the division yields a
non zero remainder and the data does not pass.
data
CRC
divisor
data
data
CRC
remainder
divisor
CRC
Zero, accept
Non zero, reject
receiver
sender
00..0
N0bits
N+1
bits
111101
divisor
1 1 0 1 )1 0 0 1 0 0 0 0 0
1101
1000
1101
1010
1101
1110
1101
0110
0000
1100
1101
0 0 1 remainder(CRC)
CRC CHECKER
A CRC checker function is exactly as the generator does. After receiving the data
appended with the CRC, it does the same modulo-2 division.
If the remainder is all 0s, the CRC is dropped and the data are accepted;
otherwise, the received stream of bits is discarded and data are resent.
The following figure shows the process of division in the receiver. We assume
that there is an error.
The remainder is not full of 0s, and the data are rejected.
111101
divisor
1 1 0 1 )1 0 0 1 0 0 0 0 1
1101
1000
1101
1010
1101
1110
1101
0110
0000
1101
1101
0 0 1 result
POLYNOMIALS
The divisor in the CRC most often represented not as a string of 1s and 0s, but as
an algebraic polynomial. The polynomial format is useful to solve the concept
mathematically.
x7+x5+x2+x+1
A polynomial
x7+x5+x2+x+1
1010 0 1
CHECKSUM
Section1
Section2
Checksum
sender
N bits
Section2
N bits
--------N bits
-----------
Section k
Section1
N bits
N bits
Checksum
--------All 0s
Section k
----------N bits
N bits
Checksum
N bits
Packet
N bits
N bits
N bits
N bits
CHECKSUM CHECKER
The receiver subdivides the data unit into k sections each of n bits.
All sections are added using ones complement arithmetic to get the sum.
The sum is complemented.
If the result is zero, the data are accepted: otherwise they are rejected.
EXAMPLE
sum
sum
00000000
complement ( pattern is ok )
11111001
11000101
sum
00011101
00111000
PERFORMANCE
It detects all errors involving an odd number of bits as well as most errors
involving an even number of bits.
If one or more bits of a segment are damaged and the corresponding bit or bits
of opposite value in the second segment are also damaged, the sum of those
columns will not change and the receiver will not detect the problem.
HAMMING CODE:
A minimum number of redundancy bits needed to correct any single bit error in
the data
A minimum of 4 redundancy bits is needed if the number of data bits is 4.
Redundancy bits in the Hamming code are placed in the codeword bit positions
that are a power of 2
Each redundancy bit is the parity bit for a different combination of data bits
Each data bit may be included in more than one parity check.
Easy way to compute the redundancy bit values: write down binary
representations for positions of data bits which contain a 1; compute parity
bits for each column; put parity bits into codeword in correct order.
Here: data is 1001101 so codeword will look like 100x110x1xx (where x denotes
redundancy bits) 1s in positions 3, 6, 7, and 11
11: 1 0 1 1
7: 0 1 1 1
6: 0 1 1 0
3: 0 0 1 1
1001
parity bits
r1 r2 r4 r8
If the transmitted codeword is received error-free, the new parity bits the
receiver computes will all be 0 ,the receiver knows no bit errors occurred.
This simple form of Hamming code can be used to provide some protection
against burst errors, by transmitting 1st bit from every codeword to be transmitted, then
2nd bit from every one of these codeword, and so onIn some cases, burst errors can be
corrected
.FLOW CONTROL
Flow control coordinates that amount of data that can be sent before receiving ACK It is
one of the most important duties of the data link layer.
ERROR CONTROL
Error control in the data link layer is based on ARQ (automatic repeat request), which
is the retransmission of data.
The term error control refers to methods of error detection and retransmission.
Anytime an error is detected in an exchange, specified frames are retransmitted. This
process is called ARQ.
FLOW AND ERROR CONTROL MECHANISMS
1. STOP-AND WAIT ARQ.
2. GO-BACK-N ARQ.
3. SELECTIVE-REPEAT ARQ.
Sender
Receiver
S=0
Frame 0
S=1
ACK 1
Frame 1
R=0
R=1
ACK 0
S=0
Time
Time
S=0
Receiver
Frame 0
R=0
S=1
ACK 1
Frame 1
R=1
Lost
S=1
Frame 1
R=1
Time-out
ACK0
R=0
S=0
Lost acknowledgement
o A lost or damaged ACK is handle in the same by the sender; if the sender
receives a damaged ACK, it discards it.
o The following figure shows a lost ACK 0.the waiting sender does not know if
frame 1 has been received. When the timer for frame 1 expires the sender
retransmits frame 1.
o Note that the receiver has already received frame 1 and is expecting to receive
frame 0. Therefore, its silently discards the second copy of frame 1.
Sender
Receiver
S=0
Frame 0
R=0
ACK 1
Frame 1
S=1
R=1
ACK 0
Time-out
S=1
Lost
Frame 1
R=0
ACK0
Expecting frame 0
Frame 1 is discarded
S=0
Time
Time
Delayed acknowledgement
o An ACK can be delayed at the receiver or by some problem with the link. The
following figure shows the delay of ACK 1; it ids received after the timer for
frame 0 as already expired.
o The sender has already retransmitted a copy of frame 0. The receiver expects
frame 1 so its simply discards the duplicate frame 0.
o The sender has now received two ACKs, one that was delayed and one that
was sent after the duplicate frame 0 arrived. The second ACK 1 is discarded.
Sender
Receiver
S=0
Frame 0
R=0
Time-out
ACK1
S=0
Frame0
S=1
R=1
Frame 1
Expecting frame 0
Frame 1 is discarded
ACK1
Discarded
S=1
Frame1
Time-out
R=1
ACK0
Time
Time
BIDIRECTIONAL TRANSMISSION
The stop and wait mechanism is unidirectional. We can have bi-directional
transmission if the two parties have two separate channels for full duplex communication
or share the same channel for off duplex transmission. In this case, each party needs both
S and R variables to track frames sent and expected.
PIGGYBACKING
Its a method to combine a data frame with an ACK. In following figure both the
sender and the receiver have data to send. Instead of sending separate data and ACK
frames. It can save bandwidth because the overhead from a data frame and an ACK frame
can be combined into just one frame
Sender
Receiver
R=0
S=0
Frame 0,ACK0
R=0
S=0
R=0
Frame0,ACK 1
S=1
Frame 1,ACK1
R=1
S=1
R=1
Frame1,ACK 0
S=0
Time
Time
GO-BACK-N ARQ
As in Stop-and-wait protocol senders has to wait for every ACK then next frame
is transmitted. But in GO-BACK-N ARQ number of frames can be transmitted
without waiting for ACK. A copy of each transmitted frame is maintained until
the respective ACK is received.
Features of GO-BACK-N ARQ
1.sequence numbers.
Sequence numbers of transmitted frames are maintained in the header of
frame. If k is the number of bits for sequence number, then the numbering can
range from 0 to 2k-1. Example: if k=3 means sequence numbers are 0 to 7.
2. sender sliding window:
Window is a set of frames in a buffer waiting for ACK. This window keeps on
sliding in forward direction, the window size is fixed. As the ACK is received, the
respective frame goes out of window and new frame to sent come into window.
Figure illustrates the sliding window.
If Sender receives. ACK 4, then it knows Frames upto
and including Frame 3 were correctly received
Window size=7
4. Control variables:
Sender variables and Receiver variables:
Sender deals with three different variables
S -> sequence number of recently sent frame
SF -> sequence number of first frame in the window.
SL -> sequence number of last frame in the window.
The receiver deals with only one variable
R -> sequence number of frame expected.
5. Timers
The sender has a timer for each transmitted frame. The receivers dont have any
timer.
6. Acknowledgement:
The receiver responds for frame arriving safely by positive ACK. For damaged or
lost frames receiver doesnt reply, the sender has to retransmit it when timer of that frame
elapsed. The receiver may ACK once for several frames.
7. resending frames:
if the timer for any frame expires, the sender sender has to
resend that frame and the subsequent frame also, hence the protocol is called GOBACK-N ARQ.
Operation
Normal operation:Following diagram shows this mechanism. The sender keeps track of
the outstanding frames and updates the variables and windows as acknowledgements
arrive.
SF
Sender
SL
0 1 2 3 0
111
Receiver
Frame 0
Frame 1
0 1 2 3 0
111
S
0 1 2 3 0
111
S
ACK 2
Frame 2
0 1 2 3 0
111
0 1 2 3 0
111
Frame 3
S
Time
0 1 2 3 0
1111 111
ACK3
0 1 2 3 0
111 1 111
0 1 2 3 0
111
Time
SF
Sender
SL
0 1 2 3 0
111
Receiver
Frame 0
Frame 1
0 1 2 3 0
111
S
0 1 2 3 0
111
ACK 2
Frame 2
lost
0 1 2 3 0
111
0 1 2 3 0
111
0 1 2 3 0
1111 111
Frame 3
0 1 2 3 0
111
Timeout
resent
0 1 2 3 0
111
Frame 2
1
Frame 3
0 1 2 3 0
111
0 1 2 3 0
111
resent
0 1 2 3 0
111 1 111
R
Time
Time
selective repeat also defines a negative ACK NAK that reports the sequence
number of a damaged frame before the timer expires.
Operation
Normal operation
Normal operations of the selective repeat ARQ is same as GO-BACK-N ARQ
mechanism.
Lost or damaged frame
The following figure shows operation of the mechanism with an example of a lost
frame.
Frame 0 and 1 are accepted when received because they are in the range specified
by the receiver window. When frame 3 is received, it is also accepted for the same
reason. However the receiver sends a NAK 2 to show that frame 2 has not been
received. When the sender receives the NAK 2, it resends only frame 2, which is then
accepted because it is in the range of the window.
Sender
0 1 2 3 0
111
Receiver
Frame 0
Frame 1
0 1 2 3 0
111
S
0 1 2 3 0
111
ACK 2
Frame 2
0 1 2 3 0
111
0 1 2 3 0
111
0 1 2 3 0
111
0 1 2 3 0
111
lost
Frame 3
0 1 2 3 0
111
NAK 2
Frame 2
0 1 2 3 0
111
1
resent
Time
Time
HDLC standardized ISO in 1979 and accepted by most other standards bodies
(ITU-T, ANSI)
3 types of end-stations:
Primarysends commands
Secondarycan only respond to Primarys commands
Combinedcan both command and respond
3 types of configuration
(Note: no balanced multipoint)
TRANSFER MODE
only difference is that secondary needs permission from the Primary in NRM, but
doesnt need permission from the Primary in ARM.
FRAMES:
3 types of Frames are
I-Frame transports user data and control info about user data.
S-Frame supervisory Frame, only used for transporting control information
U-Frame unnumbered Frame, reserved for system management(managing the
link itself)
FRAME FORMAT
U-Frames:
U-frames are used for functions such as link setup. They do not contain any
sequence numbers.
Five code bits denote the frame type (but there are not 32 different possibilities):
Set Asynchronous Balanced Mode (SABM).Used in the link set up to indicate
ABM mode will be used.
Set Normal Response Mode (SNRM).Used for asymmetric mode (master/slave).
SABME and SNMREextended format.
Disconnect (DISC).Used to disconnect the logical connection.
Frame Reject (FRMR)reject frame with incorrect semantics.
S-Frames:
S-frames are similar to unnumbered frames, the main difference being that they
do carry sequence information.
Some supervisory frames function as positive and negative acknowledgements,
they therefore play a very important role in error and flow control.
Two bits indicate the frame type, so that there are four possibilities.
Control Field:
Physical topology
90
50
120
75
400
75
120
90
400
Medium options
1. Broadband: Transmission medium is co-axial cable and its uses
AM/PSK as a signaling techniques, data rate is 1,5,10 mbps.
2. Carrier band: Transmission medium is co-axial cable and its
uses KSK as a signaling techniques, data rate is 1,5,10Mbps.
1
Preamble
pr
1
SD
1
FC
2-6
DA
2-6
SA
0-8182
DATA
4
FCS
ED
priority. The frame control field indicates the type of the frame data
frame or control frame.
DA: Destination address: The destination address field is 2 or 6 bytes
long.
SA: Source address: The destination address field is 2 or 6 bytes long.
DATA: Data field
FCS: Frame check sequence: frame check sequence is 4 bytes long
and contains CRC code. It is used to detect transmission errors on DA,
SA, FC and data fields.
ED: End delimiter: It is a unique bit pattern, which marks the end of
the frame. It is one byte long.
The total length of the frame is 8191 bytes.
Performance:
For token ring, the slightly higher delay compared to CSMS/CD bus
occurs. For higher transmission loads the token ring performs well.
stations
Ring interface
byte
SD
AC
ED
Data Frame
1
1
SDpr
1
AC
1
FC
2-6
DA
SA
2-6
No limit
DATA
FCS
FS
ED
SD: Start frame delimiter: Its also one byte unique bit pattern, which
marks the start of the frame.
AC: Access control: It is one byte long field containing priority
bits(P), Token bit(T),
monitoring bit(M), and reservation bir(R).
FC: Frame control: The frame control field is used to distinguish data
frames from control frames. For data frame, it carries the frames
priority. The frame control field indicates the type of the frame data
frame or control frame.
DA: Destination address: The destination address field is 2 or 6 bytes
long.
SA: Source address: The destination address field is 2 or 6 bytes long.
DATA: Data field
FCS: Frame check sequence: frame check sequence is 4 bytes long
and contains CRC code. It is used to detect transmission errors on DA,
SA, FC and data fields.
ED: End delimiter: It is a unique bit pattern, which marks the end of
the frame. It is one byte long.
FS: Frame status: This field is none byte long and contains a unique
bit pattern marking the end of a token or a data frame.
Performance:
When traffic is light, the token will spend most of its time idly
circulating around the ring. When traffic is heavy, there is a queue at each
station. Network efficiency is more.
Disadvantages:
A break in a link or repeater failures disturbs the entire network.
Installation of new repeaters requires identification of two
topologically adjacent repeaters.
Since the ring is closed loop, a packet will circulate indefinitely
unless it is removed.
Each repeater adds an increment of delay.
There is practical limit to the number of repeaters.
Introduction
The Fiber Distributed Data Interface (FDDI) specifies a 100-Mbps tokenpassing, dual-ring LAN using fiber-optic cable. FDDI is frequently used as
high-speed backbone technology because of its support for high bandwidth
and greater distances than copper. It should be noted that relatively recently,
a related copper specification, called Copper Distributed Data Interface
(CDDI), has emerged to provide 100-Mbps service over copper. CDDI is the
implementation
of FDDI protocols over twisted-pair copper wire. This chapter focuses
mainly on FDDI specifications and operations, but it also provides a highlevel overview of CDDI.
FDDI uses dual-ring architecture with traffic on each ring flowing in
opposite directions (called counter-rotating). The dual rings consist of a
primary and a secondary ring. During normal operation, the primary ring is
used for data transmission, and the secondary ring remains idle. As will be
discussed in detail later in this chapter, the primary purpose of the dual rings
is to provide superior reliability and robustness. Figure 8-1 shows the
counter-rotating primary and secondary FDDI rings.
FDDI Specifications
FDDI specifies the physical and media-access portions of the OSI reference
model. FDDI is not actually a single specification, but it is a collection of
four separate specifications, each with a specific function. Combined, these
The following descriptions summarize the FDDI data frame and token fields
illustrated in Figure 8-10.
Dual Ring
FDDI's primary fault-tolerant feature is the dual ring. If a station on the dual
ring fails or is powered down, or if the cable is damaged, the dual ring is
automatically wrapped (doubled back onto itself) into a single ring. When
the ring is wrapped, the dual-ring topology becomes a single-ring topology.
Data continues to be transmitted on the FDDI ring without performance
impact during the wrap condition. Figure 8-6 and Figure 8-7 illustrate the
effect of a ring wrapping in FDDI.
also
Wraps to Withstand
a Cable Failure
When a single station fails, as shown in Figure 8-6, devices on either side of
the failed (or powered-down) station wrap, forming a single ring. Network
operation continues for the remaining stations on the ring. When a cable
failure occurs, as shown in Figure 8-7, devices on either side of the cable
fault wrap. Network operation continues for all stations.
It should be noted that FDDI truly provides fault tolerance against a single
failure only. When two or more failures occur, the FDDI ring segments into
two or more independent rings that are incapable of communicating with
each other.
The MAC layer controls the node's access to the network media and is
specific to the individual protocol. All IEEE 802.3 MACs must meet the
same basic set of logical requirements, regardless of whether they include
one or more of the defined optional protocol extensions. The only
requirement for basic communication (communication that does not require
optional protocol extensions) between two network nodes is that both MACs
must support the same transmission rate.
The 802.3 physical layer is specific to the transmission data rate, the signal
encoding, and the type of media interconnecting the two nodes. Gigabit
Ethernet, for example, is defined to operate over either twisted-pair or
optical fiber cable, but each specific type of cable or signal-encoding
procedure requires a different physical layer implementation.
The IEEE 802.3 standard defines a basic data frame format that is required
for all MAC implementations, plus several additional optional formats that
are used to extend the protocol's basic capability. The basic data frame
format contains the seven fields shown in Figure 7-6.
Preamble (PRE)Consists of 7 bytes. The PRE is an alternating pattern
of ones and zeros that tells receiving stations that a frame is coming, and that
provides a means to synchronize the frame-reception portions of receiving
physical layers with the incoming bit stream.
Start-of-frame delimiter (SOF)Consists of 1 byte. The SOF is an
alternating pattern of ones and zeros, ending with two consecutive 1-bits
indicating that the next bit is the left-most bit in the left-most byte of the
destination address.
Destination address (DA)Consists of 6 bytes. The DA field identifies
which station(s) should receive the frame. The left-most bit in the DA field
indicates whether the address is an individual address (indicated by a 0) or a
group address (indicated by a 1). The second bit from the left indicates
whether the DA is globally administered (indicated by a 0) or locally
Note Individual addresses are also known as unicast addresses because they
refer to a single MAC and are assigned by the NIC manufacturer from a
block of addresses allocated by the IEEE. Group addresses (a.k.a. multicast
addresses) identify the end stations in a workgroup and are assigned by the
network manager. A special group address (all 1sthe broadcast address)
indicates all stations on the network.
Frame Transmission
The destination and source addresses are inserted into the address fields.
The LLC data bytes are counted, and the number of bytes is inserted into
the Length/Type field.
The LLC data bytes are inserted into the Data field. If the number of
LLC data bytes is less than 46, a pad is added to bring the Data field length
up to 46.
An FCS value is generated over the DA, SA, Length/Type, and Data
fields and is appended to the end of the Data field.
After the frame is assembled, actual frame transmission will depend on
whether the MAC is operating in half-duplex or full-duplex mode.
The IEEE 802.3 standard currently requires that all Ethernet MACs support
half-duplex operation, in which the MAC can be either transmitting or
receiving a frame, but it cannot be doing both simultaneously. Full-duplex
operation is an optional MAC capability that allows the MAC to transmit
and receive frames simultaneously.
UNIT III
Network Layer
Transport segment from sending to receiving host.
On sending side encapsulates segments into datagrams.
On receiving side, delivers segments to transport layer.
network layer protocols in every host, router.
Router examines header fields in all IP datagrams passing through it.
Network-Layer Functions
forwarding: move packets from routers input to appropriate router
Output.
routing: determine route taken by packets from source to destination.
Internetworking
Switching Schemes
VC implementation
A VC consists of:
Packet Switching
Messages are split into smaller pieces called packets.
These packets are numbered and addressed and sent through the network
one at a time.
Allows Pipelining
Overlap sending and receiving of packets on multiple
links.
IP Addresses
Each network interface on the Internet as a unique global address, called the
IP address. An IP address- is 32 bits long. It encodes a network number and
a host number.IP addresses are written in a dotted decimal notation:
128.238.42.112 means
10000000 in 1st Byte
11101110 in 2nd Byte
00101010 in 3rd Byte
01110000 in 4th Byte
IP Address classes
Class A:
For very large organizations
16 million hosts allowed
Class B:
For large organizations
65 thousand hosts allowed
Class C
For small organizations
255 hosts allowed
Class D
Multicast addresses
No network/host hierarchy
Internet= a collection of connected networks which share a common set of
rules for communication
IP Address Hierarchy
Note that Class A, Class B, and Class C addresses only support two levels
of hierarchy
Each address contains a network and a host portion, meaning two levels of
Hierarchy.
However, the host portion can be further split into subnets by the address
class owner
This allows for more than 2 levels of hierarchy.
IP Subnetting
Subnetting is a technique used to allow a single IP network address to
Span multiple physical networks
IP hosts should support subnetting.
Subnetting is done by using some of the bits of the host-id part of the
IP address physical layer network identifier
The subnet mask is used to determine the bits of the network
identifier.
All hosts on the same network should have the same subnet mask.
IP address is composed of a Netid part and a Hostid part 2-level
hierarchy.
Sometimes a 2-level hierarchy is insufficient for an organisations needs.
Subnetting
An IP packet from some other network destined for host 141.14.2.21
still reaches router R1, since the destination address is still a Class B
address with Netid141.14 and Hostid 2.21 as far as the rest of the
Internet is concerned.
when the packet reaches router R1, the interpretation of the IP address
changes
R1 knows that there are 3 levels of hierarchy within the organization,
and that in this case, the Netid is 141.14,the Subnetid is 2, and the
Hostid is 21.
Subnet Masks
Subnet masks allow hosts to determine if another IP address is on the same
subnet or the same network.
Router
Routing issues:
Scalability: must be able to support large numbers of hosts, routers,
networks
Adapt to changes in topology or significant changes in traffic, quickly and
efficiently
self-healing: little or not human intervention
Route selection may depend on different criteria
Performance: "choose route with smallest delay"
Policy : "choose a route that doesn't cross a government network"
(equivalently: "let no non-government traffic cross this network")
Classification of Routing algorithms
Centralized versus decentralized
Centralized: central site computes and distributed routes (equivalently:
information for computing routes known globally, each router makes same
computation)
Decentralized: each router sees only local information (itself and physicallyconnected neighbors) and computes routes on this basis. pros and cons?
Static versus adaptive
Static: routing tables change very slowly, often in response to human
intervention
Dynamic: routing tables change as network traffic or topology change
Two basic approaches adopted in practice:
Link-state routing: centralized, dynamic (periodically run)
Distance vector: distributed, dynamic (in direct response to changes)
Routers
Routers are distinguished by the functions they perform
Internal routers
Only route packets within one area
Area border routers
Connect to areas together
Backbone routers
Reside only in the backbone area
AS boundary routers
Routers that connect to a router outside the AS
Routing
The most common routing algorithms are distance-vector and linkstate routing.
Distance-vector:
Each router exchanges information about the entire network with
neighboring routers at regular intervals.
Neighboring routers = connected by a direct link (e.g. a LAN)
Regular intervals: e.g. every 30 seconds
Link-state:
The algorithm keeps track of 2 sets of nodes and arcs Temporary and
Permanent.
Initially, the Temporary set contains all neighbor nodes of the router
itself, and the arcs connecting them to the router; only the router is
initially Permanent.
When all nodes and arcs are in the Permanent set, the algorithm has
terminated.
Identify the Temporary node whose arc has the lowest cumulative cost
from the root: this node and arc are moved into the Permanent set.
Any nodes which are connected to the new Permanent node and are
not already in the Temporary set, along with the connecting arcs, are
made Temporary.
Also, if any node already in the Temporary set has a lower cumulative
cost from the root by using a route passing through the new
Permanent node, then this new route replaces the existing one
Repeat until all nodes and arcs are Permanent.
Once a router has found its shortest-path spanning tree, it can build its
routing table.
To complete the Example, here is router As link-state routing table
UNIT - IV
The Transport Layer is responsible for end-to-end data transport
Primary functions include:
Provision of connection oriented or connectionless service.
The source port, much like the source port in TCP, identifies the
process on the originating system. TCP ports and UDP ports are not
the same. There is no relationship between the two.
The destination port identifies the receiving process on the receiving
machine. Whereas the IP address identifies which machine should get
the packet, the port identifies which machine should get the data.
The length field contains the length of the UDP datagram. This
includes the length of the UDP header and UDP data. It does not
include anything added to the packet in-transit by other protocols -but these are stripped away before UDP sees the datagram at the other
side.
The checksum field is used by UDP to verify the correctness of the
UDP header and data. If the checksum indicates an error, the packet is
dropped. UDP is unreliable, so it makes no attempt to mitigate the
loss.
Application
Datagram oriented
unreliable, connectionless
simple
unicast and multicast
Useful only for few applications, e.g., multimedia applications
Used a lot for services
network management(SNMP), routing (RIP),naming(DNS), etc.
Port Numbers
UDP (and TCP) use port numbers to identify applications
A globally unique address at the transport layer (for both UDP and
TCP) is a tuple <IP address, port number>
There are 65,535 UDP ports per host.
If the bit is set, the following bytes contain an urgent message in the
sequence number range SeqNo <= urgent message <= SeqNo +
urgent pointer
ACK: Segment carries a valid acknowledgement
PSH: PUSH Flag
Notification from sender to the receiver that the receiver should pass
all data that it has to the application.
Normally set by sender when the senders buffer is empty
RST: Reset the connection
The flag causes the receiver to reset the connection.
Receiver of a RST terminates the connection and indicates higher
layer application about the reset
SYN: Synchronize sequence numbers
Sent in the first packet when initiating a connection
FIN: Sender is finished with sending
Used for closing a connection
Both sides of a connection must send a FIN.
Connection Termination :
Congestion Control
Open Loop Congestion Control
At connection set-up time, the sender and carrier negotiate a traffic pattern
(shape)
The leaky bucket enforces a constant output rate regardless of the burstiness of
the input. Does nothing when input is idle.
The host injects one packet per clock tick onto the network. This results in a
uniform flow of packets, smoothing out bursts and reducing congestion.
When packets are the same size (as in ATM cells), the one packet per tick is okay.
For variable length packets though, it is better to allow a fixed number of bytes
per tick.
In the TB algorithm, the bucket holds tokens. To transmit a packet, the host must
capture and destroy one token.
Tokens are generated by a clock at the rate of one token every t sec.
Idle hosts can capture and save up tokens (up to the max. size of the bucket) in
order to send larger bursts later.
Token bucket operation
TB accumulates fixed size tokens in a token bucket
Transmits a packet (from data buffer, if any are there) or arriving packet if the
sum of the token sizes in the bucket add up to packet size
More tokens are periodically added to the bucket (at rate t). If tokens are to be
added when the bucket is full, they are discarded
Token bucket properties
Does not bound the peak rate of small bursts, because bucket may contain enough
token to cover a complete burst size
Performance depends only on the sum of the data buffer size and the token bucket
size
FQDN
If label is terminated by a null string it is called a FQDN
DNS client adds suffix atc.fhda.deu before passing the address to the DNS server.
Domain:
A domain is a sub-tree of the domain space.
Domain may itself be divided into sub domains.
Zone
What a Server is responsible for or has authority over is called zone.
If a server accepts responsibility for a domain and does not divide the domain into
smaller domains.
The domain and the zone refer to the same thing.
Server makes a database called a zone file.
It keeps all the information for every node under that domain
Root server
Is a server whose zone consists of whole tree
It does not store any info about domain but delegates authority to other servers
Primary server:
A server that stores a file about the zone for which it is an authority.
Responsible for creating, maintaining the and updating the zone file
A primary server loads all information from the disk file; the secondary server
loads all information from the primary server
DNS In The Internet
In the Internet, Domain name space (tree) is divided into 3 sections.
Generic Domain
It defines registered hosts according to their generic behavior.
Each node in the tree defines a domain, which is an index to the domain name
space database.
Seven labels describe three organization types.
Description
com
Commercial organizations
edu
Educational institutions
gov
Government institutions
int
International organizations
mil
Military groups
net
org
Nonprofit organizations
Country Domain
Follows the same format as the generic domain but uses two character country
abbreviations.
Inverse domain
It is used to map an address to a name
Ex:
When a server has received a request from a client to do a task
Whereas the server has a file that contains a list of authorized clients, the server
lists only the IP address of the client
To determine if the client is on the authorized list ,server send a query
To inverse DNS server and ask for a mapping of address to a name
This query is called inverse or pointer (PTR) query
To handle this ,inverse domain is added to the domain space with the first level
node called arpa
Second level is also one single node named in-addr
Rest of the domain defines the IP address.
Resolution
Mapping a name to an address or an address to a name is called name-address
resolution.
Resolver
A host that needs to map an address to a name or a name to an address calls a
DNS client named a resolver.
It accesses the closest DNS server with a mapping request
If the server has the information , it satisfies the resolver.
Otherwise it refers the resolver to other servers or ask other servers to provide
information.
After the resolver receives the mapping ,it interprets to see if it is a real resolution
or an error and finally delivers the result to the process that requested it.
Mapping Names to addresses
The resolver gives a domain name to the server and asks for the corresponding
address
In this ,server checks the generic domain or the country domain to find the
mapping
If from the generic domain the resolver receives a domain name such as
chal.atc.fhda.edu.
Query is sent by the resolver to the local DNS server for resolution
If cant refers the resolver to other servers or ask other servers directly
If from the country domain, the resolver receives a domain name such as
ch.fhda.cu.ca.us.
Iterative Resolution
DNS Messages
Header format
Identification
Used by the client to match the response with the query.
Uses a diff id no. each time it sends a query.
Server duplicates this no. in the corresponding response.
Flag
Collection of fields that define the
Type of msg
Type of answers requested
Type of desired resolution (recursive or iterative)
Addresses
To deliver mail, an addressing system used by SMTP consists of 2 parts
Local part : defines the name of a specific file called mail box
All the mail received for a user is stored in the mail box for retrieval by the user
agent
Domain Name : comes from the DNS database or is a logical name (name of the
organization)
Email address
User agent
A s/w package that composes, reads, replies to, and forward messages.
Some examples of command-driven user agents are mail, pine, and elm
Some examples of GUI-based user agents are Eudora, Outlook, and Netscape.
MIME:
It converts a Non-ASCII code to ASCII code.
MIME Header:
Type
Text
Subtype
Plain
Description
Unformatted text
Body contains ordered
Mixed
parts of different data
types
Same as above, but no
Parallel
order
Multipart
Similar to mixed, but the
Digest
default is message/RFC822
Parts are different
Alternative versions of the same
message
Body is an encapsulated
RFC822
message
Body is a fragment of a
Message
Partial
bigger message
Body is a reference to
Ext. Body
another message
JPEG
Image is in JPEG
Image
GIF
Video is in GIF format
Video
MPEG
Video is in MPEG format
Single-channel encoding of
Audio
Basic
voice at 8 KHz
PostScript Adobe PostScript
Application OctetGeneral binary data (8-bit
Stream
bytes)
Content-transfer encoding
Category Description
Type
7bit
8bit
Binary
Base64
Code
11
22
33
44
55
12
23
34
45
56
13
24
35
46
57
14
25
36
47
58
15
26
37
48
59
16
27
38
49
60
17
28
39
50
61
18
29
40
51
62
19
30
41
52
63
20
31
42
53
10
21
32
43
54
Quoted Printable:
MTA
Actual mail transfer is done through MTA
To send mail a system must have a client MTA and to receive a mail a server
MTA
Mail transfer occurs between two mail servers
MTA client and server
Uses commands and responses to transfer messages between an MTA client and
an MTA server
Command or reply is terminated by a two character endofline token
Commands
Sent from client to server
Consist of a keyword followed by zero or more arguments
Responses
Sent from server to the client
Response is a three digit code that may be followed by additional textual
information
Mail transfer
Transferring a mail message occurs in 3 phases
Connection establishment
After a client has made a TCP connection to the well known port 25 ,SMTP
server starts the connection phase.
Message transfer
Message between a sender and one or more recipients can be exchanged.
Connection Termination
After the message is transferred ,the client terminates the connection
Mail Delivery
Consists of 3 stages
Ist stage
Email goes from user agent to the local server.
Mail does not go directly to the remote server.
Mail is stored in the local server until it can be sent.
User agent uses SMTP client s/w and the local server uses SMTP server s/w.
Second stage
Email is relayed by local server, which now acts as SMTP client to the remote
server, which is the SMTP server in this stage
Email is delivered to the remote server ,not to the remote user agent
Third stage
The remote user agent uses a mail access protocol such as POP3 or IMAP4 to
access the mailbox and the mail
IMAP4
Powerful and more complex.
User can check the email header prior to downloading.
User can check the contents of email for a specific string of characters prior to
downloading.
Can partially download email.
User can create, delete or rename mailboxes on the mail server.
Can create a hierarchy of mailboxes in a folder for email storage.
FTP
For copying a file from one host to another
FTP uses the services of TCP. It needs two TCP connections. The well-known port 21
is used for the control connection, and the well-known port 20 is used for the data
connection
While the control connection is open, the data connection can be opened and close
multiple times if several files are transferred
Conn remains open during the entire process
Service type used is minimize delay
User types commands and expects to receive responses without significant delay
Data connection
Uses the well known port 20 at the server site
Connection open when data ready to transfer
Closed when it is not needed
Service type used is maximize throughput
Communication
FTP client and server run on different computers
Must communicate with each other
May use different operating system, diff character sets, diff file structures and diff
file formats
FTP make this compatible
FTP has 2 diff approaches. one for ctrl conn & the other for data conn
Communication over ctrl conn
Same approach as SMTP
Uses the ASCII character set.
Communication is achieved through commands and responses
Each line is terminated with a two-character (carriage return and line feed) endof-line token
File transfer
HTTP
Used mainly to access data on the www
The protocol transfers data in the form of plain text, hyper text, audio and video
and so on.
A client sends a request ,which looks like mail to the server
The server sends the response which looks like a mail reply to the client
The request and response messages carry data in the form of a letter with a MIME-like
format
HTTP uses the services of TCP on well-known port 80.
Request Message
Request Line:
Request msg
Request type:
Several request types are defined
RT categorizes the request msgs into several methods
URL
A client that wants to access a web page needs an address.
To facilitate access of documents ,it uses URL.
It defines 4 things
Method: a protocol used to retrieve the document (FTP and HTTP)
Host : a computer where info is located
Port number of server
Path name of file where info is located
Current version is HTTP 1.1
Methods
Request type defines several kinds of messages referred as methods
Request method is the actual command or request that a client issues to the server
GET :if the client wants to retrieve the document from the server
HEAD: if the client wants some info about the document
POST: used by the client to provide some info to the server
PUT: used by the client wants to provide a new or replacement document to be
stored on the server
PATCH : similar to PUT with some differences to be implemented with the
existing file.
COPY : copies a file to another location
MOVE: moves a file to another location
DELETE : removes a document on the server
LINK : creates a link or links from a doc to another location
UNLINK: deletes the link created by the link
Response Message:
Status Line:
Header Format:
Other features
Persistent Connection: the server leaves the connection open for more requests
after sending a response.
Non-Persistent Connection: one TCP connection is made for each request and
response.
HTTP version 1.1 specifies a persistent connection by default
WWW
Repository of info spread all over the world and linked together
It has a unique combination of flexibility, portability and user-friendly features .
It is a distributed client-server service.
A client using a browser can access a service using a server.
The service provided is distributed over many locations called websites.
Hypertext and hypermedia
Info is stored in a set of documents that are linked using the concept of pointers
An item can be associated with another document by a pointer
Hypermedia: It can contain pictures , graphics and sound
A unit of Hypertext or hypermedia available on the web is called a page
Hypertext:
Browser Architecture:
Static Document :
HTML
A language for creating web pages.
Allows to embed formatting instructions in the file itself.
Boldface tags
Common tags
Beginning Ending
Tag
Tag
Meaning
Skeletal Tags
<HTML> </HTML> Defines an HTML document
<HEAD> </HEAD> Defines the head of the document
<BODY> </BODY> Defines the body of the document
Title and Header Tags
<TITLE> </TITLE> Defines the title of the document
<Hn>
</Hn>
Beginning
Tag
Ending
Tag
Meaning
</B>
Boldface
<I>
</I>
Italic
<U>
</U>
Underlined
<SUB>
</SUB>
Subscript
<SUP>
</SUP>
Superscript
Centered
<BR>
</BR>
Line break
Beginning
Tag
Ending
Tag
Meaning
List Tags
<OL>
</OL>
Ordered list
<UL>
</UL>
Unordered list
<LI>
</LI>
An item in a list
Image Tag
<IMG>
Defines an image
Hyperlink Tag
<A>
</A>
Executable Contents
<APPLET> </APPLET>
This example shows how tags are used to let the browser format the appearance of the
text
Dynamic Document
Do not exist in a predefined format
It is created by a web server whenever a browser requests the document
Active document
Skeleton of an applet
In this example, we first import two packages, java.awt and java.applet. They
contain the declarations and definitions of classes and methods that we need. Our
example uses only one publicly inherited class called First. We define only one
public method, paint. The browser can access the instance of First through the
public method paint. The paint method, however, calls another method called
drawString, which is defined in java.awt.*.
import java.applet.*;
import java.awt.*;
public class First extends Applet
{
public void paint (Graphics g)
{
g.drawString ("Hello World", 100, 100);
}
}