Data Communication and Computer Networks: Addis Ababa Science and Technology University
Data Communication and Computer Networks: Addis Ababa Science and Technology University
Computer Networks
Addis Ababa Science and Technology University
Peer-to-Peer
LANs, WANs, and Internets
Components of a Network
There are three categories of network components:
• Devices
• Media
• Services
Components of a Network
End Devices
Some examples of end devices are:
• Computers (work stations, laptops, file servers, web servers)
• Network printers
• VoIP phones
• TelePresence endpoint
• Security cameras
• Mobile handheld devices (such as smartphones, tablets, PDAs, and
wireless debit / credit card readers and barcode scanners)
Components of a Network
Network Media
Components of a Network
Network Representations
LANs and WANs
Types of Networks
The two most common types of network infrastructures are:
• Local Area Network (LAN)
• Wide Area Network (WAN).
The Internet
LANs, WANs, and the Internet
Internet Connections
• Internet Access Technologies
• Internet Service Provider (ISP)
• Broadband cable
• Broadband Digital Subscriber Line (DSL)
• Wireless WANs
• Mobile Services
• Business DSL
• Leased Lines
• Metro Ethernet
Converged Networks
• Traditional Separate Networks
• Each network with its own rules and
• The Converging Network
• Capable of delivering data, voice, and video over the same
network infrastructure
Network Trends
Data Centers
A data center is a facility used to house computer systems and
associated components including:
• Redundant data communications connections
• High-speed virtual servers (sometimes referred to as server farms or
server clusters)
• Redundant storage systems (typically uses SAN technology)
• Redundant or backup power supplies
• Environmental controls (e.g., air conditioning, fire suppression)
• Security devices
The Changing Network Environment
Wireless Broadband
Networking Technologies for the Home
Powerline Networking
Summary
• Networks and the Internet have changed the way we communicate,
learn, work, and even play.
• Networks come in all sizes. They can range from simple networks
consisting of two computers, to networks connecting millions of devices.
• The Internet is the largest network in existence. In fact, the term Internet
means a ‘network of networks. The Internet provides the services that
enable us to connect and communicate with our families, friends, work,
and interests.
• The network infrastructure is the platform that supports the network. It
provides the stable and reliable channel over which communication can
occur. It is made up of network components including end devices,
intermediate device, and network media.
Chapter 2
Protocols and Architectures
PROTOCOL LAYERING
• A protocol defines the rules that both the sender and receiver
and all intermediate devices need to follow to be able to
communicate effectively.
• When communication is simple, we may need only one simple
protocol;
• When the communication is complex, we may need to divide
the task between different layers, in which case we need a
protocol at each layer, or protocol layering.
• Two simple scenarios:
Senario 1
• Using logical connections makes it easier to understand the duty of each layer:
• The duty of the application, transport, and network layers is end-to-end.
• Whereas, the duty of the data-link and physical layers is hop-to-hop, in which a hop is a
host or router.
• In other words, the domain of duty of the top three layers is the internet, and the domain
of duty of the two lower layers is the link.
LAYERS IN THE TCP/IP PROTOCOL SUITE …
• Another way of thinking of the logical connections is the data unit created from
each layer:
• In the top three layers, the data unit (packets) should not be changed by any router or link-layer
switch.
• In the bottom two layers, the packet created by the host is changed only by the routers, not by the
link-layer switches.
• Remember the second principle of protocol layering.
THE PHYSICAL LAYER
• Responsible for carrying individual bits in a frame across the link.
• Although the lowest level in the TCP/IP protocol suite, the communication between two
devices at the physical layer is still a logical communication because there is another,
hidden layer, the transmission media, under the physical layer.
• Two devices are connected by a transmission medium (cable or air).
• Note that the transmission medium does not carry bits; it carries electrical or optical
signals.
• So the bits received in a frame from the data-link layer are transformed and sent
through the transmission media, but we can think that the logical unit between two
physical layers in two devices is a bit.
THE DATA-LINK LAYER
• An internet is made up of several links (LANs and WANs) connected by routers.
• Several overlapping sets of links that a datagram can travel from the host to the
destination.
• Routers are responsible for choosing the best links.
• Next link to travel is determined by the router; the data-link layer is responsible
for taking the datagram and moving it across the link.
• The link can be a wired LAN with a link-layer switch, a wireless LAN, a wired
WAN, or a wireless WAN.
• We can also have different protocols used with any link type.
• In each case, the data-link layer is responsible for moving the packet through
the link.
• TCP/IP does not define any specific protocol for the data-link layer.
THE DATA-LINK LAYER …
• It supports all the standard and proprietary protocols.
• Any protocol that can take the datagram and carry it through the link suffices
for the network layer.
• The data-link layer takes a datagram and encapsulates it in a packet called a
frame.
• Frame contains headers. E.g. “Type Field”:
• This field in the frame header indicates the network protocol in the data portion.
• For example, this field might indicate that the Data field contains an IP, IPv6, or ARP
packet, to name just a few possibilities.
• Each link-layer protocol may provide a different service.
• Some link-layer protocols provide complete error detection and correction,
some provide only error correction.
NETWORK LAYER
• The network layer is responsible for creating connection between the source
computer and the destination computer.
• The communication at the network layer is host-to-host (end-to-end).
• However, since there can be several routers from the source to the
destination, the routers in the path are responsible for choosing the best
route for each packet.
• The network layer is responsible for host-to-host communication and routing
the packet through possible routes.
• Why do we need the network layer?
• We could have added the routing duty to the transport layer and dropped this layer.
• 1st reason: as said before, is the separation of different tasks between different layers.
• 2nd reason: is that the routers do not need the application and transport layers.
• Separating the tasks allows us to use fewer protocols on the routers.
NETWORK LAYER …
• The network layer in the Internet includes the main protocol: Internet Protocol (IP)
• Responsibilities of IP:
• Defines the format of the packet, called a datagram at the network layer.
• Defines the format and the structure of addresses used in this layer.
• Route a packet from its source to its destination, which is achieved by each router forwarding
the datagram to the next router in its path.
• IP is a connectionless protocol
• Provides no flow control, no error control, and no congestion control services.
• If any of theses services is required for an application, the application should rely only on the
transport-layer protocol.
• The network layer also includes unicast (one-to-one) and multicast (one-to-many)
routing protocols.
• A routing protocol does not take part in routing (it is the responsibility of IP), but it
creates forwarding (routing) tables for routers to help them in the routing process.
NETWORK LAYER …
• The network layer also has some auxiliary protocols that help IP in its
delivery and routing tasks.
• ICMP (Internet Control Message Protocol): helps to report some problems during
packet routing.
• IGMP (Internet Group Management Protocol): helps IP in multicasting
• DHCP (Dynamic Host Configuration Protocol): helps IP get the network-layer address
for a host.
• ARP (Address Resolution Protocol): helps IP find the link-layer address of a host or a
router given its network-layer address.
TRANSPORT LAYER
• The logical connection at the transport layer is also end-to-end.
• The transport layer at the source host
• gets the message from the application layer,
• encapsulates it in a transport layer packet (called a segment or a user datagram in different
protocols) and
• sends it, through the logical (imaginary) connection, to the transport layer at the destination host.
• In other words, the transport layer is responsible for giving services to the application
layer:
• Get a message from an application program running on the source host and
• Deliver it to the corresponding application program on the destination host.
• Why do we need an end-to-end transport layer when we already have an end-to-end
application layer?
• The separation of tasks and duties (as discussed earlier).
• The transport layer should be independent of the application layer.
• We have more than one protocol in the transport layer, with each application program using the
protocol that best matches its requirement.
TRANSPORT LAYER …
• A few transport-layer protocols in the Internet, each designed for some specific task.
1. Transmission Control Protocol (TCP):
• TCP (main transport protocol) is a connection-oriented protocol that first establishes a
logical connection between transport layers at two hosts before transferring data.
• It creates a logical pipe between two TCPs for transferring a stream of bytes.
• It provides:
• Flow control (matching the sending data rate of the source host with the receiving data rate of the
destination host to prevent overwhelming the destination),
• Error control (to guarantee that the segments arrive at the destination without error and resending the
corrupted ones), and
• Congestion control to reduce the loss of segments due to congestion in the network.
2. User Datagram Protocol (UDP):
• The other common protocol, is a connectionless protocol that transmits user datagrams
without first creating a logical connection.
• In UDP, each user datagram is an independent entity without being related to the previous
or the next one (the meaning of the term connectionless).
TRANSPORT LAYER …
• UDP is a simple protocol that does not provide flow, error, or congestion control.
• Its simplicity (small overhead) is attractive to an application program that needs to send
short messages and cannot afford the retransmission of the packets as in TCP, when a
packet is corrupted or lost.
• Stream Control Transmission Protocol (SCTP): A new protocol designed to respond to
new applications that are emerging in the multimedia.
APPLICATION LAYER
• The logical connection between the two application layers is end-to-end.
(refer slide 51 here)
• The two application layers exchange messages between each other as
though there were a bridge between the two layers.
• However, remember that the communication is done through all the
layers.
• Communication at the application layer is between two processes (two
programs running at this layer).
• To communicate:
• A process sends a request to the other process and receives a response.
• Process-to-process communication is the duty of the application layer.
APPLICATION LAYER …
• The application layer in the Internet includes many predefined protocols, but a
user can also create a pair of processes to be run at the two hosts. Here are
some of the predefined protocols:
• HTTP (Hypertext Transfer Protocol): is a vehicle for accessing the World Wide
Web (WWW).
• SMTP (Simple Mail Transfer Protocol) is the main protocol used in electronic mail
(e-mail) service.
• FTP (File Transfer Protocol) is used for transferring files from one host to another.
• TELNET (Terminal Network) and SSH (Secure Shell) are used for accessing a site
remotely.
• SNMP (Simple Network Management Protocol) is used by an administrator to
manage the Internet at global and local levels.
• DNS (Domain Name System) is used by other protocols to find the network-layer
address of a computer.
TCP/IP and Protocols
ENCAPSULATION and DECAPSULATION
• One of the important concepts in protocol layering in the Internet is
encapsulation/decapsulation.
• Information added at the front of data is called a header, and information
added at the end of data is called a trailer.
• Encapsulation/decapsulation for the simple internet shown on slide 47 is here.
ENCAPSULATION and DECAPSULATION …
• One of the important concepts in protocol layering in the Internet is
encapsulation/decapsulation.
• The layers for the link-layer switches are not shown because no
encapsulation/decapsulation occurs in this device.
• Encapsulation in the source host,
• Decapsulation in the destination host,
• Encapsulation and decapsulation in the router.
• Encapsulation at the Source Host:
1. At the application layer, the data to be exchanged is referred to as a
message. 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.
ENCAPSULATION and DECAPSULATION …
• It adds the transport layer header to the payload, which contains:
• Identifiers of the source and destination application programs (called port
numbers) that want to communicate
• Information for end-to-end delivery of the message: flow control, error control,
congestion control
• Result: transport layer packet (PDU) which we call segment (in TCP) and 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.
• The network layer then passes the packet to the data-link layer.
ENCAPSULATION and DECAPSULATION …
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, this 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 to find the next hop to which the
datagram is to be delivered.
• The contents of the datagram should not be changed by the network layer in the router
unless there is a need to fragment the datagram if it is too big to be passed through the
next link.
ENCAPSULATION and DECAPSULATION …
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:
• 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.
ENCAPSULATION and DECAPSULATION …
Segment
Packet
Frame
ENCAPSULATION and DECAPSULATION …
ENCAPSULATION and DECAPSULATION …
Comparison of OSI and TCP/IP
(Practical Model)
Similar to
TCP/IP
Similar
to OSI
Ethernet Frames
• Three sine waves with the same amplitude and frequency, but different phases
Periodic Analog Signals …
• 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.
• The frequency of a signal is independent of the medium, but the wavelength depends on both
the frequency and the medium.
• Wavelength is a property of any type of signal.
• For example, wavelength is used to describe the transmission of light in an optical fiber.
• The wavelength is the distance a simple signal can travel in one period.
Periodic Analog Signals …
•• Given
the propagation speed, and period of the signal, then wavelength, is
• We usually consider the propagation speed of segnals to be equal to speed of light, and
hence, we have:
• However, if it were in a coaxial or fiber-optic cable, the wavelength is shorter (0.5 μm)
because the propagation speed in the cable is decreased.
Time and Frequency Domains
• To show the relationship between amplitude and frequency, we can use what is
called a frequency-domain plot.
• A frequency-domain plot is concerned with only the peak value and the frequency.
• A complete sine wave in the time domain can be represented by one single spike in the frequency
domain.
Composite Signals
• Simple sine waves have many applications: sending a single sine wave to
carry electric energy from one place to another.
• E.g.: the power company sends a single sine wave with a frequency of 60 Hz to
distribute electric energy to customers.
• If we had only one single sine wave to convey a conversation over the
phone, it would make no sense and carry no information.
• We would just hear a buzz.
• We need to send a composite signal to communicate data.
• A composite signal is a signal made of many simple sine waves.
• A single-frequency sine wave is not useful in data communications; we
need to send a composite signal, a signal made of many simple sine
waves.
Composite Signals …
• French mathematician, Jean-Baptiste Fourier showed that any composite
signal is a combination of simple sine waves of different frequencies,
amplitudes and phases.
• A composite signal can be periodic or nonperiodic.
• Periodic composite signal: can be decomposed into a series of simple sine waves
with discrete frequency values (1, 2, 3, and so on)
• Nonperiodic composite signal: can be decomposed into a combination of sine waves
with continuous frequencies.
Composite Signals …
Time-domain decomposition of a
composite signal
Frequency-domain decomposition
of a composite signal
Composite Signals …
• The amplitude of the sine wave with frequency f is almost the same as the peak amplitude of
the composite signal.
• The amplitude of the sine wave with frequency 3f is one-third of that of the first.
• And, amplitude of the sine wave with frequency 9f is one-ninth of the first.
• The frequency of the sine wave with frequency f is the same as the frequency of the composite
signal;
• It is called the fundamental frequency, or first harmonic.
• The sine wave with frequency 3f has a frequency of 3 times the fundamental frequency;
• it is called the third harmonic.
• The third sine wave with frequency 9f has a frequency of 9 times the fundamental frequency;
• it is called the ninth harmonic.
• Note that the frequency decomposition of the signal is discrete: frequencies f, 3f and 9f
• No frequencies such as 1.2f or 2.6f
• Periodic composite signals are always made of discrete spikes.
Composite Signals …
• For nonperiodic composite signal, however, we have a continuous frequencies (for example,
human voice).
• Although the number of frequencies in a human voice is infinite, the range is limited.
• A human can create a continuous range of frequencies between 0 and 4kHz.
• The telephone network was designed to work with analog signals in the voice frequency
range of about 300 to 3400 Hz.
Bandwidth
• Bandwidth is the range of frequencies contained in a composite signal.
• It is the difference between the highest frequency and the lowest frequency in that
signal.
Bandwidth: Examples
1. A nonperiodic composite signal has a bandwidth of 200 kHz, with a middle frequency
of 140 kHz and peak amplitude of 20 V. The two extreme frequencies have an
amplitude of 0. Draw the frequency domain of the signal.
20V
The time and frequency domains of periodic and nonperiodic digital signals
• Infinite BW.
• Digital signal components: Horizontal and Vertical lines.
• A vertical line in the time domain means a frequency of infinity (sudden change in time);
• A horizontal line in the time domain means a frequency of zero (no change in time).
• All frequencies in between are part of the domain.
TRANSMISSION OF DIGITAL SIGNALS
• A digital signal is a composite analog signal with an infinite BW. (frequencies b/n 0 and infinity).
• Consider only nonperiodic digital signals (what we really have in digital communication)
• How to send a digital signal from point A to point B?
• Two approaches of digital transmission: baseband and broadband
• Baseband Transmission: Sending a digital signal over a channel without changing the digital
signal to an analog signal.
• It requires that we have a low-pass channel, a channel with a bandwidth that starts from zero.
• This is the case if we have a dedicated medium with a bandwidth constituting only one channel.
For example, the entire bandwidth of a cable connecting two computers is one single channel.
• Wide bandwidth: we need to send the entire spectrum (continuous range of frequencies
between 0 and infinity)
• Possible if we have a dedicated medium with an infinite BW b/n sender and receiver, that
preserves the exact amplitude of each component of the composite signal.
TRANSMISSION OF DIGITAL SIGNALS …
• This is not possible b/n two devices.
• But the amplitudes of the frequencies at the border of the BW are so small that they can be
ignored.
• Modulation of a digital
signal for transmission
on a bandpass channel
MODULATION …
• An example of broadband transmission using modulation:
• The sending of computer data through a telephone subscriber line, the line connecting a
resident to the central telephone office.
• These lines, are designed to carry voice (analog signal) with a limited bandwidth
(frequencies between 0 and 4 kHz).
• Although this channel can be used as a low-pass channel, it is normally considered a
bandpass channel.
• One reason is that the bandwidth is so narrow (4 kHz) that if we treat the channel as low-
pass and use it for baseband transmission, the maximum bit rate can be only 8 kbps.
• The solution is to consider the channel a bandpass channel, convert the digital signal from
the computer to an analog signal, and send the analog signal.
• We can install two converters to change the digital signal to analog and vice versa at the
receiving end.
• This converter is called a modem (modulator/demodulator).
MODULATION …
• Modulation involves operation on one or more of the three characteristics
of a carrier signal: amplitude, frequency, and phase.
• Accordingly, there are three basic encoding or modulation techniques for
transforming digital data into analog signals
• Amplitude Shift Keying (ASK),
• Frequency Shift Keying (FSK), and
• Phase Shift Keying (PSK).
MODULATION: Amplitude Shift Keying (ASK)
•• In
ASK, the two binary values are represented by two different amplitudes of the carrier frequency.
• Commonly, one of the amplitudes is zero; that is, one binary digit is represented by the presence, at
constant amplitude, of the carrier, the other by the absence of the carrier.
• The resulting transmitted signal for one bit time is,
• where and are typically offset from the carrier frequency by equal but
opposite amounts.
• BFSK is less susceptible to error than ASK. On voice-grade lines, it is typically
used up to 1200 bps.
• It is also commonly used for high-frequency (3 to 30 MHz) radio transmission.
• It can also be used at even higher frequencies on local area networks that use
coaxial cable.
MODULATION: Frequency Shift Keying (FSK) …
• multiple FSK (MFSK): A signal that is more bandwidth efficient, but also more susceptible
to error,
• More than two frequencies are used.
• In this case, each signaling element represents more than one bit.
• The transmitted MFSK signal for one signal element time can be defined as follows:
MODULATION …
MODULATION: Frequency Shift Keying (FSK) …
• Example:
• we have the following frequency assignments for each of the eight possible 3-bit data
combinations:
• Because a phase shift of 180° is equivalent to flipping the sine wave or multiplying it by -1,
the rightmost expressions in the Equation can be used.
• This leads to a convenient formulation.
• An alternative form of two-level PSK is differential PSK (DPSK). Figure below shows an
example.
• In this scheme, a binary 0 is represented by sending a signal burst of the same phase as the
previous signal burst sent.
• A binary 1 is represented by sending a signal burst of opposite phase to the preceding one.
MODULATION: Phase Shift Keying (PSK) …
• In differential encoding, the information to be transmitted is represented in terms of the
changes between successive data symbols rather than the signal elements themselves.
• This term differential refers to the fact that the phase shift is with reference to the
previous bit transmitted rather than to some constant reference signal.
Differential Phase-
Shift Keying (DPSK)
MODULATION: Phase Shift Keying (PSK) …
• Four-Level
PSK More efficient use of bandwidth can be achieved if each signaling
element represents more than one bit. For example, instead of a phase shift of 180°, as
allowed in BPSK, a common encoding technique, known as quadrature phase shift keying
(QPSK), uses phase shifts separated by multiples of .
• Thus each signal element represents two bits rather than one.
ENCODING (Line Coding)
Solution
We shift (modulate) each of the three voice channels to a different
bandwidth, as shown in Figure 6.6. We use the 20- to 24-kHz
bandwidth for the first channel, the 24- to 28-kHz bandwidth for
the second channel, and the 28- to 32-kHz bandwidth for the third
one. Then we combine them as shown in Figure.
Figure for Example 1.
Example 6.2
Five channels, each with a 100-kHz bandwidth, are to be
multiplexed together. What is the minimum bandwidth of
the link if there is a need for a guard band of 10 kHz
between the channels to prevent interference?
Solution
For five channels, we need at least four guard bands. This
means that the required bandwidth is at least
5 × 100 + 4 × 10 = 540 kHz,
as shown in Figure 6.7.
Figure for Example 2
TRANSMISSION OF DIGITAL SIGNALS …
• The OSI physical layer provides
the means to transport the bits
that make up a data link layer
frame across the network media.
• The physical layer encodes the
frames and creates the electrical,
optical, or radio wave signals that
represent the bits in each frame.
• These signals are then sent on
the media, one at a time.
• The destination node physical
layer retrieves these individual
signals from the media, restores
them to their bit representations,
and passes the bits up to the data
link layer as a complete frame.
TRANSMISSION OF DIGITAL SIGNALS …
• There are three basic forms of
network media. The physical layer
produces the representation and
groupings of bits for each type of
media as:
• Copper cable: The signals are patterns
of electrical pulses.
• Fiber-optic cable: The signals are
patterns of light.
• Wireless: The signals are patterns of
microwave transmissions.
TRANSMISSION OF DIGITAL SIGNALS …
• The physical layer standards address three functional areas:
• Physical Components
• The physical components are the electronic hardware devices,
media, and other connectors that transmit and carry the signals to
represent the bits. Hardware components such as NICs, interfaces
and connectors, cable materials, and cable designs are all specified
in standards associated with the physical layer. The various ports
and interfaces on a Cisco 1941 router are also examples of physical
components with specific connectors and pinouts resulting from
standards.
• Encoding
• Encoding or line encoding is a method of converting a stream of
data bits into a predefined "code”. Codes are groupings of bits used
to provide a predictable pattern that can be recognized by both the
sender and the receiver. In the case of networking, encoding is a
pattern of voltage or current used to represent bits; the 0s and 1s.
• For example, Manchester encoding represents a 0 bit by a high to
low voltage transition, and a 1 bit is represented as a low to high
voltage transition. An example of Manchester encoding is illustrated
in Figure 1. The transition occurs at the middle of each bit period.
This type of encoding is used in 10 b/s Ethernet. Faster data rates
require more complex encoding.
TRANSMISSION OF DIGITAL SIGNALS …
• There are many ways to transmit
signals. A common method to send
data is using modulation techniques.
Modulation is the process by which
the characteristic of one wave (the
signal) modifies another wave (the
carrier).
• The nature of the actual signals
representing the bits on the media
will depend on the signaling method
in use.
TRANSMISSION OF DIGITAL SIGNALS …
• Interference from two sources:
• Electromagnetic interference (EMI) or radio
frequency interference (RFI) - EMI and RFI
signals can distort and corrupt the data signals
being carried by copper media. Potential
sources of EMI and RFI include radio waves and
electromagnetic devices, such as fluorescent
lights or electric motors as shown in the figure.
• Crosstalk - Crosstalk is a disturbance caused by
the electric or magnetic fields of a signal on
one wire to the signal in an adjacent wire. In
telephone circuits, crosstalk can result in
hearing part of another voice conversation
from an adjacent circuit. Specifically, when an
electrical current flows through a wire, it
creates a small, circular magnetic field around
the wire, which can be picked up by an
adjacent wire.
IP Addresses and Subnetting
• An IP address is a numeric identifier assigned to each machine on an IP network.
• An IP address is a software address, not a hardware address—the latter is hard-coded on a
network interface card (NIC) and used for finding hosts on a local network.
• IP addressing was designed to allow hosts on one network to communicate with a host on a
different network
• IPv4 Addresses
• An IPv4 address is a 32-bit number divided into four 8-bit values called “octets.”
• Each octet can have a value from 0 to 255.
• IPv4 addresses are written in dotted decimal notation.
• This format consists of four decimal numbers, each in the range 0 to 255, separated by a period.
• Every IP address contains a network ID, which specifies the network on which the computer is
found, and a host ID, which uniquely identifies the computer on that network.
• Determining which part of the IP address is the network ID and which part is the host ID
depends on the subnet mask.
IP Addresses ...
• Examples:
• IP address: 10.1.221.101
• Subnet mask: 255.0.0.0
• Hence the network address/ID is 10, written
as 10.0.0.0 • IP address: 172.31.100.6
• Host ID is 1.221.101 • Subnet mask: 255.255.0.0
• Hence the network address/ID is ?
• IP address: 192.168.14.250 • Host ID is ?
• Subnet mask: 255.255.255.0
• Hence the network address/ID is 10, written
as 10.0.0.0
• And, host ID is 250
•When referring to the network ID, we always fill in the host part of the address with 0s.
•A subnet mask is another 32-bit dotted decimal number consisting of a contiguous series of
binary 1 digits followed by a contiguous series of binary 0 digits.
•A contiguous series of eight binary 1s equals the decimal value 255.
•Example: a typical subnet mask is 255.0.0.0 or 255.255.0.0.
•In these two examples, for each 255 in the subnet mask, the corresponding octet of the IP
address is part of the network ID / network address.
IP Addresses ...
• Network address is the designation used in routing to send packets to a remote network
— for example, 10.0.0.0, 172.16.0.0, and 192.168.10.0.
• Broadcast address The address used by applications and hosts to send information to all
nodes on a network is called the broadcast address.
• Examples of layer 3 broadcasts:
• 255.255.255.255, which is any network, all nodes;
• 172.16.255.255, which is all subnets and hosts on network 172.16.0.0;
• 10.255.255.255, which broadcasts to all subnets and hosts on network 10.0.0.0.
• We can’t have the subnet mask 255.0.255.0 because the network ID must be contiguous.
• But, you can have an IP address and a subnet mask such as 172.16.67.5 and
255.255.192.0.
• Look at the third octet of this subnet mask?
• This subnet mask doesn’t look like the other examples, but it’s still a contiguous series of
1s followed by a contiguous series of 0s.
• In binary, this subnet mask looks like this: 11111111.11111111.11000000.00000000
IP Addresses ...
• The decimal equivalent of this binary number is 255.255.192.0, making the network ID of
the 172.16.67.5 address equal to 172.16.64.0 and the host ID equal to 3.5.
• 10101100.00010000.01000011.00000101 (binary for 172.16.67.5) AND
• 11111111.11111111.11000000.00000000 (binary for 255.255.192.0)
= 10101100.00010000.01000000.00000000 (binary for 172.16.64.0)
network ID 172.16.64.0
The remaining bits in the IP address that aren’t part of the network ID are the host ID.
In this case, it’s 00000011.00000101, which is equal to decimal 3.5.
• Anywhere there’s a 1 bit in the subnet mask, the corresponding bits in the IP address are
part of the network ID; Anywhere there are 0 bits in the subnet mask, the corresponding
bits are part of the host ID.
• The Hierarchical IP Addressing Scheme
• An IP address consists of 32 bits of information.
• These bits are divided into four sections, referred to as octets or bytes, with each
containing 1 byte (8 bits).
IP Addresses ...
• You can depict an IP address using one of three methods:
• Dotted-decimal, as in 172.16.30.56
• Binary, as in 10101100.00010000.00011110.00111000
• Hexadecimal, as in AC.10.1E.38
• All these examples represent the same IP address.
• Dotted-decimal or binary representation most common.
• The 32-bit IP address is a structured or hierarchical address as opposed to a flat or
nonhierarchical address.
• Advantage: can handle a large number of addresses
• The disadvantage of the flat addressing scheme, and the reason it’s not used for IP addressing,
relates to routing.
• If every address were unique, all routers on the Internet would need to store the address of
each and every machine on the Internet.
• This would make efficient routing impossible, even if only a fraction of the possible addresses
were used!
IP Addresses ...
• Solution is to use a two- or three-level hierarchical addressing scheme structured by
network and host (two level) or by network, subnet, and host (three level).
• Compare to telephone numbers:
• Area Code (very large area)
• Local call area
• Customer number
Example: 251 11 551 25 36
• IP addresses use the same type of layered structure.
• Rather than all 32 bits being treated as a unique identifier, as in flat addressing,
• a part of the address is designated as the network address and
• the other part is designated as either the subnet and host or just the node address.
IP Addresses …
• IP Address Classes
IP Addresses ...
• Class D addresses are reserved for multicasting, in which a packet is addressed so that more
than one destination can receive it.
• Applications using this feature include videoconferencing and streaming media; Routing
protocols use them to set up routes.
• In a Class D address, the first octet is in the range 224 to 239.
• Class D addresses can’t be used to assign IP addresses to host computers.
• Class E addresses have a value from 240 to 255 in the first octet.
• This range of addresses is reserved for experimental use and can’t be used for address
assignment.
• Network Address Range: Class A
• the first bit of the first byte in a Class A network address must always be 0.
• 00000000 (0) through 01111111 (127), and total networks: 26
• Network Address Range: Class B
• The first bit of the first byte must always be turned on, but the second bit must always be turned
off.
• 10000000 (128) through 10111111 (191), and total networks: 214
IP Addresses ...
• Network Address Range: Class C
• The first 2 bits of the first octet as always turned on, but the third bit can never be on.
• 11000000 (192) through 11011111 (223), total networks 221
• Network Address Ranges: Classes D and E
• The addresses between 224 to 255 are reserved for Class D and E networks.
• Class D: 11100000 (224) – 11100000 (239), used for multicast addresses.
• Class E: 11110000 (240) – 11111111 (255), used for scientific purposes.
• Valid host IDs
• All host bits off (0) = network address
• All host bits on (1) = broadcast address
• Valid host IDs are those in between these two.
• Examples:
• Class A: 10.0.0.0 – 10.255.255.255; Valid hosts: 10.0.0.1 – 10.255.255.254
• Class B: 172.16.0.0 – 172.16.255.255; Valid hosts: 172.16.0.1 – 172.16.255.254
• Class C: 192.168.100.0 – 192.168.100.255; Valid hosts: 192.168.100.1 – 192.168.100.254
IP Addresses ...
• Private IP Addresses
• Addresses that can be used on a private network, but not routable through the Internet.
• For the purpose of creating a measure of security and saving IP address space.
• Using private IP addresses, ISPs, corporations, and home users only need a relatively
small group of IP addresses to connect their networks to the Internet.
• This is economical because they can use private IP addresses on their inside networks and
get along just fine.
• To do this, the ISP and the corporation need to use something called Network Address
Translation (NAT), which basically takes a private IP address and converts it for use on the
Internet.
Reserved Private IP
address space
IP Addresses ...
• IPv4 Address Types
• Loopback (localhost): Used to test the IP stack on the local computer. Can be any address from 127.0.0.1
through 127.255.255.254.
• Layer 2 broadcasts: These are sent to all nodes on a LAN.
• Known as hardware broadcasts—they only go out on a LAN, but they don’t go past the LAN boundary (router).
• The broadcast would be all 1s in binary, (all Fs in hexadecimal), as in ff:ff:ff:ff:ff:ff
• Every NIC will receive and read the frame, including the router, since this was a layer 2 broadcast, but the router
would never, ever forward this!
• Broadcasts (layer 3): These are sent to all nodes on the network.
• Broadcast messages are meant to reach all hosts on a broadcast domain.
• These are the network broadcasts that have all host bits on.
• 72.16.255.255—all host bits on.
• Broadcasts can also be “any network and all hosts,” as indicated by 255.255.255.255
• Unicast: This is an address for a single interface, and these are used to send packets to a single destination host.
• All hosts on the broadcast domain would receive this frame and accept it.
• Only the destination NIC of 10.1.1.2 would accept the packet; the other NICs would discard the packet.
• Multicast: These are packets sent from a single source and transmitted to many devices on different networks.
Referred to as “one-to-many.”
IP Addresses ...
Broadcast
Unicast
IP Addresses ...
• Multicast enables multiple recipients to receive messages without flooding the messages
to all hosts on a broadcast domain
• Multicast works by sending messages or data to IP multicast group addresses.
• Unlike with broadcasts, which aren’t forwarded, routers then forward copies of the
packet out to every interface that has hosts subscribed to that group address.
• This is where multicast differs from broadcast messages—with multicast communication,
copies of packets, in theory, are sent only to subscribed hosts.
• For example, when I say in theory, I mean that the hosts will receive a multicast packet
destined for 224.0.0.10.
• This is an EIGRP packet, and only a router running the EIGRP protocol will read these.
• All hosts on the broadcast LAN will pick up the frame, read the destination address, then
immediately discard the frame unless they’re in the multicast group.
IP Addresses ...
Subnetting
• Subnets: subdivisions of an IP network address space.
• Subnetting: a process that reallocates bits from an IP address’s host portion to the network portion,
creating multiple smaller address spaces.
• Classless Interdoamin Routing (CIDR):
• IP address configuration where subnet masks could be configured regardless of the address class.
• For example, assigning the IP address 172.31.210.10 with a subnet mask of 255.255.255.0 (instead of the
default of 255.255.0.0) is acceptable.
• In this case, the network ID is 172.31.210, and the host ID is 10.
• CIDR Notation:
• Writing IP addresses with their subnet masks can be tedious and takes up a lot of space.
• It is enough to know how many bits of the IP address constitute the network ID.
• For this, we can specify an IP address and its subnet mask with CIDR notation.
• CIDR notation uses the format A.B.C.D/n; n is the number of 1 bits in the subnet mask (the number of bits in
the network ID) and it’s called the prefix.
• Examples: 172.31.210.10 with subnet mask 255.255.255.0 is expressed as 172.31.210.10/24 in CIDR notation.
• 10.25.106.12 with subnet mask 255.255.240.0 is expressed as 10.25.106.12/20.
• 20 bits for network, 12 bits for hosts.
Subnetting …
Subnet Mask CIDR Prefix Subnet Mask CIDR Prefix
255.0.0.0 /8 255.255.224.0 /19 • The /8 through /15 can only be
used with Class A network
255.128.0.0 /9 255.255.240.0 /20
addresses.
255.192.0.0 /10 255.255.248.0 /21 • /16 through /23 can be used by
255.224.0.0 /11 255.255.252.0 /22 Class A and B network
255.240.0.0 /12 255.255.254.0 /23 addresses.
255.248.0.0 /13 255.255.255.0 /24 • /24 through /30 can be used by
255.252.0.0 /14 255.255.255.128 /25 Class A, B, and C network
255.254.0.0 /15 255.255.255.192 /26 addresses.
255.255.0.0 /16 255.255.255.224 /27 • This is a big reason why most
255.255.128.0 /17 255.255.255.240 /28 companies use Class A network
255.255.192.0 /18 255.255.255.248 /29 addresses.
• Since they can use all subnet
255.255.255.252 /30
masks, they get the maximum
flexibility in network design.
Subnetting …
FIGURE: Implementing a
Class C /27 logical network
Subnetting …
• Subnetting Example 3: Class C Addresses
• 192.168.10.0/28 (255.255.255.240)
• Subnet the Class C network address 192.168.10.0.
• Subnet mask = 255.255.255.240
• How many subnets does the chosen subnet mask produce? 24 = 16
1. How many valid hosts per subnet are available? 24 – 2 = 14 (block size – 2)
2. What are the valid subnets? 256 – 240 = 16 = block size (increment number)
• Subnets are: 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240
3. What’s the broadcast address of each subnet?
• Broadcast address for subnet 192.168.10.0 is: 192.168.10.15
• Broadcast address for subnet 192.168.10.16 is: 192.168.10.31 …
4. What are the valid hosts in each subnet?
• Valid hosts in subnet 192.168.10.0: 192.168.10.1 – 192.168.10.14
• Valid hosts in subnet 192.168.10.128: 192.168.10.17 – 192.168.10.30 …
Subnetting …
Table: Subnets, hosts, and broadcast addresses provided from a Class C 255.255.255.240 mask
Subnet 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240
First Host 1 17 33 49 65 81 97 113 129 145 161 177 193 209 225 241
Last Host 14 30 46 62 78 94 110 126 142 158 174 190 206 222 238 254
Broadcast 15 31 47 63 79 95 111 127 143 159 175 191 207 223 239 255
• Subnetting Example 4: Given the class C address 50 with subnet mask 255.255.255.224
• First determine the subnet where the IP address belongs.
• Block size = 256 – 224 = 32
Where would .138
• Subnets are: 0, 32, 64, 96, … , 224 (total: 8 subnets)
be? And .205?
• Our 50 falls between 32 and 64, and must be part of the 192.168.10.32 subnet.
• Next subnet is 64, so the broadcast address of our subnet is 192.168.10.63.
• Valid host ranges: between subnet address and broadcast address: 192.168.10.33 – 192.168.10.62
• Subnetting Example 5: Given Class C address 192.168.10.50 and subnet mask 255.255.255.240
• Block size = 256 – 240 = 16
• Subnets are: 0, 16, 32, 48, 64, 80, 96, … , 240 (total: 16 subnets)
• Our 50 falls between 48 and 64, and must be part of the 192.168.10.48 subnet. Where would .174
• Next subnet is 64, so the broadcast address of our subnet is 192.168.10.63. be? And .191?
• Valid host ranges: 192.168.10.49 – 192.168.10.62 (total: 14 hosts)
Subnetting …
• Subnetting Class B Addresses
• All the possible Class B subnet masks: a lot more subnet masks than we have with Class C
• 255.255.0.0 (/16) 255.255.252.0 (/22) 255.255.255.192 (/26)
• 255.255.128.0 (/17) 255.255.254.0 (/23) 255.255.255.224 (/27)
• 255.255.192.0 (/18) 255.255.248.0 (/21) 255.255.255.240 (/28)
• 255.255.224.0 (/19) 255.255.255.0 (/24) 255.255.255.248 (/29) 255.255.240.0
(/20) 255.255.255.128 (/25) 255.255.255.252 (/30)
• Remember the Class B network address has 16 bits available for host addressing.
• This means we can use up to 14 bits for subnetting because we need to leave at least 2 bits for host
addressing.
• The process of subnetting a Class B network is similar to Class C, except that you have more host bits
and you start in the third octet.
• Use the same subnet numbers for the third octet with Class B that you used for the fourth octet with
Class C, but add a zero to the network portion and a 255 to the broadcast section in the fourth octet.
• For example: consider this /20 (255.255.240.0):
Subnetting …
• Example 1B: 172.16.0.0, 255.255.128.0 (/17)
• Number of Subnets: 21 = 2, number of hosts: 215 – 2 = 32,766
• Block size: 256 – 128 = 128, Subnets: 172.16.0.0, 172.16.128.0 (same numbers as a Class C 240
mask, except that we put them in the 3rd octet!)
• Broadcast addresses: 172.16.127.255 and 172.16.255.255
• Example 2B: 172.16.0.0, 255.255.192.0 (/18)
• Number of Subnets: 22 = 4, number of hosts: 214 – 2 = 16,382
• Block size: 256 – 192 = 64, Subnets: 172.16.0.0, 172.16.64.0, 172.16.128.0, 172.16.192.0 (same
numbers as a Class C 240 mask, except that we put them in the 3rd octet!)
• Broadcast addresses: 172.16.63.255, 172.16.127.255, 172.16.191.255, 172.16.255.255
Subnetting …
• Example 3B: 172.16.0.0, 255.255.240.0 (/20)
• Number of Subnets: 24 = 16, number of hosts: 212 – 2 = 4094
• Block size: 256 – 240 = 16, subnets: 172.16.0.0, 172.16.16.0, 172.16.32.0, … , 172.16.240.0 (same
numbers as a Class C 240 mask, we just put them in the 3rd octet!)
• Broadcast addresses: 172.16.15.255, 172.16.31.255, 172.26.47.255, …, 172.16.255.255
• We have more host bits and we use the same subnet numbers we used with Class B and C, but we start using these
numbers in the second octet.
• However, the reason Class A addresses are so popular to implement is because they give the most flexibility.
• You can subnet in the second, third or fourth octet.
Subnetting …
• Example 1A: 10.0.0.0, 255.255.0.0
• The 255.255.0.0 mask with a Class A address is using 8 subnet bits:
• Subnets? 28 = 256, hosts = 216 – 2 = 65,534.
• Interesting octet: 255, hence 256 – 255 = 1. 0, 1, 2, 3, … (all in the second octet!)
• So the subnets will be: 10.0.0.0, 10.1.0.0, 10.2.0.0, 10.3.0.0, …, 10.255.0.0
• Borrowing 1 bit is not enough. So we borrowed 2 bits from host portion, hence creating 22 = 4
subnets.
• 255.255.255.1100 0000, since last 1’s bit position value is 64, our subnets are: .0, .64, .128 and .
192
128
64
Practical Examples of Subnets
• d
IPv6
• Overview
• The Internet Engineering Task Force (IETF) started development on IPng (IP next generation) in 1994,
and it was later named IPv6.
• IPv6 was developed to address IPv4’s shortcomings.
• Some improvements and changes in IPv6 include the following:
1. Larger address space—IPv4 addresses are 32 bits, which provide a theoretical four billion addresses.
IPv6 addresses are 128 bits, so the number of possible addresses can be expressed as 34 followed by
37 0s, or 340 trillion trillion trillion.
2. Hierarchical address space—Unlike IPv4, in which numbers in the address have little meaning other
than the address class, and the network ID and host ID, IPv6 addresses have a more defined
structure.
• For example, the first part of an address can indicate a particular organization or site.
3. Autoconfiguration—IPv6 can be self-configuring or autoconfigured from a router or server running
IPv6 or through DHCPv6.
4. Built-in quality of service (QoS) support—IPv6 includes built-in fields in packet headers to support
QoS strategies (used to prioritize data packets based on the type or urgency of information they
contain) without having to install additional protocol components, as IPv4 does.
IPv6 …
5. Built-in support for security—From the ground up, IPv6 is built to support secure protocols,
such as Internet Protocol Security (IPsec), whereas IPv4’s support for IPsec is an add-on
feature.
6. Support for mobility—With built-in support for mobility, routing IPv6 packets generated by
mobile devices over the Internet is more efficient than with IPv4.
7. Extensibility—IPv6 uses extension headers instead of IPv4’s fixed-size 40-byte header.
Extension headers allow adding features to IPv6 simply by adding a new header.
• IPv6 Address Structure
• With IPv6 subnetting is not as difficult as it is in IPv4.
• IPv6 addresses are written as eight 16-bit hexadecimal numbers separated by colons.
• E.g. fe80:0:0:0:18ff:0024:8e5a:60
• Pv6 addresses often have several 0 values. One or more consecutive 0 values can be written as a
double colon (::).
• Our example address can be written asfe80::18ff:0024:8e5a:60.
• However, you can have only one double colon in an IPv6 address.
IPv6 …
• Leading 0s are optional.
• The value 0024 in the previous example could just as easily have been written as 24, and the value 60
could have been written as 0060.
• The hexadecimal numbering system was chosen to represent IPv6 addresses mostly because
it’s much easier to convert to binary than decimal is.
• Each hexadecimal digit represents 4 bits, so to convert an IPv6 address to binary, simply
convert each hexadecimal digit (accounting for leading 0s) to its binary equivalent.
• For example, the first field in the preceding address (fe80) can be written as follows:
•1111 1110 1000 0000
f e 8 0
• IPv6 addresses have a prefix length that is always 64 for host addresses because in IPv6, all
network IDs are 64 bits.
• So a typical IPv6 address can be written as follows:
• fe80:0:0:0:18ff:0024:8e5a:60/64
• However, because the prefix is always 64 for an IPv6 host address, the prefix is often omitted.
IPv6 …
• The IPv6 Interface ID
• Because the prefix length (network ID) of an IPv6 address is, 64 bits, the interface ID (the
host ID in IPv4) is also 64 bits.
• So you can easily identify the network ID of an IPv6 address by looking at the first 64 bits
(16 hex digits or four fields) and the interface ID by looking at the last 64 bits.
• Example: in the address fe80:0:0:0:18ff:0024:8e5a:60
• The network ID is fe80:0:0:0, and the interface ID is 18ff:0024:8e5a:60.
• An IPv6 interface ID can be assigned to a host in these ways:
1. Using the 48-bit MAC address—Because a MAC address is only 48 bits, the other 16
bits come from the value fffe inserted after the first 24 bits of the MAC address.
• In addition, the first two 0s that compose most MAC addresses are replaced with 02.
• Example: given the MAC address 00-0C-29-7C-F9-C4, the host ID of an IPv6 address is
020c:29ff:fe7c:f9c4.
• This autoconfigured 64-bit host ID is called an Extended Unique Identifier (EUI)-64 interface
ID.
IPv6 …
2. A randomly generated permanent interface identifier
• The interface ID is generated randomly but is a permanent assignment maintained through
system restarts.
• Windows Vista and later use this method by default for permanent interfaces, such as Ethernet
ports.
• However, you can have Windows use EUI-64 addresses with this netsh command:
netsh interface ipv6 set global randomizeidentifiers=disabled
3. A temporary interface identifier
• Some connections, such as dial-up Point-to-Point Protocol (PPP) connections, might use this
method for interface IPv6 address assignment, whereby the interface ID is assigned randomly
and changes each time IPv6 is initialized to maintain anonymity.
4. Via DHCPv6
• Addresses are assigned via a DHCPv6 server to IPv6 interfaces when they’re initialized.
5. Manually
• Similar to IPv4 configuration, the IPv6 address is entered manually in the interface’s Properties
dialog box.
IPv6 …
IPv6 Address Types
• IPv4 defines unicast, multicast, and broadcast addresses, and
• IPv6 defines unicast, multicast, and anycast addresses.
1. IPv6 Unicast Addresses
• A unicast address specifies a single interface on a device.
2. Link-Local Addresses
• Addresses starting with fe80 are called link-local IPv6 addresses and are self-configuring.
• Link-local addresses can’t be routed and are somewhat equivalent to Automatic Private IP Addressing (APIPA) in IPv4.
3. Unique Local Addresses
• Unique local IPv6 addresses are analogous to the familiar private IPv4 addresses
• Unique local IPv6 addresses are analogous to the familiar private IPv4 addresses
4. Global unicast Addresses
• Are analogous to public IPv4 addresses.
• They are accessible on the public Internet and can be routed.
• Essentially, an IPv6 address is global if it doesn’t fall into one of the other categories of address (special use,
link-local, unique local, loopback, transition, and so forth).
• IPv6 addresses have one sizable advantage over IPv4 addresses, aside from the much larger address space; a
structure, or a hierarchy, can be built into them that allows more efficient routing on the Internet.