0% found this document useful (0 votes)
27 views40 pages

Cs 601 Notes

Uploaded by

aminabibihere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views40 pages

Cs 601 Notes

Uploaded by

aminabibihere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Cs 601

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:

UTP is un-shield and STP is metal shield. UTP is used commonly.

 Unshielded twisted pair (UTP). These cables generally comprise wires


and insulators.
 Shielded twisted pair (STP). These cables come with a braided, wired
mesh that encases each pair of insulated copper wires. In STP we had a
metallic shield, it is the reason it prevents the impact of the noise,
crosstalk etc.
Coaxial cable
Second type of guided media. It carries signals of higher frequency range than
those in twisted cable. When we see the structure of coaxial cable, we see that
this is more guided and much more protected. structure of cable:
Inner conductor: it carries electrical signals. It carries a higher frequency range
of signals. It is made of copper.
Insulator: it is normally insulated.
Outer conductor (shield): it is metallic rapping. In STP we had a metallic
shield, it is the reason it prevents the impact of the noise, crosstalk etc. it
protected the signals which are carried by the inner conductor.
Insulator: this is another insulator that balances out the insulator that is directly
above the inner conductor.
Plastic cover: the whole cable is protected by this outer plastic cover.

Coaxial Cable (from reading tab)

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).

Categories of Coaxial Cables


Coaxial Cable Connectors
To connect coaxial cable to devices, we need coaxial connectors. The most common type of
connector used today is the Bayonet Neill-Concelman (BNC) connector. three popular types of
these connectors: the BNC connector, the BNC T connector, and the BNC terminator.

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.

Fiber optic cable:


It is made of mostly glass or plastic and transmits signals in the form of light.
Structure:

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

The common types of Fiber optic

Fiber-Optic Cable Connector


The common types of Fiber optic connectors

There are three types of connectors for Fiber-optic cables.


The subscriber channel (SC) connector is used for cable TV. It uses a push/pull locking
system. The straight-tip (ST) connector is used for connecting cable to networking devices.
It uses a bayonet locking system and is more reliable than SC. MT-RJ is a connector that is
the same size as RJ45. Also use in networking devices.

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

Less corrosive than copper

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.

In line-of-sight propagation, very high-frequency signals are transmitted in straight lines


directly from antenna to antenna. Antennas must be directional, facing each other, and either
tall enough or close enough together not to be affected by the curvature of the earth. Line-of -
sight propagation is tricky because radio transmissions cannot be completely focused.

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.

Very high-frequency microwaves cannot penetrate walls. This characteristic can be a


disadvantage if receivers are inside buildings.

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

Three Methods of Switching

three methods of switching have been discussed:

 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.

Packet switching can further be divided into two subcategories.

 virtual circuit approach


 datagram approach

116

Circuit switched networks.


A circuit-switched network consists of a set of switches connected by physical links. A
connection between two stations is a dedicated path made of one or more links. However,
each connection uses only one dedicated channel on each link. Each link is normally divided
into n channels by using FDM and TDM. Use in telephone system.

“A circuit-switched network is made of a set of switches connected by physical links, in


which each link is divided into n channels by using FDM and TDM.”

1 physical layer it works on physical layer.


2 contingency flow data is flow in continuous like as 1,2,3 than 4 and soon.
3 no header first the connection is set than no one disturb in that call.
4 efficiency less when we reserve resources and don’t share any data due to this the
efficiency is less.
5 delay less when dedicated link is make then data is flow directly, that’s why delay
is less. Data is transferring form one port to another port and reached on
destination point.
6 Total time = setup time + transmission time (TT) (message/bandwidth) +
propagation delay (PD) (distance/speed) + teardown

We need to emphasize several points here:

 Circuit switching takes place at the physical layer.


 Before starting communication, the stations must make a reservation for the
resources to be used during the communication.
 Data transferred between the two stations are not packetized. The data are a
continuous flow sent by the source station and received by the destination station,
although there may be periods of silence.
 There is no addressing involved during data transfer. The switches route the data
based on their occupied band (FDM) or time slot (TDM).

Example 8.1

As a trivial example, let us use a circuit-switched network to connect eight telephones in a


