Computer Networks Introduction To Computer Networks: M.Sc. (Computer Application) Sem-II
Computer Networks Introduction To Computer Networks: M.Sc. (Computer Application) Sem-II
Computer Networks Introduction To Computer Networks: M.Sc. (Computer Application) Sem-II
Chapter 1
Communication:
Sharing information, Sharing can be local (face to face) or
remote (over distance)
Tele communication:
(telephone, television, telegraphy) means communication at a
distance remote communication. (tele: far)
Data communication:
exchange of data between two devices via some form of
transmission medium such as a wire cable
Communicating devices for data communication to occur:
made up of Hardware (physical equipment ) and Software
(programs)
Characteristics of Data Communication
The effectiveness of data communication system depends on following
four fundamental characteristics:
• Delivery:
System must deliver data to the correct destination. Data must be
received by only intended device or user.
• Accuracy:
The system must deliver data accurately because altered and incorrect
data is unusable.
• Timeliness:
The system must deliver data in a timely manner called real-
time transmission. Data delivered later are useless.
• Jitter:
Variation in the packet arrival time. It is the uneven delay in the
delivery of audio or video packets.
Components of Data communication
• Video: can be analog or digital signal, video refers to the recording or broadcasting of
a picture or movie .
Types of data flow
Communication between two devices can be Simplex,
Half-duplex or Full-duplex. It refers to the direction in
which data moves between two devices.
1. Simplex: In this mode, Communication is unidirectional. (one-way-street).
Only one of the two devices on a link can transmit; the other can only receive.
Data flows in one direction only.
Ex: As Keyboard (only input) and monitors (only output), TV, radio
In this mode entire capacity of the channel is used to send data in one
direction.
A B
Simplex A to B only
2. Half duplex:
Each station can both transmit and receive , but not at the same time. When one
device is sending the other can receive and vice versa. Data can flow in both
directions but not simultaneously.
A B
Half-duplex A to B or B to A
3. Full-Duplex:
Both stations can transmit and receive simultaneously. Like two-way-street with
traffic flowing in both directions at the same time.
A B
Full-duplex A to B and B to A
Computer Network
Network:
Network is a set of devices (often referred to as nodes) connected
by communication links. A node can be a computer, printer, or
any other device capable of sending and/or receiving data
generated by other nodes on the network.
Computer Network:
A computer network is essentially collection of autonomous
computers interconnected by a single technology. Two computers
are said to be interconnected if they are able to exchange
information. It is a system which allows communication among
the computers connected in the network.
Goals of Computer Network
1. Resource sharing: Make all programs, data and equipment
available to anyone on the network regardless of the physical
location of the resource and user.
2. Provide high reliability: Ensures that network devices, data
and links are available at all time by having alternative sources
of supply i.e. backup servers, replication of files on more than
one machine to ensure availability. Useful for military,
banking, air traffic control application.
3. Distribution of workload: Big and complex task can be
distributed among multiple processors in the network.
4. Saving money: It is economical to set up network of a large
number of small computers than to invest in a few large ones
like mainframe.
5. Expandability: Network size and performance enhanced
gradually by adding more processors and communication
devices.
6. Powerful communication medium: people in distant
geographical areas can easily exchange and share information,
ideas and technology to enhance communication.
Advantages of Computer Network
1. Increased speed: network provide fast means for sharing and
transfer of files as compare to CDs and Pen drive
2. Reduced cost: popular versions of software usable for the
entire network as compare to individual licensed copies.
3. Improved security: protect program and files from illegal
copying by restricting access to authorized users only.
4. Centralized software management: All software can be
loaded on one computer instead of installing updates and
tracking files on independent computers. All other computers
can use centralized software.
5. Electronic mail: computer network makes hardware available
which is necessary to install an email system for person-to-
person communication.
6. Flexible access: It is possible for authorized users to access
their files from any computer connected on the network.
Disadvantages of Computer Network
1. High cost of installation: Initial installation cost of
network is high due to cost of cables, network cards,
computers and cost of services of technicians
2. Requires time for administration: Computer networks
needs proper and careful administration and maintenance
which is time consuming job.
3. Failure of server: If the file servers “goes down” then the
entire network comes to standstill.
4. Cable faults: Cable faults can paralyze a network.
Physical Structure
The physical structure of a network refers to the
way in which network elements are connected.
Transmission technology is an important aspect
which guides the design of networks.
Transmission Technology:
This refers to the way in which two devices can
be connected.
Repeater Repeater
Repeater Repeater
Repeater
Ring Topology Advantages:
• Since each device is linked only to its immediate neighbors, the
ring network is easy to install or reconfigure.
• Fault isolation is easy since the faulty device can be bypassed by
altering the connections.
• Only one device can send data at a time. The device which
wants to send data must capture a special frame called token.
Ring Topology Disadvantages:
•A break in the ring (such as disabled station) can disable the
entire network.
•The major constraint is the maximum ring length and the
number of devices connected.
•Since the traffic is unidirectional, data transfer is slow.
•Failure of one computer on the ring can affect the whole
network.
Categories of Networks
Computer network can be classified based on the
geographical area they cover, i.e. the area over which the
network is spread.
Following are three primary categories of networks:
LAN (Local-Area Network)
LAN is a network which is designed to operate over a small physical area such
as an office, factory or a group of buildings.
LAN
• Privately owned network connecting devices within a
single room, building or campus, extending upto a few
kilometers in size.
• LANs designed to allow resources to be shared
between PCs or workstations. The resources may be
hardware (e.g. printer) or software ( applications
program) or data.
• In LANs one of the computers has a large capacity drive
and becomes a server to other clients.
• S/W stored on server and used as needed by the whole
group.
• LAN size determined by licensing restrictions( Number
of users per copy of S/W)
LAN
• LANs are restricted in size which makes it possible to
determine transmission speed and also simplifies network
management.
• LAN is used for connecting two or more personal
computers through a communication medium such as
twisted pair, coaxial cable etc.
• The most common LAN topologies are Bus, Ring and
Star.
• Traditional LANs have data rates of 10Mbps to 100
Mbps. Newer LANs are capable of speed upto 10 Gbps.
• Many organizations have multiple LANs which can be
connected by devices like bridges or switches.
• A bridge is used to connect two LAN segment and passes
data from one segment to another. It helps in extending
LAN as well as segmenting a LAN into smaller LANs.
• Local Area Network provides higher security.
Advantages of LAN
1. High reliability: Failure of individual computer does not
affect the entire LAN.
2. It is possible to add a new computer easily.
3. The transmission of data is at a very high rate.
4. Sharing of peripheral devices such as printer is possible.
Applications of LAN
1. File transfer and file access
2. Office automation: create, collect, store, manipulate and
relay office information.
3. Document distribution
4. Remote access to database
5. Electronic message handling
6. Distributed computing
MAN (Metropolitan Area Network)
A MAN is a network which extends over an entire city.
MAN
•MAN may be a single network such as common cable
television network, or it may connect several LANs into
a large network.
•A company may use a MAN to connect all LAN’s in its
offices spread throughout a city.
•The ownership of MAN may be wholly private or a
public service company such as local telephone company.
•MAN is a network with the size between a LAN and a
WAN.
•e.g. Network between Banks in a city
WAN (Wide Area Network)
• A WAN provides long distance transmission of data, image,
audio and video information over large geographic areas that
may comprise a state, a country, a continent or even the
whole world.
•WANs generally use public, private or leased
communication equipments or combination.
•Example: A 4G mobile network is widely used across country, A
bank private network that connects many offices.
WAN
•A Wide Area Network is not limited to a single location, but it
spans over a large geographical area through a telephone
line, fiber optic cable or satellite links.
•The switched WAN connects the end systems, which usually
comprise a router that connects to another LAN or WAN.
•WANs typically use point-to-point transmission technology.
•The point-to-point WAN is normally a line leased from a
telephone or cable TV provider that connects a home
computer or small LAN to an Internet Service Provider to
provide Internet access.
•The internet is one of the biggest WAN in the world.
•A Wide Area Network is widely used in the field of
Business, government, and education.
Internetwork : Interconnections of networks
A collection of interconnected networks is called as an
internetwork or internet. Two or more computer
network LANs or WAN or computer network segments are
connected using devices, and they are configured by a
local addressing scheme. This process is known
as internetworking.
• Today it is very rare to see a LAN or a MAN in
isolation; they are connected to one another called
as internetwork.
• There exist a large number of diverse and
heterogeneous networks. The uses of one type of
network often require to communicate with uses of
other.
• Individual networks are joined into internetworks by
the use of internetworking devices like bridges,
routers and gateways.
• Gateways are the special computers which are
required to make the connection and translation in
terms of hardware and software between the
incompatible networks
Types Of Internetwork:
1. Extranet:
• It is used for information sharing.
• The access to the extranet is restricted to only those
users who have login credentials.
• An extranet cannot have a single LAN, at least it must
have one connection to the external network.
2. Intranet:
• An intranet is a private network.
• An intranet belongs to an organization which is only
accessible by the organization's employee or members. The
main aim of the intranet is to share the information and
resources among the organization employees.
• An intranet provides the facility to work in groups.
Protocols and Standards
Network Software:
Network software is an equally important aspect of
computer networks.
Two terms are widely used regarding network software:
1. Protocols 2. Standards
Protocols:
A protocol is a set of rules that governs data
communication. A protocol is an agreement between
communicating entities on how communication is to take
place. A protocol defines: What is communicated, How
it is communicated, When it is communicated.
A communicating entity is anything capable of sending and
receiving information.
A protocol has following three key elements:
1. Syntax
2. Semantics
3. Timing
1. Syntax:
The term syntax refers to the structure or format of the
data, meaning the order in which they are presented.
Example:
A simple protocol might expect the first 8 bits of data to be
the address of the sender, the second 8 bits to be the
address of the receiver, and the rest of the stream to be the
msg itself.
2. Semantics:
The word semantics refers to the meaning of data. How
is a particular pattern to be interpreted, and what action is
to be taken based on that interpretation?
Example:
Does an address identify the route to be taken or the final
destination of the msg?
3. Timing:
The term timing refers to two characteristics:
When data should be sent?
How fast they can be sent?
Example:
If a sender produces data at 100 Mbps but the receiver
can process data at only 1 Mbps, the transmission will
overload the receiver and some data will be lost.
Standards:
Standards are essential in creating and maintaining an open
and competitive market for equipment manufacturers. Since
number of networks and network users has increased in the last
few decades there are a large number of equipment
manufacturers in the market today. To ensure that there is
compatibility between these devices, some standards have to
be followed so that data communication is possible.
Need for standards:
• To guarantee that the technology and processes used for data
communication operate at national as well as international
levels.
• Standards provide guidelines for equipment manufacturers,
vendors, government agencies and other service providers to
ensure that interconnectivity is achieved in international
communications.
Data communication standards fall into two categories:
(Layer 2) (Layer 2)
Msg in English Msg in English
Translator Translator
Physical
Medium
b. Byte streams:
Data is sent as a sequence of bytes. No boundaries are
preserved and even if distinct msgs are sent, they arrive as a
continuous byte stream.
Example: Logging into a remote time-sharing system.
2. Unreliable service:
For some applications, loss of data bits is tolerable but
the delay introduced by reliable communication is
unacceptable.
Example: Digitized voice traffic (real-time). It is
preferable to hear a bit of noise on the line rather than
have gaps in conversation. (telephone)
Connectionless Services:
No connection is established for data communication. Each
message carries the full destination address and each one
is routed independent of the others. In such a case, it is
possible that messages arrive out of order. Its types are:
i. Unreliable datagram service: A msg is sent with a high
probability of arrival but no guarantee and no
acknowledgement. Example: Electronic junk mail.
ii. Acknowledged datagram service: It is used where
connection oriented service is not required but reliability is
essential. The receiver is made to acknowledge receipt of
message. Example: Registered mail.
iii. Request - reply service: In this service, the sender
transmits a single datagram containing a request and the
reply contains the answer. Example: Database query.
Service Primitives :
A service is formally specified by a set of primitives (basic
operations) available to a user or other entity to access the
service. Primitives are called calling functions between the
layers that are used to manage communication among the
adjacent protocol layers.
Example: five service primitives for implementing a
simple connection-oriented service.
Relationship between services and protocol:
A service is a set of operations that a layer (service
provider) provides to the layer above it (service user). These
operations are specified in an abstract manner with no
details of how to provide that service.
On the other hand, a protocol specifies a set of rules to carry
out communication between peers i.e. communicating
entities in the same layer on different machines. Protocols
clearly define "how to carry out the communication.
Entities use protocols to implement services. Different
layers use different protocols for communication.
Thus, services correspond to the interface between
adjacent layers while protocols correspond to
communication between peer entities in the
corresponding or same layer on different machines.
M.Sc. (Computer Application) Sem-II
Computer Networks
Chapter 2
Network Models
Differences:
• OSI has 7 while TCP/IP has 4 layers. The common layers
are Network, Transport and Application layer.
• OSI model supports connection oriented and connection
less service in the Network layer and only connection –
oriented communication in the Transport layer.
• TCP/IP has only connectionless mode in the Internet
layer but supports connection oriented and connection
less in the Transport layer.
• The OSI model makes a clear distinction between
services, interfaces and protocols, whereas TCP/IP
model does not clearly distinguish between them.
• The OSI reference model is a general purpose model.
Hence, this model was not biased toward one particular
set of protocols.
• In TCP/IP, the protocols were developed first and the
model fits the protocol description. Hence, it does not fit
any other protocol stack.
• OSI model does not take care of internetworking. The
TCP/IP protocols were designed first and the main goal
was to handle internetworking.
• The session and presentation layers in the OSI model
are nearly empty whereas the data link and network
layers are overfull.
• The TCP / IP model on the other hand, does not
distinguish - nor mention physical and data link layers.
• The OSI model is very useful to discuss and
understand - computer networks but the OSI model has
not been implemented. In contrast, the protocols in the
TCP/IP model are universally used.
Addressing:
An internetwork or internet is a collection of several
independent and diverse networks which are connected.
Thus, it is a network of networks. For communication to
take place in an internet there should be a mechanism of
identifying
• A network among several networks.
• A computer/device in the network.
• A process running in that computer.
For these purposes four levels of addresses are used in an
internetwork using TCP/IP protocols.
Each address is used at a different layer in the TCP/IP model
as shown in the following diagram.
1. Physical address:
Computer Network
Chapter 3
Physical Layer
Analog signals are more accurate Digital signals are less accurate
The curve representing the analog The lines of the digital signal,
signal passes through an infinite demonstrate the sudden jump that
number of points. the signal makes from value to
value.
All analog signals exhibit some Digital signals do not exhibit non
form of non linearity linearity
Analog Signal Digital Signal
The noise on the channel affects Noise does not affect digital
analog signals considerably signals much
Analog signals are weakened or Digital signals can be regenerated
attenuated during transmission. or restored to their original values
Attenuation is different for exactly
different frequencies
Low data rates are possible Higher data rates are possible
There are Storage and Digital techniques overcome
transmission overheads many of the transmission and
storage limitations of analog
technology
Analog Signal Digital Signal
Encryption techniques cannot be Encryption techniques can be
applied easily to analog signals. readily applied to digital data as
Hence, they are less secure compared to analog data
To effectively utilize capacity of Multiplexing is more easily and
high bandwidth links such as cheaply achieved with digital
satellite, a high degree of signals
multiplexing is needed which is
not easily applied on analog
signals
Bit Rate and Bit Length of Digital Signal:
Consider transmission of binary data (digital) using a digital
signal. Binary data has only bits - 0 and 1. If we use a digital
signal with two levels - high and zero, we can transmit one
bit per level. This is shown below.
Since a digital signal can have many discrete levels, more
than one bit can be transmitted for each level. If a digital
signal has L levels, the number of bits each level represents
can be calculated as:
For example, if the digital signal has 2 levels, each level can
represent log22=1 bit.
If L=4, each level can represent 2 bits.
For example, if the levels are L1, L2, L3 and L4, each level
can represent two bits as follows:
L1:00
L2:01
L3:10
L4:11
If the data to be transmitted is 1110010100000010, it can
be represented as follows:
2B=C/log2L
2B=9600/4
Hence, B = 1200 Hz.
Performance of the Network
A computer network consists of several communicating
devices, connecting devices and communication links. All
these factors have an important impact on the performance
of the network.
3. Latency (Delay):
The latency is a measure of the total time taken for an entire
message to reach the destination from the time its first bit
was transmitted at the source. It is calculated as:
Latency = Propagation time + Transmission time +
Queuing time + Processing time
i. Propagation time is the time required for a single bit to
travel from the source to destination. It is calculated as:
Propagation time = Distance/Propagation speed
ii. Transmission time is the time required for all bits of a
message to arrive at the destination. It depends on the
message size and the bandwidth.
Transmission time = Message Size/Bandwidth
iii. Queuing time is the time taken by intermediate or end
devices to store the entire message before it is processed. It
depends on the network traffic and the device
characteristics.
iv. Processing time is the time taken by a device to process
the message. The processing includes inspecting message
headers to read source and destination address, calculate
checksum to identify errors etc.
4. Bandwidth-Delay Product:
The bandwidth-delay product defines the number of bits that
can fill the communication link. This is used to calculate how
many bits can be sent at a time before the acknowledgement
is received so that the channel does not remain idle.
For example, let us consider a channel having bandwidth of
1bps and a delay of 5 seconds. This means that when the
sender sends 1 bit, it reaches the receiver after 5 seconds. If
the sender has to wait for an acknowledgement before
sending the next bit, the channel will be idle for 4 seconds.
Instead of keeping the channel idle, calculate the bandwidth-
delay product and transmit those many bits. Here, it is 1 x 5
= 5 bits. The following figure shows this scenario.
5. Jitter:
Latency refers to the delay in the message reaching the
receiver. Jitter is the variation in this delay. If the delay is
fixed, a buffering mechanism can be used so that the
receiver is given data at a constant speed. However, if
there is jitter, there are lags and gaps in the data. Time
sensitive data like audio and video cannot tolerate jitter.
Problems
1. Calculate the propagation and transmission time for a 10
kbytes message through a network having a bandwidth of
1Gbps. The transmission medium is vacuum and the signal is
transmitted using light pulses over a distance of 3000km.
Solution
Since the medium is vacuum the speed of light in vacuum is
3x108 m/s.
Propagation time = distance / propagation speed
= (3000 x 1000) / 3 x 108
= 1/102 s = 0.01s
= 10ms
Transmission time = message size/bandwidth
= (10 x 1000 x 8) / 109
= 8/105 = 0.00008 s
= 0.08 ms
2. What are the propagation time and the transmission time
for a 5-Mbyte message (an image) if the bandwidth of the
network is 1 Mbps? Assume that the distance between the
sender and the receiver is 12,000 km and that light travels at
2.4 x 108 m/s.
Solution
Propagation time =(12000 x 1000)/2.4 x 108
=12x106 / 2.4x108
=0.05s
4. How many bits can fit on a link with a 2ms delay if the
link bandwidth is 1Mbps?
Solution
Number of bits = bandwidth x delay = 1 Mbps x 2 ms
= 1x106bps x 0.002s = 2000 bits
5. Calculate the total delay for a frame of size 5 million bits
which is sent on a link with 10 routers, each having queuing
time of 2µs and a processing time of 1µs. The length of the
link is 2000 km and speed of light is 2 x 108m/s in the link.
The link has bandwidth 5Mbps.
Solution
Latency = Propagation time + Transmission time +
Queuing time + Processing time
i. Propagation time = Distance/Propagation speed
=2000 x 103/2 x 108 =1/102= 0.01s
ii. Transmission time = Message size/ Bandwidth
=5 x 106/5 x 106 = 1s
iii. Queuing time = 10 x 2µs = 20µs =20x10-6= 0.00002s
iv. Processing time = 10 x lµs = 10µs = 0.00001s
Latency = 0.01 + 1 + 0.00002 + 0.00001 = 1.01003s
Line Coding
Line coding is a process of converting a series of bits into a digital
signal. Several encoding schemes have been developed. This is
done so that the receiver can clearly determine the start, stop or the
middle of each bit in order to correctly receive the data.
iii. Manchester
Figure: Polar RZ
Disadvantage:
The RZ code occupies more bandwidth because it requires two signal
changes to encode one bit.
iii. Manchester: This code also requires a transition in the
middle of each bit interval.
Negative-to-positive transition represents 1
Positive-to-negative represents 0
Thus, by using just two levels of amplitude, it can achieve
the same level of synchronization as RZ code.
Example: Binary data 010011
Disadvantages
1. It requires n communication lines between the devices
2. Higher cost
2. Serial Transmission
In this method of transmission, the streams of bits are sent
serially, one after the other and hence, only one
communication channel is needed.
Figure: Serial Transmission
Advantages
1. Requires only one communication channel.
2. Reduced cost of transmission.
Disadvantage
1.The sender requires a parallel to serial converter and the
receiver needs a serial to parallel converter.
Types of Serial Transmission
1. Synchronous transmission:
• Synchronous transmission is used to send a long
uninterrupted series of bits from sender to receiver.
• In this the bit stream is combined together into long
“frames” which contain multiple bytes.
• The bits do not have any delimiters markers to identify
end of a frame or byte.
• The receiver receives the bits and groups them
appropriately. Since there are no delimiters, the receiver
has to receive the bits accurately.
• As the name suggests, there should be synchronization
between the sender and receiver Hence, timing is very
critical. e.g. webcam, video conferencing
Figure: Synchronous Transmission
Advantages
1. Very high speed of data transfer.
2. No need of extra bits as delimiters to identify start and
end of data.
Disadvantage
1. Requires precise timing and synchronization.
2. Asynchronous transmission:
• In this type of transmission, the data bits are grouped
into logical units like a character or byte and sent as a
unit.
• Special bits called start bit(0 bit) and stop bit(1 bit) are
used to indicate start and end of the group so that the
receiver knows when the group starts and when it ends.
• When the receiver receives a start bit, it synchronizes
itself to the incoming stream and continues accepting till
a stop bit pattern is encountered. The next group may
follow immediately or after some gap.
• It is typically used for request reply kind of
applications where data is sent in bursts.
• It is called Asynchronous because sender and receiver
does not have to synchronize. e.g. email, social media
Figure: Asynchronous Transmission
Advantages
1. Timing is not an important criteria.
2. The sender can send data when required without the
receiver being synchronized.
3. It is a cheap and effective method of communication.
Disadvantages
1. Data has to be grouped into logical units.
2. Start and stop bits have to be added to each unit to identify
start and end of a group.
3. Isochronous transmission:
• This type of transmission is used in applications which
do not tolerate any jitter (variation in delay). These
include real-time audio and video applications.
• If the video is sent as a sequence of frames, all frames
must be viewed at the same rate. Although synchronous
transmission allows a long series of bits to be sent
without delay, there may be gaps between frames.
• In isochronous transmission, the entire stream is
synchronized so that there are no gaps.
• It guarantees that the data arrives at the fixed rate.
Multiplexing
•It is not possible to set up a separate connection between
each pair of communicating devices. In such cases, a single
communication link may be shared among multiple
devices.
•This communication link is usually of a high capacity.
Such links are called “trunks”. Multiplexing is a technique
which allows simultaneous transmission of multiple
signals across a single communication channel.
Disadvantages
1. Since the channel bandwidth is divided into smaller
channels, each station gets only a small bandwidth for
communication.
2. If there are many stations, it may not be possible to assign
a channel to each station. Moreover, this will reduce the
transmission bandwidth for each channel.
Time Division Multiplexing
Disadvantages
1. If some station does not have data to send, the time
slot is wasted and the channel is underutilized.
2. If the number of stations are very large, a station has
to wait for a long time for its time slot.
Comparison between FDM and TDM
Frequency Division Time Division
Multiplexing (FDM) Multiplexing (TDM)
FDM divides a channel into TDM divides a channel by
smaller frequency bands allocating a time period for
each station.
Each station can use the sub A station can use the whole
channel for the entire duration. channel for a time slot
assigned to it.
There is no delay in data A station has to wait for its
transmission. time slot.
The receiver has to demodulate The demultiplexer has to
the signal. separate portions of signals
and recombine them to create
the whole signal.
Frequency Division Time Division
Multiplexing (FDM) Multiplexing (TDM)
FDM can accommodate only a TDM can accommodate more
limited number of stations stations compared to FDM
Signals are separated by guard Signals are separated by time
bands between sub channels. slots.
Used in applications where the Used when the signal
signal bandwidth is small and bandwidth requires the entire
channel bandwidth is very large. channel bandwidth.
Example: radio channels. Example: television channels
Problems
1. Ten signals, each requiring 4000 Hz, are multiplexed onto
a single channel using FDM. What is the minimum
bandwidth required for the multiplexed channel ? Assume
that the guard bands are 400 Hz wide.
Solution
There are 10, 4000 Hz signals. We need nine guard bands to
avoid any interference.
The minimum bandwidth required is
4000 x 10 + 400 x 9 = 43,600Hz.
Wavelength Division Multiplexing (WDM)
• Fiber Optic communication use WDM. The concept of WDM
relates to Physics. When a white light beam goes through a
prism, it separates into individual colored light beams by the
prism. Each light beam has different wavelengths. This
scenario works vice versa as well. The individual color beams
combine back to generate a white light beam.
• Wavelength division multiplexing is a technique of multiplexing
multiple optical carrier signals through a single optical fiber
channel by varying the wavelengths of laser lights.
• It combines multiple light beams from channels using a
multiplexer and sends them as a single light beam through an optic
fiber strand. They are combined so that their wavelengths are
different.
• On the receiving end, the demultiplexer separates the single light
beam back into multiple light beams and sends them to their own
channels.
• WDM is similar to FDM but, the transmission occurs through
fiber optic channels. Therefore, the multiplexing and
demultiplexing involve optical signals, whereas FDM uses analog
signals and TDM uses digital and analog signals.
Types of Switching
1. Circuit Switching
2. Message Switching
3. Packet Switching
1. Circuit Switching
This is a method in which an end-to-end path or circuit is
established between communicating machines. The
machines have exclusive use of this path until connection is
released.
This involves three phases:
i. Circuit Establishment: Before any data transfer can
begin, an end-to-end path has to be set up. Some setup time
is required.
ii. Data Transfer: Once the circuit is established, analog or
digital data can be transmitted depending upon the nature of
the network. The only delay now is the propagation delay.
There is no danger of congestion or a busy signal.
iii. Circuit Disconnection: The circuit can be released by
either of the connected stations after data transfer takes
place.
An example of circuit switching is the telephone system
where a physical circuit is setup between the source and
destination machine.
Disadvantages
1. Circuit switching can be inefficient. Even if no data is
being transferred, the channel remains dedicated for the
duration of the connection.
2. Problems occur when two or more stations attempt to
establish a link with the same station. Such situations have
to be resolved.
2. Message Switching
Disadvantages
1. The system implementing message switching requires
sufficiently large data buffers to hold the messages.
2. A single block may tie up a line for a long time, thereby
causing delay to the other messages queued up on that link.
3. If there's a lot of traffic on the network, the delay will
be very high thereby, reducing throughput.
4. Complicated routing algorithms are required.
3. Packet Switching
Disadvantages
1. There is no guarantee that packets will be delivered.
2. Requires more overheads since each packet has to carry a
lot of control information.
3. The packets may arrive out of order.
The difference between Circuit, Message and Packet switching is
illustrated in figure
Figure: Timing of Events
(a) Circuit Switching (b) Message Switching (c) Packet Switching
Comparison of Circuit, Message and Packet Switching
Circuit switching Message switching Packet switching
Computer Networks
Chapter 4
The Data Link Layer
1. Character Count
2. Flag bytes with byte stuffing
3. Starting and Ending flags with bit stuffing
4. Physical Layer Coding Violations
1. Character Count:
In this method of framing, a field in the frame header is
used to store the number of characters in the frame.
• When the receiving data link layer receives the frame,
it reads the character count and knows how many
characters are in the frame. Hence, it can detect the end
of the frame. The following example shows this
technique for four frames of sizes 5, 5, 8, 8 respectively.
• One problem with this method is that a transmission
error can modify the count value. If this happens, there
is no way of telling where the next frame starts or
ends.
• Even if the receiver detects a transmission error, the
receiver cannot ask for retransmission of a specific
frame since it does not know which frame had the error.
Thus, the entire data need to be retransmitted.
• For example, if the count in the second frame gets
modified from 8 to 7, the length of the next frame will be
interpreted as 1.
2. Flag Bytes with Byte Stuffing:
• Some protocols use special bytes as frame delimiter. This
byte is called flag byte and is used as the starting as
well as the ending delimiter for a frame. This flag byte
is used to identify start and end of the frame.
• However, a problem occurs when the flag byte's
binary code occurs as a part of the data itself.
• The receiver will mistakenly interpret it as a frame
delimiter, this problem can be solved using byte stuffing
or character stuffing.
stuffed bits
(c) After destuffing
011011111111111010010
Figure: Bit Stuffing
Thus if the receiver loses track, it scans the input for flag
sequences. Since they can only occur at frame
boundaries, and never within the data, the receiver can
identify frame boundaries easily.
4. Physical Layer Coding Violations:
11010110111110
1 2 3 4 5 6 7
C1 C2 D1 C3 D2 D3 D4
where C1, C2, and C3 are check bits and D1 to D4 are data
bits.
The check bits are calculated such that the check bit along-
with some data bits has even (or odd) parity.
• C1 is calculated from bit position 1, 3, 5, 7, 9, i.e.,
position numbers having bit l in their LSB.
• C2 is calculated from 2, 3, 6, 7, 10, i.e., having bit 1 in
the second place from LSB.
• C3 is calculated from 4, 5, 6, 7, ... , i.e., having bit l in
the third place from LSB.
Ex: Calculate the Hamming bits for data message 1001.
Here, m= 4. Thus, r = 3,
since (m + r + 1) <= 2r i.e. 4 + 3+1 <=23.
1 2 3 4 5 6 7
C1 C2 D1 C3 D2 D3 D4
1 0 0 1
Algorithm sender()
{ while (true)
{ WaitForEvent();
if (event (RequestToSend))
{ GetData();
MakeFrame ();
SendFrame();
}
}
}
Algorithm Receiver
1. The receiver is waiting for an event to occur.
2.When it is notified of a frame arrival, the frame is taken from
the Physical Layer.
3. The Data is extracted from the frame and sent to the Network
layer.
4.The receiver goes back into the wait state.
Algorithm receiver()
{ while(true)
{ WaitForEvent();
if (Event(ArrivalNotification))
{ ReceiveFrame();
ExtractData();
DeliverData();
}
}
}
The following diagram shows the communication between
the sender and receiver. The sender does not worry about the
receiver, it keeps on sending frames whenever the network
layer gives it data.
Disadvantages of Piggybacking
Peculiar Situation
• If both, A and B send simultaneously, a peculiar situation
arises. There will be a synchronization problem if
both A and B transmit simultaneously.
• This causes duplicate frames to be delivered even
though there is no transmission error.
• Figure (b) shows that duplicate frames will be delivered
since A and B send at the same time.
• The * indicates where a frame is accepted.
Figure: Two scenarios for one bit sliding window protocol.
(a) Normal Operation (b) Duplicate frames delivered
Pipeline Technique
• In the previous protocol, the sender had to wait till it
received an acknowledgement before sending the next
frame.
• In order to achieve better efficiency, the sender can
transmit 'w' frames instead of 1 such that by the time it
has transmitted the w frame, the acknowledgement for
frame 1 arrives, thus eliminating the sender's waiting
period.
• Thus, 'w' unacknowledged frames are outstanding at all
times. The sender's window size is thus 'w'.
• This technique is used when the propagation delay is
large and the line cannot be kept idle during this time.
Thus, more frames can be sent at a time to utilize the
channel bandwidth efficiently.
Design Considerations
Since multiple frames are transmitted at the same time,
two strategies are used to deal with errors in the
pipelining technique:
1. Go back n ARQ
2. Selective repeat ARQ
5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4
a b c d
Ssize=2m-1
Receiver Sliding Window: The receiver only accepts
frames in order. Hence, the receiver window size is 1. It
stores the expected frame number in Rn. When the expected
frame arrives, Rn is incremented.
Method:
• The sender sends multiple frames and maintains a timer
for each sent frame.
• The receiver sends a separate acknowledgement for
each correctly received frame. If it receives a frame
with error, the receiver discards the damaged frame
and all subsequent frames.
• When the sender does not receive an acknowledgement
for a frame, the timer times out. The sender then
retransmits all the outstanding frames.
The Go-back-N strategy is illustrated in figure. Here, frame
2 is arrived with an error, hence it is discarded. The
receiver also discards all subsequent frames 3-8. The
sender retransmits frames 2-8.
Window Sizes
• The sender and receiver maintain a sliding window of
frame numbers. The sender and receiver window sizes
are the same.
• The receiver window corresponds to the frame numbers
which the receiver can accept and buffer.
Operation
• The sender sends multiple frames corresponding to its
sending window.
• The receiver window corresponds to frame numbers
which it can accept.
• If a frame arrives damaged or is lost, the receiver
sends a NAK (negative acknowledgement) for that frame
and stores all subsequent frames.
• When the sender receives the NAK, it just resends that
frame. The following diagram shows the operation of
Selective Repeat ARQ.
Figure : Selective Repeat ARQ protocol
Computer Networks
Chapter 5
The Medium Access Sub Layer
ALOHA
• This protocol was developed in 1970 in the University
of Hawaii to solve the channel allocation problem
among users trying to use a single shared channel.
• It uses a wireless medium because University of Hawaii
had its departments spread across several islands where
cabling was not possible.
There are two versions of ALOHA:
1. Pure ALOHA
2. Slotted ALOHA
Pure ALOHA
• The basic idea of pure ALOHA is simple. Users can
transmit whenever they have data to be sent.
• There will be collisions and the colliding frames will be
destroyed. The station has to wait for acknowledgement.
• If a collision has occurred, the station does not receive a
feedback. It then waits for a random amount of time
(back-off time) and retransmits the frame.
• The waiting period has to be random or the same
frames will collide again. After a maximum number of
retransmission attempts Kmax, the station must stop
and try again later.
The figure shows a pure ALOHA system with 5 stations- A, B, C, D
and E transmitting whenever they have data.
Slotted ALOHA
• In slotted ALOHA, time is divided into discrete intervals.
All stations are synchronized in time. All stations are
forced to transmit frames only at the slot boundary.
• Thus, whenever a station has data to send, it cannot do so
immediately but has to wait for the beginning of the next
time slot.
In the following figure, stations B and C have data to send
but have to wait for the next slot to begin. If two or more
frames are sent in a time slot, there will be collision.
Figure: Slotted ALOHA
Throughput
In slotted ALOHA, the probability of collision is reduced
and throughput is better. The channel utilization of slotted
ALOHA is:
S = Ge-G
This gives a maximum utilization when G = 1, i.e., S = 1/e =
0.368, i.e., 36.8% (twice that of Pure ALOHA).
Figure: Throughput versus traffic
Difference between Pure and Slotted ALOHA
• Pure ALOHA uses continuous time principle, i.e., time is
not divided into discrete intervals.
In slotted ALOHA, time is divided into discrete slots or
intervals.
Types of CSMA:
1. 1-persistent
2. Non persistent
3. p-persistent
1. 1-Persistent CSMA:
Does not defer transmission Does not defer transmission Defers transmission with
when the channel is idle when the channel is idle probability 1-p when the channel
is idle
Senses the channel Senses the channel at Senses the channel continuously
continuously if it is busy random intervals if it is busy
Time is not divided into slots Time is not divided into Applies for slotted channels
slots
Carrier Sense Multiple Access with Collision Detection
(CSMA/CD)
• In CSMA, a station cannot find out if a collision has
occurred during transmission.
• In CSMA/CD (CSMA with Collision Detection),
stations are able to detect collisions. The advantage of
this is that when the stations detect a collision, they can
abort the transmission immediately.
• This saves time and bandwidth. CSMA/CD is widely
used on LAN and it is the basis for a popular LAN
standard called Ethernet.
• The conceptual model of CSMA/CD is as shown in the
following figure:
Figure: CSMA/CD Model
• A station that wants to send a frame senses the channel
continuously.
• If the channel is free, the station transmits the frame.
• If a collision takes place, the station stops transmission.
• To reduce the probability of collision the second time,
the station waits a random amount of time (back-off
time) before repeating the process.
• Thus, this model will contain alternating contention
and transmission periods with idle periods occurring
when all stations are quiet.
Procedure
The CSMA/CD procedure is shown in the following
flowchart. It is similar to CSMA except that a station can
detect a collision and when it occurs, a jamming signal is
sent on the channel to inform stations of the collision.
Figure: CSMA/CD procedure
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
In CSMA/CD protocol, stations have to abort transmission
when a collision is detected and then retransmit.
This scheme works well if the channel bandwidth is large
and the stations are in a limited distance.
However, in case of wireless systems, the bandwidth is not
very high, so retransmissions are not very efficient.
Moreover, all stations may not detect the collision
immediately.
In such situations, it is better to avoid collisions. CSMA/CA
is mainly employed in Wireless LAN.
Collisions are avoided using three strategies:
i. Interframe Space
ii. Contention Window
iii. Acknowledgements
1. Interframe Space: In this mechanism, when a station finds the
channel idle, it does not transmit immediately but defers
transmission by a period of time called Interframe Space (IFS).
The IFS allows the signal from the remote stations to reach. If
the channel is still idle after the IFS, the station sends the frame
after waiting for contention time.
2. Contention Window: The contention window is a period of
time divided into contention slots. When a station is ready to
transmit, it chooses a random number of slots and waits. If the
channel is idle after waiting, the frame is sent and the station
waits for a time-out period for an acknowledgement to arrive.
If it is found busy, the timer is stopped and process is
restarted.
3. Acknowledgement: A station will know that the frame
transmission was successful if it receives a positive
acknowledgement within the time-out period. If not, it means
the data got corrupted due to error.
Figure: CSMA/CA Procedure
Controlled Access
In controlled access, the stations decide which station should
be allowed to transmit. Only that station has a right to
transmit. A station cannot send unless it has been
authorized to do so by other stations.
Disadvantages
Disadvantages
Disadvantage
Disadvantages
Disadvantages
Disadvantages
W2N = WN WN
WN WN
W2 = +1 +1
+1 -1
W4= +1 +1 +1 +1
+1 -1 +1 -1
+1 +1 -1 -1
+1 -1 -1 +1
M.Sc. (Computer Application) Sem-II
Computer Networks
Chapter 6
IPv4 Addresses:
The Internet protocol version 4 (IPv4) is the most important
protocol in the network layer of the TCP/IP model.
Address Space:
• If we have an ‘n' bit address, there can be 2n unique
addresses. For example, suppose we have a 2 bit
address, we can create 4 unique addresses:00,01,10 & 11.
• IPv4 uses 32 bit addresses. Hence, the IPv4 address
space is 232 i.e., 4,294,976,296 addresses in all.
Notations:
An IPv4 address can be represented using two notations:
1. Binary notation
2. Dotted-decimal notation
Binary notation:
In this notation, the address is represented as 32 bits. Thus it
is a 4-byte address.
Example: 10010101 00000010 00011101 01110101
Dotted-decimal notation:
• It is usually difficult to read and write IP addresses in
binary. To make it easier, the dotted-decimal format is
used.
• In this case, each byte (8 bits) are converted to decimal
and separated by a dot (.). The general form is A.B.C.D
where A, B, C and D are positive integers in the range 0
to 255.
• No leading zeroes are allowed. For example, 0004 is not
allowed.
Example: 128.5.3.16
10000000 00000101 00000011 00010000
128. 5. 3. 16
Figure: Binary and dotted-decimal format
Classful Addressing:
First byte
Class A 0-127
Class B 128-191
Class C 192-223
Class D 224-239
Class E 240-255
Class A, B and C addresses are used in internetworks.
Class D and E are reserved. Class A networks are the
largest networks with maximum number of hosts while
class C networks are the smallest networks with 256 hosts.
Thus, if an organization has 100 machines, it should take a
class C address.
Class Netid Hostid First No. of No. of Hosts
byte Networks
range
Class A 1 byte 3 bytes 0-127 27 = 128 224 = 16,777,216
Class B 2 bytes 2 bytes 128-191 214 = 16,384 216 = 65,536
Class C 3 bytes 1 byte 192-223 221 = 2,097,152 28 = 256
Class D - - 224-239 Not divided further. Used for
multicasting
Class E - - 240-255 Not divided further. Used as
reserved addresses
Network Address
Problems
1. Convert the following binary notation to dotted-decimal
notation
a. 01101111 00111000 00101101 01001110
b. 11111111 00000000 11111111 00000000
Solution
a. 111.56.45.78
b. 255.0.255.0
2. Convert from dotted-decimal to binary notation:
129.11.5.27
Solution
10000001 00001011 00000101 00011011
Block Block
First
205.16.37.32 11001101 00010000 00100101 00100000
205.16.37.33 11001101 00010000 00100101 00100001
. .
. . 16
addresses
. .
. .
Last 205.16.37.47 11001101 00010000 00100101 00101111
a. Decimal b. Binary
Address Masks
To identify a network and route packets to the network,
the routers outside the network use a default mask to get
the network address.
a) Net-id Host-id
b) Net-id Subnet-id Host-id
Figure: Subnetting
a) IP address without subnetting b) IP address with subnetting
Host prefix
D M
D: Do not fragment M: More fragment
Figure: Flags
Source routing
Fragmentation
Extension
Headers Authentication
Destination option
These extension headers are described below:
1. Hop-by-hop option: This option is used when the
source needs to pass information to all routers which the
datagram visited.
2. Source routing: Specifies the path to be taken by the
datagram.
3. Fragmentation: Only the source can fragment the
datagram.
4. Authentication: Validates the sender and ensures
message integrity.
5. Encrypted Security Payload: Provides confidentiality
and guards against eavesdropping.
6. Destination Option: This option allows a sender to
send some information only to the destination.
Intermediate routers cannot access this information.
IPv4 IPv6
IPv4 address is 32 bits. IPV6 address is 128 bits.
IPv4 is a numeric address, andIPv6 is an alphanumeric
its binary bits are separated by
address whose binary bits are
a dot (.). separated by a colon (:). It
also contains hexadecimal.
Limited address space. Very large address space.
Classful addressing (A, B, C, IPv6 uses subnetting to adjust
D, E classes). network sizes with a given
requirement.
Header length is variable Header length is fixed
(20-60 bytes). (40 bytes).
Computer Networks
Chapter 7
However, the data link layer and the network layer do not
guarantee that the receiving application will receive data
correctly. The transport layer delivers data to the correct
application running in that machine. This is called process-
to-process delivery.
Figure: Delivery domains of layers
Disadvantages of UDP
1. It does not guarantee reliable data transfer.
2. Packets may get lost or arrive out of order.
3. It does not perform flow control.
Transmission Control Protocol (TCP)
Many applications require reliable and sequenced delivery of
data. TCP is specifically designed to provide a reliable end-
to-end byte stream over unreliable network.
TCP Services
TCP provides the following services to the application layer
protocols:
1. Process-to-Process Communication
i. Allows one process to communicate with another
process using port numbers.
ii. Only unicast transmission, i.e., one sender and
one receiver.
iii. Does not support broadcasting or multicasting.
iv. Well known ports used by TCP are FTP (20 and
21), TELNET (23), SMTP (25) etc.
2. Stream Delivery Service
i. TCP is a stream-oriented protocol; sender
sends "bytes” of data.
ii. No “message boundaries”.
iii. TCP creates a connection which allows the
sending process to push bytes into the stream
and a receiver to read bytes from the stream.
4. Connection-Oriented service
Sender and receiver set up a connection beforehand and
terminate it after communication is over.
Communication takes place in three phases:
a. Connection establishment
b. Data transfer
c. Connection release
It is not a physical connection since the network layer is
connection-less. It is simply a virtual connection between
the two processes.
TCP takes responsibility of providing the two processes the
feel that the communication is taking place in a connection-
oriented manner. But in reality, it is taking place in a
connection-less manner.
5. Reliable Service
i. TCP provides the application a reliable service.
ii. Bytes are received in the same order and
without error.
iii. TCP uses sequence numbers and checksum to
achieve reliability.
TCP Features
To provide the services discussed above, TCP has some
important features which allow TCP to provide a reliable,
stream-oriented connection-oriented service to the
applications.
1. Numbering System:
TCP has to keep a track of the bytes which have been sent
and acknowledged. Further, a set of bytes are grouped into a
segment. Hence, TCP has to also keep a track of the
number of bytes sent in a segment. To do this, TCP uses
three numbers:
Byte Number: Each byte transferred from sender to receiver
is numbered. The bytes are numbered consecutively. The
starting number is a random number between 0 and 232- 1.
Sequence Number: This number identifies a segment. The
sequence number of a segment is the byte-number of the
first byte in the segment.
Acknowledgement Number: This number confirms the
number of bytes a receiver has received correctly. The
acknowledgement number specifies the next byte expected.
For example, if the receiver has received 'x' bytes correctly, it
will send the acknowledgement number as 'x+l'.
Acknowledgements are cumulative, i.e., a single
acknowledgement number acknowledges all previous
byte numbers. For example, if it sends an acknowledgement
number as 501, it means that it has received 500 bytes
correctly. Acknowledgements are piggybacked.
The following diagram shows the communication between a
client and server machine.
Figure: TCP operation
Flow Control: TCP provides flow control to prevent a fast sender
from overloading a slow receiver. It is achieved using buffers and
sliding windows. When the receiver's buffer does not have any more
space, it informs the sender to stop sending by advertising a receiver
window size of 0.When buffers have space, TCP informs sender to
start sending.
Error Control: To ensure that the bytes are given to the receiver in an
error-free manner, TCP uses checksum for error control. It has
mechanisms for detecting corrupted / lost/ out of order/ duplicated
segments.
• Reliable Transmission
It uses SACK(selective acknowledgement) and checksums to detect
damaged, corrupted, discarded, duplicate and reordered data. It is
similar to TCP but SCTP is more efficient when it comes to
reordering of data.
• Message oriented
Each message can be framed and we can keep order of datastream
and tabs on structure. For this, In TCP, we need a different layer for
abstraction.
• Multi-homing
It can establish multiple connection paths between two end points
and does not need to rely on IP layer for resilience.
Advantages of SCTP :
• It is a full- duplex connection i.e. users can send and receive data
simultaneously.
• It allows half- closed connections.
• The message’s boundaries are maintained and application doesn’t
have to split messages.
• It has properties of both TCP and UDP protocol.
• It doesn’t rely on IP layer for resilience of paths.
Disadvantages of SCTP :
Computer Networks
Chapter 8
Architecture
We will consider four scenarios to understand the emailing
process. Let us assume that Alice (A) wants to send an email
to Bob (B).
Scenario 1: Sender and Receiver Connected to the same
system
In this scenario, the sender and receiver are users on the
same system. Each user has a mailbox in the system. Each
message carries the mailbox address of the sender and
receiver. ‘A’ uses a User Agent (UA) to create the message
and sends the mail to B's mailbox. ‘B’ can read the messages
in B's mailbox anytime according to convenience.
Figure: Email architecture - Scenario 1
Scenario 2: Sender and Receiver connected to different
systems
In this scenario, the sender and receiver are users on
different systems. The email has to be sent from user A in
one system to user B in another system. The mail may have
to be sent over the internet. Thus we need two User Agents
(UA) and two Message Transfer Agents (MTA). The UA's
will allow A and B to send and retrieve messages. The
MTA's are needed to actually do the transmission from
A's server to B's server.
Figure: Email architecture - Scenario 2
Scenario 3: One user is a remote user
In this scenario, the receiver B is connected directly to his
system. But A is not connect directly to her system. A is a
remote user.
A connects to her system using a LAN or a WAN link.
In this case
• A uses a UA to create the message.
• The message is now sent through the LAN or WAN to
the email server by an MTA client to the MTA server
running in the email server.
• The MTA client then sends the message to B's MTA
mail server.
• B retrieves the mail from his mail server using a UA.
Figure: Email architecture - Scenario 3
Scenario 4: Both users are remote users
Disadvantages:
• If the local device on which the emails were
downloaded crashes or gets stolen, the emails are
lost.
IMAP (Internet Message Access Protocol)
The most differentiating features of the IMAP protocol is that that the
emails and inboxes are not stored on your computer but
somewhere in the cloud. This allows all your mails to be perfectly
synchronized when usually read emails from different computers or
devices, as all devices and platforms will show exactly same emails.
Advantages:
• Two-way synchronized communication between the email server
and the email client, which allows several devices to work on the
same account seeing the changes made by everyone.
• Emails are on the server all the time, so accessing them can be
done from any place by having a device with internet access.
• In case of a computer crash or accidental deletion of data, since
emails are on the mail server, it is possible to get the emails back.
• As the emails are stored on mail server, it utilizes minimal local
storage.
Disadvantages:
URL
To access any web document in a standard manner, HTTP
uses Uniform Resource Locators. It identifies any type of
information on the internet.
A URL consists of:
1. Protocol: Software used to retrieve the document.
Example: ftp, http.
2. Host computer: Computer on which the web document
is located.
3. Port number: Optional field which specifies the port
from which the resource can be obtained
4. Path and filename: Specifies the document name and
path in the host computer.
Figure: URL Syntax
Example,
http://www.google.com/welcome.html
http://192.168.200.3:80/examples/intro.html
Web Documents
• Web document is a document viewed on the world
wide web. Web documents are formatted in a
markup language like HTML or XML and can also
contain content produced with scripting languages
like Javascript, PHP, and Perl.
• The web documents in the WWW can be grouped
into three broad categories: static, dynamic, and
active.
• The category is based on the time at which the
contents of the document are determined.
Three basic types of web documents
Static web document
• A static web document resides in a file that it is associated with a web
server. The author of a static document determines the contents at the
time the document is written. Because the contents do not change,
each request for a static document results in exactly the same
response.
• When you type any site and request for it, the internet
servers takes you to that site and give access to it. When
you are surfing on the internet and requesting for
something then with that request your IP address goes
to the proxy.
• NVT uses two sets of characters, one for data and one for
control. Both are 8-bit bytes.
• Data Characters
For data, NVT normally uses what is called NVT ASCII.
This is an 8-bit character set in which the seven lowest order
bits are the same as US ASCII and the highest order bit is
0 (see Figure). Although it is possible to send an 8-bit
ASCII (with the highest order bit set to be 0 or 1), this must
first be agreed upon between the client and the server using
option negotiation.
Format of Data Characters
Control Characters
• To send control characters between computers
(from client to server or vice versa), NVT uses an 8-
bit character set in which the highest order bit is set
(see Figure).
• Status. This option allows the user or the process running on the
client machine to get the status of the options being enabled at the
server site.
• Timing mark. This option allows one party to issue a timing mark
that indicates all previously received data has been processed.
• Terminal type. This option allows the client to send its terminal
type.
• Terminal speed. This option allows the client to send its terminal
speed.
• Line mode. This option allows the client to switch to the line
mode.
MODE OF OPERATION
• Most TELNET implementations operate in one of
three modes: default mode, character mode, or line
mode.
Default Mode
What is FTP?
• One of the most popular uses of the Internet is to
download files - that is, transfer files from a computer
on the Internet to your computer. Many thousands of
files are downloaded every day from the Internet.
Stream mode
• It is the default mode.
• File is transmitted as continuous stream of bytes to TCP.
• TCP is responsible for chopping data into segments of appropriate size.
Block mode
• Data is delivered from FTP to TCP in blocks.
• Each block is preceded by 3 bytes header.
• The first byte is called the block descriptor.
• The second and third byte defines the size of the block in bytes.
Compressed mode
• Data is usually compressed if the file to be transmitted is very big.
• The compression method normally used in Run-length encoding.
• In a text file, usually spaces (blanks) are removed.
• In a binary file, null characters are compressed.
4. Error control
• Since TCP is used for data transfer no additional
error recovery mechanism is required.
5. Access control
• File access protection is done using login procedure
with login name and password.
FTP operation
• FTP uses client/server model for communication.
• Two TCP connections are used for file transfer.
• On one connection control signals (commands and
responses) are exchanged and the other connection is used
for actual data transfer. These two connections are called
control connection and data connection respectively.
Control Connection
The Control connection has following features:
1. It is used to transfer control signals (commands and responses)
between the client and server.
2. This connection is used by the control process of client and
server. The control process is called Protocol Interpreter (PI).
3. The TCP connection for control signal uses well-known FTP
server port 21.
4. This control connection remains connected during the entire
interactive FTP session.
5. The control connection uses very simple rules of communication.
We need to transfer only a line of command or a line of response
at a time.
Data Connection
The Data connection has following features:
1. Data connection is used for actual data transfer.
2. This connection is established between the Data Transfer
Process (DTP) of client and server
3. The server port used for data connection is Port 20.
4. The data connection is opened and then closed for each file
transferred. It opens each time commands that involve
transferring files are used, and it closes when the file is transferred
File transfer in FTP means one of three things: