Anda di halaman 1dari 26

Course Title: Computer Networks

Course Code: CSE 2105

Prepared By:
Dipanita Saha
Lecturer, IIT
Chapter 2: Encapsulation and Decapsulation
Encapsulation at the Source Host
 1. At the application layer, the data to be exchanged is referred to as a
message. A message normally does not contain any header or trailer. The
message is passed to the transport layer.
 2. The transport layer takes the message as the payload, the load that the
transport layer should take care of. It adds the transport layer header to the
payload, which contains the identifiers of the source and destination
application programs and
information needed for flow, error control, or congestion control. The result is
the transport-layer packet, which is called the segment (in TCP) and the user
datagram (in UDP).

 3. The network layer takes the transport-layer packet as data or payload


and adds its own header to the payload. The header contains the addresses
of the source and destination hosts and some more information used for
error checking of the header, fragmentation information, and so on. The
result is the network-layer packet, called a datagram.

 4. The data-link layer takes the network-layer packet as data or payload


and adds its own header, which contains the link-layer addresses of the
host or the next hop (the router). The result is the link-layer packet, which
is called a frame.

 The frame is passed to the physical layer for transmission.


 Decapsulation and Encapsulation at the Router
 At the router, we have both decapsulation and encapsulation because
the router is connected to two or more links.
 1. After the set of bits are delivered to the data-link layer,
decapsulates the datagram from the frame and passes it to the network
layer.
 2. The network layer only inspects the source and destination
addresses in the datagram header and consults its forwarding table. The
contents of the datagram should not be changed by the network layer
in the router.
 3. The data-link layer of the next link encapsulates the datagram in a
frame and passes it to the physical layer for transmission.

 Decapsulation at the Destination Host


 At the destination host, each layer only decapsulates the packet
received, removes the payload, and delivers the payload to the next-
higher layer protocol until the message reaches the application layer.
 It is necessary to say that decapsulation in the host involves error
checking.
Addressing
 we have logical communication between pairs of layers. Any
communication that involves two parties needs two addresses:
source address and destination address.
 if we need five pairs of addresses, one pair per layer, we normally
have only four because the physical layer does not need addresses
because bit cannot have an address.
 there is a relationship between the layer, the address used in that
layer, and the packet name at that layer.
 At the application layer, we normally use names to define the site
that provides services, such as someorg.com.
 At the transport layer, addresses are called port numbers to
define the application-layer programs at the source and
destination.
 Port numbers are local addresses that distinguish between several
programs running at the same time.
 At the network-layer, the addresses are global, with the whole
Internet as the scope. A network-layer address uniquely defines
the connection of a device to the Internet.
 The data-link-layer addresses, sometimes called MAC addresses,
are locally defined addresses, each of which defines a specific host
or router in a network.
 MAC (Media Access Control) address is a unique identifier assigned to a
network interface controller (NIC) for communications at data-link layer
of a network segment.
Multiplexing and Demultiplexing
 We have multiplexing at the source and demultiplexing at the
destination.
 Multiplexing means that a protocol at a layer can encapsulate a
packet from several next-higher layer protocols (one at a time);
 Demultiplexing means that a protocol can decapsulate and
deliver a packet to several next-higher layer protocols (one at a
time).
OSI versus TCP/IP
 Open Systems Interconnection (OSI) model. It was first
introduced in the late 1970s.
 ISO is the organization; OSI is the model.
Chapter 3:

Introduction to Physical Layer


DATA AND SIGNALS
 Analog and Digital Data
 Data can be analog or digital.
 Analog data refers to information that is continuous; Digital data refers
to information that has discrete states.
 For example, an analog clock that has hour, minute, and second hands
gives information in a continuous form; the movements of the hands are
continuous.
 On the other hand, a digital clock that reports the hours and the minutes
will change suddenly from 8:05 to 8:06.
 Analog data, such as the sounds made by a human voice, take on
continuous values. When someone speaks, an analog wave is created in
the air.
 Digital data take on discrete values. For example, data are stored in
computer memory in the form of 0s and 1s. They can be converted to a
digital signal or modulated into an analog signal for transmission across
a medium.
Analog and Digital Signals
 Signals can be either analog or digital.
 An analog signal has infinitely many levels of intensity over a period
of time. As the wave moves from value A to value B, it passes through
and includes an infinite number of values along its path.
 A digital signal, can have only a limited number of defined values.
Although each value can be any number, it is often as simple as 1 and
0.

 The curve representing the analog signal passes through an infinite


number of points. The vertical lines of the digital signal, demonstrate
the sudden jump that the signal makes from value to value.
Periodic and Nonperiodic

 A periodic signal completes a pattern within a measurable time


frame, called a period, and repeats that pattern over subsequent
identical periods.
 The completion of one full pattern is called a cycle.
 A nonperiodic signal changes without exhibiting a pattern or
cycle that repeats over time.
 Both analog and digital signals can be periodic or nonperiodic.
 In data communications, we commonly use periodic analog
signals and nonperiodic digital signals
PERIODIC ANALOG SIGNALS
 Periodic analog signals can be classified as simple or composite.
 A simple periodic analog signal, a sine wave, cannot be decomposed
into simpler signals.
 A composite periodic analog signal is composed of multiple sine
waves.
 Sine Wave
 The sine wave is the most fundamental form of a periodic analog
signal.
 When we visualize it as a simple oscillating curve, its change over the
course of a cycle is smooth and consistent, a continuous, rolling flow.

 Each cycle consists of a single arc above the time axis followed by a
single arc below it.
 A sine wave can be represented by three parameters:
peak amplitude, frequency, phase.
 These three parameters fully describe a sine wave.
 Peak Amplitude
 The peak amplitude of a signal is the absolute value of its highest
intensity, proportional to the energy it carries.
 For electric signals, peak amplitude is normally measured in volts.
 Period and Frequency
 Period refers to the amount of time, in seconds, a signal needs to
complete 1 cycle.
 Frequency refers to the number of periods in 1 s.
 Period is the inverse of frequency, and frequency is the inverse of
period.

 Period is formally expressed in seconds. Frequency is formally


expressed in Hertz (Hz), which is cycle per second.
 The power we use at home has a frequency of 60 Hz (50 Hz in Europe).
Calculate the period of this sine wave.

 Express a period of 100 ms in microseconds.


 What if a signal does not change at all? What if it maintains a constant
voltage level for the entire time it is active?
 In such a case, its frequency is zero.
 If a signal does not change at all, it never completes a cycle, so its
frequency is 0 Hz.
 But what if a signal changes instantaneously? What if it jumps from
one level to another in no time?
 Then its frequency is infinite.
 when a signal changes instantaneously, its period is zero; since
frequency is the inverse of period, the frequency is 1/0, or infinite
(unbounded).
 Phase
 The term phase, or phase shift, describes the position of the wave form
relative to time 0.
 Phase is measured in degrees or radians
[360º is 2π rad; 1º is 2π/360 rad, and 1 rad is 360/(2π)].
 A phase shift of 360º corresponds to a shift of a complete period; a
phase shift of 180° corresponds to a shift of one-half of a period; and a
phase shift of 90º corresponds to a shift of one-quarter of a period.
 A sine wave is offset 1/6 cycle with respect to time 0. What is its phase in
degrees and radians?

 Wavelength
 Wavelength is another characteristic of a signal traveling through a
transmission medium.
 Wavelength binds the period or the frequency of a simple sine wave to
the propagation speed of the medium.

 While the frequency of a signal is independent of the medium, the


wavelength depends on both the frequency and the medium.
 Wavelength can be calculated if one is given the propagation speed (the
speed of light) and the period of the signal.

 Time and Frequency Domains


 A sine wave is comprehensively defined by its amplitude, frequency,
and phase.
 The time-domain plot shows changes in signal amplitude with respect
to time (it is an amplitude-versus-time plot). Phase is not explicitly
shown on a time-domain plot.
 A frequency-domain plot is concerned with only the peak value and
the frequency. Changes of amplitude during one period are not shown.
Composite Signals
 We can send a single sine wave to carry electric energy from one
place to another. For example, the power company sends a single sine
wave with a frequency of 60 Hz to distribute electric energy to houses
and businesses.
 we can use a single sine wave to send an alarm to a security center
when a burglar opens a door or window in the house.
 Composite signal is made of many simple sine waves.

 According to Fourier analysis, any composite signal is a combination


of simple sine waves with different frequencies, amplitudes, and
phases.
 If the composite signal is periodic, the decomposition gives a series of
signals with discrete frequencies; if the composite signal is
nonperiodic, the decomposition gives a combination of sine waves
with continuous frequencies.
 Example 3.8 and 3.9( Read at home)
 Bandwidth
 The range of frequencies contained in a composite signal is its
bandwidth.
 The bandwidth is normally a difference between two numbers.
 For example, if a composite signal contains frequencies between 1000
and 5000, its bandwidth is 5000 − 1000, or 4000.
 Example 3.10
 If a periodic signal is decomposed into five sine waves with frequencies
of 100, 300, 500, 700,and 900 Hz, what is its bandwidth? Draw the
spectrum, assuming all components have a maximum amplitude of 10 V.

 Solve the examples from text book

Anda mungkin juga menyukai