small area. Communication is through 4-kHz voice channels. We assume that each link uses
FDM to connect a maximum of two voice channels. The bandwidth of each link is then 8
kHz. Figure 8.4 shows the situation. Telephone 1 is connected to telephone 7; 2 to 5; 3 to 8;
and 4 to 6. “Of course, the situation may change when new connections are made. The switch
controls the connections.”
Example 8.2

As another example, consider a circuit-switched network that connects computers in two


remote offices of a private company. The offices are connected using a T-1 line leased from a
communication service provider. There are two 4 × 8 (4 inputs and 8 outputs) switches in this
network. For each switch, four output ports are folded into the input ports to allow
communication between computers in the same office. Four other output ports allow
communication between the two offices. Figure 8.5 shows the situation.

117

Three Phases in a Circuit Switched Network

The actual communication in a circuit-switched network requires 3 phases:

 Connection Setup
 Data Transfer
 Connection Teardown

Others are here.


 Setup request
 Acknowledgement
 Connection established.
 Data transfer
 Teardown phase

118

Efficiency of a Circuit-Switched Network

 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 forwarddue to this efficiency high. This is advantage of it.
 Delay is also increased.

 In packet switching we use pipeline.


 Total time = n(TT) + PD

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

• A virtual-circuit network is a cross between a circuit-switched network and a


datagram network.
• As in a circuit-switched network, there are setup and teardown phases in addition to
the data transfer phase.
• Resources can be allocated during the setup phase, as in a circuit-switched network,
or on demand, as in a datagram network.
• As in a datagram network, data are packetized, and each packet carries an address in
the header.

Addressing
In a virtual-circuit network, two types of addressing are involved:

global and local (virtual-circuit identifier).

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

Structure Of Circuit Switch

• Circuit switching today can use either of two technologies:


 The Space-Division switch
 The Time-Division switch

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.

To design a three-stage switch, we follow these steps:

 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

In the above example:

 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 other four nodes are four routers.

The first, the third, and the fifth links represent the three LANs; the second and the
fourth links represent the two WANs.

126

Services provided by Data-Link Layer

 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.

A Communication with only Three Nodes

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

Two Categories of Links


We can have the following two types of links:

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.

Two Sublayers of Data-Link Layer

We can divide the data-link layer into two sublayers:

Data Link Control (DLC):

Data Link Control (DLC) is a sublayer of the Data Link Layer.

 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):

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.

 It is responsible for assigning unique addresses to network devices and controlling


their access to the communication channel, ensuring that data is transmitted efficiently
and without collisions.
 MAC addresses are hardware-based and serve as unique identifiers for devices on a
network.
 The MAC protocol is typically implemented in the data link layer of the OSI model
and plays a crucial role in facilitating reliable and orderly communication within a
network.

129

Why LINK-LAYER ADDRESSING?

 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.

IP addresses & Link-Layer Addresses

In the above figure:

 We have three links and two routers.


 We also have shown only two hosts: Alice (source) and Bob (destination).
 For each host, we have shown two addresses, the IP addresses (N) and the link-
layer addresses (L).
 Note that a router has as many pairs of addresses as the number of links the router
is connected to.
 Each frame carries the same datagram with the same source and
destination addresses (N1 and N8), but the link-layer addresses of
the frame change from link to link.
 In link 1, the link-layer addresses are L1 and L2.
 In link 2, they are L4 and L5.
 In link 3, they are L7 and L8.
 Note that the IP addresses and the link-layer addresses are not in the same order.
 For IP addresses, the source address comes before the destination address; for link-
layer addresses, the destination address comes before the source.

130

Why do we need more than one IP address in a router, one for each interface?

 The answer is that an interface is a connection of a router to a link.


 We will see that an IP address defines a point on the Internet at which a device is
connected.
 A router with n interfaces is connected to the Internet at n points.
 This is the situation of a house at the corner of a street with two gates; each gate
has the address related to the corresponding street.

How are the source and destination IP addresses in a packet determined?

 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

Three Types of addresses

Unicast: one to one communication.

 A unicast address refers to a unique identifier assigned to a single network interface or


