Computer Networkss Unit 1
Computer Networkss Unit 1
Computer network
INTRODUCTION
DCE: The interface between the Sender and the Medium, and the
Medium & the Receiver is called the DCE (Data Communication
Equipment) and is a physical piece of equipment.
DTE: Data Terminal Equipment is the Telecommunication name
given to the Source and Receiver's equipment.
It defines how the data flows between two end points. Based on the direction
and time of flow there are three kinds of data flow,
1. Simplex
2. Half-Duplex
3. Full-duplex.
Simplex:
In this type of data communication, the data flows in only one direction
on the data communication line (medium).
Examples are Keyboard, Monitor, Radio and Television broadcasts
Half-Duplex:
In this type of data communication, the data flows in both directions
but at a time in only one direction on the data communication line.
Example Conversation on walkie-talkies is a half-duplex data flow.
Time t1
Time t2
Figure: Half-Duplex Data Flow
Point to Point
It provides a dedicated link between two devices.
The entire capacity (bandwidth) of the link is reserved for
transmission between these two devices.
The two devices are connected by means of a pair of wires or using a
microwave or satellite link.
Eg : Computers connected by telephone line
PPP connection between remote and TV
Categories of networks
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 technology is the Ethernet technology
developed by the Xerox Corporation.
MAN
A MAN is designed to extend over an entire city.
It could be a single network such as cable TV network or connect a
number of LANs into a larger network.
Figure: Metropolitan Area Network
WAN
A WAN provides long distance transmission of data, voice, image and
video information over large geographic areas.
Transmission rates are typically 2 Mbps, 34 Mbps, 45 Mbps, 155
Mbps and 625 Mbps. WAN utilize public, leased, or private
communication equipment usually in combinations and therefore
span an unlimited number of miles.
A WAN that is wholly owned and used by a single company is
referred to as an Enterprise Network.
PAN
A Personal Area Network (PAN) is the interconnection of devices
within the range of an individual person, typically within a range of
10 meters.
For example, a person traveling with a laptop, a personal digital
assistant (PDA), and a portable printer could interconnect them
without having to plug anything in, using some form
of wireless technology.
Typically, this kind of personal area network could also be
interconnected without wires to the Internet or other networks.
Topology
Physical Topology refers to the fashion in which nodes in the network is laid
out physically. The topology of a network is the geometric representation of
the relationship of all the links and the linking
devices tone another. It defines the physical
layout of the network.
Mesh
In a mesh topology each device has a dedicated point to point link to
every other device.
The term dedicated means that the link carries traffic only between
the two devices it connects.
A fully connected mesh network therefore has n (n-1)/2 physical
channels to link n devices. To accommodate that many links every device
on the network should have (n-1) I/O ports.
Merits
Eliminates the traffic problems that occur when the links are shared by
multiple devices.
If one link becomes unusable, it does not incapacitate the entire
system.
Since every message travels along a dedicated line only the intended
recipient will receive the message and hence the data is secure.
Demerits
The amount of cabling and the I/O ports required increases with the
Star
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.
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.
Failure of the central controller
incapacitates the entire network.
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 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.
Merits
Ease of installation.
Bus uses less cabling than mesh or star topologies.
Demerits
Difficult reconnection and isolation.
Signal reflection at the taps can cause degradation in quality.
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
Merits:
Easy to install and reconfigure.
To add or delete a device requires changing only two connections.
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.
Hybrid Topology
A hybrid topology is a type of network topology that uses two or
more other network topologies, including bus topology,
mesh topology, ring topology, star topology, and tree topology.
Connectivity in a network:
1. Circuit Switched
First establishes a dedicated circuit across a sequence of links and then
allows the source node to send a stream of bits across this circuit to a
destination node.
A switch multiplexing packets from multiple sources onto one shared link
Framing - Divides the stream of bits received into data units called
frames.
Flow control- If the rate at which the data are absorbed by the
receiver is less than the rate produced in the sender, the Data link
layer imposes a flow control mechanism.
Access control -Used to determine which device has control over the
link at any given time.
3. NETWORK LAYER
(Source to destination delivery of packets)
4. TRANSPORT LAYER
(Source to destination delivery of message)
It is responsible for Process to Process delivery of entire message.
It also ensures whether the message arrives in order or not.
5. SESSION LAYER
Dialog control - This session allows two systems to enter into a dialog
either in half duplex or full duplex.
Synchronization-This allows to add checkpoints into a stream of
data. Example: If a system is sending a file of 2000 pages, check points
may be inserted after every 100 pages to ensure that each 100 page unit
is advised and acknowledged independently. So if a crash happens
during the transmission of page 523, retransmission begins at page
501, pages 1 to 500 need not be retransmitted.
6. PRESENTATION LAYER
Presentation Layer is concerned with the syntax and semantics
of the information exchanged between two systems.
7. APPLICATION LAYER
This layer enables the user to access the network resources. This allows
the user to log on to remote user.
Application layer
Transport layer
Internet layer
Network interface
layer
Fig: Alternative view of the Internet architecture. The “Network
Interface” layer shown here is sometimes referred to as the “sub-
network” or “link” layer.
While the 7-layer OSI model can, with some imagination, be applied
to the Internet, a 4-layer model is often used instead.
The TCP/IP protocol suite was developed prior to the OSI model.
Therefore, the layers in the TCP/IP protocol suite do not exactly match those
in the OSI model.
The second layer consists of a single protocol—the Internet Protocol (IP). This
is the protocol that supports the interconnection of multiple networking
technologies into a single, logical internetwork.
Data link layer divides the stream of bits received from the upper layer
(network layer) into manageable data units called frames. It adds a header
to the frame to define the physical address (source address & destination
address).
Framing Protocols:
(i) Byte-oriented protocols
(ii) Bit-oriented protocols
(iii) Clock-based protocols
Bit-oriented protocols:
(i) HDLC – High Level Data Link Control
Clock-based protocols:
(i) SONET - Synchronous Optical Network
Sentinel Approach
It uses special characters known as sentinel characters to
indicate where the frame starts and ends.
The problem with the sentinel approach, of course, is that the ETX
character might appear in the data portion of the frame.
BISYNC overcomes this problem by "escaping" the ETX character by
preceding it with a DLE (data-link-escape) character whenever it
appears in the body of a frame; the DLE character is also escaped
(by preceding it with an extra DLE) in the frame body. This
approach is often called byte stuffing or character stuffing
because extra characters are inserted in the data portion of the
frame.
Bit-Oriented Protocols
HDLC denotes both the beginning and the end of a frame with the
distinguished bit sequence 01111110.
This sequence is also transmitted during any times that the link is idle
so that the sender and receiver can keep their clocks synchronized.
ERROR
Data can be corrupted during transmission. Signals flows from one
point to another. They are subjected to unpredictable interferences from heat,
magnetism and other forms of electricity. For reliable communication, errors
must be detected and corrected.
TYPES OF ERRORS
Burst Error:
A burst error means that 2 or more bits in the data unit have
changed.
Example:
Here two bits are corrupted .
ERROR DETECTION
Redundancy
Error detection use the concept of redundancy, which means adding
extra bits for detecting errors .i.e., instead of repeating the entire data
stream, a shorter group of bits may be appended to the end of each unit.
1. Parity check
o Simple parity check ( Vertical Redundancy Check)
o Two dimensional Parity Check (Longitudinal Redundancy Check)
2. Cyclic redundancy check
3. Checksum
Parity check
A redundant bit called parity bit, is added to every data unit so that the total
number of 1’s in the unit becomes even (or odd).
Simple parity check ( Vertical Redundancy Check)
Sender Side:
In a simple parity check a redundant bit is added to a stream of data so that
total number of 1’s in the data become even or odd.
Receiver Side:
Note :
Simple parity check can detect all single-bit errors. It can detect burst
errors only if the total number of bits changed in each data unit is odd.
At the receiver side, if the resulting unit (data + CRC) becomes exactly
divisible by the same predetermined binary number (divisor) , the data is
accepted. If a remainder results it indicates that the data unit has been
damaged in transit and therefore must be rejected.
CRC GENERATOR
It uses modulo-2 division. The following figure shows this process.
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.
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
101 0 01 1 1
1010 0 1 1 1
CRC Performance
All burst errors with length less than or equal to the degree of the
polynomial (r)
CRC can detect all burst errors that affect an odd number of bits
CRC can detect all burst errors of length equal to the degree of the
polynomial+1 (r+1) with probability 1 – (1/2)r–1.
CRC can detect burst errors of length greater than the degree of the
polynomial+1 (r+1) with probability 1 – (1/2)r
(where r is the degree of the CRC polynomial)
CHECKSUM
EXAMPLE
Suppose the block of 16 bits is to be sent using a checksum of 8 bits.
10101001 00111001
the numbers are added using one’s complement arithmetic
10101001 block 1
00111001 block 2
00000000
11100010
00000000 initial checksum
_
11100010 sum
10101001
00111001
00011101
1 1 1 1 1 1 1 1 sum
(1)1 0 1 0 1 0 0 0
1 (carry 1)
1010100 1
00011101
1 1 0 0 0 1 1 1 (carry 1)
1 1 0 0 0 1 0 1 sum
0 0 1 1 1 0 0 0 complement
As the complement is non zero we assume that (the data is errored)
Example 2:
Error correction
● Two methods
1. Retransmission after detecting error
-retransmit the data if error is detected
2. Forward error correction (FEC)
-hamming code is used to correct the error
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.
But the r bits are also transmitted along with data; hence
Number of Redundant Bits
Number of Number of Total
data bits redundancy bits
(k ) bits(r) k+r
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11
For r1,
The bits considered are -1,3,5,7,9,11(to decide on these bits, follow this trick,
since r1 bit, start from 1st bit, take one and leave one and so on)
For r2,
The bits considered are -2,3,6,7,10,11(to decide on these bits, follow this
trick, since r2 bit, start from 2nd bit, take two and leave two and so on)
For r4,
The bits considered are -4,5,6,7(to decide on these bits, follow this trick, since
r4 bit, start from 4th bit, take four and leave four and so on)
For r8,
The bits considered are -8,9,10,11(to decide on these bits, follow this trick,
since r8 bit, start from 8th bit, take eight and leave eight and so on)
Flow control coordinates the amount of data that can be sent before
receiving acknowledgement from the receiver. It is one of the most
important duties of the data link layer.
ACK
An acknowledgement (ACK for short) is a small control frame that a
protocol sends back to its peer saying that it has received the earlier
frame.
◦ A control frame is a frame with header only (no data).
◦ The receipt of an acknowledgement indicates to the sender of the
original frame that its frame was successfully delivered.
MECHANISMS
In Fig (a) ACK is received before the timer expires, (b) and (c) show the
situation in which the original frame and the ACK, respectively, are lost,
and (d) shows the situation in which the timeout fires too soon..
Suppose the sender sends a frame and the receiver acknowledges it, but
the acknowledgment is either lost or delayed in arriving. This situation is
in (c) and (d). In both cases, the sender times out and retransmit the
original frame, but the receiver will think that it is the next frame, since it
correctly received and acknowledged the first frame.
This makes the receiver to receive the duplicate copies. To avoid this two
sequence numbers (0 and 1) must be used alternatively.
2. Sliding Window
Sliding Window