Cs 601 Notes
Cs 601 Notes
Week-7
Module 101
Transmission media
“Transmission medium is a link between any two devices or points that
carries information.” Transmission medium lies below the physical layer, that
layer is known as layer zero. The transmission medium can be made of copper.
Data is transferred from metallic media (twisted pair and coaxial), Optical fiber
cable and free space (air, vacuum). Data is transmitted in the form of bits. (we
transmit data in the form of electrical signals, in the form of light, etc.)
It is a physical path between sender/transmitter and receiver in data
communication. Data is transmitted through the electromagnetic signals.
102
Guided media:
“Technically, the guided media is the media that provides a conduit from point A
to point B.” Conduit is the guided path. If you have got a guided path between two
points and using that to transmit information, then we say that our media is wired,
or our media is guided media. Examples are twisted pair cable, coaxial cable, and
Fiber optics cable.
A twisted pair and coaxial cable carry the information in the form of electrical
signals. They have copper as the primary conductor.
Optical fiber cables we have got light as the primary conductor, and it’s made of
glass. It contains some physical limits, and our signals travel within the physical
limits.
Twisted pair cable:
This is the first type of guided media. It consists of two copper wires which are
twisted with each other. Each copper wire has got a plastic covering and plastic
covering is also twisted to each other. “One cable carries the actual signals, and
the second cable is a ground reference only.”
INTERFERENCE which is noise and cross talk. The twisted pair is impacted
by sources around it. “The form of noise is like motors, thermal noise.” Cross
talk in the case of telephone this is interference it impacts our twisted pair cable.
The twisted wire is balanced out by the interference.
A twisted pair consists of two insulated copper wires arranged in a regular spiral
pattern.
Types of Twisted pair:
The name of the cable is coaxial as it contains two conductors parallel to each
other. Coaxial cable is very commonly used transmission media, for example,
TV wire is usually a coaxial cable. It has a higher frequency as compared to
Twisted pair cable. The inner conductor of the coaxial cable is made up of
copper, and the outer conductor is made up of copper mesh. The middle core is
made up of non-conductive cover that separates the inner conductor from the
outer conductor. The middle core is responsible for the data transferring
whereas the copper mesh prevents from the EMI (Electromagnetic
interference).
The BNC connector is used to connect the end of the cable to a device, such as a TV set.
The BNC T connector is used in Ethernet networks to branch out to a connection to a
computer or other device.
The BNC terminator is used at the end of the cable to prevent the reflection of the signal.
Fibre optic is a cable that holds the optical fibres coated in plastic that are used
to send the data by pulses of light. The plastic coating protects the optical fibres
from heat, cold, electromagnetic interference from other types of wiring. Fibre
optics provide faster data transmission than copper wires.
How is the light travels?
Lighth travels in a straight line if it is moving through a single uniform
substance.
If a ray of light travels through one substance and suddenly enters another
substance, then the ray changes direction due to different density or
frequency.
Optical fibres use reflection to guide light through a channel. A glass or plastic core is
surrounded by a cladding of less dense glass or plastic. The difference in density of the two
materials must be such that a beam of light moving through the core is reflected off the
cladding instead of being refracted into it.
109
Propagation modes
There are two basic modes of propagation.
1- Multimode (step index, graded index)
2- Single mode
In the optical fibers cable that is using multiple mode propagation is called
multimode. Density of the core remains constant. The ray of light moving in
the straight line. The term step-index refers to the suddenness of this change, which
contributes to the distortion of the signal as it passes through the fibre.
In the optical fibers cable that is using single mode propagation is called single
mode. Single-mode uses step-index Fiber and a highly focused source of light that limits
beams to a small range of angles, all close to the horizontal. The single-mode Fiber itself is
manufactured with a much smaller diameter than that of multimode Fiber, and with
substantially lower density. The decrease in density results in a critical angle that is close
enough to 90° to make the propagation of beams almost horizontal. propagation of different
beams is almost identical, and delays are negligible.
110
Fiber Types
Applications
Fiber-optic cable is often found in backbone networks because its wide bandwidth is cost-
effective. Today, with wavelength-division multiplexing (WDM), we can transfer data at a
rate of 1600 Gbps. The SONET network that we discuss such a backbone. Some cable TV
companies use a combination of optical Fiber and coaxial cable, thus creating a hybrid
network. Optical Fiber provides the backbone structure while coaxial cable provides the
connection to the user premises.
Advantages
Higher Bandwidth
Less Attenuation
Less EM Interference
Light Weight
Disadvantages:
Installation/Maintenance
Unidirectional
Cost
111
Unguided media:
In this microwave, radio waves, and infrared they do not contain any physical
limits or conductor. the part of the electromagnetic spectrum, ranging from 3 kHz to 900 THz,
used for wireless communication.
Unguided signals can travel from the source to the destination in several ways: ground
propagation, sky propagation, and line-of-sight propagation.
In ground propagation, radio waves travel through the lowest portion of the atmosphere,
hugging the earth. These low-frequency signals emanate in all directions from the
transmitting antenna and follow the curvature of the planet. Distance depends on the amount
of power in the signal: The greater the power, the greater the distance.
In sky propagation, higher-frequency radio waves radiate upward into the ionosphere (the
layer of atmosphere where particles exist as ions) where they are reflected back to earth. This
type of transmission allows for greater distances with lower output power.
The section of the electromagnetic spectrum defined as radio waves and microwaves is
divided into eight ranges, called bands, each regulated by government authorities. These
bands are rated from very low frequency (VLF) to extremely high frequency (EHF).
112
Radio wave:
Second type of unguided media. Electromagnetic waves ranging in frequencies between 3
kHz and 1 GHz are normally called radio waves. radio waves are mostly omnidirectional.
When an antenna transmits radio waves, they are propagated in all directions. They are not
very narrow and line-of-sight. The omnidirectional property has a disadvantage too. The
radio waves transmitted by one antenna are susceptible to interference by another antenna
that may send signals using the same frequency or band. Radio waves, particularly those
waves that propagate in the sky mode, can travel long distances. This makes radio waves a
good candidate for long-distance broadcasting such as AM radio.
Radio waves, particularly those of low and medium frequencies, can penetrate walls.
This characteristic can be both an advantage and a disadvantage. It is an advantage
because, for example, an AM radio can receive signals inside a building. It is a
disadvantage because we cannot isolate a communication to just inside or outside a
building. The radio wave band is relatively narrow, just under 1 GHz, compared to the
microwave band. When this band is divided into sub bands, the sub bands are also
narrow, leading to a low data rate for digital communications.
113
Microwaves:
“Electromagnetic waves having frequencies between 1 and 300 GHz are called microwaves.”
Microwaves are unidirectional. When an antenna transmits microwaves, they can be narrowly
focused. The unidirectional property has an obvious advantage.
Unidirectional antennas:
Microwaves need unidirectional antennas that send out signals in one direction. Two types of
antennas are used for microwave communications: the parabolic dish and the horn.
A parabolic dish antenna is based on the geometry of a parabola: Every line parallel to the
line of symmetry (line of sight) reflects off the curve at angles such that all the lines intersect
in a common point called the focus. The parabolic dish works as a funnel, catching a wide
range of waves and directing them to a common point. In this way, more of the signal is
recovered than would be possible with a single-point receiver. Outgoing transmissions are
broadcast through a horn aimed at the dish. The microwaves hit the dish and are deflected
outward in a reversal of the receipt path.
A horn antenna looks like a gigantic scoop. Outgoing transmissions are broadcast up a stem
(resembling a handle) and deflected outward in a series of narrow parallel beams by the
curved head. Received transmissions are collected by the scooped shape of the horn, in a
manner like as the parabolic dish, and are deflected down into the stem.
Infrared:
Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1 mm to 770
nm), can be used for short-range communication. Infrared waves, having high frequencies,
cannot penetrate walls. This advantageous characteristic prevents interference between one
system and another; a short-range communication system in one room cannot be affected by
another system in the next room. When we use our infrared remote control, we do not
interfere with the use of the remote by our neighbours. However, this same characteristic
makes infrared signals useless for long-range communication. In addition, we cannot use
infrared waves outside a building because the sun’s rays contain infrared waves that can
interfere with the communication.
114
Switching:
“An internet is a switched network in which a switch connects at least two links together.” A
switched network consists of a series of interlinked nodes, called switches. Switches are
devices capable of creating temporary connections between two or more devices linked to the
switch.
115
circuit switching
packet switching
message switching.
The first two are commonly used today. The third has been phased out in general
communications but still has networking applications.
116
Example 8.1
117
Connection Setup
Data Transfer
Connection Teardown
118
Not as efficient as packet switching because resources are allocated during the entire
duration of the connection and these resources are unavailable to other connections.
In a telephone network, people normally terminate the communication when they
have finished their conversation.
Data Network is an issue.
Circuit switched networks have low efficiency but minimal delay.
Data is not delayed at each switch; the resources are allocated for the duration of the
connection.
119
PACKET SWITCHING
In data communications, we need to send messages from one end system to another. If the
message is going to pass through a packet-switched network, it needs to be divided into
packets of fixed or variable size. The size of the packet is determined by the network and the
protocol.
Packet switched work on data link layer and network layer, two types of packed switched
networks that are datagram and virtual circuit network.
Datagram work on network layer and virtual circuit work on data link layer.
Store and forwarddue to this efficiency high. This is advantage of it.
Delay is also increased.
Datagram Networks
Datagram is the type of packet switched network. We see thar datagram is larger than the
frame is called datagram or packets. And exist in the layer three approach. Each packet is
treated as first come first out (FIFO).
In a datagram network, each packet is treated independently of all others. Even if a packet is
part of a multipacket transmission, the network treats it as though it existed alone. Packets in
this approach are referred to as datagrams.
120
Datagram switch Virtual circuit switch
Connectionless connection
No reservation reservation
Out of order Same order
High overhead (address) Less over head
More Chances of packet loss Least chances of packet loss
Use of internet x.25, ATM (asynchronous transfer mode)
Low cost, high efficiency High cost
More delay Least delay
Virtual-Circuit Networks
Addressing
In a virtual-circuit network, two types of addressing are involved:
Global addressing:
A source or a destination needs to have a global address—an address that can be unique in
the scope of the network or internationally if the network is part of an international network.
we will see that a global address in virtual-circuit networks is used only to create a virtual-
circuit identifier.
Virtual-Circuit Identifier:
The identifier that is used for data transfer is called the virtual-circuit identifier (VCI) or the
label. A VCI, unlike a global address, is a small number that has only switch scope; it is used
by a frame between two switches. When a frame arrives at a switch, it has a VCI; when it
leaves, it has a different VCI.
123
Space-Division Switch
In space-division switching, the paths in the circuit are separated from one another spatially.
This technology was originally designed for use in analog networks but is used currently in
both analog and digital networks. It has evolved through a long history of many designs.
Crossbar Switch
A crossbar switch connects n inputs to m outputs in a grid, using electronic micro switches
(transistors) at each crosspoint (see Figure 8.17). The major limitation of this design is the
number of crosspoints required. To connect n inputs to m outputs using a crossbar switch
requires n × m crosspoints. For example, to connect 1000 inputs to 1000 outputs requires a
switch with 1,000,000 crosspoints. A crossbar switch with this number of crosspoints is
impractical. Such a switch is also inefficient because statistics show that, in practice, fewer
than 25 percent of the crosspoints are in use at any given time. The rest are idle.
Multistage Switch
The solution to the limitations of the crossbar switch is the multistage switch, which
combines crossbar switches in several (normally three) stages, as shown in Figure 8.18. In a
single crossbar switch, only one row or column (one path) is active for any connection. So we
need N × N crosspoints. If we can allow multiple paths inside the switch, we can decrease the
number of crosspoints. Each crosspoint in the middle stage can be accessed by multiple
crosspoints in the first or third stage.
We divide the N input lines into groups, each of n lines. For each group, we use one
crossbar of size n × k, where k is the number of crossbars in the middle stage. In other
words, the first stage has N/n crossbars of n × k crosspoints.
We use k crossbars, each of size (N/n) × (N/n) in the middle stage.
We use N/n crossbars, each of size k × n at the third stage. We can calculate the total
number of crosspoints as follows:
OR
Time-Division Switch
Time-division switching uses time-division multiplexing (TDM) inside a switch. The most
popular technology is called the time-slot interchange (TSI).
Time Slot Interchange a system connecting four input lines to four output lines. Imagine
that each input line wants to send data to an output line according to the following pattern: (1
→ 3), (2 → 4), (3 → 1), and (4 → 2), in which the arrow means “to.”
124
Data-Link Layer
Communication at the Data-Link Layer
The data-link layer on Alice’s computer communicates with the data-link layer at
router R2.
The data-link layer at router R2 communicates with the data-link layer at router R4,
and so on.
Finally, the data-link layer at router R7 communicates with the data-link layer at
Bob’s computer.
Only one data-link layer is involved at the source or the destination, but two data-link
layers are involved at each router. The reason is that Alice’s and Bob’s computers are
each connected to a single network, but each router takes input from one network and
sends output to another network.
125
Nodes and Links:
Nodes are devices such as computers or network elements that send, receive, or
process data.
Links are the communication pathways that connect these nodes, enabling the transfer
of data between them.
The first node is the source host; the last node is the destination host.
The first, the third, and the fifth links represent the three LANs; the second and the
fourth links represent the two WANs.
126
Data-Link Layer is located between the physical and the network layers.
Data-Link Layer provides services to Network Layer and receives services from
Physical layer.
Framing: is the process of structuring data for transmission by adding start and stop
bits, headers, or other delimiters. It helps to set the boundaries of a data frame,
enabling the receiver to identify and extract the transmitted information accurately.
o Encapsulation: involves wrapping data in a specific format or protocol before
transmission. This process adds headers and trailers to the original data,
creating a packet for efficient routing and delivery.
o Decapsulation: is the reverse process where the recipient removes the added
headers and trailers to retrieve the original data from the received packet.
Flow Control: control is the regulation of data transmission between devices to
prevent congestion and ensure efficient and reliable information exchange.
Flow control is a mechanism used to manage the rate of data transmission between two
devices to prevent congestion or data loss. It ensures that a fast sender does not
overwhelm a slower receiver.
Flow control can be implemented through techniques such as buffering, acknowledgement
signals, and windowing.
o Buffers temporarily store data during transmission, allowing the sender and
receiver to operate at different speeds.
o Acknowledgement signals inform the sender about the successful receipt of
data, enabling it to adjust its transmission rate accordingly.
o Windowing involves specifying the number of unacknowledged packets that
can be in transit at any given time, controlling the flow of data between sender
and receiver. Flow control is crucial for optimizing data transfer reliability and
efficiency in communication networks.
Error Control: Error control in data communication involves implementing
techniques to detect and correct errors that may occur during the transmission of data.
These techniques ensure data integrity and reliability. Common error control methods
include checksums, parity bits, and more advanced techniques like cyclic
redundancy check (CRC).
Congestion Control: involves managing and preventing network congestion to
maintain optimal performance. It utilizes techniques such as traffic shaping,
prioritization, and flow control to regulate data flow and prevent network saturation,
ensuring efficient and reliable data transmission.
In the above diagram router is source of communication between the source and destination.
The datagram received by the data-link layer of the source host is encapsulated in a
frame.
The frame is logically transported from the source host to the router.
The frame is decapsulated at the data-link layer of the router and encapsulated at
another frame.
The new frame is logically transported from the router to the destination host.
Note that, router has separate data link layer for every interface connecting to the physical
link.
128
Point-to-point link:
Point-to-point link is a dedicated communication channel that connects two specific devices,
allowing data to be transferred directly between them without the need for any intermediary
devices or shared infrastructure.
Broadcast link:
“Broadcast link is a network connection that allows data to be sent from one sender to
multiple receivers simultaneously.” It's like a radio broadcast where one station sends signals
that many people can tune into and receive at the same time. In a broadcast link, information
is shared widely to all connected devices on the network.
It manages the reliable and efficient transfer of data frames between devices on a
network, providing error detection and correction, flow control, and addressing.
DLC ensures that data is transmitted accurately and in the correct order over the
physical layer.
Media Access Control (MAC) is typically implemented in the data link layer of the OSI
model and used to manage access to a shared communication medium.
129
Each datagram on the Internet, from the same source host to the same destination
host, may take a different path.
We need to remember that the IP addresses in a datagram should not be changed. If
the destination IP address in a datagram changes, the packet never reaches its
destination.
We cannot make a datagram reach its destination using only IP addresses on the
Internet. For that purpose, we need another addressing mechanism in a connectionless
internetwork: the link-layer addresses of the two nodes. A link-layer address is
sometimes called a link address, sometimes a physical address, and sometimes
a MAC address.
Since a link is controlled at the data-link layer, the addresses need to belong to the
data-link layer.
When a datagram passes from the network layer to the data-link layer, the datagram
will be encapsulated in a frame and two data-link addresses are added to the
frame header.
These two addresses are changed every time the frame moves from one link to
another.
130
Why do we need more than one IP address in a router, one for each interface?
The answer is that the host should know its own IP address, which becomes the
source IP address in the packet.
The application layer uses the services of DNS to find the destination address of the
packet and passes it to the network layer to be inserted in the packet.
How are the source and destination link-layer addresses determined for each link?
Again, each hop (router or host) should know its own link-layer address.
The destination link-layer address is determined by using the Address Resolution Protocol.
131
Multicast:
Broadcast:
Broadcast address is a special address that allows a message to be sent to all devices
within a network.
It is typically the highest address in the network range and is used to transmit data to
all devices simultaneously.
Broadcast link-layer addresses in the most common LAN, Ethernet, are 48 bits, all 1s,
that are presented as 12 hexadecimal digits separated by colons.
132
Every host or router on the network receives and processes the ARP request packet,
but only the intended recipient recognizes its IP address and sends back an ARP
response packet.
The response packet contains the recipient’s IP and link-layer addresses. The packet is
unicast directly to the node that sent the request packet.
The system on the left (A) has a packet that needs to be delivered to another system
(B) with IP address N2.
System A needs to pass the packet to its data-link layer for the actual delivery, but it
does not know the physical address of the recipient.
It uses the services of ARP by asking the ARP protocol to send a broadcast ARP
request packet to ask for the physical address of a system with an IP address of N2.
This packet is received by every system on the physical network, but only system
B will answer it. System B sends an ARP reply packet that includes its physical
address.
Now system A can send all the packets it has for this destination using the
physical address it received.
133
ARP Packet
In the format of an ARP packet, the names of the fields are self-explanatory.
The hardware type field defines the type of the link-layer protocol; Ethernet is given
the type 1.
The protocol type field defines the network-layer protocol: IPv4 protocol is
(0800)16.
The source hardware and source protocol addresses are variable-length fields
defining the link-layer and network-layer addresses of the sender.
The destination hardware address and destination protocol address fields define
the receiver link-layer and network-layer addresses.
An ARP packet is encapsulated directly into a data-link frame.
The frame needs to have a field to show that the payload belongs to the ARP and not
to the network-layer datagram.
Assume Alice needs to send a datagram to Bob, who is three nodes away on the Internet.
The network layer knows it’s given NA, NB, and the packet, but it needs to find
the link-layer address of the next node.
The network layer consults its routing table and tries to find which router is next
(the default router in this case) for the destination NB.
The routing table gives N1, but the network layer needs to find the link-layer
address of router R1.
It uses its ARP to find the link-layer address L1.
The network layer can now pass the datagram with the link-layer address to the
data-link layer.
The data-link layer knows its own link-layer address, LA.
It creates the frame and passes it to the physical layer, where the address is
converted to signals and sent through the media.
The packet received needs to go up through these three layers and come down.
At arrival, the physical layer of the left link creates the frame and passes it to the
data-link layer.
The data-link layer decapsulates the datagram and passes it to the network layer.
The network layer examines the network-layer address of the datagram and finds
that the datagram needs to be delivered to the device with IP address NB.
The network layer consults its routing table to find out which is the next node
(router) in the path to NB.
The forwarding table returns to N3.
The IP address of router R2 is in the same link as R1.
The network layer now uses the ARP to find the link-layer address of this router,
which comes up as L3.
The network layer passes the datagram and L3 to the data-link layer belonging to the
link at the right side.
The link layer encapsulates the datagram, adds L3 and L2 (its own link-layer address),
and passes the frame to the physical layer.
The physical layer encodes the bits to signals and sends them through the medium to
R2.
Now let us see what happens at Bob’s site, how the signals at Bob’s site are changed to a
message.
Types of Errors -1
Single-bit error means that only 1 bit of a given data unit (such as a byte, character, or
packet) is changed from 1 to 0 or from 0 to 1.
Burst Error means that 2 or more bits in the data unit have changed from 1 to 0 or from 0 to
1.
Whenever bits flow from one point to another, they are subject to unpredictable changes
because of interference. This interference can change the shape of the signal.
136
Types of Errors -2
The number of bits affected depends on the data rate and duration of noise.
If we are sending data at 1 kbps, a noise of 1/100 second can affect 10 bits.
If we are sending data at 1 Mbps, the same noise can affect 10,000 bits.
137
Redundancy
The number of errors and the size of the message are important factors.
If we need to correct a single error in an 8-bit data unit, we need to consider eight possible
error locations.
If we need to correct two errors in a data unit of the same size, we need to consider 28
(permutation of 8 by 2) possibilities.
You can imagine the receiver’s difficulty in finding 10 errors in a data unit of 1000 bits.
138
Coding
Redundancy is achieved through various coding schemes. Sender adds redundant bits
through a process that creates a relationship between redundant bits and the actual
data bits.
The receiver checks the relationships between the two sets of bits to detect errors.
The ratio of redundant bits to data bits and the robustness of the process are important
factors in any coding scheme.
139
We concentrate on block coding; convolution coding is more complex and beyond the scope
of this book.
Block Coding
We divide our message into blocks, each of ‘k’ bits, called data words.
We add ‘r’ redundant bits to each block to make the length ‘n = k + r’
The resulting ‘n-bit’ blocks are called codewords.
BLOCK CODING in Error Detection
If the following two conditions are met, the receiver can detect a change in the original code
word:
140
Example
In the above example, assume the sender encodes the data word 01 as 011 and sends it to the
receiver.
Case:1
1. The receiver receives 011. It is a valid code word. The receiver extracts the data word
01 from it.
Case:2
2. The code word is corrupted during transmission, and 111 is received (the leftmost bit
is corrupted). This is not a valid code word and is discarded.
Case:3
3. The code word is corrupted during transmission, and 000 is received (the right two bits
are
corrupted). This is a valid code word. The receiver incorrectly extracts the data word 00.
142
Hamming Distance
The Hamming Distance between two words of the same size is the number of
differences between the corresponding bits.
We show Hamming Distance between two words x and y is d(x,y)
The humming distance between received code word and sent code word is a number
of bits corrupted during transmission.
Example
1. The Hamming distance d(000, 011) is 2 because (000 ⊕ 011) is 011 (two 1s).
2. The Hamming distance d(10101, 11110) is 3 because (10101 ⊕ 11110) is 01011 (three 1s)
If the Hamming distance between the sent and the received code word is not zero, the code
word has been corrupted during transmission.
The Hamming distance can easily be found if we apply the XOR operation (⊕) on the two
words and count the number of 1s in the result.
Note that the Hamming distance is a value greater than or equal to zero.
143
Minimum Hamming distance is a concept used to measure the similarity between two sequences,
often represented as binary strings. Imagine comparing two binary sequences of equal length, bit by
bit.
The Hamming distance is the count of differing bits between these sequences. The minimum
Hamming distance specifically refers to the smallest number of bit changes needed to make the two
sequences identical.
For example, if we have binary strings '10101' and '10011,' the Hamming distance is 2, but the
minimum Hamming distance is 2, as changing two bits is the smallest modification required for them
to match. This concept finds applications in various fields, including error detection in computer
systems and DNA sequence analysis.
Linear block codes are a specific subset of block codes that possess the additive property you
described. In linear block codes, the exclusive OR (XOR) of two valid codewords results in another
valid codeword. This property is a fundamental characteristic of linear block codes and is closely
related to their algebraic structure.