device.
 It allows communication between a specific sender and a specific receiver in a
network, ensuring that the data is delivered only to the intended destination.
 Unicast link-layer addresses in the most common LAN, Ethernet, are 48 bits (six
bytes) that are presented as 12 hexadecimal digits separated by colons.

Multicast:

 A multicast address in data communication is a destination address used for


communication where a single sender can transmit data to multiple receivers
simultaneously.
 It is a unique identifier that represents a group of devices interested in receiving the
same data.
 Multicast communication enables efficient distribution of information to a specific
group rather than broadcasting to all devices on the network.
 Multicast link-layer addresses in the most common LAN, Ethernet, are 48 bits (six
bytes) that are presented as 12 hexadecimal digits separated by colons.
 The second digit, however, needs to be an even number in hexadecimal.

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

Address Resolution Protocol (ARP) -1


 Anytime a node has an IP packet to send to another node in a link, it has the IP
address of the receiving node.
 However, the IP address of the next node is not helpful in moving a frame through a
link; we need the link-layer address of the next node.
 This is the time when the Address Resolution Protocol (ARP) becomes helpful.
 ARP maps an IP address to a logical-link address.
 ARP accepts an IP address from the IP protocol, maps the address to the
corresponding link-layer address, and passes it to the data-link layer.
 Anytime a host or a router needs to find the link-layer address of another host or
router in its network, it sends an ARP request packet.
 The packet includes the link-layer and IP addresses of the sender and the IP address of
the receiver.
 Because the sender does not know the link-layer address of the receiver, the query
is broadcast over the link using the link-layer broadcast address.

Address Resolution Protocol (ARP):

 Address Resolution Protocol (ARP) is a protocol used to map an IP address to a


physical (MAC) address in a local network.
 It enables devices to discover each other's hardware address, facilitating proper
communication within the network.

Position of ARP in TCP/IP protocol suite


133

Address Resolution Protocol (ARP) -2

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.

ARP (Address Resolution Protocol) caching:

 Refers to the temporary storage of mappings between IP addresses and


corresponding MAC addresses in a device's memory.
 This caching mechanism helps optimize network performance by reducing the need
for frequent ARP broadcasts.
 When a device needs to communicate with another on the same network, it checks
its ARP cache to find the MAC address associated with the destination IP address.
 If the mapping is not found or has expired, the device initiates an ARP request to
obtain the correct mapping.

133

Address Resolution Protocol (ARP) -3

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.

The internet for our example

Assume Alice needs to send a datagram to Bob, who is three nodes away on the Internet.

Flow of packets at Alice site

 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.

Flow of activities at router R1

Router R1, as we know, has only three lower layers.

 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.

Flow of activities at router R2


Activities at router R2 are almost the same as in R1

Activities at Bob’s site

Now let us see what happens at Bob’s site, how the signals at Bob’s site are changed to a
message.

 At Bob’s site there are no more addresses or mapping needed.


 The signal received from the link is changed to a frame.
 The frame is passed to the data-link layer, which decapsulates the datagram and
passes it to the network layer.
 The network layer decapsulates the message and passes it to the transport layer.
135

Types of Errors -1

Data transmission suffers unpredictable changes because of interference.

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 central concept in detecting or correcting errors is redundancy.


 To be able to detect or correct errors, we need to send some extra bits with our data.
 These redundant bits are added by the sender and removed by the receiver.
 Their presence allows the receiver to detect or correct corrupted bits.

Detection versus Correction

 Correction is more difficult than detection.


 In error detection, we are only looking to see if any error has occurred (Yes or No)
 We are not interested in the number of corrupted bits in Detection.
 Single-bit error is the same as a Burst error.

 In Error Correction, we need to know:

o The exact number of bits that are corrupted and,


o Their location in the message

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

Types of Coding Schemes

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:

o The receiver has (or can find) a list of valid codewords.


o The original code word has changed to an invalid one.

140

Example

In the above example, assume the sender encodes the data word 01 as 011 and sends it to the
receiver.

Consider the following cases:

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.

Two corrupted bits have made the error undetectable.

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

Let us find the Hamming distance between two pairs of words.

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:

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:

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.

You might also like